forked from apache/wicket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-versions.py
executable file
·57 lines (44 loc) · 1.51 KB
/
build-versions.py
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
50
51
52
53
54
55
56
57
#!/usr/bin/python
#
# prints a release.properties file for instructing the Maven Release Plugin
# to generate the proper release artefacts without having to manually version
# everything.
#
# Usage:
#
# build-versions.py <release-version> <dev-version>
#
# This will generate a release.properties file that will release the
# release-version, and will continue development on dev-version.
#
# Example:
#
# build-milestone.py 7.0.0-M1 7.0.0-SNAPSHOT
#
import sys
from xml.dom.minidom import parse
groupId = "org.apache.wicket"
if len(sys.argv) != 3:
print "Usage: %s <release-version> <dev-version>" % sys.argv[0]
sys.exit(1)
relVersion = sys.argv[1]
devVersion = sys.argv[2]
relVersions = []
devVersions = []
def addVersions(groupId, module):
relVersions.append("project.rel." + groupId + "\\:" + module + "=" + relVersion)
devVersions.append("project.dev." + groupId + "\\:" + module + "=" + devVersion)
def getModulesFromParent(parentPomFile):
pom = parse(parentPomFile)
for moduleTag in pom.getElementsByTagName('module'):
module = moduleTag.childNodes[0].nodeValue.replace("testing/", "").replace("archetypes/quickstart", "wicket-archetype-quickstart")
addVersions(groupId, module)
addVersions(groupId, "wicket-parent")
addVersions("org.apache.wicket.experimental.wicket8", "wicket-experimental")
getModulesFromParent("pom.xml")
getModulesFromParent("wicket-native-websocket/pom.xml")
for version in relVersions:
print version
print
for version in devVersions:
print version