Chilli
04/29/2020, 9:53 AMx80486
04/29/2020, 2:31 PMdetekt
plugin in the subprojects
block. This is what I have so far: https://gist.github.com/x80486/52d5b8f1d584f90732e7d1881df423a7, but Gradle tells me that detekt
is not recognizable. I would like to avoid to configure detekt
in all subprojects, that's what I'm really trying to do. Anyone have done this before?Ola Adolfsson
04/30/2020, 6:06 AMAnaniya
04/30/2020, 3:46 PMplugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.3.71'
id "org.jetbrains.kotlin.kapt" version "1.3.71"
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testCompile group: 'junit', name: 'junit', version: '4.12'
implementation "com.squareup.retrofit2:converter-gson:2.3.0"
implementation "io.reactivex.rxjava2:rxandroid:2.0.1"
compile 'org.jsoup:jsoup:1.13.1'
testImplementation "com.squareup.okhttp3:mockwebserver:4.5.0"
implementation "com.squareup.okhttp3:okhttp:4.5.0"
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation("com.squareup.moshi:moshi-kotlin:1.9.2")
kapt("com.squareup.moshi:moshi-kotlin-codegen:1.9.2")
implementation("com.squareup.moshi:moshi:1.9.2")
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
Omar Mainegra
05/01/2020, 1:56 PM1.3.7x
I could finally run iOS and JS tests from Idea, but now it doesn't show the option to run android (but still works if I add the task to the Run Configuration)Ilya Muradyan
05/02/2020, 6:00 PMfun DependencyHandler.kotlin(module: String, version: String? = null): Any =
"org.jetbrains.kotlin:kotlin-$module${version?.let { ":$version" } ?: ""}"
Why does it return Any? It becomes a problem when I use this overload of implementation
:
implementation(kotlin("...")) { isTransitive = false }
In this variant, implementation
takes String
as a first argument and I need to explicitely cast return value to String
Javier
05/03/2020, 11:23 PMDariusz Kuc
05/05/2020, 7:27 PMregister<Zip>("createS3DependencyBundle") {
archiveFileName.set("${project.name}-dependencies.zip")
destinationDirectory.set(file("$buildDir/dist"))
from(fileTree(File(gradle.gradleHomeDir, "caches/modules-2/files-2.1")))
}
but no zip archive is created - any ideas?Dariusz Kuc
05/06/2020, 5:32 AMpublish
with closeAndReleaseRepository
(from gradle-nexus-staging-plugin
) but it needs to run after ALL modules finish publishing their artifacts. Currently I’m explicitly running gradle publish closeAndReleaseRepository
but wondering whether there is a better wayDariusz Kuc
05/07/2020, 4:47 PM- project1
- project2
- directory // nothing in this project -> its just for logically grouping project3 and project4 together
|- project3
|- project4
Any idea how to instrument Gradle to skip processing directory
module from the above?Dariusz Kuc
05/07/2020, 6:36 PMpom.xml
. So my question is
a) I’m publishing to both Maven central and Gradle plugin portal - should this plugin marker pom.xml
actually be published to Central?
b) If its not needed -> how do I exclude it from publications
c) If it is needed -> how do I configure it to add required fields for sonatype validation
d) its a multi-module project where other libs are published to Maven central -> how do I disable Gradle plugin from publishing to Maven central?PHondogo
05/07/2020, 7:59 PMx80486
05/09/2020, 2:53 PM6.4.0
, there are a lot of dependencies on different configurations (e.g.: implementation
, kapt
, etc.)...my question: is there a way to just include a BOM without the need to include it in all configurations? This is what I have:
implementation(enforcedPlatform("io.micronaut:micronaut-bom:${project.property("micronaut.version")}"))
kapt(enforcedPlatform("io.micronaut:micronaut-bom:${project.property("micronaut.version")}"))
kaptTest(enforcedPlatform("io.micronaut:micronaut-bom:${project.property("micronaut.version")}"))
testImplementation(enforcedPlatform("io.micronaut:micronaut-bom:${project.property("micronaut.version")}"))
...I would like just to have one of those applied to the entire project, if that's possible.rkeazor
05/10/2020, 3:36 PMDariusz Kuc
05/11/2020, 3:28 PM- build.gradle.kts // [1] root builds java artifact
- src
- main/java - some common utils here
- main/resources - some common resources
- main/proto
- kotlin-specific
- build.gradle.kts [2] builds kotlin artfiact with some sources from [1]
- src/main/kotlin - kotlin specific utils
Whats the proper way to reference sources/resources from root [1] in my kotlin specific build [2]? e.g. I could do something like
sourceSets {
main {
java.srcDir("${rootProject.java}/src/main/java")
}
}
but wondering if there is a better wayDariusz Kuc
05/13/2020, 3:43 AMfinalizedBy
always executes regardless whether finalized task succeeded or not - is there a way to ensure taskB
runs after taskA
only if taskA
is successful?
I’m trying to put ordering in publishing artifacts to maven central and Gradle plugin portal, was hoping I could order the tasks so that when I run ./gradlew publish
it will
1) initialize sonatype staging repo before publishing - [ok] root publish depends on intialize staging repo)
2) all subprojects attempt to publish their lib to maven central - [ok]
3) after publish is complete i need to close the staging repo - finalize doesn’t work as I don’t want to close the sonatype repo if publish failed
4) after this is complete I then want to publish my plugin to Gradle portal - was going to use publishPlugins
depends on closeStaging
and publish
is finalized by publishPlugins
but hit the same problem that I do not want to publish if it previous steps fail
Guess I should just stick to explicit tasks from command line? e.g.
./gradlew :initializeSonatypeStagingRepository publish :closeAndReleaseRepository publishPlugins
tim
05/13/2020, 8:55 AMimplementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
and
implementation(kotlin("stdlib"))
Both seem to work fine for my project so i'd like to understand what each is doing?Chilli
05/13/2020, 12:06 PM> Task :compileTestKotlinJvm
Could not perform incremental compilation: Could not connect to Kotlin compile daemon
Could not connect to kotlin daemon. Using fallback strategy.
And I think it's making building slower. Any way to fix it?Gopal S Akshintala
05/14/2020, 2:25 PMrrva
05/16/2020, 11:18 AMgradle.properties
?rrva
05/18/2020, 10:03 AMMSC
05/18/2020, 9:14 PMprotobuf
plugin and packaging into a jar, then in the consumer project I want to add this library(jar file) as a dependency in the gradle file and be ready to create a blocking stub, which requires the io.grpc
library to be present? 🤔Tomas Pekarek
05/19/2020, 7:34 AMtasks{
"bootJar"(BootJar::class) {
archiveFileName.set("imps.jar")
}}
I was wondering what kind of language construct allows me to write string followed by (). I mean "bootJar"(BootJar::class). What is that?
--
I found that string boot initializer uses
withType<Test> {
useJUnitPlatform()
}
What is the preferred way to modify tasks?Martin Westman
05/19/2020, 8:47 AMmodule-info.java:2: error: module not found: kotlin.stdlib
requires kotlin.stdlib;
^
Dariusz Kuc
05/19/2020, 8:59 PMmavenJava
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? ~Should I just add from(jarComponent)
to all MavenPublications~(doesn’t work - fails with Maven publication ‘pluginMaven’ cannot include multiple components)~?~Harun
05/23/2020, 1:32 PMursus
05/24/2020, 3:57 PM˛gradlew testDebugUnitTest
is not picking up tests from :app
module since I have flavors, what gives? Wasnt it supposed to run everything?Slackbot
05/25/2020, 1:06 AMDylan
05/25/2020, 1:21 PMbuildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"
}
}
repositories {
google()
jcenter()
}
dependencies {
implementation("com.squareup:kotlinpoet:1.5.0")
}
With that configuration, after trying to build my project, I have the following exception:
Caused by: org.gradle.api.plugins.InvalidPluginException: Could not find implementation class 'com.example.gradle.MyPlugin' for plugin 'MyPlugin' specified in [Path to buildSrc jar]
After looking into the Jar itself, it looks like MyPlugin.properties
is here, but not the class MyPlugin
.
Do you have any idea?Dariusz Kuc
05/26/2020, 6:49 PMgradle myTask -PcustomParam=abc -PcustomParam=xyz
that would result in customParam=[abc, xyz]
?Dariusz Kuc
05/26/2020, 6:49 PMgradle myTask -PcustomParam=abc -PcustomParam=xyz
that would result in customParam=[abc, xyz]
?build.gradle