aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/BuildHelpers.py
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2015-07-08 17:17:00 +0300
committerTeemu Suo-Anttila <teemusa@vaadin.com>2015-07-08 17:17:00 +0300
commit94581505567f09e2fa90f4d41b7fea7cbae1b250 (patch)
treec6bd2b9bf2d63dabdaa206f1ad27803576d338c1 /scripts/BuildHelpers.py
parent09b8d081fc6a3b4883e2a7837ac077f092fb4aba (diff)
downloadvaadin-framework-94581505567f09e2fa90f4d41b7fea7cbae1b250.tar.gz
vaadin-framework-94581505567f09e2fa90f4d41b7fea7cbae1b250.zip
Fix version number resolution for validation scripts
Change-Id: I799553cea50cb8e81ab06482f1a971f324da8fa1
Diffstat (limited to 'scripts/BuildHelpers.py')
-rw-r--r--scripts/BuildHelpers.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/scripts/BuildHelpers.py b/scripts/BuildHelpers.py
index 7068168052..3302649c81 100644
--- a/scripts/BuildHelpers.py
+++ b/scripts/BuildHelpers.py
@@ -26,9 +26,11 @@ args = None
# Default argument parser
parser = argparse.ArgumentParser(description="Automated staging validation")
-parser.add_argument("version", type=str, help="Vaadin version to use")
+group = parser.add_mutually_exclusive_group(required=True)
+group.add_argument("--version", help="Vaadin version to use")
+group.add_argument("--artifactPath", help="Path to local folder with Vaadin artifacts")
+
parser.add_argument("--maven", help="Additional maven command line parameters", default=None)
-parser.add_argument("--artifactPath", help="Path to local folder with Vaadin artifacts", default=None)
# Parse command line arguments <version>
def parseArgs():
@@ -99,6 +101,16 @@ def copyWarFiles(artifactId, resultDir = resultPath, name = None):
copiedWars.append(join(resultDir, deployName))
return copiedWars
+def readPomFile(pomFile):
+ # pom.xml namespace workaround
+ root = ElementTree.parse(pomFile).getroot()
+ nameSpace = root.tag[1:root.tag.index('}')]
+ print("Using namespace: %s" % (nameSpace))
+ ElementTree.register_namespace('', nameSpace)
+
+ # Read the pom.xml correctly
+ return ElementTree.parse(pomFile), nameSpace
+
# Recursive pom.xml update script
def updateRepositories(path, repoIds = None, repoUrl = repo):
# If versions are not supplied, parse arguments
@@ -108,13 +120,8 @@ def updateRepositories(path, repoIds = None, repoUrl = repo):
# Read pom.xml
pomXml = join(path, "pom.xml")
if isfile(pomXml):
- # pom.xml namespace workaround
- root = ElementTree.parse(pomXml).getroot()
- nameSpace = root.tag[1:root.tag.index('}')]
- ElementTree.register_namespace('', nameSpace)
-
# Read the pom.xml correctly
- tree = ElementTree.parse(pomXml)
+ tree, nameSpace = readPomFile(pomXml)
# NameSpace needed for finding the repositories node
repoNode = tree.getroot().find("{%s}repositories" % (nameSpace))