snowe
04/24/2019, 9:33 PMCzar
04/24/2019, 9:39 PMsnowe
04/24/2019, 9:41 PM-SNAPSHOT
then you've got to rewrite it to somehow rewrite kotlin code.
another downside is that the version is now abstracted 2 clicks away. Whereas before you could keep it in gradle.properties
now you either have to cmd/ctrl click to the dependencies and then to the versions from there, or you have to navigate the buildSrc directory.snowe
04/24/2019, 9:41 PMCzar
04/24/2019, 9:46 PMsnowe
04/24/2019, 9:49 PMKeeping deps in gradle.properties forces you to go to that file each time you need to use a dependency. with buildSrc you only need to go there to change something.I don't understand what you mean here. I only store versions in
gradle.properties
and then I can set them up as extra properties in the root build.gradle.kts and then reference them in every module with interpolation.Czar
04/24/2019, 9:49 PMsnowe
04/24/2019, 9:49 PMCzar
04/24/2019, 9:50 PMI don't understand what you mean here.I see, I missed the
ext
part 🙂 I remember having a setup like that, completion wasn't always working unfortunately + I had to edit two different files for each dep, which was a bother.snowe
04/24/2019, 9:51 PM-SNAPSHOT
I'd definitely do it the buildSrc
way. It sounds like it has better advantages...Czar
04/24/2019, 9:52 PM-SNAPSHOT
at build time?snowe
04/24/2019, 9:53 PM-SNAPSHOT
on the end. We also don't want to be depending on any -SNAPSHOT
versions. So we can automatically remove that.snowe
04/24/2019, 9:55 PMCzar
04/24/2019, 9:55 PMLib1-1.0-SNAPSHOT
..LibN-1.0-SNAPSHOT
and when you're releasing you rewrite versions in a properties file to remove SNAPSHOT
?snowe
04/24/2019, 9:56 PMCzar
04/24/2019, 9:56 PMsnowe
04/24/2019, 9:56 PMCzar
04/24/2019, 9:57 PMsnowe
04/24/2019, 9:58 PMsnowe
04/24/2019, 9:58 PMtasks {
register("snapshotIncrementer") {
inputs.file("gradle.properties")
outputs.file("gradle.properties")
doFirst {
val file = File("$projectDir/gradle.properties")
val newLines = file.readLines().map { it.replace("-SNAPSHOT", "") }
file.writeText(newLines.joinToString(separator = "\n"))
exec {
isIgnoreExitValue = true
commandLine("git", "commit", "-m", "Removing SNAPSHOT versions", "--", "gradle.properties")
}
}
}
}
Czar
04/24/2019, 10:00 PMCzar
04/24/2019, 10:00 PMCzar
04/24/2019, 10:02 PMsnowe
04/24/2019, 10:21 PMgildor
04/24/2019, 11:44 PMgildor
04/24/2019, 11:45 PMsnowe
04/25/2019, 4:16 PM