mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 20:18:18 +00:00
add support for keyfiles
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
f4ced3c164
commit
5ebe342da1
|
@ -186,6 +186,10 @@ def mk_dist_dir():
|
||||||
build_path = BUILD_DIR
|
build_path = BUILD_DIR
|
||||||
dist_path = os.path.join(DIST_DIR, get_z3_name())
|
dist_path = os.path.join(DIST_DIR, get_z3_name())
|
||||||
mk_dir(dist_path)
|
mk_dir(dist_path)
|
||||||
|
name = get_z3_name()
|
||||||
|
if "x64" in name or "mac" in name:
|
||||||
|
mk_util.DOTNET_CORE_ENABLED = DOTNET_ENABLED
|
||||||
|
else:
|
||||||
mk_util.DOTNET_ENABLED = DOTNET_ENABLED
|
mk_util.DOTNET_ENABLED = DOTNET_ENABLED
|
||||||
mk_util.DOTNET_KEY_FILE = DOTNET_KEY_FILE
|
mk_util.DOTNET_KEY_FILE = DOTNET_KEY_FILE
|
||||||
mk_util.JAVA_ENABLED = JAVA_ENABLED
|
mk_util.JAVA_ENABLED = JAVA_ENABLED
|
||||||
|
|
|
@ -668,6 +668,7 @@ def display_help(exit_code):
|
||||||
if IS_WINDOWS:
|
if IS_WINDOWS:
|
||||||
print(" -v, --vsproj generate Visual Studio Project Files.")
|
print(" -v, --vsproj generate Visual Studio Project Files.")
|
||||||
print(" --optimize generate optimized code during linking.")
|
print(" --optimize generate optimized code during linking.")
|
||||||
|
print(" --dotnetcore generate .NET platform bindings.")
|
||||||
print(" --dotnet generate .NET bindings.")
|
print(" --dotnet generate .NET bindings.")
|
||||||
print(" --dotnet-key=<file> sign the .NET assembly using the private key in <file>.")
|
print(" --dotnet-key=<file> sign the .NET assembly using the private key in <file>.")
|
||||||
print(" --java generate Java bindings.")
|
print(" --java generate Java bindings.")
|
||||||
|
@ -1627,6 +1628,23 @@ class PythonInstallComponent(Component):
|
||||||
def mk_makefile(self, out):
|
def mk_makefile(self, out):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def set_key_file(self):
|
||||||
|
global DOTNET_KEY_FILE
|
||||||
|
# We need to give the assembly a strong name so that it
|
||||||
|
# can be installed into the GAC with ``make install``
|
||||||
|
if not DOTNET_KEY_FILE is None:
|
||||||
|
self.key_file = DOTNET_KEY_FILE
|
||||||
|
|
||||||
|
if not self.key_file is None:
|
||||||
|
if os.path.isfile(self.key_file):
|
||||||
|
self.key_file = os.path.abspath(self.key_file)
|
||||||
|
elif os.path.isfile(os.path.join(self.src_dir, self.key_file)):
|
||||||
|
self.key_file = os.path.abspath(os.path.join(self.src_dir, self.key_file))
|
||||||
|
else:
|
||||||
|
print("Keyfile '%s' could not be found; %s.dll will be unsigned." % (self.key_file, self.dll_name))
|
||||||
|
self.key_file = None
|
||||||
|
|
||||||
|
|
||||||
class DotNetDLLComponent(Component):
|
class DotNetDLLComponent(Component):
|
||||||
def __init__(self, name, dll_name, path, deps, assembly_info_dir, default_key_file):
|
def __init__(self, name, dll_name, path, deps, assembly_info_dir, default_key_file):
|
||||||
Component.__init__(self, name, path, deps)
|
Component.__init__(self, name, path, deps)
|
||||||
|
@ -1688,19 +1706,7 @@ class DotNetDLLComponent(Component):
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
# We need to give the assembly a strong name so that it
|
set_key_file(self)
|
||||||
# can be installed into the GAC with ``make install``
|
|
||||||
if not DOTNET_KEY_FILE is None:
|
|
||||||
self.key_file = DOTNET_KEY_FILE
|
|
||||||
|
|
||||||
if not self.key_file is None:
|
|
||||||
if os.path.isfile(self.key_file):
|
|
||||||
self.key_file = os.path.abspath(self.key_file)
|
|
||||||
elif os.path.isfile(os.path.join(self.src_dir, self.key_file)):
|
|
||||||
self.key_file = os.path.abspath(os.path.join(self.src_dir, self.key_file))
|
|
||||||
else:
|
|
||||||
print("Keyfile '%s' could not be found; %s.dll will be unsigned." % (self.key_file, self.dll_name))
|
|
||||||
self.key_file = None
|
|
||||||
|
|
||||||
if not self.key_file is None:
|
if not self.key_file is None:
|
||||||
print("%s.dll will be signed using key '%s'." % (self.dll_name, self.key_file))
|
print("%s.dll will be signed using key '%s'." % (self.dll_name, self.key_file))
|
||||||
|
@ -1843,8 +1849,6 @@ class DotNetCoreDLLComponent(Component):
|
||||||
|
|
||||||
|
|
||||||
def mk_makefile(self, out):
|
def mk_makefile(self, out):
|
||||||
# TBD: handle keyfile
|
|
||||||
global DOTNET_KEY_FILE
|
|
||||||
if not is_dotnet_core_enabled():
|
if not is_dotnet_core_enabled():
|
||||||
return
|
return
|
||||||
cs_fp_files = []
|
cs_fp_files = []
|
||||||
|
@ -1860,6 +1864,11 @@ class DotNetCoreDLLComponent(Component):
|
||||||
out.write(cs_file)
|
out.write(cs_file)
|
||||||
out.write('\n')
|
out.write('\n')
|
||||||
|
|
||||||
|
set_key_file(self)
|
||||||
|
key = ""
|
||||||
|
if not self.key_file is None:
|
||||||
|
key = "<AssemblyOriginatorKeyFile>%s</AssemblyOriginatorKeyFile>" % self.key_file
|
||||||
|
|
||||||
if VS_X64:
|
if VS_X64:
|
||||||
platform = 'x64'
|
platform = 'x64'
|
||||||
elif VS_ARM:
|
elif VS_ARM:
|
||||||
|
@ -1887,13 +1896,14 @@ class DotNetCoreDLLComponent(Component):
|
||||||
<Description>Z3 is a satisfiability modulo theories solver from Microsoft Research.</Description>
|
<Description>Z3 is a satisfiability modulo theories solver from Microsoft Research.</Description>
|
||||||
<Copyright>Copyright Microsoft Corporation. All rights reserved.</Copyright>
|
<Copyright>Copyright Microsoft Corporation. All rights reserved.</Copyright>
|
||||||
<PackageTags>smt constraint solver theorem prover</PackageTags>
|
<PackageTags>smt constraint solver theorem prover</PackageTags>
|
||||||
|
%s
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="..\%s\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
<Compile Include="..\%s\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>""" % (platform, version, self.to_src_dir)
|
</Project>""" % (platform, version, key, self.to_src_dir)
|
||||||
|
|
||||||
mk_dir(os.path.join(BUILD_DIR, 'dotnet'))
|
mk_dir(os.path.join(BUILD_DIR, 'dotnet'))
|
||||||
csproj = os.path.join('dotnet', 'z3.csproj')
|
csproj = os.path.join('dotnet', 'z3.csproj')
|
||||||
|
|
|
@ -208,7 +208,7 @@ def mk_dist_dir(x64):
|
||||||
build_path = BUILD_X86_DIR
|
build_path = BUILD_X86_DIR
|
||||||
dist_path = os.path.join(DIST_DIR, get_z3_name(x64))
|
dist_path = os.path.join(DIST_DIR, get_z3_name(x64))
|
||||||
mk_dir(dist_path)
|
mk_dir(dist_path)
|
||||||
mk_util.DOTNET_ENABLED = DOTNET_ENABLED
|
mk_util.DOTNET_CORE_ENABLED = DOTNET_ENABLED
|
||||||
mk_util.DOTNET_KEY_FILE = DOTNET_KEY_FILE
|
mk_util.DOTNET_KEY_FILE = DOTNET_KEY_FILE
|
||||||
mk_util.JAVA_ENABLED = JAVA_ENABLED
|
mk_util.JAVA_ENABLED = JAVA_ENABLED
|
||||||
mk_util.PYTHON_ENABLED = PYTHON_ENABLED
|
mk_util.PYTHON_ENABLED = PYTHON_ENABLED
|
||||||
|
|
Loading…
Reference in a new issue