File tree Expand file tree Collapse file tree 5 files changed +35
-12
lines changed Expand file tree Collapse file tree 5 files changed +35
-12
lines changed Original file line number Diff line number Diff line change 1414# limitations under the License.
1515#
1616---
17+ install :
18+ - true
1719language : java
1820jdk :
19- - oraclejdk8
20- addons :
21- apt :
22- packages :
23- - oracle-java8-installer
24- dist : trusty
25- sudo : false
21+ - openjdk8
2622script : ci/buildViaTravis.sh
2723cache :
2824 directories :
Original file line number Diff line number Diff line change 1616
1717plugins {
1818 id ' com.gradle.build-scan'
19+ id ' com.palantir.git-version'
1920 id ' io.spring.dependency-management' apply false
2021 id ' com.jfrog.bintray' apply false
2122 id ' com.jfrog.artifactory' apply false
2223 id ' org.jetbrains.kotlin.jvm' apply false
2324}
2425
26+ def versionSuffix = versionSuffix()
27+
2528allprojects {
2629 dependencyLocking {
2730 lockAllConfigurations()
2831 }
32+ project. version + = versionSuffix
33+ println " version: ${ project.version} "
2934}
3035
3136subprojects {
@@ -81,3 +86,23 @@ buildScan {
8186 termsOfServiceUrl = ' https://gradle.com/terms-of-service'
8287 termsOfServiceAgree = ' yes'
8388}
89+
90+ def versionSuffix () {
91+ def versionSuffix = ' '
92+ def branchName = project. findProperty(' branch' );
93+ if (branchName == null ) {
94+ def details = versionDetails()
95+ if (details != null ) {
96+ branchName = details. branchName
97+ }
98+ }
99+
100+ if (branchName != null ) {
101+ if (branchName == ' master' ) {
102+ versionSuffix = ' -SNAPSHOT'
103+ } else {
104+ versionSuffix = " -${ branchName.replace("/", "-")} -SNAPSHOT"
105+ }
106+ }
107+ return versionSuffix
108+ }
Original file line number Diff line number Diff line change 33
44if [ " $TRAVIS_PULL_REQUEST " != " false" ]; then
55 echo -e " Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH ]"
6- ./gradlew build
6+ ./gradlew -Pbranch= " ${TRAVIS_BRANCH} " build
77elif [ " $TRAVIS_PULL_REQUEST " == " false" ] && [ " $TRAVIS_TAG " == " " ]; then
88 echo -e ' Build Branch with Snapshot => Branch [' $TRAVIS_BRANCH ' ]'
9- ./gradlew -PbintrayUser=" ${bintrayUser} " -PbintrayKey=" ${bintrayKey} " build artifactoryPublish --stacktrace
9+ ./gradlew -PbintrayUser=" ${bintrayUser} " -PbintrayKey=" ${bintrayKey} " -Pbranch= " ${TRAVIS_BRANCH} " build artifactoryPublish --stacktrace
1010elif [ " $TRAVIS_PULL_REQUEST " == " false" ] && [ " $TRAVIS_TAG " != " " ]; then
1111 echo -e ' Build Branch for Release => Branch [' $TRAVIS_BRANCH ' ] Tag [' $TRAVIS_TAG ' ]'
12- ./gradlew -Pversion= " $TRAVIS_TAG " - PbintrayUser=" ${bintrayUser} " -PbintrayKey=" ${bintrayKey} " build bintrayUpload --stacktrace
12+ ./gradlew -PbintrayUser=" ${bintrayUser} " -PbintrayKey=" ${bintrayKey} " build bintrayUpload --stacktrace
1313else
1414 echo -e ' WARN: Should not be here => Branch [' $TRAVIS_BRANCH ' ] Tag [' $TRAVIS_TAG ' ] Pull Request [' $TRAVIS_PULL_REQUEST ' ]'
15- ./gradlew build
15+ ./gradlew -Pbranch= " ${TRAVIS_BRANCH} " build
1616fi
Original file line number Diff line number Diff line change 1515#
1616
1717group =io.rsocket.kotlin
18- version =0.9.7-SNAPSHOT
18+ version =0.9.7
1919
2020buildScanPluginVersion =2.4.1
2121dependencyManagementPluginVersion =1.0.8.RELEASE
2222bintrayPluginVersion =1.8.4
2323artifactoryPluginVersion =4.9.8
2424kotlinPluginVersion =1.3.50
25+ gitPluginVersion =0.12.0-rc2
2526
2627nettyBufferVersion =4.1.37.Final
2728jsr305Version =3.0.2
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ pluginManagement {
2121 id ' com.jfrog.bintray' version " ${ bintrayPluginVersion} "
2222 id ' com.jfrog.artifactory' version " ${ artifactoryPluginVersion} "
2323 id ' org.jetbrains.kotlin.jvm' version " ${ kotlinPluginVersion} "
24+ id " com.palantir.git-version" version " ${ gitPluginVersion} "
2425 }
2526}
2627
You can’t perform that action at this time.
0 commit comments