eygraber
09/04/2023, 10:50 PMsourceSets
I have the following:
androidMain {
dependencies {
implementation(platform(libs.composeAndroid.bom)) // composeAndroid-bom = "dev.chrisbanes.compose:compose-bom:2023.09.00-alpha03"
implementation(libs.composeAndroid.material3) // composeAndroid-material3 = { module = "androidx.compose.material3:material3" }
}
}
but I get an error Cannot convert the provided notation to an object of type Dependency: map(valueof(DependencyValueSource)).
If I move it to a top level dependencies
block (which the Android plugin uses) it works fine.Norbi
09/06/2023, 8:54 AMProject accessors enabled, but root project name not explicitly set for 'buildSrc'. Checking out the project in different folders will impact the generated code and implicitly the buildscript classpath, breaking caching.I have a
buildSrc
project in my multi-project build but rootProject.name
is set to the "real" root project, not buildSrc
...Norbi
09/06/2023, 11:53 AMbuildSrc/build.gradle.kts
segment correct in this case?
plugins {
`kotlin-dsl`
}
...
dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10")
}
Won't this interfere with Gradle's embedded Kotlin 1.9.0?
Thanks.ursus
09/06/2023, 4:48 PMExecution failed for task ':foo:bar:testDebugUnitTest'.
> Process 'Gradle Test Executor 260' finished with non-zero exit value 134
This problem might be caused by incorrect test process configuration.
For more on test execution, please refer to <https://docs.gradle.org/8.3/userguide/java_testing.html#sec:test_execution> in the Gradle documentation.
anyone have a clue what is this about? (IDE restart fixes it)
is it maybe related to in memory sqlite im using in tests?Guilherme Delgado
09/08/2023, 10:21 AM#!/bin/bash
echo "> Yay!"
task:
tasks.register<Exec>("runBashScript") {
commandLine("./script.sh")
}
But I’m always getting:
Execution failed for task ':runBashScript'.
> A problem occurred starting process 'command './script.sh''
I’m lost 😕Settingdust
09/10/2023, 3:31 AMkotlin1910.kotlin1910_builtins
.
Then, I added custom transformers for avoiding shadow
relocate the .kotlin_builtins
constant in kotlin reflect.
And relocate the kotlin/kotlin.kotlin_builtins
to kotlin1910/kotlin1910.kotlin_builtins
But the reflect can't find the builtin class AssertionError: Built-in class kotlin1910.Any is not found
Norbi
09/11/2023, 8:01 AMroot
|- shared
|- project1
|- project2
and
// in root's settings.gradle.kts
includeBuild("shared")
includeBuild("project1")
includeBuild("project2")
// in project1's settings.gradle.kts
includeBuild("../shared")
// in project2's settings.gradle.kts
includeBuild("../shared")
Thanks.Norbi
09/11/2023, 8:45 AMbuildSrc
module loading several common Gradle plugins, used by precompiled script plugins:
// buildSrc/build.gradle.kts
dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10")
...
}
The project had no Android support, but now I'd like add the Android plugin as well to one of the sub-modules.
It seems that I have to add it to buildSrc
as well, otherwise I get the error (which seems to be a Gradle classloading conflict):
Unable to load class 'com.android.build.gradle.api.BaseVariant'.
So I added it to buildSrc
as well:
// buildSrc/build.gradle.kts
dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10")
...
implementation("com.android.tools.build:gradle:8.1.1")
}
Gradle sync now works in Idea but when I try to compile the project, errors like the following appear:
Cannot locate tasks that match ':kotlinw:kotlinw-remoting-client-ktor:compileJava' as task 'compileJava' not found in project ':kotlinw:kotlinw-remoting-client-ktor'.
Which I don't understand because the given project is a Kotlin-only project, it has no Java sources, and the Android plugin is not applied to it...
Do you have any idea what is happening? Thanks.Andrey Tabakov
09/11/2023, 2:59 PMe: commonMain can't declare dependsOn on other source sets
I've got this code:
sourceSets {
val commonAntlr by creating {
dependencies {
implementation(kotlin("stdlib"))
// add antlr-kotlin-runtime otherwise, the generated sources will not compile
implementation(project(":3rdparty:antlr-kotlin:antlr-kotlin-runtime"))
}
// you have to add the generated sources the to the kotlin compiler source directory list
// this is not required if you use src/commonAntlr/kotlin and want to add the generated sources to version control
kotlin.srcDir("build/generated-src/commonAntlr/kotlin")
}
val commonMain by getting {
dependsOn(commonAntlr)
kotlin.srcDir("build/generated-src/commonMain/kotlin")
dependencies {
....
}
}
}
How to migrate this?mbonnin
09/12/2023, 1:37 PM1.9.20-Beta
, I'm hit with:
w: Kotlin Source Set 'jvmJavaCodegen' can't depend on 'commonTest' as they are from different Source Set Trees.
Please remove this dependency edge.
Is there somewhere I can learn about Source Set Trees? What constitutes a Tree?mbonnin
09/12/2023, 2:21 PM1.9.20-Beta
plugin marker did not make it to MavenCentral ? kotlin-gradle-plugin
is there but not the plugin marker?eygraber
09/12/2023, 3:25 PMIf you want to have additional source sets that the default hierarchy template doesn't provide...configuring additional source sets manually as usual with dependsOn()
Does that mean that the API for extending the default hierarchy is being removed, or is it not mentioned because it's still experimental?
Zoltan Demant
09/14/2023, 7:04 AMlibs.versions.toml
somehow?Jeff Lockhart
09/14/2023, 10:02 PMeygraber
09/14/2023, 11:24 PMTodd
09/15/2023, 6:14 PMNorbi
09/17/2023, 6:00 AMwebpackTask(
Action {
...
}
)
instead of the (now deprecated) simpler, more readable, shorter, less verbose, ... :)
webpackTask {
...
}
Thanks.Tech
09/17/2023, 4:26 PMplugins
section.
val test_version: String by project
plugins {
id("random.plugin") version "$test_version"
}
I want to just have a single value to update that will update the version of a plugin in my entire project.
The current error being thrown is 'val test_version: String' can't be called in this context by implicit receiver. Use the explicit one if necessary
Tech
09/17/2023, 11:04 PMsrc
sourceset.
I tried doing
sourceSets {
remove(sourceSets.getByName("main"))
}
With no luckChristopher Mederos
09/18/2023, 3:56 AMOla Adolfsson
09/18/2023, 8:49 AMJustin Tullgren
09/18/2023, 7:25 PMpluginManager.withPlugin("org.jetbrains.kotlin.jvm")
and trying to configure the the KotlinCompile
task tasks.withType<KotlinCompile>().configureEach
. however, gradle says the class can’t be found. This is a JVM project. Any idea why?Raphael
09/19/2023, 6:45 AMimport org.sonarqube.gradle.SonarExtension
gradle is not able to resolve the class. (Unresolved reference: sonarqube
) It clearly is there as the package org.sonarqube.gradle
can be inspected and contains the File SonarExtension
. Adding the sonarqube plugin in the build.gradle.kts of the plugin project changes nothing.
Does anyone have any experience/hints regarding that matter? Thanks in advance.natario1
09/19/2023, 10:23 AMKotlinTargetHierarchyDsl
be used to implement this in a clean way?
In addition to main and test, for all native leaf targets and all nodes shared among them, I’d like to have a <name>Debug
and <name>Release
source sets. Later I can create compilations that use these sets as default source set, and configure the binaries depending on NativeBuildType
. Kind of like this: https://github.com/ilmat192/kotlin-native-gradle-samples/blob/master/debug-logger/build.gradle.ktskrzysztof
09/20/2023, 5:14 AMmudasar187
09/20/2023, 8:05 AMQamar Khan
09/20/2023, 10:38 AMimplementation("com.appdynamics:appdynamics-runtime:23.4.1")
after adding app dynamic will cause the very high build times. even we are using M2 pro system also we are added some code to optimise the build times but still not resolved.
I request someone to help us, if he/she had experience the same issue and how to fix or reduce build time.
see thread i attached some screen ..CLOVIS
09/21/2023, 2:45 PMerror message: java.lang.NoClassDefFoundError: org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo (initialization failure)
at java.base/java.lang.J9VMInternals.initializationAlreadyFailed(J9VMInternals.java:156)
at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer.analyzeDeclarations$default(LazyTopDownAnalyzer.kt:61)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:119)
...
Caused by: java.lang.NoClassDefFoundError: javaslang.λ
at java.base/java.lang.ClassLoader.defineClassImpl(Native Method)
...
Caused by: java.lang.ClassNotFoundException: javaslang.λ
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:827)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:1095)
... 74 more
I've seen it on a MacOS running Gradle 7.2 and 8.3, it happens when compiling buildSrc
.
After deleting ~/.gradle
, the project works well, so I don't really have anything to reproduce with to create an issue. If there is already an issue somewhere, maybe I can add some information to it?Raphael
09/21/2023, 3:25 PM/
/gradlePlugins <-- In here plugins are specified
/subProjectA
/subProjectB
/build.gradle.kts <-- should apply the plugin to all subprojects and should apply the default config
/settings.gradle.kts <-- here the plugin is included
/default-config.gradle.kts
The defualt-config.gradle.kts should look something like this:
apply(plugin = "my-plugin")
myPluginConfig {
foo="bar"
}
The build.gradle.kts should include this config something like this:
...
subprojects {
apply(from = "default-config.gradle.kts")
}
Unfortunately this doesn't work.
1. Because i cannot apply the plugin in the subprojects
container due to Cannot run Project.afterEvaluate(Action) when the project is already evaluated.
2. The default-config.gradle.kts
cannot resolve myPluginConfig
as well as any imports of it.
I have tried countless different scenarios without any luck. Does anyone have an idea on how to do that?Justin Tullgren
09/21/2023, 4:09 PMincludedBuild
to develop a kotlin compiler plugin
. The subplugin however is ways being “fetched” and not using the artifact from the included build, which is requiring me to publish to mavenlocal or another repo for testing. Is there a way to have the kotlin compiler use the artifact from the build?