Slackbot
06/25/2019, 5:56 AMursus
06/26/2019, 3:55 AMkapt.incremental.apt=true
but then gradle breaks with
* What went wrong:
Execution failed for task ':core:kaptDebugKotlin'.
> Could not resolve all files for configuration ':core:_classStructurekaptDebugKotlin'.
> Failed to transform file 'classes.jar' to match attributes {artifactType=class-structure, org.gradle.usage=java-runtime-jars}
> Execution failed for StructureArtifactTransform: C:\Users\ursus\.gradle\caches\transforms-2\files-2.1\d17b7c88a03f1112fe0ba327a2d0eee6\jars\classes.jar.
> java.lang.IllegalArgumentException (no error message)
> Failed to transform file 'runtime-jvm-1.1.3.jar' to match attributes {artifactType=class-structure, org.gradle.usage=java-runtime-jars}
> Execution failed for StructureArtifactTransform: C:\Users\ursus\.gradle\caches\modules-2\files-2.1\com.squareup.sqldelight\runtime-jvm\1.1.3\133500e0dcd9092c8f376d5add6ad7c4afb7177e\runtime-jvm-1.1.3.jar.
> java.lang.IllegalArgumentException (no error message)
> Failed to transform file 'kotlin-stdlib-jdk7-1.3.40.jar' to match attributes {artifactType=class-structure, org.gradle.usage=java-runtime-jars}
> Execution failed for StructureArtifactTransform: C:\Users\ursus\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib-jdk7\1.3.40\2995de8f68444ad47f29e7b59962ac31e6301d7e\kotlin-stdlib-jdk7-1.3.40.jar.
> java.lang.IllegalArgumentException (no error message)
.... truncated, same error but different dependency
Stephan Schroeder
06/26/2019, 3:22 PMtask integrationTest(type: Test) {
useJUnit {
include '**/*IntegrationTest.class'
}
}
to KotlinDSL?
I tried
task {
named<Test>("integrationTest") {
useJUnit {
include("**/*IntegrationTest.class")
}
}
}
but get Task with name 'integrationTest' not found in root project
.Stephan Schroeder
06/26/2019, 3:33 PMinitialVersion
makes problems
scmVersion {
versionIncrementer 'incrementMinor'
tag {
initialVersion = { config, position -> '1.0.0' }
}
checks {
aheadOfRemote = false
uncommittedChanges = false
}
}
I got
tasks {
scmVersion {
versionIncrementer("incrementMinor")
tag {
initialVersion = { config, position -> "1.0.0" }
}
checks(delegateClosureOf<ChecksConfig> {
aheadOfRemote = false
uncommittedChanges = false
})
}
}
but there is no longer an initialVersion
available, closest thing is maybe init{versionCreator{...
this wants some closure.Stephan Schroeder
06/26/2019, 3:35 PMtasks {
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
}
but the mavenJava
is red 😔 with unresolved reference: mavenJava
. I assume I should have been included by this but didn’t
plugins {
id("java")
`maven-publish`
}
Stephan Schroeder
06/27/2019, 12:47 PMjava
can’t be resolved in
tasks{
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components.get().java) //in groovy it's 'components.java'
}}}}
and according to the docu (https://docs.gradle.org/current/dsl/org.gradle.api.publish.maven.MavenPublication.html#N1BEBB) 3 types of component are supported: ‘components.java’ (added by the JavaPlugin) And I do import the javaPlugin:
plugins {
java
`maven-publish`
So I get why java
can’t be found on components.get()
statically (because it’s added dynamically by a different plugin). But how can i access it?
This is the javadoc of the class CompoentReport
and I’m still not able to figure it out: https://docs.gradle.org/current/javadoc/org/gradle/api/reporting/components/ComponentReport.htmlFabian
06/27/2019, 2:45 PMplugins {
java
}
seems to be mandatoryPaulius Ruminas
06/28/2019, 1:11 PMandroidx.navigation.safeargs.kotlin
plugin to my project: Caused by: org.gradle.api.GradleException: androidx.navigation.safeargs.kotlin plugin must be used with kotlin plugin
.
settings.gradle.kts:
pluginManagement {
repositories {
gradlePluginPortal()
jcenter()
google()
mavenCentral()
}
resolutionStrategy {
eachPlugin {
when (requested.id.namespace) {
"org.jetbrains.kotlin" -> useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${Version.Kotlin}")
}
when (requested.id.id) {
"kotlinx-serialization" -> useModule("org.jetbrains.kotlin:kotlin-serialization:${Version.Kotlin}")
"com.android.application" -> useModule("com.android.tools.build:gradle:3.4.1")
"androidx.navigation.safeargs.kotlin" -> useModule("androidx.navigation:navigation-safe-args-gradle-plugin:${Version.NavigationKtx}")
}
}
}
}
// ...
build.gradle.kts:
plugins {
id("com.android.application")
kotlin("android")
kotlin("android.extensions")
kotlin("kapt")
id("androidx.navigation.safeargs.kotlin")
}
// ...
Allan Wang
07/03/2019, 1:57 AMNicholas Bilyk
07/08/2019, 3:52 PMincludeBuild("../acornui") {
dependencySubstitution {
substitute(module("com.acornui:acornui-utils-metadata")).with(project(":acornui-utils"))
substitute(module("com.acornui:acornui-utils-jvm")).with(project(":acornui-utils"))
substitute(module("com.acornui:acornui-utils-js")).with(project(":acornui-utils"))
}
}
This actually works as far as building is concerned, but the IDE doesn't accept the substitution. Any suggestions for where I can go from here?bjonnh
07/13/2019, 8:33 PMvishna
07/16/2019, 10:45 AMgradle init --dsl kotlin --type kotlin-application
is doing, namely instead of having:
\
|-\src
|-build.gradle.kts
|-settings.gradle.kts
have it generate a project with app module & buildSrc.
\
|-\app
|-\buildSrc
|-build.gradle.kts
|-settings.gradle.kts
Rationale: I want to have more modules, reuse constants via buildSrc and default project layout is a PITA to changethana
07/16/2019, 12:54 PMPHondogo
07/18/2019, 12:35 PMvoben
07/18/2019, 2:46 PMUnresolved reference: creditcall
Execution failed for task ':app:compileDebugKotlin'
Library module: build.gradle
apply plugin: 'java-library'
dependencies {
implementation files("libs/MyCurrencyJar.jar")
}
App module: build.gradle
...
dependencies {
...
implementation project(':myLibrary')
}
Can I add a jar to a library module this way?voben
07/19/2019, 12:54 AMsettings.gradle
file.
Now the issue is, even if I have a settings.gradle.kts
file, android studio creates a settings.gradle and adds my dependency in there rather than in the .kts
version. Is there a way to tell AS to add the dependency to the existing settings.gradle.kts file rather than create a new settings.gradle?Dias
07/19/2019, 9:46 AMLine 15: kotlin("jvm") version "$kotlinVersion"
^ Unresolved reference: kotlinVersion`
ursus
07/21/2019, 6:31 PMassembleRelease
Usually I do it in app build.gradle via
afterEvaluate {
assembleRelease.dependsOn test
}
However this doesnt work for my multimodule app, It seems that code only runs tests in :app
I could add that block to every module's build file but that is error prone
I tried
allprojects {
afterEvaluate {
assembleRelease.dependsOn test
}
}
* What went wrong:
A problem occurred configuring root project 'icewarp-teamchat-android'.
> Could not get unknown property 'assembleRelease' for root project 'abc' of type org.gradle.api.Project.
Javier
07/23/2019, 11:41 AMJavier
07/23/2019, 9:43 PMThis script caused build configuration to fail, run 'gradle tasks' for more information
Alanna
07/25/2019, 6:19 PMgradle init --type kotlin-application
and I have added the lines found here to my settings.gradle: https://github.com/JetBrains/kotlin/#including-into-composite-build
When I do a ./gradlew build --info
in my starter project, I can see that the there are :kotlin:*
tasks running (though they re-run only after I do a ./gradlew dist
in the kotlin compiler repo) but the changes I've made to the Kotlin compiler (I've added some print/logging statements) are not showing up. I'm new to gradle - do I need to disable running the kotlin compiler via the daemon, or do something else in my gradle files to point gradle at my built-from-source kotlin compiler? Any help would be greatly appreciated!!
Also if this question fits better on the forum, please let me know; I would be happy to move it there 🙂ursus
07/26/2019, 4:41 PMbuild
task in gradlew :tasks --all
? I only see module:build, module:test etcvpriscan
07/28/2019, 11:36 AMStephan Schroeder
07/29/2019, 3:47 PMsubprojects {
plugins {
java
idea
`maven-publish`
id("pl.allegro.tech.build.axion-release") version "1.9.3"
}
group = "uk.co.di.platform"
version = scmVersion.version
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {
mavenCentral()
mavenLocal()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
}
}
}
tasks {
scmVersion {
versionIncrementer("incrementMinor")
tag(delegateClosureOf<TagNameSerializationConfig> {
initialVersion = KotlinClosure2<TagProperties, ScmPosition, String>({ _, _ ->"1.0.0"})
})
checks(delegateClosureOf<ChecksConfig> {
aheadOfRemote = false
uncommittedChanges = false
})
}
}
}
scmVersion is e.g. flagged as unresolved reverence, but it should have been made accessible by the axion-release plugin.Chris Miller
07/30/2019, 2:01 PMconfigurations.getByName("jsMainImplementation").forEach { ... }
My question is, what do I need to change this to for it to work with 1.3.30+?miqbaldc
08/02/2019, 2:04 AMursus
08/02/2019, 11:29 PMunless all inputs and outputs are represented as a file
?barteks2x
08/03/2019, 10:01 PMHow do I force intellij to refresh gradle buildSrc index so that it actually knows what changed in there?
Usually I just mess around with the buildscript until a message pops up that buildscript dependencies have changed, then I restore everything to what it was and click "apply"
(also I'm on gradle 4.8, so any gradle 5.x specific way won't work for me)
barteks2x
08/03/2019, 10:11 PMbarteks2x
08/03/2019, 10:21 PMbarteks2x
08/03/2019, 10:21 PMoctylFractal
08/05/2019, 8:54 PM