René
12/18/2019, 6:43 PMproject.convention.getPlugin(JavaPluginConvention::class.java.sourceSets
ursus
12/21/2019, 12:47 AMImran/Malic
12/21/2019, 2:32 PMsubProject { project ->
def projectSourceSetClasspath = project.sourceSets.main.runTimeClassPath
}
Clint Checketts
12/23/2019, 11:55 PMrootProject.name = "example"
val mavenUser: String by settings
val mavenPassword: String by settings
pluginManagement {
repositories {
maven {
url = uri("<https://myrepo>")
authentication { create<BasicAuthentication>("basic") }
credentials {
username = mavenUser
password = mavenPassword
}
}
}
}
jdemeulenaere
12/25/2019, 6:51 PMpg
12/29/2019, 1:38 PMVsevolod Kaganovych
01/03/2020, 11:44 PMversion code
and version name
and then use it via apply
. But when I try to enter android {}
function, it says “cannot resolve reference”. Is there any way out?Smith
01/05/2020, 2:47 PMval someVersion: String by extra("1.2.3")
However, in childproj/build.gradle.kts:
val someVersion: String by extra
does not work, saying “Cannot get non-null extra property ‘someVersion’”
What’s the appropriate way to do variable inheritance?nrobi
01/06/2020, 11:30 AMKtor
backend module from a KMP
project to Heroku, but I’m getting A problem occurred configuring project ':app'. > kotlin.KotlinNullPointerException (no error message)
for Task :buildSrc:build
. Anyone who had similar issues?Nicholas Bilyk
01/06/2020, 3:04 PMallprojects {
this.tasks.withType<TestReport> {
this.destinationDir = rootProject.buildDir.resolve("<mailto:reports/${this@allprojects.name|reports/${this@allprojects.name>}/")
}
this.tasks.withType<Test> {
this.reports.junitXml.destination = rootProject.buildDir.resolve("<mailto:reports/${this@allprojects.name|reports/${this@allprojects.name>}/xml/")
this.reports.html.destination = rootProject.buildDir.resolve("<mailto:reports/${this@allprojects.name|reports/${this@allprojects.name>}/html/")
}
}
But that doesn't seem to work. What's strange is that if I run clean / test repeatedly sometimes they end up where I'm declaring, but it's unreliable. It's as if I'm declaring this in the wrong spot.Joan Colmenero
01/06/2020, 5:01 PMimplementation project(':app')
in my feature modules in Android?Javier
01/06/2020, 10:51 PMAlessandro Tagliapietra
01/07/2020, 1:56 AMjimn
01/07/2020, 9:08 AMBorzdeG
01/08/2020, 8:44 PMimport org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.kotlin.dsl.registering
import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper
class PublishPlugin : Plugin<Project> {
override fun apply(target: Project): Unit = target.run {
apply<KotlinPluginWrapper>()
val sourcesJar by tasks.registering(Jar::class){
classifier = "sources"
}
}
}
Tell me what is wrong in the code? I get the error Type 'RegisteringDomainObjectDelegateProviderWithTypeAndAction <out TaskContainer, Jar>' has no method 'getValue (Nothing ?, KProperty <*>)' and thus it cannot serve as a delegate
doing based on an example: https://github.com/gradle/kotlin-dsl-samples/blob/master/samples/maven-publish/build.gradle.ktsDariusz Kuc
01/10/2020, 9:55 PMrootA
- build.gradle.kts
- gradle.properties <-- share this
- settings.gradle.kts
- libA
- libB
- pluginA
- rootB
- build.gradle.kts
- settings.gradle.kts
- exampleA (uses libA/libB and pluginA)
Is there a way to share rootA/gradle.properties
with rootB
project?joe
01/12/2020, 12:57 AMDominaezzz
01/12/2020, 5:48 PMimplementation(project(":sibling"), classifier = "natives-linux")
doesn't work.tapchicoma
01/15/2020, 1:33 PMw: Language version 1.4 is experimental, there are no backwards compatibility guarantees for new language and library features
Sylvain Patenaude
01/15/2020, 4:44 PMsourceSets {
commonMain {
dependencies {
implementation kotlin("stdlib-common")
}
}
The warning is: 'kotlin' cannot be applied to '(java.lang.String)'
.Dariusz Kuc
01/15/2020, 11:42 PMpom.xml
using maven-publish
plugin but having trouble setting up the description
, i.e. my project structure is
root
\- moduleA
\- moduleB
both root
and modules contain their own build.gradle.kts
files where i set their descriptions yet when I try to read them in [root] subprojects{}
their all descriptions turn out empty. Any ideas?jkbbwr
01/16/2020, 1:58 PM├── c_v_b_ce_one.h
├── c_v_b_ce_two.h
├── c_v_b_ce_three.h
├── c_v_b_ce_four.h
├── c_v_b_cl_five.h
├── c_v_b_cr_six.h
├── c_v_b_cr_seven.h
├── c_v_b_cr_eight.h
├── c_v_b_cr_nine.h
├── c_v_b_cr_ten.h
├── c_v_b_cr_eleven.h
I need to split on _
and put them in a directory structure.Dariusz Kuc
01/16/2020, 2:32 PMautoReleaseAfterClose
property from nexus-staging-maven-plugin
)?Shan
01/19/2020, 4:05 AMandroid-remote
.patrickdelconte
01/19/2020, 12:09 PMNo tests found for given includes: [AmountTest.bla](filter.includeTestsMatching)In a normal jvm project this is fixed by adding
test { userJUnitPlatform() }
to the build script. However I am having a hard time figuring out how to do it in multiplatfomRodrigo Silva
01/22/2020, 7:28 PMRan Magen
01/23/2020, 4:16 AM$rootDir/gradle/root.gradle
ext.foo = "something"
// $rootDir/gradle/root/git_util.gradle
ext.complex_value = someValue.with {
return doSomeHardWork(rootDir) + foo
}
// build.gradle
apply {
from "$rootDir/gradle/root/git_util.gradle"
}
def someMap = [
key: complex_value
]
I can't figure out how to get an equivalent going in Kotlin such that I could define `val`s that are globally available but are computed once and have access to the Project
(e.g. using rootDir
)
(I know I can make extension functions on Project
in buildSrc
but those are all functions that will get invoked on every call. Groovy has .memoize()
but I don't think there's an equivalent in .kts
)genovich
01/23/2020, 11:07 AMcom.android.build.gradle.tasks.AndroidJavaCompile
. I add buildscript
block like this
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.5.3")
}
}
I invoke tasks.withType<AndroidJavaCompile>().all { println(name) }
and there is no result.
If I invoke tasks.matching { it.name == "compileDebugJavaWithJavac" }.all { println(javaClass) }
, i’ve got com.android.build.gradle.tasks.AndroidJavaCompile_Decorated
.Marc Knaup
01/24/2020, 9:06 AM> Could not resolve org.junit.jupiter:junit-jupiter-api:5.0.0.
Required by:
project : > org.jetbrains.kotlin:kotlin-test-junit5:1.3.61
> Cannot choose between the following variants of org.junit.jupiter:junit-jupiter-api:5.6.0:
- javadocElements
- sourcesElements
All of them match the consumer attributes:
- Variant 'javadocElements' capability org.junit.jupiter:junit-jupiter-api:5.6.0:
- Unmatched attributes:
- Found org.gradle.category 'documentation' but wasn't required.
- Found org.gradle.dependency.bundling 'external' but wasn't required.
- Found org.gradle.docstype 'javadoc' but wasn't required.
- Required org.gradle.jvm.version '7' but no value provided.
- Found org.gradle.status 'release' but wasn't required.
- Required org.jetbrains.kotlin.platform.type 'jvm' but no value provided.
- Compatible attribute:
- Required org.gradle.usage 'java-api' and found compatible value 'java-runtime'.
- Variant 'sourcesElements' capability org.junit.jupiter:junit-jupiter-api:5.6.0:
- Unmatched attributes:
- Found org.gradle.category 'documentation' but wasn't required.
- Found org.gradle.dependency.bundling 'external' but wasn't required.
- Found org.gradle.docstype 'sources' but wasn't required.
- Required org.gradle.jvm.version '7' but no value provided.
- Found org.gradle.status 'release' but wasn't required.
- Required org.jetbrains.kotlin.platform.type 'jvm' but no value provided.
- Compatible attribute:
- Required org.gradle.usage 'java-api' and found compatible value 'java-runtime'.
arnaud.giuliani
01/24/2020, 6:10 PMFoo
in my Kotlin project and apply my plugin, I would like to get this compiled class Foo
. Any hint regarding the topic?arnaud.giuliani
01/24/2020, 6:10 PMFoo
in my Kotlin project and apply my plugin, I would like to get this compiled class Foo
. Any hint regarding the topic?octylFractal
01/24/2020, 6:41 PMarnaud.giuliani
01/24/2020, 8:01 PMoctylFractal
01/24/2020, 8:07 PMfiles(tasks.named("compileKotlin")).asFileTree
${projectRoot}/build/classes/kotlin/main/Foo.class
arnaud.giuliani
01/25/2020, 9:49 AMModule
variable from Gradle to be able to check itoctylFractal
01/25/2020, 9:54 AMruntimeClasspath
. I'm not very familiar with that myself so you'll have to ask someone elsearnaud.giuliani
01/25/2020, 1:57 PMMichal Harakal
01/29/2020, 9:07 AM