pablisco
02/13/2020, 12:31 PMNick Halase
02/13/2020, 2:52 PMbuildSrc
builds to declare plugin dependencies. What is the difference between declaring a dependency in the dependencies
block of buildSrc/build.gradle.kts
and doing it as buildscript
or using the plugins
block?Brendan Weinstein
02/13/2020, 10:17 PMbuildSrc
sourceSet, but I could not find an example of how to do this. I am playing around with buildSrc
sourceSets right now, but would appreciate it if anyone has some code I could reference to save a few cyclesCyril Scetbon
02/14/2020, 3:20 PM<dependency>
<groupId>io.debezium</groupId>
<artifactId>debezium-core</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
I'd like to add it to my gradle with a kotlin projectJavier
02/15/2020, 12:43 AMbaseFeature
in kts?Fleshgrinder
02/15/2020, 11:28 AMMark
02/16/2020, 5:09 AMnapperley
02/17/2020, 2:29 AMAhmed Ibrahim
02/17/2020, 1:53 PMunitTests.all {
useJUnitPlatform()
}
In Kotlin script though I'm doing
testOptions {
unitTests.all(closureOf<Test> {
useJUnitPlatform()
} as Closure<Test>)
}
However I'm a bit annoyed from the as
clause as without it I get a compile error, so my question is there a way I could do that without explicitly casting to Closure<Test>
?John Ballard
02/18/2020, 2:02 PMIbrahim Ali
02/18/2020, 4:27 PMGabriel Feo
02/19/2020, 9:27 AMExec
task’s command? Escaping the dollar sign doesn’t seem to work. For example:
commandLine = listOf("echo", "Declared in env GOOGLE_APPLICATION_CREDENTIALS=\$GOOGLE_APPLICATION_CREDENTIALS")
Output:
Declared in env GOOGLE_APPLICATION_CREDENTIALS=$GOOGLE_APPLICATION_CREDENTIALS
Seri
02/19/2020, 4:21 PMtylerwilson
02/19/2020, 4:31 PMjk2018
02/21/2020, 7:03 PMarnaud.giuliani
02/22/2020, 9:53 AMtask checkModules(type: Test) {
testLogging {
showStandardStreams = true
}
useJUnit {
includeCategories 'org.koin.test.category.CheckModuleTest'
}
}
It’s for a library. Can I distribute it as a Gradle plugin?Kenneth Andersson
02/24/2020, 11:12 AMtask myTask {
dependsOn(tasks.named("jsMainClasses").get())
println("A task running after jsMainClasses is done.")
}
Our use-case is that I want to copy the js-build artifacts to a different location after they are builtBrais Gabin
02/24/2020, 12:21 PMkapt
dependencies. In those I get this error:
Could not determine the dependencies of task ':app:kaptDebugKotlin'.
> Could not resolve all task dependencies for configuration ':app:kapt'.
> Could not find com.google.dagger:dagger-compiler:.
Required by:
project :app
The platform (bom) module:
plugins {
id 'java-platform'
}
dependencies {
constraints {
api 'com.google.dagger:dagger:2.25.2'
api 'com.google.dagger:dagger-compiler:2.25.2'
}
}
The app dependency declaration:
dependencies {
implementation platform(project(':bom'))
implementation 'com.google.dagger:dagger'
kapt 'com.google.dagger:dagger-compiler'
// ...
}
I’m getting the same error if I use annotationProcessor
. If I set the version like kapt 'com.google.dagger:dagger-compiler:2.25.2'
all works. Any idea?Fleshgrinder
02/24/2020, 1:54 PMRené
02/25/2020, 6:01 AMtim
02/25/2020, 12:43 PMyarn upgrade-interactive
regularly to upgrade all my dependencies to the latest versions (SEM ver'd so I could skip out MAJOR changes as well). Can I specify a package range in the dependencies block i.e., implements("io.github.cdimascio:java-dotenv:>5")
or is there a grandle command which will update all packages to the latest published version?tim
02/25/2020, 3:43 PMsnowe
02/25/2020, 9:26 PMAs part of the change, the SettingsScriptApi interface is no longer implemented by settings scripts and the InitScriptApi interface is no longer implemented by init scripts. They should be replaced with the corresponding model object interfaces, Settings and Gradle.but we cannot figure out the new syntax. It doesn't appear that the Settings object has any way to access the gradle.properties variables, like it did before. and it also seems like
pluginManagement {
plugins {
no longer works either. Anyone know what to do here?Dariusz Kuc
02/26/2020, 3:46 AM// set from command line
@Input
@Optional
@Option(option = "targetFileName", description = "target file")
val targetFileName: Property<String> = project.objects.property(String::class.java)
// set from DSL
@Input
@Optional
val targetFile: RegularFileProperty = project.objects.fileProperty()
Is there a better way? If not, is there a way to hide targetFileName
from the DSL?snowe
02/26/2020, 6:06 PMerror: constructor ThirdPartyFailedResponse in class ThirdPartyFailedResponse cannot be applied to given types;
ThirdPartyFailedResponse failedResponse = new ThirdPartyFailedResponse(false,
^
required: String,UUID,UUID,UUID
found: boolean,String,UUID,UUID,UUID
reason: actual and formal argument lists differ in length
class
class ThirdPartyFailedResponse(
val success: Boolean = false,
val message: String,
override val loanTransactionId: UUID,
override val loanId: UUID?,
override val serviceOrderId: UUID
) : ThirdPartyResponse
absolutely nothing has changed in the project besides running gradle init
and then fixing dependencies. I don't see how a dependency could cause an issue like this, it has nothing to do with @JvmOverloads
, or the like.Dariusz Kuc
02/27/2020, 6:05 AMCaused by: java.lang.NoSuchMethodError: kotlinx.coroutines.CoroutineScopeKt.cancel(Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Ljava/lang/Throwable;)V
which points to old version of coroutines lib being used. Sure enough by running gradle dependencies
I see
kotlinCompilerPluginClasspath
\--- org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.3.61
...
| \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.1
any ideaes on how to fix this?Gus
02/28/2020, 5:52 PM0.0.6
) gets published properly but a second version named after the artifact id (relaynet-core-jvm
) gets published along with it. I have no idea what's publishing that second version. Here's my publishing
closure: https://github.com/relaycorp/relaynet-core-jvm/blob/39bc842184c8c35b1a33734c02961270072a478d/build.gradle.kts#L100-L138. Everything else seems to work OK. Any idea what could be happening?Mohamed Ibrahim
03/01/2020, 10:03 PMAllan Wang
03/02/2020, 7:15 AMassembleRelease
is null on evaluation, and a bunch of previous posts here simply check for null before actually handling itDariusz Kuc
03/02/2020, 9:13 PMDariusz Kuc
03/02/2020, 9:13 PMopen class MyCustomTask1 : DefaultTask() {
@Input
@Option(option = "outputFileName", description = "output file name")
val outputFileName: Property<String> = project.objects.property(String::class.java)
@OutputFile
val outputFile: Provider<RegularFile> = outputFileName.flatMap { name -> project.layout.buildDirectory.file(name) }
// actual task code omitted for clarity
}
open class MyCustomTask2 : DefaultTask() {
@Input
@Optional
@Option(option = "inputFileName", description = "input file name")
val inputFileName: Property<String> = project.objects.property(String::class.java)
@Input
@Optional
val inputFile: RegularFileProperty = project.objects.fileProperty()
// skipping code
}
While individual tasks worked fine I'm trying to configure task2
to use task1
output, e.g. in build.gradle.kts
val firstTask by tasks.getting(MyCustomTask1::class) {
// configuration
}
val secondTask by tasks.getting(MyCustomTask2::class) {
inputFile.set(firstTask.outputFile)
dependsOn("firstTask")
}
unfortunately when run I'm hitting
Unable to store input properties for task .... Property 'inputFile' with value '/valid/path/to/task1/outputFile' cannot be serialized.
Any ideas?task2
using @Input
on RegularFileProperty
it works when I updated it to @InputFile
miqbaldc
03/02/2020, 10:29 PMdependsOn
first then running your inputFile.set
?
does your outputFile
exist?Dariusz Kuc
03/02/2020, 11:29 PMmiqbaldc
03/03/2020, 1:19 AM