From d5954e829b17cce03a12da43b96b006b55bed724 Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Thu, 28 Jul 2016 18:49:57 +0100 Subject: [PATCH] Enabled donet key file in dist scripts --- scripts/mk_unix_dist.py | 15 ++++++++++++--- scripts/mk_win_dist.py | 11 ++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/scripts/mk_unix_dist.py b/scripts/mk_unix_dist.py index 0c28058ed..ee1294a8b 100644 --- a/scripts/mk_unix_dist.py +++ b/scripts/mk_unix_dist.py @@ -23,6 +23,7 @@ VERBOSE=True DIST_DIR='dist' FORCE_MK=False DOTNET_ENABLED=True +DOTNET_KEY_FILE=None JAVA_ENABLED=True GIT_HASH=False @@ -52,13 +53,14 @@ def display_help(): print(" -b , --build= subdirectory where x86 and x64 Z3 versions will be built (default: build-dist).") print(" -f, --force force script to regenerate Makefiles.") print(" --nodotnet do not include .NET bindings in the binary distribution files.") + print(" --dotnet-key= sign the .NET assembly with the private key in .") print(" --nojava do not include Java bindings in the binary distribution files.") print(" --githash include git hash in the Zip file.") exit(0) # Parse configuration option for mk_make script def parse_options(): - global FORCE_MK, JAVA_ENABLED, GIT_HASH, DOTNET_ENABLED + global FORCE_MK, JAVA_ENABLED, GIT_HASH, DOTNET_ENABLED, DOTNET_KEY_FILE path = BUILD_DIR options, remainder = getopt.gnu_getopt(sys.argv[1:], 'b:hsf', ['build=', 'help', @@ -66,6 +68,7 @@ def parse_options(): 'force', 'nojava', 'nodotnet', + 'dotnet-key=', 'githash' ]) for opt, arg in options: @@ -80,7 +83,9 @@ def parse_options(): elif opt in ('-f', '--force'): FORCE_MK = True elif opt == '--nodotnet': - DOTNET_ENABLED = False + DOTNET_ENABLED = False + elif opt == '--dotnet-key': + DOTNET_KEY_FILE = arg elif opt == '--nojava': JAVA_ENABLED = False elif opt == '--githash': @@ -98,11 +103,14 @@ def mk_build_dir(path): if not check_build_dir(path) or FORCE_MK: opts = ["python", os.path.join('scripts', 'mk_make.py'), "-b", path, "--staticlib"] if DOTNET_ENABLED: - opts.append('--dotnet') + opts.append('--dotnet') + if not DOTNET_KEY_FILE is None: + opts.append('--dotnet-key=' + DOTNET_KEY_FILE) if JAVA_ENABLED: opts.append('--java') if GIT_HASH: opts.append('--githash=%s' % mk_util.git_hash()) + opts.append('--git-describe')) if subprocess.call(opts) != 0: raise MKException("Failed to generate build directory at '%s'" % path) @@ -171,6 +179,7 @@ def mk_dist_dir(): dist_path = os.path.join(DIST_DIR, get_z3_name()) mk_dir(dist_path) mk_util.DOTNET_ENABLED = DOTNET_ENABLED + mk_util.DOTNET_KEY_FILE = DOTNET_KEY_FILE mk_util.JAVA_ENABLED = JAVA_ENABLED mk_unix_dist(build_path, dist_path) if is_verbose(): diff --git a/scripts/mk_win_dist.py b/scripts/mk_win_dist.py index cee8c0460..145e356fb 100644 --- a/scripts/mk_win_dist.py +++ b/scripts/mk_win_dist.py @@ -25,6 +25,7 @@ VERBOSE=True DIST_DIR='dist' FORCE_MK=False DOTNET_ENABLED=True +DOTNET_KEY_FILE=None JAVA_ENABLED=True GIT_HASH=False @@ -57,13 +58,14 @@ def display_help(): print(" -b , --build= subdirectory where x86 and x64 Z3 versions will be built (default: build-dist).") print(" -f, --force force script to regenerate Makefiles.") print(" --nodotnet do not include .NET bindings in the binary distribution files.") + print(" --dotnet-key= sign the .NET assembly with the private key in .") print(" --nojava do not include Java bindings in the binary distribution files.") print(" --githash include git hash in the Zip file.") exit(0) # Parse configuration option for mk_make script def parse_options(): - global FORCE_MK, JAVA_ENABLED, GIT_HASH, DOTNET_ENABLED + global FORCE_MK, JAVA_ENABLED, GIT_HASH, DOTNET_ENABLED, DOTNET_KEY_FILE path = BUILD_DIR options, remainder = getopt.gnu_getopt(sys.argv[1:], 'b:hsf', ['build=', 'help', @@ -71,6 +73,7 @@ def parse_options(): 'force', 'nojava', 'nodotnet', + 'dotnet-key=', 'githash' ]) for opt, arg in options: @@ -86,6 +89,8 @@ def parse_options(): FORCE_MK = True elif opt == '--nodotnet': DOTNET_ENABLED = False + elif opt == '--dotnet-key': + DOTNET_KEY_FILE = arg elif opt == '--nojava': JAVA_ENABLED = False elif opt == '--githash': @@ -104,12 +109,15 @@ def mk_build_dir(path, x64): opts = ["python", os.path.join('scripts', 'mk_make.py'), "--parallel=24", "-b", path] if DOTNET_ENABLED: opts.append('--dotnet') + if not DOTNET_KEY_FILE is None: + opts.append('--dotnet-key=' + DOTNET_KEY_FILE) if JAVA_ENABLED: opts.append('--java') if x64: opts.append('-x') if GIT_HASH: opts.append('--githash=%s' % mk_util.git_hash()) + opts.append('--git-describe') if subprocess.call(opts) != 0: raise MKException("Failed to generate build directory at '%s'" % path) @@ -182,6 +190,7 @@ def mk_dist_dir_core(x64): dist_path = os.path.join(DIST_DIR, get_z3_name(x64)) mk_dir(dist_path) mk_util.DOTNET_ENABLED = DOTNET_ENABLED + mk_util.DOTNET_KEY_FILE = DOTNET_KEY_FILE mk_util.JAVA_ENABLED = JAVA_ENABLED mk_win_dist(build_path, dist_path) if is_verbose():