Nicole Paprocki
09/20/2023, 7:53 PMdewildte
09/20/2023, 8:11 PMCasey Brooks
09/20/2023, 8:17 PMNicole Paprocki
09/20/2023, 8:20 PMI think it’s just easier to keep everything in one repo, give everything the same version number, and release all modules at the same time, even ones that don’t have changes, so the consumer only needs to keep 1 version number in mind@Casey Brooks This is what we are thinking of doing as well. I’m currently struggling with the implementation of that strategy. I tried to add a build.gradle extra, however gradle isn’t finding the property I defined in the root.
Nicole Paprocki
09/20/2023, 8:21 PMdewildte
09/20/2023, 8:23 PMmanually publishing each moduleIs there a script or another tool you can use to automatically update the values in the modules for you? Provided you keep them all different versions that is.
dewildte
09/20/2023, 8:25 PMCasey Brooks
09/20/2023, 8:25 PMgradle.properties
, which should be available to all subprojects as well through project.properties["customVersion"]
.
Alternatively, I use Git tags and some custom code to compute the version number in my libraries. You can see how I do it hereNicole Paprocki
09/20/2023, 8:32 PMProductVersion
code to then set the version of each KMP module?Casey Brooks
09/20/2023, 8:39 PMbuild.gradle.kts
file will do
version = ProjectVersion.get(project = project, logChanges = false)
It’s mostly just something I threw together for my own use, so it’s not documented or anything, but the basic workflow is this:
• Create a Git tag with a Semantic version number (for example, 1.0.0)
• Any commits after that that will bump the version in accordance with the commit message and the latest tag. For example, [major] My commit message
will bump a major version (to 2.0.0), and [minor] My commit message
will do a minor bump (1.1.0). Absent any of those, it will give you a patch version bump (1.0.1).
• When you run a release build, add -Prelease
to the Gradle command, otherwise the version will include the -SNAPSHOT
suffix
• After releasing, make sure to create a Git tag with the version number that just releasedNicole Paprocki
09/20/2023, 8:44 PMbuild.grade.kts
files you don’t specify a version? Only the project’s build.gradle.kts
has a version?Casey Brooks
09/20/2023, 8:46 PMversion = ProjectVersion.get
is not shared among projects, so it should be added to every subproject that wants to use the computed valueNicole Paprocki
09/20/2023, 8:52 PMBuildSrc
folder?Casey Brooks
09/20/2023, 8:52 PMNicole Paprocki
09/20/2023, 8:53 PMRob Murdock
09/20/2023, 11:11 PMRob Murdock
09/20/2023, 11:13 PMsuresh
09/21/2023, 12:22 PMRob Murdock
09/21/2023, 12:23 PMRob Murdock
09/21/2023, 12:29 PMsuresh
09/21/2023, 12:36 PMNicole Paprocki
09/21/2023, 1:39 PM