def make_zips(api_dir, dist_dir):
    # Find indigo version
    from get_indigo_version import getIndigoVersion

    version = getIndigoVersion()

    if not os.path.exists(dist_dir):
        os.mkdir(dist_dir)

    archive_name = "./indigo-python-%s-%s" % (version, args.suffix)

    dest = os.path.join(dist_dir, archive_name)
    if os.path.exists(dest):
        shutil.rmtree(dest)
    os.mkdir(dest)
    os.mkdir(os.path.join(dest, "indigo"))
    shutil.copy(
        os.path.join(api_dir, "python", "indigo.py"),
        os.path.join(dest, "indigo", "__init__.py"),
    )
    shutil.copy(
        os.path.join(api_dir, "plugins", "renderer", "python",
                     "indigo_renderer.py"),
        dest,
    )
    shutil.copy(
        os.path.join(api_dir, "plugins", "renderer", "python",
                     "indigo_renderer.py"),
        os.path.join(dest, "indigo", "renderer.py"),
    )
    shutil.copy(
        os.path.join(api_dir, "plugins", "inchi", "python", "indigo_inchi.py"),
        dest)
    shutil.copy(
        os.path.join(api_dir, "plugins", "inchi", "python", "indigo_inchi.py"),
        os.path.join(dest, "indigo", "inchi.py"),
    )
    shutil.copy(
        os.path.join(api_dir, "plugins", "bingo", "python", "bingo.py"), dest)
    shutil.copy(
        os.path.join(api_dir, "plugins", "bingo", "python", "bingo.py"),
        os.path.join(dest, "indigo", "bingo.py"),
    )
    shutil.copytree(
        os.path.join(api_dir, "libs", "shared"),
        os.path.join(dest, "lib"),
        ignore=shutil.ignore_patterns("*.lib"),
    )

    shutil.copy(os.path.join(api_dir, "LICENSE"), dest)
    os.chdir(dist_dir)
    if os.path.exists(archive_name + ".zip"):
        os.remove(archive_name + ".zip")
    shutil.make_archive(archive_name, "zip", os.path.dirname(archive_name),
                        archive_name)
    shutil.rmtree(archive_name)
    full_archive_name = os.path.normpath(os.path.join(dist_dir, archive_name))
    print("Archive {}.zip created".format(full_archive_name))
def make_zips(api_dir, dist_dir):
    parser = OptionParser(description='Indigo Python libraries build script')
    parser.add_option('--suffix', '-s', help='archive suffix', default="")

    (args, left_args) = parser.parse_args()

    # Find indigo version
    from get_indigo_version import getIndigoVersion
    version = getIndigoVersion()

    if not os.path.exists(dist_dir):
        os.mkdir(dist_dir)

    archive_name = "./indigo-python-" + version + args.suffix

    dest = os.path.join(dist_dir, archive_name)
    if os.path.exists(dest):
        shutil.rmtree(dest)
    os.mkdir(dest)
    os.mkdir(os.path.join(dest, 'indigo'))
    shutil.copy(os.path.join(api_dir, "python", 'indigo.py'),
                os.path.join(dest, 'indigo', '__init__.py'))
    shutil.copy(
        os.path.join(api_dir, "plugins", "renderer", "python",
                     "indigo_renderer.py"), dest)
    shutil.copy(
        os.path.join(api_dir, "plugins", "renderer", "python",
                     "indigo_renderer.py"),
        os.path.join(dest, 'indigo', 'renderer.py'))
    shutil.copy(
        os.path.join(api_dir, "plugins", "inchi", "python", "indigo_inchi.py"),
        dest)
    shutil.copy(
        os.path.join(api_dir, "plugins", "inchi", "python", "indigo_inchi.py"),
        os.path.join(dest, 'indigo', 'inchi.py'))
    shutil.copy(
        os.path.join(api_dir, "plugins", "bingo", "python", "bingo.py"), dest)
    shutil.copy(
        os.path.join(api_dir, "plugins", "bingo", "python", "bingo.py"),
        os.path.join(dest, 'indigo', 'bingo.py'))
    shutil.copytree(os.path.join(api_dir, "libs", "shared"),
                    os.path.join(dest, "lib"),
                    ignore=shutil.ignore_patterns("*.lib"))

    shutil.copy(os.path.join(api_dir, "LICENSE"), dest)
    os.chdir(dist_dir)
    if os.path.exists(archive_name + ".zip"):
        os.remove(archive_name + ".zip")
    shutil.make_archive(archive_name, 'zip', os.path.dirname(archive_name),
                        archive_name)
    shutil.rmtree(archive_name)
    full_archive_name = os.path.normpath(os.path.join(dist_dir, archive_name))
    print('Archive {}.zip created'.format(full_archive_name))
Exemple #3
0
    if not args.type:
        args.type = 'python,java,dotnet'

    if len(left_args) > 0:
        print("Unexpected arguments: %s" % (str(left_args)))
        exit()

    suffix = ""
    if args.config.lower() != "release":
        suffix = "-" + args.config.lower()

    need_join_archieves = args.libonlyname is None
    need_gen_wrappers = args.libonlyname is None

    # Find indigo version
    version = getIndigoVersion()
    with cwd(os.path.join(os.path.split(__file__)[0], '..', 'dist')):

        if need_join_archieves:
            flatten_directory(".")

        if need_join_archieves:
            for dest, pattern in arc_joins:
                p = pattern.replace("%ver%", version) + "\.zip"
                d = dest.replace("%ver%", version) + suffix
                join_archives_by_pattern(p, d)

        print("*** Making wrappers *** ")

        api_dir = os.path.abspath(os.path.join("..", "api"))
        libs_dir = os.path.join(api_dir, "libs")
import shutil
from os.path import *
import re
import subprocess

from optparse import OptionParser

parser = OptionParser(description='Indigo Java libraries build script')
parser.add_option('--suffix', '-s', help='archive suffix', default="")
parser.add_option('--doc', default=False, action='store_true', help='Put documentation into the archive')

(args, left_args) = parser.parse_args()

# Find indigo version
from get_indigo_version import getIndigoVersion
version = getIndigoVersion()

api_dir = abspath(dirname(__file__))
root = join(api_dir, "..")
dist_dir = join(root, "dist")
if not os.path.exists(dist_dir):
    os.mkdir(dist_dir)

os.chdir(dist_dir)
if os.path.exists("java"):
    shutil.rmtree("java")
os.mkdir('java')

os.chdir(os.path.join(api_dir, "java"))
subprocess.check_call("mvn versions:set -DnewVersion=%s" % version, shell=True)
subprocess.check_call("mvn clean package install -Dmaven.test.skip=true", shell=True)