Skip to content

Commit fe10d6a

Browse files
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>
1 parent bfbe6a9 commit fe10d6a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ buildscript {
3939
]
4040
ext.koverEnabled = property('kover.enabled') ?: true
4141

42+
def noTeamcityInteractionFlag = rootProject.hasProperty("no_teamcity_interaction")
43+
def buildSnapshotUPFlag = rootProject.hasProperty("build_snapshot_up")
44+
ext.teamcityInteractionDisabled = noTeamcityInteractionFlag || buildSnapshotUPFlag
45+
4246
/*
4347
* This property group is used to build kotlinx.serialization against Kotlin compiler snapshot.
4448
* When build_snapshot_train is set to true, kotlin_version property is overridden with kotlin_snapshot_version.

gradle/teamcity.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
def teamcitySuffix = project.findProperty("teamcitySuffix")?.toString()
6-
if (project.hasProperty("teamcity") && !(build_snapshot_train || rootProject.properties['build_snapshot_up'])) {
6+
if (!teamcityInteractionDisabled && project.hasProperty("teamcity") && !(build_snapshot_train || rootProject.properties['build_snapshot_up'])) {
77
// Tell teamcity about version number
88
def postfix = (teamcitySuffix == null) ? "" : " ($teamcitySuffix)"
99
println("##teamcity[buildNumber '${project.version}${postfix}']")

0 commit comments

Comments
 (0)