# Generate the required command line for archetype generation cmd = [mavenCmd, "archetype:generate"] cmd.append("-DarchetypeGroupId=%s" % (archetypeGroup)) cmd.append("-DarchetypeArtifactId=%s" % (archetype)) cmd.append("-DarchetypeVersion=%s" % (args.version)) if hasattr(args, "archetype") and args.archetype != None: cmd.append("-DarchetypeRepository=%s" % (repo % (args.archetype))) cmd.append("-DgroupId=%s" % (group)) cmd.append("-DartifactId=%s" % (artifactId)) cmd.append("-Dversion=1.0-SNAPSHOT") cmd.append("-DinteractiveMode=false") # Generate pom.xml print("Generating pom.xml for archetype %s" % (archetype)) subprocess.check_call(cmd, stdout=log) # Return the artifactId so we know the name in the future return artifactId ## DO THIS IF RUN AS A SCRIPT (not import) ## if __name__ == "__main__": args = parseArgs() for archetype in archetypes: log = getLogFile(archetype) artifactId = generateArchetype(archetype) updateRepositories(artifactId) mavenValidate(artifactId, logFile=log) copyWarFiles(artifactId, name=archetype)
#version = VersionObject() #version.version = "7.4.8" # Uncomment lines before this, and comment following line to make a non-staging test version = None demos = { "dashboard" : "https://github.com/vaadin/dashboard-demo.git", "parking" : "https://github.com/vaadin/parking-demo.git", "addressbook" : "https://github.com/vaadin/addressbook.git", "confirmdialog" : "https://github.com/samie/Vaadin-ConfirmDialog.git" } def checkout(folder, url): Repo.clone_from(url, folder) if __name__ == "__main__": if version is None: version = parseArgs() for demo in demos: print("Validating demo %s" % (demo)) try: checkout(demo, demos[demo]) updateRepositories(demo, repoIds = version) mavenValidate(demo, repoIds = version, logFile = getLogFile(demo)) copyWarFiles(demo) print("%s demo validation succeeded!" % (demo)) except: print("%s demo validation failed" % (demo)) print("")