changeset 141:9f4b4e791d44

Bug 2840: Support maven 3.0 and 2.2 Reviewed-by: yasuenag GitHub: https://github.com/HeapStats/heapstats/pull/9
author KUBOTA Yuji <kubota.yuji@lab.ntt.co.jp>
date Wed, 03 Feb 2016 20:26:20 +0900
parents 13533e30935b
children c2a62f39b056
files ChangeLog analyzer/cli/pom.xml analyzer/core/pom.xml analyzer/fx/pom.xml mbean/java/pom.xml release.sh
diffstat 6 files changed, 21 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Feb 02 21:19:27 2016 +0900
+++ b/ChangeLog	Wed Feb 03 20:26:20 2016 +0900
@@ -1,3 +1,7 @@
+2016-02-03  KUBOTA Yuji <kubota.yuji@lab.ntt.co.jp>
+
+	* Bug 2840: Support maven 3.0 and 2.2
+
 2016-02-02  KUBOTA Yuji <kubota.yuji@lab.ntt.co.jp>
 
 	* Bug 2833: Improve the versioning by maven
--- a/analyzer/cli/pom.xml	Tue Feb 02 21:19:27 2016 +0900
+++ b/analyzer/cli/pom.xml	Wed Feb 03 20:26:20 2016 +0900
@@ -23,7 +23,7 @@
     <parent>
         <groupId>jp.co.ntt.oss.heapstats</groupId>
         <artifactId>heapstats</artifactId>
-        <version>${project.version}</version>
+        <version>2.0</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
--- a/analyzer/core/pom.xml	Tue Feb 02 21:19:27 2016 +0900
+++ b/analyzer/core/pom.xml	Wed Feb 03 20:26:20 2016 +0900
@@ -23,7 +23,7 @@
     <parent>
         <groupId>jp.co.ntt.oss.heapstats</groupId>
         <artifactId>heapstats</artifactId>
-        <version>${project.version}</version>
+        <version>2.0</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
--- a/analyzer/fx/pom.xml	Tue Feb 02 21:19:27 2016 +0900
+++ b/analyzer/fx/pom.xml	Wed Feb 03 20:26:20 2016 +0900
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>heapstats</artifactId>
         <groupId>jp.co.ntt.oss.heapstats</groupId>
-        <version>${project.version}</version>
+        <version>2.0</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
--- a/mbean/java/pom.xml	Tue Feb 02 21:19:27 2016 +0900
+++ b/mbean/java/pom.xml	Wed Feb 03 20:26:20 2016 +0900
@@ -23,7 +23,7 @@
     <parent>
         <groupId>jp.co.ntt.oss.heapstats</groupId>
         <artifactId>heapstats</artifactId>
-        <version>${project.version}</version>
+        <version>2.0</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
--- a/release.sh	Tue Feb 02 21:19:27 2016 +0900
+++ b/release.sh	Wed Feb 03 20:26:20 2016 +0900
@@ -26,14 +26,17 @@
 read -p "Is release date: ${DATE} ? (y/n) > " _check_date
 if [[ ${_check_date} != "y" && ${_check_date} != "Y" ]]; then
   read -p "Enter release date (YYYY-MM-DD) > " DATE
+  # simple verification to use `date`
   if [[ ! ${DATE} =~ [2-9][0-9][0-9][0-9]\-[0-1][0-9]\-[0-3][0-9] ]]; then
     echo "Enter correct date as YYYY-MM-DD"
     exit 1
   fi
+  # if wrong format, return error by `date`
   DATE=$(LANG=C date --date=${DATE} "+%Y-%m-%d")
 fi
 
 # Input new version
+# show current version by project.version from pom.xml
 CURRENT_VERSION=`sed -n 's#^\s\+<version>\(.\+\)</version>#\1#p' pom.xml`
 echo "Current version is ${CURRENT_VERSION}"
 read -p "Enter release version > " VERSION
@@ -44,7 +47,15 @@
 
 # analyzer
 ## pom
+### parent has 1 version element
 sed -i -e "/^\s\+<version>/s#${CURRENT_VERSION}#${VERSION}#g" pom.xml
+### children have some version elements
+CHILDREN=($(find ./*/ -name "pom.xml" -type f))
+for child in ${CHILDREN[@]}; do
+  # replace version number between <parent> and </parent>
+  LINE=$(sed -n "/parent/=" ${child} | tr '\n' ',')
+  sed -i -e "${LINE:0:$((${#LINE}-1))}s#${CURRENT_VERSION}#${VERSION}#g" ${child}
+done
 ## Dialog
 sed -i -e "/Version/s#text=\"Version\s.\+\"#text=\"Version ${VERSION}\"#g" analyzer/fx/src/main/resources/jp/co/ntt/oss/heapstats/aboutDialog.fxml
 
@@ -73,8 +84,9 @@
 sed -i "1i${DATE}  ${AUTHOR}\n\n\t\* Bump to ${VERSION}\n" ChangeLog
 
 # NEWS
+## Add template
 sed -i "1iNew in release ${VERSION} (${DATE})\n\n* Fix some bugs\n" NEWS
-## Edit to add more detailed history
+## ... and edit to add more detailed history
 read -p "Press ENTER to edit NEWS ..."
 if [ -z ${EDITOR+x} ]; then
   vim NEWS