示例#1
0
文件: jar.py 项目: cclauss/CMCP
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)
示例#2
0
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)
示例#3
0
文件: ivy.py 项目: cclauss/CMCP
def _callIvy(args, debug=False):
    baseArgs = [
        "java", "-jar", PathIvy,
        "-m2compatible"
    ]
    if not debug:
        baseArgs += ["-warn"]
    ssjb.call(baseArgs + args)
示例#4
0
文件: ivy.py 项目: cclauss/CMCP
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))
示例#5
0
文件: ivy.py 项目: wgaylord/EMCP
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))
示例#6
0
文件: ivy.py 项目: wgaylord/EMCP
def _callIvy(args, debug=False):
    baseArgs = ["java", "-jar", PathIvy, "-m2compatible"]
    if not debug:
        baseArgs += ["-warn"]
    ssjb.call(baseArgs + args)