Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ allprojects {
google()
mavenCentral()
}
if (findProperty("final") != "true") {
version = "$version-SNAPSHOT"
}
}

nexusPublishing {
Expand Down
17 changes: 16 additions & 1 deletion buildSrc/src/main/kotlin/otel.publish-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,23 @@ plugins {
id("signing")
}

version = project.version.toString().replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that we can just reference version below and not the full project.version. I guess this works somehow tho.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version is a special project property, so it's not needed for it, but custom ones are less straightforward to get/set 😅

// If this module is not marked as stable (the default state) then append "-alpha" to its version.
// ---
// To mark a module as stable, it needs to define the following property: "otel.stable=true" preferably within a "gradle.properties" file
// located in the same directory as the target module's "build.gradle.kts" file.
if (findProperty("otel.stable") != "true") {
version = "$version-alpha"
}
// If this release isn't "final" (the default state) then append "-SNAPSHOT" to this module's version.
// ---
// To make a release "final", the gradle release command must include the "-Pfinal=true" argument.
// For example: "./gradlew publishToMavenLocal -Pfinal=true".
if (findProperty("final") != "true") {
version = "$version-SNAPSHOT"
}

// When isARelease is `false`, only the main deliverable is generated (.aar/.jar file) and is not signed.
// When isARelease is `true`, some extra work is done to also generate javadoc/sources artifacts, while signing them all as well.
val isARelease = System.getenv("CI") != null

val android = extensions.findByType(LibraryExtension::class.java)
Expand Down