-
Notifications
You must be signed in to change notification settings - Fork 0
/
bump-version
executable file
·49 lines (46 loc) · 2.31 KB
/
bump-version
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# Usage: ./bump-version 2.8.awesome
NEW_VERSION="$1"
DIRECTORIES="
bioclipse.balloon/plugins/net.bioclipse.*
bioclipse.balloon/features/net.bioclipse.balloon_feature
bioclipse.cheminformatics/plugins/net.bioclipse.*
bioclipse.cheminformatics/features/net.bioclipse.cdk_feature
bioclipse.cheminformatics/features/net.bioclipse.chemoinformatics_feature
bioclipse.cheminformatics/features/net.bioclipse.cdk_feature
bioclipse.statistics/plugins/net.bioclipse.*
bioclipse.statistics/features/net.bioclipse.statistics_feature
bioclipse.rdf/plugins/net.bioclipse.*
bioclipse.rdf/features/net.bioclipse.cheminformatics.rdf_feature
bioclipse.rdf/features/net.bioclipse.pellet_feature
bioclipse.rdf/features/net.bioclipse.rdf.ui_feature
bioclipse.rdf/features/net.bioclipse.rdf_feature
bioclipse.core/plugins/net.bioclipse.*
bioclipse.core/features/net.bioclipse.core_feature
bioclipse.core/features/net.bioclipse.platform_feature
bioclipse.social/plugins/net.bioclipse.*
bioclipse.social/features/net.bioclipse.social_feature
bioclipse.qsar/plugins/net.bioclipse.qsar*
bioclipse.qsar/plugins/net.bioclipse.cdk*
bioclipse.qsar/features/net.bioclipse.qsar.xmpp_feature
bioclipse.qsar/features/net.bioclipse.qsar_feature
bioclipse.ds/plugins/net.bioclipse.*
bioclipse.ds/features/net.bioclipse.*
bioclipse.experimental/plugins/net.bioclipse.*
bioclipse.experimental/features/net.bioclipse.*
"
for file in `find $DIRECTORIES -name MANIFEST.MF -or -name feature.xml`; do
perl -i -lpe '
BEGIN { $l = 0 }
if (/^Bundle-Version:/) {
$_ = "Bundle-Version: '$NEW_VERSION'"
}
elsif (/^(\s+)version="/ && !$l++) {
$_ = $1 . q[version="'$NEW_VERSION'"]
}' $file
done
perl -i -lpe '
s/^(\<product.*?version=)".*?"/$1"'$NEW_VERSION'"/;
s/(-Declipse.buildId=\").*?(\")/$1;'$NEW_VERSION'$2/;
' bioclipse.core/features/net.bioclipse.platform_feature/bioclipse.product
echo 0=$NEW_VERSION > bioclipse.core/plugins/net.bioclipse.ui/about.mappings