2 # Copyright (C) 2009, Google Inc.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Eclipse Public License v1.0
6 # which accompanies this distribution, and is available at
7 # http://www.eclipse.org/legal/epl-v10.html
9 # Update all pom.xml with new build number
11 # TODO(spearce) This should be converted to some sort of
12 # Java based Maven plugin so its fully portable.
22 V
=$
(echo "$1" | perl
-pe 's/^--snapshot=//')
25 echo >&2 "usage: $0 --snapshot=0.n.0"
36 V
=$
(git describe HEAD
) ||
exit
46 echo >&2 "usage: $0 {--snapshot=0.n.0 | --release} [--jgit=0.n.0]"
52 v
*) V
=$
(echo "$V" | perl
-pe s
/^v
//) ;;
54 echo >&2 "usage: $0 {--snapshot=0.n.0 | --release}"
61 OSGI_V
="${V%%-SNAPSHOT}.qualifier"
64 POM_V
=$
(echo "$V" | perl
-pe 's/-(\d+-g.*)$/.$1/')
66 $ARGV[0] =~ /^(\d+)(?:\.(\d+)(?:\.(\d+))?)?-(\d+)-g(.*)$/;
67 my ($a, $b, $c, $p, $r) = ($1, $2, $3, $4, $5);
68 $b = '0' unless defined $b;
69 $c = '0' unless defined $c;
71 printf "%s.%s.%s.%6.6i_g%s\n", $a, $b, $c, $p, $r;
82 $ARGV[0] =~ /^(\d+(?:\.\d+(?:\.\d+)?)?)/;
89 $ARGV[0] =~ /^(\d+)(?:\.(\d+)(?:\.(\d+))?)?/;
90 my ($a, $b) = ($1, $2);
91 $b = 0 unless defined $b;
97 EGIT_V
=$
(to_version
"$V")
98 EGIT_N
=$
(next_version
"$EGIT_V")
101 JGIT_V
=$
(to_version
"$J")
102 JGIT_N
=$
(next_version
"$JGIT_V")
105 s/^(Bundle-Version:\s*).*$/${1}'"$OSGI_V"'/;
106 s/(org.eclipse.egit.*;version=")[^"[(]*(")/${1}'"$EGIT_V"'${2}/;
107 s/(org.eclipse.egit.*;version="\[)[^"]*(\)")/${1}'"$EGIT_V,$EGIT_N"'${2}/;
108 s/(org.eclipse.jgit.*;version="\[)[^"]*(\)")/${1}'"$JGIT_V,$JGIT_N"'${2}/;
109 ' $
(git ls-files |
grep META-INF
/MANIFEST.MF
)
112 if ($ARGV ne $old_argv) {
116 if (!$seen_version) {
117 $seen_version = 1 if (!/<\?xml/ &&
118 s/(version=")[^"]*(")/${1}'"$OSGI_V"'${2}/);
120 s/(feature="org.eclipse.jgit" version=")[^"]*(")/${1}'"$JGIT_V"'${2}/;
121 ' org.eclipse.egit-feature
/feature.xml
124 s{<(version)>[^<\$]*</\1>}{<${1}>'"$POM_V"'</${1}>};
125 ' org.eclipse.egit-feature
/pom.xml
128 if ($ARGV ne $old_argv) {
132 if ($seen_version < 2) {
134 s{<(version)>[^<\$]*</\1>}{<${1}>'"$POM_V"'</${1}>};
136 ' org.eclipse.egit-updatesite
/pom.xml
139 if ($ARGV ne $old_argv) {
143 if (!$seen_version) {
145 s{<(version)>[^<\$]*</\1>}{<${1}>'"$POM_V"'</${1}>};
147 s{<(jgit-version)>[^<]*</\1>}{<${1}>'"$J"'</${1}>};
148 ' $
(git ls-files |
grep pom.xml
)