napperley
11/20/2019, 6:13 AMGabriel Desilets
11/20/2019, 2:06 PMDariusz Kuc
11/20/2019, 4:55 PMeekboom
11/21/2019, 10:15 AMval artifactoryUsername : String? by settings
if(artifactoryUsername == null) {
...
How can I do the same in groovy dsl? (Sorry, not all builds converted to kotlin, yet)alexfacciorusso
11/21/2019, 10:57 AMsimtel12
11/21/2019, 8:23 PMkotlin-android
makes it so that module is not a required dependency. Does anyone know if this is a known bug?Lex Luthor
11/22/2019, 12:28 AM1.3.60
from 1.3.41
we started getting this error in the logs:
Internal compiler error. See log for more details
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':my-module:compileKotlin'.Open stacktrace
Caused by: org.gradle.api.GradleException: Internal compiler error. See log for more detailsClose stacktrace
at org.jetbrains.kotlin.gradle.tasks.TasksUtilsKt.throwGradleExceptionIfError(tasksUtils.kt:15)
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.run(GradleKotlinCompilerWork.kt:122)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.runCompilerAsync(GradleKotlinCompilerRunner.kt:148)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.runCompilerAsync(GradleKotlinCompilerRunner.kt:143)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.runJvmCompilerAsync(GradleKotlinCompilerRunner.kt:83)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompilerAsync$kotlin_gradle_plugin(Tasks.kt:429)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompilerAsync$kotlin_gradle_plugin(Tasks.kt:339)
at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.executeImpl(Tasks.kt:296)
at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.execute(Tasks.kt:268)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
We have also tried Kotlin 1.3.50
with the same result. On the console we see the following stacktrace:
:my-module:compileKotlin FAILED
e: java.lang.NoSuchMethodError: kotlin.script.experimental.util.PropertiesCollection$Companion.key$default(Lkotlin/script/experimental/util/PropertiesCollection$Companion;Ljava/lang/Object;ZILjava/lang/Object;)Lkotlin/script/experimental/util/PropertiesCollection$PropertyKeyDelegate;
at org.jetbrains.kotlin.scripting.definitions.ScriptCompilationConfigurationFromDefinitionKt.<clinit>(ScriptCompilationConfigurationFromDefinition.kt:86)
at org.jetbrains.kotlin.scripting.compiler.plugin.ScriptingCompilerConfigurationExtension$updateConfiguration$hostConfiguration$1.invoke(ScriptingCompilerConfigurationExtension.kt:47)
at org.jetbrains.kotlin.scripting.compiler.plugin.ScriptingCompilerConfigurationExtension$updateConfiguration$hostConfiguration$1.invoke(ScriptingCompilerConfigurationExtension.kt:28)
at kotlin.script.experimental.host.ScriptingHostConfiguration.<init>(hostConfiguration.kt:20)
at kotlin.script.experimental.host.ScriptingHostConfiguration.<init>(hostConfiguration.kt:25)
at org.jetbrains.kotlin.scripting.compiler.plugin.ScriptingCompilerConfigurationExtension.updateConfiguration(ScriptingCompilerConfigurationExtension.kt:46)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:187)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:113)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:420)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:263)
I've googled this extensively but have come up empty. Has anyone here encountered this error?ubu
11/22/2019, 5:36 AMFeri Nagy
11/22/2019, 4:06 PMVincent Williams
11/24/2019, 4:49 AMeekboom
11/25/2019, 11:22 AMget()
, because main
references a
NamedDomainObjectProvider<SourceSet>
and not an actual SourceSet:
task foo(type: JavaExec) {
classpath sourceSets.main.runtimeClasspath
has become
tasks.create<JavaExec>("foo") {
classpath = sourceSets.main.get().runtimeClasspath
Couple of questions about that:
• Have I now changed the behavior from lazy to eager configuration?
• How does groovy do this magic (i.e. why can I use runtimeClassPath on a Provider)?
• Is there any cleaner way to do this?eekboom
11/25/2019, 11:24 AMDariusz Kuc
11/26/2019, 2:45 PMproject
| build.gradle.kts
|- childA
| build.gradle.kts
|- childB
| build.gradle.kts
how can i define some values in root build file so i can reference them from child modules build files? If I define them as val
it works fine in single file but cannot be accessed outside. Guess I'm looking for :kotlin: equivalent of ext
block from GroovyDariusz Kuc
11/26/2019, 8:00 PMiammini5
12/02/2019, 12:51 AMDariusz Kuc
12/02/2019, 5:59 AMproject
| build.gradle.kts
| library
| build.gradle.kts
| custom-plugin
| build.gradle.kts
| example
| build.gradle.kts <-- use both library classath dependency and apply custom-plugin to the build
It appears that it is not possible? Above setup is pretty easy to do in Maven project but getting some trouble with Gradle. My attempt for example build script
buildscript {
dependencies {
// cannot use project(path = :custom-plugin) here -> Cannot use project dependencies in a script classpath definition
classpath("com.sample:custom-plugin:1.0.0-SNAPSHOT") // this searches for the released jar
}
}
apply(plugin = "com.sample.custom")
dependencies {
implementation(project(path = ":library"))
}
Any suggestions?Davide Giuseppe Farella
12/02/2019, 7:50 AMkotlin-android
get() = kotlin("android")`
and this is shown correctly in my build.gradle
plugins {
`kotlin-android`
}
But when I try to sync I got the following error: `Unresolved reference: `kotlin-android``iammini5
12/03/2019, 6:53 AMgmariotti
12/05/2019, 9:14 AMsettings.gradle.kts
? Or is there any other best practice to avoid having duplicate code for using artifactory as a gradle plugin repository?ursus
12/06/2019, 9:49 PMtestDebugUnitTest
and testReleaseUnitTest
? Afaik you cannot run unit tests on a proguared release etc.?ursus
12/07/2019, 12:45 AMspierce7
12/09/2019, 7:41 PM./gradle/deps.gradle.kts
, do I have a way of statically accessing the file’s classes it defines externally in another kotlin file where I do something like this:
plugins {
`kotlin-dsl`
}
buildscript {
apply {
file(File(project.rootDir, "gradle/deps.gradle.kts"))
}
dependencies {
classpath(Plugins.kotlin) // Unresolved reference error
}
}
spierce7
12/09/2019, 8:26 PMsettings.gradle
is complaining that it can’t find a class from the buildSrc
. Is this a change, or is this a potential bug?tapchicoma
12/09/2019, 9:11 PMNikky
12/10/2019, 8:08 AM<http://java.io|java.io>.IOException: The filename, directory name, or volume label syntax is incorrect
> The filename, directory name, or volume label syntax is incorrect
i think this is somehow because windows.. but any more is speculation...eekboom
12/10/2019, 12:31 PMPHondogo
12/10/2019, 6:22 PMplugins {
kotlin("multiplatform")
}
how can i set properties like jvmTarget to all submodules?Czar
12/14/2019, 3:26 PMinternal
stuff in a custom integrationTests
source-set in gradle)
Also is this still the correct way to do this? Seems very ugly, and not user-friendly at all.
val compileKotlin by tasks
val compileIntegTestKotlin by tasks
KotlinCompile::class.java.getMethod("setFriendTaskName\$kotlin_gradle_plugin", String::class.java).run {
invoke(compileIntegTestKotlin, compileKotlin.name)
}
gaetan
12/17/2019, 9:43 AMsubprojects {
apply from: rootProject.file('gradle/publish-bintray.gradle')
}
the execution doesn’t stop on my breakpoint inside my linked gradle file. Is there a way of having breakpoints on this file?sean
12/17/2019, 8:25 PMsean
12/17/2019, 8:25 PMnapperley
12/17/2019, 9:06 PMsean
12/17/2019, 9:17 PMlinuxX64 {
val main by compilations.getting
binaries {}
compilations.getByName("main") {
cinterops.create("zfLog") {
defFile = File("$projectDir/src/linuxX64Main/nativeInterop/cinterop/zLog.def")
includeDirs("$projectDir/src/linuxX64Main/nativeInterop/zLog")
}
}
}
Then a source set
val linuxX64Main by getting {
dependsOn(commonMain)
}
But I'm still getting
The Kotlin source set linux was configured but not added to any Kotlin compilationnapperley
12/17/2019, 9:18 PMsean
12/17/2019, 9:20 PMnapperley
12/17/2019, 9:21 PMlinuxX64 {
to linuxX64("native")
.sean
12/17/2019, 9:23 PMnamed("linuxX64Main")
named("linuxX64")
, then the by gettingnapperley
12/17/2019, 9:41 PMsean
12/17/2019, 9:42 PMnapperley
12/17/2019, 9:44 PMsean
12/17/2019, 9:44 PMnapperley
12/17/2019, 9:45 PMsean
12/17/2019, 9:50 PMnapperley
12/17/2019, 9:52 PMsean
12/17/2019, 9:53 PMKotlinSourceSet with name 'linuxX64Main' not found.
napperley
12/17/2019, 10:03 PMsean
12/17/2019, 10:05 PMnapperley
12/18/2019, 12:30 AMsean
12/18/2019, 12:34 AMnapperley
12/18/2019, 12:39 AMsean
12/18/2019, 12:44 AMnapperley
12/18/2019, 10:53 PMsean
12/19/2019, 12:20 AMval nativeMain by sourceSets.creating {
dependencies {
api("org.jetbrains.kotlin:kotlin-stdlib-common")
}
}
val linuxX64 by sourceSets.creating {
dependsOn(nativeMain)
}
targets.withType(KotlinNativeTarget::class.java) {
compilations["main"].defaultSourceSet.dependsOn(nativeMain)
when (hostPresetName) {
"macosX64" -> TODO()
"linuxX64" -> compilations["main"].defaultSourceSet.dependsOn(linuxX64)
"mingwX64" -> TODO()
else -> error("Unsupported host platform")
}
}