wuseal
08/06/2019, 3:26 PMbuild.gradle.kts
from gradle.properties
file, I can get the value by val kotlin_version: String = property("kotlin_version").toString()
but can’t by val kotlin_version: String by properties
. WHY?😂 , Anybody could tell me?Matej Drobnič
08/07/2019, 6:43 AMapply from
syntax) in kts gradle script? Currently I'm doing a hack by putting all properties of this plugin into regular non-kts gradle file and then applying that file, but it's ugly.thana
08/07/2019, 12:16 PMplugins {
kotlin("multiplatform") version "1.3.41"
}
thana
08/07/2019, 12:28 PMplugins {
id "org.jetbrains.kotlin.multiplatform" version '1.3.41' apply false
}
now i finally wanted to try out the kotlin dsl and creaed a child module with a build.gradle.kts where i use
apply(plugin = "org.jetbrains.kotlin.multiplatform")
but now the kotlin { }
block cannot be resolved what am i doing wrong?thana
08/08/2019, 10:35 AM.js
and .meta.js
files from the js()
target somewhere else for some reason. with the original groovy i could acces this folder with compileKotlinJs.destinationDir
.
How can i do that with kotlin dsl?Ola Adolfsson
08/08/2019, 2:27 PMAlexander Weickmann
08/08/2019, 4:34 PMmbonnin
08/08/2019, 5:58 PMkotlin-stdlib-jdk8
but not for plain kotlin-stdlib
?
implementation("org.jetbrains.kotlin:kotlin-stdlib")
works but implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
doesn'tpablisco
08/10/2019, 1:11 PMbuildSrc
as a dependendies.kt
file. However we have tests inside buildSrc
so the build.gradle.kts
inside buildSrc
has dependencies too. Anyone has or can think of a way to use the dependencies from the build script in the buildSrc
folder?thana
08/13/2019, 11:46 AMjvmTarget = "1.8
to all submodules?thana
08/13/2019, 2:50 PMtasks.withType(Test::class).configureEach(object : Action<Test> {
override fun execute(it: Test) {
it.outputs.upToDateWhen { false }
}
})
Yet when i do it manually or let intellij do it for with following result:
tasks.withType(Test::class).configureEach {
it.outputs.upToDateWhen { false }
}
It complains that it
is undefined. Any idea why?ghedeon
08/14/2019, 8:55 PMNikolai Skladnev
08/16/2019, 11:04 AMMatej Drobnič
08/20/2019, 5:13 AMSlackbot
08/20/2019, 9:36 AMtulio
08/21/2019, 7:53 PMtasks.register(CustomTask)
and just override the name in my CustomTaskjuliocbcotta
08/23/2019, 2:34 AMribesg
08/23/2019, 9:34 AMProject.publishing
added by maven-publish
?Marc Knaup
08/23/2019, 1:42 PM.kts
Gradle files Android Studio doesn’t import all settings properly and I cannot access the module settings to change the version manually.robertoestivill
08/23/2019, 2:58 PMmbonnin
08/24/2019, 11:54 AMThe Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build.
Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects.
What exact kotlin plugin are we talking about ? My root project has modules using org.jetbrains.kotlin.android
and others using plain org.jetbrains.kotlin.jvm
. Can they/Should they both be applied in the root build.gradle.kts ?darkmoon_uk
08/27/2019, 4:33 AMval buildConfig : Any? = JsonSlurper().parseText(buildConfigFile.readText())
val defaultInstallDir = buildConfig.SetupDefaults.InstallDir // Not compiling as Kotlin compiler doesn't generate dynamic access code
I understand this kind of dynamicism is exactly where Groovy excels (and suffers in equal measure), where Kotlin is meant to be more type safe.darkmoon_uk
08/27/2019, 4:34 AMstepango
08/27/2019, 11:04 AMJeremy
08/31/2019, 10:01 PMkapt("group:name:version")
results in inferred type is String but Action<KaptExtension> was expected
Kroppeb
08/31/2019, 10:24 PMimport kotlinx.serialization.*
it tells me it can't resolve serialization
. I'm assuming it is cause my build.gradle is messed up or somethingmbonnin
09/02/2019, 1:42 PMbuild.gradle
to build.gradle.kts
, it looks like autocomplete in IDEA doesn't work until a first gradle sync is successful. Generated accessors are missing but also more regular things are underlined in red. So what I do is usually comment all of the build.gradle.kts and then uncomment parts as I fix them. Is there a better way to do this ? I feel like even if my android
block is wrong, the dependencies
could be parsed correctly ?Czar
09/03/2019, 6:55 AMsubprojects {
dependencies {
implementation(platform(SpringBootPlugin.BOM_COORDINATES))
}
}
in a subproject:
dependencies {
kapt("org.springframework.boot:spring-boot-configuration-processor")
}
result:
> Could not find org.springframework.boot😒pring-boot-configuration-processor:.if I change
kapt
to implementation
, dependency resolution will work, but obviously won't do what is needed.
I know this is in part Spring question, but the problem seems to be more gradle than Spring.
Basically there is a platform defined by BOM and there is a configuration defined by kapt plugin, gradle does not resolve dependency version for it.Feri Nagy
09/03/2019, 10:58 AMbuildSrc
. Now (hopefully) only last thing remains.
In the buildSrc/build.gradle.kts
we have:
dependencies {
implementation("com.android.tools.build:gradle:3.4.1")
}
Then in root project’s build.gradle.kts
we have:
buildscript {
repositories {
google()
...
}
dependencies {
classpath("com.android.tools.build:gradle:3.4.1")
...
}
}
Is there a way so that the version 3.4.1
would be specified only in single place? Thanks for any tips.Bernhard
09/09/2019, 8:13 AMBernhard
09/09/2019, 8:13 AMgildor
09/09/2019, 8:14 AMBernhard
09/09/2019, 8:45 AM/**
* Applies the given Kotlin plugin [module].
*
* For example: `plugins { kotlin("jvm") version "1.3.41" }`
*
* Visit the [plugin portal](<https://plugins.gradle.org/search?term=org.jetbrains.kotlin>) to see the list of available plugins.
*
* @param module simple name of the Kotlin Gradle plugin module, for example "jvm", "android", "kapt", "plugin.allopen" etc...
*/
fun PluginDependenciesSpec.kotlin(module: String): PluginDependencySpec =
id("org.jetbrains.kotlin.$module")
Czar
09/09/2019, 10:37 AMkotlin("jvm")
kotlin("plugin.spring")
kotlin("plugin.jpa")
kotlin("kapt")