rocketraman
05/23/2017, 10:44 PMcom.google.protobuf
I now have available protobuf
as a keyword. Is there an equivalent process that happens with adding plugins to a Kotlin build script? And how does Kotlin script handle classpath / imports when only one project within a larger build adds a plugin, especially given that Kotlin script seems to require imports at the top level?jre
05/24/2017, 4:42 AMvoid hello() {
println "Hello World!"
}
Child build.gradle:
// Will print Hello World when gradle is invoked
hello()
This no longer works for kotlin based build scripts, the method reference is just considered as undefined.
Any idea how can I best fill this gap? Should I raise an issue for such use case?appdev
05/24/2017, 12:27 PMalband
05/25/2017, 8:21 AMrocketraman
05/25/2017, 8:33 PMdouglarek
05/27/2017, 5:51 AMdependencyManagement
with gradle-kotlin-script ?deckard_shaw
05/28/2017, 1:46 AMplugins {
application
id("org.jetbrains.kotlin.jvm") version "1.1.2-2"
//id("org.jetbrains.kotlin.plugin.spring") version "1.1.2-2"
}
apply {
plugin("io.spring.dependency-management")
plugin("kotlin")
//plugin("kotlin-jpa")
//plugin("kotlin-spring")
plugin("org.springframework.boot")
}
spierce7
05/28/2017, 4:16 PMconfigurations {
provided
}
sourceSets {
main {
compileClasspath += configurations.provided
runtimeClasspath += configurations.provided
}
test {
compileClasspath += configurations.provided
runtimeClasspath += configurations.provided
}
customSourceSet
}
dependencies {
provided project(':Core')
}
I'm assuming I'd need to think of it differently with gradle-kotlin-script
? Maybe I'd be using something extension functions to add similar behavior?
I'm also not sure how I'd do something like customSourceSetCompile
in kotlin-script-gradle
, and am curious what the solution is.andyb
05/28/2017, 7:12 PMbarteks2x
05/29/2017, 3:37 PMval ext = (this as HasConvention).convention.extraProperties
jlleitschuh
05/30/2017, 3:17 PMorg/gradle/script/lang/kotlin/KotlinDependencyHandler
by default??bamboo
06/01/2017, 3:52 PMnekoinemo
06/02/2017, 7:51 AMpublishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
}
}
}
results in "specif constructor, MavenPublication doesn't have companion object" and "mavenJava()" being unresolved reference
It does compile if i replace it with
publishing {
publications {
create<MavenPublication>("mavenJava"){
from(components["java"])
}
}
}
though. I don't get why it works on way and not the other?kasper.kondzielski
06/07/2017, 10:51 AMjava
being not recognised, finally I manage to do this in following way:
configure<JavaPluginConvention> {
sourceSets[SourceSet.MAIN_SOURCE_SET_NAME].java {
srcDir("src/main/kotlin")
}
}
jlleitschuh
06/07/2017, 5:50 PMhughg
06/11/2017, 8:18 AMwasyl
06/11/2017, 10:27 AMjakiej
06/12/2017, 9:19 PMjakiej
06/12/2017, 9:33 PMaalmiray
06/13/2017, 12:55 PMbuild.gradle.kts
? For reference this is what it can done for the Groovy version
configurations {
integrationTestCompile {
extendsFrom testCompile
}
integrationTestRuntime {
extendsFrom integrationTestCompile, testRuntime
}
functionalTestCompile {
extendsFrom compile
}
functionalTestRuntime {
extendsFrom runtime
}
}
dependencies {
functionalTestCompile “org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion”
functionalTestCompile “org.codehaus.griffon:griffon-core-test:$griffonVersion”
functionalTestCompile “org.codehaus.griffon:griffon-javafx-test:$griffonVersion”
}
sourceSets {
integrationTest {
kotlin.srcDirs file(‘src/integration-test/kotlin’)
compileClasspath += sourceSets.main.output
runtimeClasspath += compileClasspath
}
functionalTest {
kotlin.srcDirs file(‘src/functional-test/kotlin’)
compileClasspath += sourceSets.main.output
runtimeClasspath += compileClasspath
}
}
idea {
module {
scopes.TEST.plus += [configurations.integrationTestCompile]
scopes.TEST.plus += [configurations.integrationTestRuntime]
testSourceDirs += sourceSets.integrationTest.allSource.srcDirs
scopes.TEST.plus += [configurations.functionalTestCompile]
scopes.TEST.plus += [configurations.functionalTestRuntime]
testSourceDirs += sourceSets.functionalTest.allSource.srcDirs
}
}sdeleuze
06/13/2017, 4:41 PMpoohbar
06/14/2017, 3:55 PMUnsupported major.minor version 52.0
scott
06/14/2017, 5:22 PMbamboo
06/14/2017, 6:30 PMnapperley
06/15/2017, 12:49 AMjlleitschuh
06/16/2017, 1:47 PMmyanmarking
06/19/2017, 5:11 PMjlleitschuh
06/20/2017, 2:49 PMpddstudio
06/21/2017, 10:30 AMtrevjones
06/23/2017, 6:48 PMtrevjones
06/23/2017, 6:48 PMdagguh
06/23/2017, 6:52 PMtasks["compileTestKotlin"].dependsOn(tasks["compileKotlin"])
Unforunately, it didn't helpUnresolved reference
errors