From f4fe3a84555993094508fc40b3657463dc896bd3 Mon Sep 17 00:00:00 2001 From: Mark Hiner Date: Wed, 16 Apr 2014 14:10:07 -0500 Subject: [PATCH 1/2] bump-pom-scijava: change property range As the pom-scijava pom.xml now contains multiple properties ranges, it is not enough to search and replace within the properties tag. A special start/end anchor was added to the pom.xml to define the non-profiled properties section, so this is used instead. --- bump-pom-scijava.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bump-pom-scijava.sh b/bump-pom-scijava.sh index f0fc733..598d6c9 100755 --- a/bump-pom-scijava.sh +++ b/bump-pom-scijava.sh @@ -208,7 +208,7 @@ else p="$(sed_quote "$property")" v="$(sed_quote "$value")" sed \ - -e "//,/<\/properties>/s/\(<$p>\)[^<]*\(<\/$p>\)/\1$v\2/" \ + -e "/<\!-- LIVE PROPERTIES START -->/,/<\!-- LIVE PROPERTIES END -->/s/\(<$p>\)[^<]*\(<\/$p>\)/\1$v\2/" \ $pom > $pom.new && if ! cmp $pom $pom.new then From d304dac44262953cd260465e82f07884ebf4b85d Mon Sep 17 00:00:00 2001 From: Mark Hiner Date: Wed, 16 Apr 2014 14:30:48 -0500 Subject: [PATCH 2/2] bump-pom-scijava: set profile properties When bumping pom properties, also bump the corresponding properties in any profile sections to the latest SNAPSHOT versions. --- bump-pom-scijava.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/bump-pom-scijava.sh b/bump-pom-scijava.sh index 598d6c9..c143771 100755 --- a/bump-pom-scijava.sh +++ b/bump-pom-scijava.sh @@ -207,6 +207,7 @@ else p="$(sed_quote "$property")" v="$(sed_quote "$value")" + # Set the primary property version sed \ -e "/<\!-- LIVE PROPERTIES START -->/,/<\!-- LIVE PROPERTIES END -->/s/\(<$p>\)[^<]*\(<\/$p>\)/\1$v\2/" \ $pom > $pom.new && @@ -221,6 +222,25 @@ else mv $pom.new $pom || die "Failed to set property $property = $value" + # Set the profile snapshot version + if test "$ga" + value = "$(sh "$maven_helper" latest-version "$ga:SNAPSHOT")" + v="$(sed_quote "$value")" + sed \ + -e "//,/<\/profile>/s/\(<$p>\)[^<]*\(<\/$p>\)/\1$v\2/" \ + $pom > $pom.new && + if ! cmp $pom $pom.new + then + message="$(printf '%s\n\t%s = %s%s' \ + "$message" "$property" "$value" "$latest_message")" + elif test -n "$must_change" + then + die "Profile property $property not found in $pom" + fi && + mv $pom.new $pom || + die "Failed to set profile property $property = $value" + fi + shift shift done