File tree 5 files changed +35
-12
lines changed
5 files changed +35
-12
lines changed Original file line number Diff line number Diff line change 14
14
# limitations under the License.
15
15
#
16
16
---
17
+ install :
18
+ - true
17
19
language : java
18
20
jdk :
19
- - oraclejdk8
20
- addons :
21
- apt :
22
- packages :
23
- - oracle-java8-installer
24
- dist : trusty
25
- sudo : false
21
+ - openjdk8
26
22
script : ci/buildViaTravis.sh
27
23
cache :
28
24
directories :
Original file line number Diff line number Diff line change 16
16
17
17
plugins {
18
18
id ' com.gradle.build-scan'
19
+ id ' com.palantir.git-version'
19
20
id ' io.spring.dependency-management' apply false
20
21
id ' com.jfrog.bintray' apply false
21
22
id ' com.jfrog.artifactory' apply false
22
23
id ' org.jetbrains.kotlin.jvm' apply false
23
24
}
24
25
26
+ def versionSuffix = versionSuffix()
27
+
25
28
allprojects {
26
29
dependencyLocking {
27
30
lockAllConfigurations()
28
31
}
32
+ project. version + = versionSuffix
33
+ println " version: ${ project.version} "
29
34
}
30
35
31
36
subprojects {
@@ -81,3 +86,23 @@ buildScan {
81
86
termsOfServiceUrl = ' https://gradle.com/terms-of-service'
82
87
termsOfServiceAgree = ' yes'
83
88
}
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 3
3
4
4
if [ " $TRAVIS_PULL_REQUEST " != " false" ]; then
5
5
echo -e " Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH ]"
6
- ./gradlew build
6
+ ./gradlew -Pbranch= " ${TRAVIS_BRANCH} " build
7
7
elif [ " $TRAVIS_PULL_REQUEST " == " false" ] && [ " $TRAVIS_TAG " == " " ]; then
8
8
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
10
10
elif [ " $TRAVIS_PULL_REQUEST " == " false" ] && [ " $TRAVIS_TAG " != " " ]; then
11
11
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
13
13
else
14
14
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
16
16
fi
Original file line number Diff line number Diff line change 15
15
#
16
16
17
17
group =io.rsocket.kotlin
18
- version =0.9.7-SNAPSHOT
18
+ version =0.9.7
19
19
20
20
buildScanPluginVersion =2.4.1
21
21
dependencyManagementPluginVersion =1.0.8.RELEASE
22
22
bintrayPluginVersion =1.8.4
23
23
artifactoryPluginVersion =4.9.8
24
24
kotlinPluginVersion =1.3.50
25
+ gitPluginVersion =0.12.0-rc2
25
26
26
27
nettyBufferVersion =4.1.37.Final
27
28
jsr305Version =3.0.2
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ pluginManagement {
21
21
id ' com.jfrog.bintray' version " ${ bintrayPluginVersion} "
22
22
id ' com.jfrog.artifactory' version " ${ artifactoryPluginVersion} "
23
23
id ' org.jetbrains.kotlin.jvm' version " ${ kotlinPluginVersion} "
24
+ id " com.palantir.git-version" version " ${ gitPluginVersion} "
24
25
}
25
26
}
26
27
You can’t perform that action at this time.
0 commit comments