def makeJar(pathOut, dirIn, dirRoot=None, manifest=None): # build the base args if dirRoot is None: dirRoot = dirIn dirIn = "." invokeArgs = ["jar"] filesArgs = ["-C", dirRoot, dirIn] if manifest is not None: # make a temp file for the manifest tempFile, tempFilename = tempfile.mkstemp(text=True) try: # write the manifest for (key, value) in manifest.iteritems(): os.write(tempFile, "%s: %s\n" % (key, value)) os.close(tempFile) # build the jar with a manifest ssjb.call(invokeArgs + ["cmf", tempFilename, pathOut] + filesArgs) finally: os.remove(tempFilename) else: # just build the jar without a manifest ssjb.call(invokeArgs + ["cf", pathOut] + filesArgs) print ("Wrote jar: %s" % pathOut)
def makeJar(pathOut, dirIn, dirRoot=None, manifest=None): # build the base args if dirRoot is None: dirRoot = dirIn dirIn = "." invokeArgs = ["jar"] filesArgs = ["-C", dirRoot, dirIn] if manifest is not None: # make a temp file for the manifest tempFile, tempFilename = tempfile.mkstemp(text=True) try: # write the manifest for (key, value) in manifest.iteritems(): os.write(tempFile, "%s: %s\n" % (key, value)) os.close(tempFile) # build the jar with a manifest ssjb.call(invokeArgs + ["cmf", tempFilename, pathOut] + filesArgs) finally: os.remove(tempFilename) else: # just build the jar without a manifest ssjb.call(invokeArgs + ["cf", pathOut] + filesArgs) print("Wrote jar: %s" % pathOut)
def _callIvy(args, debug=False): baseArgs = [ "java", "-jar", PathIvy, "-m2compatible" ] if not debug: baseArgs += ["-warn"] ssjb.call(baseArgs + args)
def deployJarToLocalMavenRepo(pathLocalRepo, pathJar, artifact, deps=None): with TempDir() as dirTemp: # write the pom file pathPom = os.path.join(dirTemp, "artifact.pom") with open(pathPom, "w") as file: file.write(_getPomXml(artifact, deps)) ssjb.call(["mvn", "install:install-file", "-DlocalRepositoryPath=%s" % pathLocalRepo, "-Dfile=%s" % pathJar, "-DpomFile=%s" % pathPom ]) print ("Deployed Maven artifact %s to %s" % (artifact, pathLocalRepo))
def deployJarToLocalMavenRepo(pathLocalRepo, pathJar, artifact, deps=None): with TempDir() as dirTemp: # write the pom file pathPom = os.path.join(dirTemp, "artifact.pom") with open(pathPom, "w") as file: file.write(_getPomXml(artifact, deps)) ssjb.call([ "mvn", "install:install-file", "-DlocalRepositoryPath=%s" % pathLocalRepo, "-Dfile=%s" % pathJar, "-DpomFile=%s" % pathPom ]) print("Deployed Maven artifact %s to %s" % (artifact, pathLocalRepo))
def _callIvy(args, debug=False): baseArgs = ["java", "-jar", PathIvy, "-m2compatible"] if not debug: baseArgs += ["-warn"] ssjb.call(baseArgs + args)