Skip to content

Commit b54e0d4

Browse files
committed
[FABN-1320] Fix git_tag.sh
- so that it parses the build.gradle version - also specify a version and add a task to print it in the root level build.gradle Signed-off-by: heatherlp <[email protected]> Change-Id: I1448b063592d4d8c1943920375e4bd4069b0e40d
1 parent 43dbff3 commit b54e0d4

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

build.gradle

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
apply plugin: 'idea'
88
apply plugin: 'eclipse-wtp'
99

10+
version = '1.4.4-SNAPSHOT'
11+
1012
allprojects {
1113
repositories {
1214
mavenLocal()
@@ -22,7 +24,7 @@ subprojects {
2224
apply plugin: 'maven'
2325

2426
group = 'org.hyperledger.fabric-chaincode-java'
25-
version = '1.4.4-SNAPSHOT'
27+
version = rootProject.version
2628

2729
sourceCompatibility = 1.8
2830
targetCompatibility = 1.8
@@ -38,7 +40,12 @@ subprojects {
3840
}
3941

4042

41-
tasks.withType(JavaCompile) {
42-
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
43-
}
43+
tasks.withType(JavaCompile) {
44+
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
4445
}
46+
47+
}
48+
49+
task printVersionName() {
50+
println rootProject.version
51+
}

scripts/gittag.sh

100644100755
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ function abort {
1717
exit -1
1818
}
1919

20-
VERSION=$(jq '.version' ${DIR}/package.json | sed -r "s/\"([0-9]?[0-9]\.[0-9]?[0-9]\.[0-9]?[0-9]).*/\1/")
20+
# Run printVersionName task in the root directory, grab the first line and remove anything after the version number
21+
VERSION=$(cd ../ && ./gradlew -q printVersionName | gsed -n 1p | gsed -r "s/-.*//")
2122

2223
echo New version string will be v${VERSION}
2324

@@ -28,9 +29,6 @@ else
2829
abort "No releases notes under the file ${DIR}/release_notes/v${NEW_VERSION}.txt exist";
2930
fi
3031

31-
32-
33-
3432
git checkout "${RELEASE}"
3533
git pull
3634
git tag -a "v${VERSION}" `git log -n 1 --pretty=oneline | head -c7` -F release_notes/"v${VERSION}".txt

0 commit comments

Comments
 (0)