Sylvain Patenaude
01/14/2020, 7:03 PMKris Wong
01/14/2020, 7:06 PMtargetName
property - that may be the ticketKris Wong
01/14/2020, 7:06 PMKris Wong
01/14/2020, 7:07 PMKris Wong
01/14/2020, 7:28 PMUgi
01/14/2020, 9:33 PMbuild.gradle.kts
when defining targets yo do something like this:
kotlin {
jvm("yourtargetname")
}
In build.gradle
it would be something like this:
kotlin {
targets {
fromPreset(presets.jvm, 'yourtargetname') {
...
}
}
}
I found this out because I did that by mistake in my library, and it actually brought some confusion 🙂Dico
01/14/2020, 9:54 PMval jvmJar by tasks.getting(Jar::class) {
archiveName.set("...")
archiveClassifier.set("...")
}
Sylvain Patenaude
01/14/2020, 10:31 PMSylvain Patenaude
01/14/2020, 10:32 PMDico
01/14/2020, 10:34 PMUgi
01/14/2020, 10:34 PMyourtargetnameMain
and yourtargetnameTest
Dico
01/14/2020, 10:35 PMSylvain Patenaude
01/14/2020, 10:37 PMSylvain Patenaude
01/15/2020, 4:25 PMJar jvmJar = tasks.getByName('jvmJar') {
from sourceSets
archiveFileName = "${archiveBaseName}.jar"
}
But when I build my project it doesn't seem to like the ${variable} syntax.
Can I use it on such an assignment?Dico
01/15/2020, 4:28 PMfrom sourceSets
? As for your question I suggest looking up groovy string interpolation.Sylvain Patenaude
01/15/2020, 4:29 PMfrom
clause was necessary. I removed it. Will look into groovy string interpolation now...Sylvain Patenaude
01/15/2020, 4:35 PMarchiveFileName = "${archiveBaseName}.jar"
, compiler doesn't complain but result file is ${archiveBaseName}.jar. ☹️Sylvain Patenaude
01/15/2020, 4:40 PM