Bernhard
10/25/2019, 1:40 PMBernhard
10/25/2019, 2:05 PMageery
10/25/2019, 3:50 PMuse(classname)
and the ExtensionModule file. The first method works for me in Gradle but I can't get the second to work. Also, is there a way in Groovy to call a Kotlin "function type with receiver" (e.g, MyObject.() -> Unit
) so the this
reference inside the lambda in Groovy refers to the receiver (currently, I have to use it
in Groovy)?bjonnh
10/25/2019, 7:48 PMDico
10/28/2019, 10:02 PMbitkid
10/29/2019, 3:50 PM./gradlew check
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\projects\ger\build.gradle.kts' line: 8
* What went wrong:
Plugin [id: 'com.github.ben-manes.versions', version: '0.27.0'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin:0.27.0')
Searched in the following repositories:
Gradle Central Plugin Repository
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at <https://help.gradle.org>
Slackbot
10/29/2019, 4:29 PMMalvin Sutanto
10/31/2019, 7:43 AMisDefault
flag.
I tried isDefault.set(true)
but getting Unresolved reference
error.
isDefault
itself is marked as private in BuildType
class.
Has anybody encountered the same issue before?robertoestivill
10/31/2019, 10:30 AMFirebasePerformance
object in order to configure it.
Documentation
https://firebase.google.com/docs/perf-mon/disable-sdk?platform=android
Groovy example from the documentation
groovy
android {
// ...
buildTypes {
debug {
FirebasePerformance {
// Set this flag to 'false' to disable @AddTrace annotation processing and
// automatic HTTP/S network request monitoring
// for a specific build variant at compile time.
instrumentationEnabled false
}
}
}
}
My build.gradle.kts
has something like
kotlin
buildTypes {
getByName("debug") {
// should disable it here but don't know how to get the reference
}
Any idea how can I get access to the FirebasePerformance
object from inside getByName("debug")
?Dico
10/31/2019, 4:03 PMzipTree
on a jar file from compile dependencies causes pathnames that exceed the windows MAX_PATH limit of 260 characters. On my local machine it is fine, but my gradle CI machine has the project cloned on a slightly longer root path.
I'm using it for proguard tasks a bit like this -
val (obfuscatedClassFiles, exemptedClassFiles) = obfuscationIncludedJars
.fold(files().asFileTree) { acc, jar -> acc + zipTree(jar) }
.let { Pair(it.matching { exclude(*programClassesThatSkipProguard) }, it.matching { include(*programClassesThatSkipProguard) }) }
gmariotti
11/02/2019, 9:09 AMbuild.gradle.kts
looks like this
gradlePlugin {
plugins {
create("customPlugin") {
id = "${project.group}.kotlin"
implementationClass = "${project.group}.kotlin.KotlinPlugin"
}
}
}
publishing {
publications {
create<MavenPublication>("plugin") {
from(components["kotlin"])
}
}
}
artifactory {
setContextUrl("<https://internal.artifactory>")
publish(closureOf<PublisherConfig> {
repository(delegateClosureOf<GroovyObject> {
val artifactoryUser: String? by rootProject
val artifactoryKey: String? by rootProject
setProperty("repoKey", "artifactoryRepoKey")
setProperty("username", System.getenv("ARTIFACTORY_USERNAME") ?: artifactoryUser)
setProperty("password", System.getenv("ARTIFACTORY_PASSWORD") ?: artifactoryKey)
setProperty("maven", true)
})
defaults(delegateClosureOf<ArtifactoryTask> {
publications("plugin")
setPublishArtifacts(true)
setProperties(mapOf("build.language" to "kotlin"))
})
})
}
albrechtroehm
11/07/2019, 12:49 PMgradle.build.kts
(e.g. val versionNumber = "1.0.1"
) in code. Would be nice to set the version in one place and use it for the build and for an about page or something similarFrodrigues
11/07/2019, 1:42 PMFrodrigues
11/07/2019, 10:50 PMShan
11/08/2019, 10:07 PM> Could not create task ':DependenciesReport'.
> Unnecessarily replacing a task that does not exist is not supported. Use create() or register() directly instead. You attempted to replace a task named 'DependenciesReport', but there is no existing task with that name.
Getting this error on Gradle 6.0. Anyone know what could be causing this? I believe DependenciesReport
is a maven plugin task, but can't seem to find any concrete info anywhere..Shan
11/08/2019, 10:34 PMinitscript {
dependencies {
classpath files(["/Users/shan/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/192.6817.14/IntelliJ <http://IDEA.app/Contents/plugins/gradle/lib/gradle-tooling-extension-impl.jar%22,%22/Users/shan/Library/Application|IDEA.app/Contents/plugins/gradle/lib/gradle-tooling-extension-impl.jar","/Users/shan/Library/Application> Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/192.6817.14/IntelliJ <http://IDEA.app/Contents/lib/gson-2.8.5.jar%22])|IDEA.app/Contents/lib/gson-2.8.5.jar"])>
}
}
allprojects {
afterEvaluate { project ->
if(project.path == ':') {
project.tasks.create(name: 'DependenciesReport', overwrite: true, type: org.jetbrains.plugins.gradle.tooling.tasks.DependenciesReport) {
outputFile = project.file("/private/var/folders/2w/1d5gpbj54_s_gkmfc4xywkdh0000gn/T/dependencies.json")
configurations = []
}
}
}
}
Frodrigues
11/08/2019, 11:12 PMnuhkoca
11/10/2019, 7:50 PMkotlin sourceSets
to my project. Below is not working. I am really stuck on it.
sourceSets {
getByName("main").java.srcDirs("src/main/kotlin")
}
robertoestivill
11/11/2019, 9:18 AMbuildSrc/src/main/kotlin/MyClass.kt
anymore. Note that this classes don't have a package as they are in the root of the source set and therefore there was no need for import statements from the different modules build.gradle.kts
. After the upgrade I'm getting Unresolved reference: MyClass
everywhere in the project. Any ideas ?BorzdeG
11/11/2019, 11:54 AMimport org.jetbrains.gradle.ext.*
plugins {
id("org.jetbrains.gradle.plugin.idea-ext") version "0.7"
}
idea {
project {
settings {
}
}
}
Script compilation error:
Line 9: settings {
^ Unresolved reference: settingsAntónio Bastião
11/12/2019, 4:17 PMcommandLine "xcrun", "simctl", "spawn", device, binary.absolutePath
into kotlin?Frodrigues
11/13/2019, 8:11 AMchristophsturm
11/13/2019, 10:44 AMType mismatch: inferred type is List<String> but ListProperty<String!>! was expected
this is how my config looks like: plugins.withId("info.solidsoft.pitest") {
configure<PitestPluginExtension> {
jvmArgs = listOf("-Xmx512m")
testPlugin = "junit5"
avoidCallsTo = setOf("kotlin.jvm.internal")
mutators = setOf("NEW_DEFAULTS")
targetClasses = setOf("randolf.*") //by default "${project.group}.*"
targetTests = setOf("randolf.*")
pitestVersion = "1.4.10"
threads = System.getenv("PITEST_THREADS")?.toInt() ?:
Runtime.getRuntime().availableProcessors()
outputFormats = setOf("XML", "HTML")
}
}
thana
11/14/2019, 11:34 AM-Xuse-experimental=kotlin.contracts.ExperimentalContracts
pabl0rg
11/14/2019, 3:50 PMdependencies {
implementation(project(":ecommerceApi"))
}
But when I run gradlew -p mainproj check
, gradle tries to build this project before the one upon which i declared a dependency, and build fails with Unresolved reference: ecommerceApi
.pabl0rg
11/14/2019, 3:51 PMeekboom
11/15/2019, 8:29 AMsettings.gradle
fails with “Unresolved reference: artifactoryUsername”:
val artifactoryUsername: String by settings
val artifactoryPassword: String by settings
pluginManagement {
repositories {
maven(url = "<https://artifacts.company.com/artifactory/gradle-plugins-proxy>") {
credentials {
username = artifactoryUsername
password = artifactoryPassword
}
}
}
}
Every developer has these properties set in their ~/.gradle/gradle.properties
Any ideas?eekboom
11/15/2019, 2:17 PMtask sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}
I got so far as
tasks.register<Jar>("sourcesJar") {
archiveClassifier.set("sources")
from(sourceSets.main.????)
}
I have groovy and groovy sources now, so “allJava” makes no sense anymore anyway.Vincent Williams
11/17/2019, 6:13 PMsubprojects
section in the root gradle file. I cant seem to be able to use the android
block inside the subprojects
block when I use kts gradle filestrathschlag
11/19/2019, 10:29 AMbuildSrc
(I am using precompiled kotlin scripts for configuring our projects):
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
/home/till/.gradle/wrapper/dists/gradle-6.0-all/cra2s42cvogxluqqpvbc5e9xd/gradle-6.0/lib/kotlin-stdlib-1.3.50.jar (version 1.3)
/home/till/.gradle/wrapper/dists/gradle-6.0-all/cra2s42cvogxluqqpvbc5e9xd/gradle-6.0/lib/kotlin-stdlib-common-1.3.50.jar (version 1.3)
/home/till/.gradle/wrapper/dists/gradle-6.0-all/cra2s42cvogxluqqpvbc5e9xd/gradle-6.0/lib/kotlin-stdlib-jdk8-1.3.50.jar (version 1.3)
/home/till/.gradle/wrapper/dists/gradle-6.0-all/cra2s42cvogxluqqpvbc5e9xd/gradle-6.0/lib/kotlin-stdlib-jdk7-1.3.50.jar (version 1.3)
/home/till/.gradle/wrapper/dists/gradle-6.0-all/cra2s42cvogxluqqpvbc5e9xd/gradle-6.0/lib/kotlin-reflect-1.3.50.jar (version 1.3)
/home/till/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.60/5cb6bf19bab36ab9d10b216356e869250c686a09/kotlin-stdlib-jdk8-1.3.60.jar (version 1.3)
/home/till/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.3.50/b499f22fd7c3e9c2e5b6c4005221fa47fc7f9a7a/kotlin-reflect-1.3.50.jar (version 1.3)
/home/till/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.60/a42a01c0338795930e0a7d8f9d19acafdd1c50ee/kotlin-stdlib-jdk7-1.3.60.jar (version 1.3)
/home/till/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre7/1.1.0/ef03cfed144ff47eed2cab1f7be4381bc18a6237/kotlin-stdlib-jre7-1.1.0.jar (version 1.1)
/home/till/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.60/984644b61450add3bcef8cf20f948fec458b420d/kotlin-stdlib-1.3.60.jar (version 1.3)
/home/till/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.60/538bd29b2d5a7d278a7188f89c3b84183fa37f75/kotlin-stdlib-common-1.3.60.jar (version 1.3)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
w: /home/till/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre7/1.1.0/ef03cfed144ff47eed2cab1f7be4381bc18a6237/kotlin-stdlib-jre7-1.1.0.jar: kotlin-stdlib-jre7 is deprecated. Please use kotlin-stdlib-jdk7 instead
Kotlin 1.3.60 is newer than 1.3.50 packaged with gradle 6. But why is there this kotlin-stdlib-jre7-1.1.0.jar? Does anybody know?trathschlag
11/19/2019, 10:29 AMbuildSrc
(I am using precompiled kotlin scripts for configuring our projects):
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
/home/till/.gradle/wrapper/dists/gradle-6.0-all/cra2s42cvogxluqqpvbc5e9xd/gradle-6.0/lib/kotlin-stdlib-1.3.50.jar (version 1.3)
/home/till/.gradle/wrapper/dists/gradle-6.0-all/cra2s42cvogxluqqpvbc5e9xd/gradle-6.0/lib/kotlin-stdlib-common-1.3.50.jar (version 1.3)
/home/till/.gradle/wrapper/dists/gradle-6.0-all/cra2s42cvogxluqqpvbc5e9xd/gradle-6.0/lib/kotlin-stdlib-jdk8-1.3.50.jar (version 1.3)
/home/till/.gradle/wrapper/dists/gradle-6.0-all/cra2s42cvogxluqqpvbc5e9xd/gradle-6.0/lib/kotlin-stdlib-jdk7-1.3.50.jar (version 1.3)
/home/till/.gradle/wrapper/dists/gradle-6.0-all/cra2s42cvogxluqqpvbc5e9xd/gradle-6.0/lib/kotlin-reflect-1.3.50.jar (version 1.3)
/home/till/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.60/5cb6bf19bab36ab9d10b216356e869250c686a09/kotlin-stdlib-jdk8-1.3.60.jar (version 1.3)
/home/till/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.3.50/b499f22fd7c3e9c2e5b6c4005221fa47fc7f9a7a/kotlin-reflect-1.3.50.jar (version 1.3)
/home/till/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.60/a42a01c0338795930e0a7d8f9d19acafdd1c50ee/kotlin-stdlib-jdk7-1.3.60.jar (version 1.3)
/home/till/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre7/1.1.0/ef03cfed144ff47eed2cab1f7be4381bc18a6237/kotlin-stdlib-jre7-1.1.0.jar (version 1.1)
/home/till/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.60/984644b61450add3bcef8cf20f948fec458b420d/kotlin-stdlib-1.3.60.jar (version 1.3)
/home/till/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.60/538bd29b2d5a7d278a7188f89c3b84183fa37f75/kotlin-stdlib-common-1.3.60.jar (version 1.3)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
w: /home/till/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre7/1.1.0/ef03cfed144ff47eed2cab1f7be4381bc18a6237/kotlin-stdlib-jre7-1.1.0.jar: kotlin-stdlib-jre7 is deprecated. Please use kotlin-stdlib-jdk7 instead
Kotlin 1.3.60 is newer than 1.3.50 packaged with gradle 6. But why is there this kotlin-stdlib-jre7-1.1.0.jar? Does anybody know?pawegio
11/19/2019, 10:40 AMtrathschlag
11/19/2019, 10:57 AMtapchicoma
11/19/2019, 6:05 PM1.1.0
stdlib. You could check it via build scan.trathschlag
11/20/2019, 9:24 AM../gradlew :dependencies
inside buildSrc
and it revealed that some old and unsused plugin pulled in the library.tapchicoma
11/20/2019, 9:35 AM