3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-06 01:24:08 +00:00

Java API: Build system update.

Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
Christoph M. Wintersteiger 2012-11-27 19:01:03 +00:00
parent c1bd6cb2fa
commit 2976fcbfd8
3 changed files with 17 additions and 10 deletions

View file

@ -71,7 +71,7 @@ def init_project_def():
static=build_static_lib(),
export_files=API_files)
add_dot_net_dll('dotnet', ['api_dll'], 'api/dotnet', dll_name='Microsoft.Z3', assembly_info_dir='Properties')
add_java_dll('java', ['api_dll'], 'api/java', dll_name='libz3java', package_name="com.Microsoft.Z3")
add_java_dll('java', ['api_dll'], 'api/java', dll_name='libz3java', package_name="com.microsoft.z3", manifest_file='manifest')
add_hlib('cpp', 'api/c++', includes2install=['z3++.h'])
set_z3py_dir('api/python')
# Examples

View file

@ -925,12 +925,13 @@ class DotNetDLLComponent(Component):
class JavaDLLComponent(Component):
def __init__(self, name, dll_name, package_name, path, deps):
def __init__(self, name, dll_name, package_name, manifest_file, path, deps):
Component.__init__(self, name, path, deps)
if dll_name == None:
dll_name = name
self.dll_name = dll_name
self.package_name = package_name
self.manifest_file = manifest_file
def mk_makefile(self, out):
if is_java_enabled():
@ -941,12 +942,16 @@ class JavaDLLComponent(Component):
out.write('%s.jar: libz3java$(SO_EXT) ' % self.package_name)
# for java_file in get_java_files(self.src_dir):
# out.write('%s ' % java_file)
# for java_file in get_java_files((self.src_dir + "/%s/Enumerations") % subdir):
# for java_file in get_java_files((self.src_dir + "/%s/enumerations") % subdir):
# out.write('%s ' % java_file)
out.write('\n')
out.write(('\t%s %s/Enumerations/*.java -d api/java\n' % (JAVAC, self.to_src_dir)).replace("/","\\"))
out.write(('\t%s -cp api/java %s/*.java -d api/java\n' % (JAVAC, self.to_src_dir)).replace("/","\\"))
out.write('\tjar cf %s.jar api/java/\n' % self.package_name)
t = ('\t%s %s/enumerations/*.java -d api/java\n' % (JAVAC, self.to_src_dir))
if IS_WINDOWS: t = t.replace("/","\\")
out.write(t)
t = ('\t%s -cp api/java %s/*.java -d api/java\n' % (JAVAC, self.to_src_dir)).replace("/","\\")
if IS_WINDOWS: t = t.replace("/","\\")
out.write(t)
out.write('\tjar cfm %s.jar %s/manifest -C api/java .\n' % (self.package_name, self.to_src_dir))
out.write('java: %s.jar\n\n' % self.package_name)
def main_component(self):
@ -1086,8 +1091,8 @@ def add_dot_net_dll(name, deps=[], path=None, dll_name=None, assembly_info_dir=N
c = DotNetDLLComponent(name, dll_name, path, deps, assembly_info_dir)
reg_component(name, c)
def add_java_dll(name, deps=[], path=None, dll_name=None, package_name=None):
c = JavaDLLComponent(name, dll_name, package_name, path, deps)
def add_java_dll(name, deps=[], path=None, dll_name=None, package_name=None, manifest_file=None):
c = JavaDLLComponent(name, dll_name, package_name, manifest_file, path, deps)
reg_component(name, c)
def add_cpp_example(name, path=None):
@ -1799,7 +1804,7 @@ def mk_z3consts_java(api_files):
java = get_component(JAVA_COMPONENT)
DeprecatedEnums = [ 'Z3_search_failure' ]
gendir = java.src_dir + "/Enumerations"
gendir = java.src_dir + "/enumerations"
if not os.path.exists(gendir):
os.mkdir(gendir)
@ -1850,7 +1855,7 @@ def mk_z3consts_java(api_files):
if name not in DeprecatedEnums:
efile = open('%s/%s.java' % (gendir, name), 'w')
efile.write('/**\n * Automatically generated file\n **/\n\n')
efile.write('package %s.Enumerations;\n\n' % java.package_name);
efile.write('package %s.enumerations;\n\n' % java.package_name);
efile.write('/**\n')
efile.write(' * %s\n' % name)

2
src/api/java/manifest Normal file
View file

@ -0,0 +1,2 @@
Manifest-Version: 1.0
Created-By: 4.3.0 (Microsoft Research LTD.)