keturn
05/26/2020, 10:54 PMbuildSrc/
, but IntelliJ isn't quite handling it smoothly. It says "The associated Gradle Project isn't imported," and that message won't go away. (the buildSrc is under the root gradle project that certainly is imported)
and if I use the type-safe configuration names in my dependencies
section, intellij's gradle sync fails unable to resolve them, while gradle itself seems just fine with it.elect
05/27/2020, 9:28 AMorg.gradle.jvmargs
to gradle kotlin scriptfrank
05/30/2020, 2:30 AMResolving dependency configuration 'implementation' is not allowed as it is defined as 'canBeResolved=false'.
Instead, a resolvable ('canBeResolved=true') dependency configuration that extends 'implementation' should be resolved.
I tried with 'compileClasspath' and 'runtimeClasspath' but dont work. Do i need to create my own implementation or use another?
My Code:
tasks.build{
doLast {
configurations["implementation"].forEach {
copy{
includeEmptyDirs = false
from(zipTree(it.absolutePath))
into("$resources/lib/kotlin")
include { fileTreeElement ->
val path = fileTreeElement.path
path.endsWith(".js") && (path.startsWith("META-INF/resources/") || !path.startsWith("META-INF/"))
}
}
} }
}
Dariusz Kuc
05/30/2020, 3:52 AMartifactId
but both plugin and its descriptor share same id (they differ in values in generated pom files). Also tried checking for packaging -> i.e. if (pom.packaging != "pom")
but that results in Cannot publish module metadata where component artifacts are modified.
Any ideas?Dariusz Kuc
05/30/2020, 7:34 PMpublish
) and Plugin Portal (publishPlugin
) and while last publish was successful I only got pom, module, javadoc and sources (from default maven publication) but no jar (in sonatype).
My root project config:
https://github.com/ExpediaGroup/graphql-kotlin/blob/master/build.gradle.kts#L172 <- I’m explicitly configuring mavenJava
publication for all projects except Gradle plugin as it explicitly creates its own pluginMaven
publication.
Gradle plugin config:
https://github.com/ExpediaGroup/graphql-kotlin/blob/master/plugins/graphql-kotlin-gradle-plugin/build.gradle.kts
publishToMavenLocal
correctly publishes the plugin jar so it would appear that pluginMaven
publication already contains the jar -> any ideas?SrSouza
06/01/2020, 7:08 PMElizabeth Mezias
06/02/2020, 1:42 AMelect
06/02/2020, 8:42 AMProject::repositories(Closure configureClosure)
doesnt accept a kt lambda.. is this normal or am I doing anything wrong?Rodrigo Silva
06/02/2020, 12:44 PMSam Garfinkel
06/04/2020, 5:35 PMkotlin("jvm")
plugin not correctly resolve MPP libraries from the meta-lib? For instance the following fails to resolve implementation("net.devrieze:xmlutil-serialization:0.20.0.1")
.Peter
06/04/2020, 9:15 PMintegration test
that depends on another module eg service
? iow, in integration test
build.gradle.kts i have implementation(project(":service"))
when building the integration test
module it fails to find the service.jar - looks like there’s a race condition as every time i check the jar did get created right around the same timegroostav
06/04/2020, 11:55 PMDavide Giuseppe Farella
06/06/2020, 3:30 PMpublish
and publishAndroid
are helpers that I wrote and internally do:
apply(plugin = "com.jfrog.bintray")
apply(plugin = "maven-publish")
group = ...
version = ...
afterEvaluate {
publishing { ... }
configure<BintrayExtension> { ... }
}
David Glasser
06/08/2020, 4:42 PMKepha
06/09/2020, 2:25 AMelect
06/09/2020, 6:06 AMDefaultSourceDirectorySet
constructor:
The DefaultSourceDirectorySet constructor has been deprecated. This is scheduled to be removed in Gradle 6.0. Please use the ObjectFactory service to create instances of SourceDirectorySet instead.with gradle 6.0 the plugin crashes because the method does not exist anymore (it calls it via reflection):
Caused by: java.lang.NoSuchMethodException: org.gradle.api.internal.file.DefaultSourceDirectorySet.<init>(java.lang.String, org.gradle.api.internal.file.FileResolver, org.gradle.api.internal.file.collections.DirectoryFileTreeFactory)
at java.base/java.lang.Class.getConstructor0(Class.java:3349)
at java.base/java.lang.Class.getConstructor(Class.java:2151)
at org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSetKt.<clinit>(DefaultKotlinSourceSet.kt:148)
... 191 more
Old code is here: https://github.com/JetBrains/kotlin/blob/a44d70e79d06a5133b86470c749cc2d0bf870053/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/sources/DefaultKotlinSourceSet.kt#L149
however in the actual code, that snippet has been reworked: https://github.com/JetBrains/kotlin/blob/bd66e87440b9d2463437a4682128d4ce24de91ca/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/sources/DefaultKotlinSourceSet.kt#L226-L227
I do use 1.3.72
, a dependencies
task prints out:
kotlinCompilerPluginClasspath
+...
\--- org.jetbrains.kotlin:kotlin-sam-with-receiver:1.3.72
+--- org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.3.72
| +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 (*)
| \--- org.jetbrains.kotlin:kotlin-native-utils:1.3.72
| +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 (*)
| \--- org.jetbrains.kotlin:kotlin-util-io:1.3.72
| \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 (*)
+--- org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.3.72
| \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 (*)
\--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 (*)
but I don't know when that snippet has been actually implemented.. I cant seem to find 1.3.72 on the repo, although 1.3.70 does have still the deprecated constructor: https://github.com/JetBrains/kotlin/blob/1.3.70/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/sources/DefaultKotlinSourceSet.kt#L249Nicolas Bourdin
06/09/2020, 9:27 AMsourceControl {
gitRepository("<ssh://git@my.privaterepo.com/Nicolas/common.git>") {
producesModule("my.private.lib:common")
}
}
//build.gradle
implementation 'my.private.lib:com'
When i try to build i got the following error with gradle :
Could not run ls-remote for <ssh://git>@my.privaterepo.com/Nicolas/common.git
<ssh://git>@my.privaterepo.com/Nicolas/common.git: Auth fail
<ssh://git>@my.privaterepo.com/Nicolas/common.git: Auth fail
Auth fail
Maybe i need to fix something with my ssh key ?gammax
06/09/2020, 9:34 AMegorand
06/09/2020, 2:50 PMCould not perform incremental compilation: Could not connect to Kotlin compile daemon
Could not connect to kotlin daemon. Using fallback strategy.
Still working on a repro sample and planning to submit a bug report, but wondering if anyone's had a similar experience.jaguililla
06/09/2020, 5:14 PM.gradle.kts
scripts with apply(from = "<file>.gradle.kts")
doesn't work for me (Gradle 6.5). However, errors happens only when the script relies on a plugin (it seems to work fine if no extra plugin is required). If someone has had the same issue I would appreciate your comments. Thanks!camdenorrb
06/10/2020, 12:28 AMGarouDan
06/10/2020, 11:23 PM!
operator in Kotlin?
For example, if I have MyClass defined as:
MyClass() {
run() {
println("finished")
}
}
I’d like to create a situation where doing something like this:
val myObject = MyClass()
myObject!
is equivalent to
myObject().run()
the methods will be more complex since this is for a special library that I’m doing, but the simple idea is like this.
How can we define this operator? I think it is possible because we have the !!
one.janvladimirmostert
06/11/2020, 8:15 PMval kotlinVersion: String = "1.4-M2"
// fun Project.kotlinVersion(): String = "1.4-M2"
plugins {
kotlin("multiplatform").version(kotlinVersion)
this doesn't show any red lines in the IDE, but neither does it compile, i doesn't know what Version is
object Version {
const val kotlin = "1.4-M2"
}
plugins {
kotlin("multiplatform").version(Version.kotlin)
Samyak Jain
06/12/2020, 2:26 PMlibraries/tools/kotlin-gradle-plugin/build.gradle.kts
.
Here's the kts file:Samyak Jain
06/12/2020, 2:26 PMmport org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.pill.PillExtension
plugins {
java
kotlin("jvm")
`java-gradle-plugin`
id("org.jetbrains.dokka")
id("jps-compatible")
}
publish()
// todo: make lazy
val jar: Jar by tasks
val jarContents by configurations.creating
sourcesJar()
javadocJar()
repositories {
google()
}
pill {
variant = PillExtension.Variant.FULL
}
dependencies {
compile(project(":kotlin-gradle-plugin-api"))
compile(project(":kotlin-gradle-plugin-model"))
compileOnly(project(":compiler"))
compileOnly(project(":compiler:incremental-compilation-impl"))
compileOnly(project(":compiler:daemon-common"))
compile(kotlinStdlib())
compile(project(":kotlin-native:kotlin-native-utils"))
compileOnly(project(":kotlin-reflect-api"))
compileOnly(project(":kotlin-android-extensions"))
compileOnly(project(":kotlin-build-common"))
compileOnly(project(":kotlin-compiler-runner"))
compileOnly(project(":kotlin-annotation-processing"))
compileOnly(project(":kotlin-annotation-processing-gradle"))
compileOnly(project(":kotlin-scripting-compiler"))
compileOnly("com.android.tools.build:gradle:2.0.0")
compileOnly("com.android.tools.build:gradle-core:2.0.0")
compileOnly("com.android.tools.build:builder:2.0.0")
compileOnly("com.android.tools.build:builder-model:2.0.0")
compileOnly("org.codehaus.groovy:groovy-all:2.4.12")
compileOnly(gradleApi())
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
runtime(projectRuntimeJar(":kotlin-compiler-embeddable"))
runtime(projectRuntimeJar(":kotlin-annotation-processing-gradle"))
runtime(projectRuntimeJar(":kotlin-android-extensions"))
runtime(projectRuntimeJar(":kotlin-compiler-runner"))
runtime(projectRuntimeJar(":kotlin-scripting-compiler-embeddable"))
runtime(project(":kotlin-reflect"))
jarContents(compileOnly(intellijDep()) {
includeJars("asm-all", rootProject = rootProject)
})
// com.android.tools.build:gradle has ~50 unneeded transitive dependencies
compileOnly("com.android.tools.build:gradle:3.0.0") { isTransitive = false }
compileOnly("com.android.tools.build:gradle-core:3.0.0") { isTransitive = false }
compileOnly("com.android.tools.build:builder-model:3.0.0") { isTransitive = false }
testCompileOnly (project(":compiler"))
testCompile(projectTests(":kotlin-build-common"))
testCompile(project(":kotlin-android-extensions"))
testCompile(project(":kotlin-compiler-runner"))
testCompile(project(":kotlin-test::kotlin-test-junit"))
testCompile("junit:junit:4.12")
testCompileOnly(project(":kotlin-reflect-api"))
testCompileOnly(project(":kotlin-annotation-processing"))
testCompileOnly(project(":kotlin-annotation-processing-gradle"))
}
runtimeJar(rewriteDepsToShadedCompiler(jar)) {
dependsOn(jarContents)
from {
jarContents.asFileTree.map {
if (it.endsWith(".jar")) zipTree(it)
else it
}
}
}
tasks {
withType<KotlinCompile> {
kotlinOptions.jdkHome = rootProject.extra["JDK_18"] as String
kotlinOptions.languageVersion = "1.2"
kotlinOptions.apiVersion = "1.2"
kotlinOptions.freeCompilerArgs += listOf("-Xskip-metadata-version-check")
}
named<ProcessResources>("processResources") {
val propertiesToExpand = mapOf("projectVersion" to project.version)
for ((name, value) in propertiesToExpand) {
inputs.property(name, value)
}
filesMatching("project.properties") {
expand("projectVersion" to project.version)
}
}
named<Jar>("jar") {
callGroovy("manifestAttributes", manifest, project)
}
named<ValidateTaskProperties>("validateTaskProperties") {
failOnWarning = true
}
named<DokkaTask>("dokka") {
outputFormat = "markdown"
includes = listOf("$projectDir/Module.md")
}
}
projectTest {
executable = "${rootProject.extra["JDK_18"]!!}/bin/java"
dependsOn(tasks.named("validateTaskProperties"))
}
pluginBundle {
fun create(name: String, id: String, display: String) {
(plugins).create(name) {
this.id = id
this.displayName = display
this.description = display
}
}
create(
name = "kotlinJvmPlugin",
id = "org.jetbrains.kotlin.jvm",
display = "Kotlin JVM plugin"
)
// create(
// name = "kotlinJsPlugin",
// id = "org.jetbrains.kotlin.js",
// display = "Kotlin JS plugin"
// )
create(
name = "kotlinMultiplatformPlugin",
id = "org.jetbrains.kotlin.multiplatform",
display = "Kotlin Multiplatform plugin"
)
create(
name = "kotlinAndroidPlugin",
id = "org.jetbrains.kotlin.android",
display = "Android"
)
create(
name = "kotlinAndroidExtensionsPlugin",
id = "org.jetbrains.kotlin.android.extensions",
display = "Kotlin Android Extensions plugin"
)
create(
name = "kotlinKaptPlugin",
id = "org.jetbrains.kotlin.kapt",
display = "Kotlin Kapt plugin"
)
create(
name = "kotlinScriptingPlugin",
id = "org.jetbrains.kotlin.plugin.scripting",
display = "Gradle plugin for kotlin scripting"
)
create(
name = "kotlinNativeCocoapodsPlugin",
id = "org.jetbrains.kotlin.native.cocoapods",
display = "Kotlin Native plugin for CocoaPods integration"
)
}
Samyak Jain
06/13/2020, 3:57 PM* Where:
Build file '/home/samyak/gsoc/kotlin/kotlin-1.3.30/kotlin-1.3.30/prepare/compiler-embeddable/build.gradle' line: 30
* What went wrong:
A problem occurred evaluating project ':kotlin-compiler-embeddable'.
> No signature of method: static EmbeddableKt.compilerDummyForDependenciesRewriting() is applicable for argument types: (java.lang.String, build_3iru8x0j1kdz5fc4ppmd4bywe$_run_closure2) values: [compilerDummy, build_3iru8x0j1kdz5fc4ppmd4bywe$_run_closure2@51ac48b3]
Possible solutions: compilerDummyForDependenciesRewriting(org.gradle.api.Project, java.lang.String, kotlin.jvm.functions.Function1)
* Try:
Run with --debug option to get more log output. Run with --scan to get full insights.
I'm not able to debug this bit, any help is appreciated.Mohamed Ibrahim
06/14/2020, 11:14 AMursus
06/14/2020, 8:25 PMtransaction:transaction-contract
?ursus
06/14/2020, 8:25 PMYevhenii Nadtochii
06/14/2020, 9:09 PMgradle run --args='--mode=middle' ---> gradle run
gradle run --args='--mode=greed' ---> gradle runGreed OR gradle run greed
gradle run --args='--mode=lavish' ---> gradle runLavish OR gradle run lavish