diff options
author | Leonid Startsev <sandwwraith@users.noreply.github.com> | 2023-10-24 11:59:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-24 11:59:25 +0200 |
commit | fe10d6a2418918635243bb01c279a267346ff645 (patch) | |
tree | 5cf520d03fc1f9a87614f71aa32074be4775c304 | |
parent | bfbe6a9127952473ef79a79e11ec754086cb0be3 (diff) | |
download | kotlinx.serialization-fe10d6a2418918635243bb01c279a267346ff645.tar.gz |
Add Gradle properties for disabling project's TC integration (#2483)
Use Gradle property no_teamcity_interaction (e.g. gradle -Pno_teamcity_interaction ...) to disable project's TeamCity integration (printing of the library version as build number in this case).
Gradle property build_snapshot_up is also supported.
Co-authored-by: Stanislav Ruban <stanislav.ruban@jetbrains.com>
-rw-r--r-- | build.gradle | 4 | ||||
-rw-r--r-- | gradle/teamcity.gradle | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/build.gradle b/build.gradle index 73b566ae..983e791b 100644 --- a/build.gradle +++ b/build.gradle @@ -39,6 +39,10 @@ buildscript { ] ext.koverEnabled = property('kover.enabled') ?: true + def noTeamcityInteractionFlag = rootProject.hasProperty("no_teamcity_interaction") + def buildSnapshotUPFlag = rootProject.hasProperty("build_snapshot_up") + ext.teamcityInteractionDisabled = noTeamcityInteractionFlag || buildSnapshotUPFlag + /* * This property group is used to build kotlinx.serialization against Kotlin compiler snapshot. * When build_snapshot_train is set to true, kotlin_version property is overridden with kotlin_snapshot_version. diff --git a/gradle/teamcity.gradle b/gradle/teamcity.gradle index ceb8a817..950494d9 100644 --- a/gradle/teamcity.gradle +++ b/gradle/teamcity.gradle @@ -3,7 +3,7 @@ */ def teamcitySuffix = project.findProperty("teamcitySuffix")?.toString() -if (project.hasProperty("teamcity") && !(build_snapshot_train || rootProject.properties['build_snapshot_up'])) { +if (!teamcityInteractionDisabled && project.hasProperty("teamcity") && !(build_snapshot_train || rootProject.properties['build_snapshot_up'])) { // Tell teamcity about version number def postfix = (teamcitySuffix == null) ? "" : " ($teamcitySuffix)" println("##teamcity[buildNumber '${project.version}${postfix}']") |