def jcc(self, dest, dry_run, verbose): # FIXME: the jcc code generation jcc = self.load_jcc() args = [ None, '--debug', '--shared', #'--output',dest, ] for jar in self.jcc_jars: args.append('--jar') args.append(jar) for classpath in self.jcc_classpath: args.append('--classpath') args.append(classpath) for package in self.jcc_packages: args.append('--package') args.append(package) for cls in self.jcc_classes: args.append(cls) for exclude in self.jcc_excludes: args.append('--exclude') args.append(exclude) args.append('--python') args.append(self.name) for cls, (method, key, value) in self.jcc_mappings.items(): args.append('--mapping') args.append(cls) args.append('%s:(%s)%s' % (method, key, value)) for cls, (length, get, value) in self.jcc_sequences.items(): args.append('--sequence') args.appned(cls) args.append('%s()I' % length) args.append('%s(I)%s' % (get, value)) if self.jcc_version: args.append('--version') args.append(self.jcc_version) if verbose: print("generating JCC extension '%s'" % (self.name, )) for arg in args: if arg is None: continue print(" %s" % (arg, )) if not dry_run: jcc(args) self.sources = [ os.path.join('build', '_' + self.name, '__wrap__.cpp'), os.path.join('build', '_' + self.name, '__init__.cpp'), os.path.join('build', '_' + self.name, self.name + '.cpp'), ]
def jcc(self, dest, dry_run, verbose): # FIXME: the jcc code generation jcc = self.load_jcc() args = [None, '--debug', '--shared', #'--output',dest, ] for jar in self.jcc_jars: args.append('--jar'); args.append(jar) for classpath in self.jcc_classpath: args.append('--classpath'); args.append(classpath) for package in self.jcc_packages: args.append('--package'); args.append(package) for cls in self.jcc_classes: args.append(cls) for exclude in self.jcc_excludes: args.append('--exclude'); args.append(exclude) args.append('--python'); args.append(self.name) for cls,(method,key,value) in self.jcc_mappings.items(): args.append('--mapping') args.append(cls) args.append('%s:(%s)%s' % (method,key,value)) for cls,(length,get,value) in self.jcc_sequences.items(): args.append('--sequence') args.appned(cls) args.append('%s()I' % length) args.append('%s(I)%s' % (get, value)) if self.jcc_version: args.append('--version'); args.append(self.jcc_version) if verbose: print("generating JCC extension '%s'" % (self.name,)) for arg in args: if arg is None: continue print(" %s" % (arg,)) if not dry_run: jcc(args) self.sources = [os.path.join('build','_'+self.name,'__wrap__.cpp'), os.path.join('build','_'+self.name,'__init__.cpp'), os.path.join('build','_'+self.name,self.name + '.cpp'), ]
jvm.dll from the registry and append it to the Path at runtime Actions: --build - generate the wrapper and compile it --compile - recompile the (previously generated) module --install - install the wrapper in the local site-packages --egg-info - ask distutils setup() to generate egg info, and don't compile the module (for pip install) Distribution actions: --use-distutils - use distutils even when setuptools is available --bdist - generate a binary distutils-based distribution or a setuptools-based .egg --wininst - create an installer application for Microsoft Windows Other distutils/setuptools options (there are passed right through): --compiler COMPILER - use COMPILER instead of the platform default --root ROOTDIR --install-dir INSTALLDIR --prefix PREFIX --home HOMEDIR --extra-setup-arg - pass an extra argument on setup.py command line (pip install uses --egg-base and --record params) ''' print help sys.exit(0) cpp.jcc(sys.argv)
"org.neo4j.graphdb.index.IndexManager", "org.neo4j.index.impl.lucene.LuceneIndexProvider", "java.util.HashMap", "--exclude", "RelationshipIndex", "--version", NEO4J_VER, "--python", "neo4jcc", ] for jar in NEO4J_JARS[NEO4J_VER]: jcc_args.extend(( '--include', join(NEO4J_HOME, 'lib', jar) )) if cmd == "install": jcc_args.append("--install") elif cmd == "build": jcc_args.append("--build") cpp.jcc(jcc_args) if cmd == 'build': with open(build_info_file, 'w') as f: f.write(NEO4J_HOME+'\n') f.write(NEO4J_VER+'\n')
if arg == 'install': jcc_args.append('--install') elif arg == 'build': jcc_args.append('--build') elif arg == '-c': # forwarded_args.append(arg) pass elif arg == 'egg_info': jcc_args.append('--egg-info') elif arg == '--vmarg': jcc_args.append(arg) i += 1 jcc_args.append(sys.argv[i]) elif arg == '--maxheap': i += 1 maxheap = sys.argv[i] else: setup_args.append(arg) i += 1 for extra_arg in setup_args: jcc_args.append('--extra-setup-arg') jcc_args.append(extra_arg) jcc_args.extend(['--maxheap', maxheap]) print "jcc_args = %s" % jcc_args cpp.jcc(jcc_args)