def compile(self, competitor): path = checkoutToBenchPath(competitor.checkout) cwd = os.getcwd() checkoutPath = checkoutToPath(competitor.checkout) try: if competitor.checkout not in self.compiledCheckouts: self.compiledCheckouts.add(competitor.checkout); # for core we build a JAR in order to benefit from the MR JAR stuff for module in ['core']: modulePath = '%s/lucene/%s' % (checkoutPath, module) os.chdir(modulePath) print ' %s...' % modulePath run('%s jar' % constants.ANT_EXE, '%s/compile.log' % constants.LOGS_DIR) for module in ('suggest', 'highlighter', 'misc', 'analysis/common', 'grouping', 'codecs', 'facet', 'sandbox'): modulePath = '%s/lucene/%s' % (checkoutPath, module) classesPath = '%s/lucene/build/%s/classes/java' % (checkoutPath, module) # Try to be faster than ant; this may miss changes, e.g. a static final constant changed in core that is used in another module: if common.getLatestModTime('%s/src/java' % modulePath) > common.getLatestModTime(classesPath, '.class'): print ' %s...' % modulePath os.chdir(modulePath) run('%s compile' % constants.ANT_EXE, '%s/compile.log' % constants.LOGS_DIR) print ' %s' % path os.chdir(path) if path.endswith('/'): path = path[:-1] cp = self.classPathToString(self.getClassPath(competitor.checkout)) competitor.compile(cp) finally: os.chdir(cwd)
def compile(self, competitor): path = checkoutToBenchPath(competitor.checkout) cwd = os.getcwd() checkoutPath = checkoutToPath(competitor.checkout) try: if competitor.checkout not in self.compiledCheckouts: self.compiledCheckouts.add(competitor.checkout); for module in ('core', 'suggest', 'highlighter', 'misc', 'analysis/common', 'grouping', 'codecs', 'facet', 'sandbox'): modulePath = '%s/lucene/%s' % (checkoutPath, module) classesPath = '%s/lucene/build/%s/classes/java' % (checkoutPath, module) # Try to be faster than ant; this may miss changes, e.g. a static final constant changed in core that is used in another module: if common.getLatestModTime('%s/src/java' % modulePath) > common.getLatestModTime(classesPath, '.class'): print ' %s...' % modulePath os.chdir(modulePath) run('%s compile' % constants.ANT_EXE, '%s/compile.log' % constants.LOGS_DIR) print ' %s' % path os.chdir(path) if path.endswith('/'): path = path[:-1] cp = self.classPathToString(self.getClassPath(competitor.checkout)) competitor.compile(cp) finally: os.chdir(cwd)
def compile(self, cp): root = benchUtil.checkoutToUtilPath(self.checkout) perfSrc = os.path.join(root, "src/main") buildDir = os.path.join(root, "build") if not os.path.exists(buildDir): os.makedirs(buildDir) # Try to be faster than ant; this may miss changes, e.g. a static final constant changed in core that is used in another module: # This is a broken optimization! E.g. if there is a single .class file, with recent timestamp, and all other .class files are missing, # this fails to compile the missing ones! if False and common.getLatestModTime(perfSrc) <= common.getLatestModTime(buildDir, '.class'): print('Skip compiling luceneutil: all .class are up to date') return # Can we iterate the perf directory and get this list automatically? files = ['%s/perf/%s' % (perfSrc, x) for x in ( 'Args.java', 'IndexState.java', 'IndexThreads.java', 'NRTPerfTest.java', 'Indexer.java', 'KeepNoCommitsDeletionPolicy.java', 'LineFileDocs.java', 'LocalTaskSource.java', 'OpenDirectory.java', 'PKLookupTask.java', 'PointsPKLookupTask.java', 'PerfUtils.java', 'RandomQuery.java', 'RemoteTaskSource.java', 'RespellTask.java', 'SearchPerfTest.java', 'SearchTask.java', 'StatisticsHelper.java', 'Task.java', 'TaskParser.java', 'TaskSource.java', 'TaskThreads.java', 'VectorDictionary.java', 'BenchRearranger.java', 'StringFieldDocSelector.java', )] print('files %s' % files) cmd = [self.javacCommand, '-g', '-d', buildDir, '-classpath', cp] cmd += files benchUtil.run(cmd, os.path.join(constants.LOGS_DIR, 'compile.log')) # copy resources/META-INF if os.path.exists(os.path.join(perfSrc, 'resources/*')): benchUtil.run('cp', '-r', os.path.join(perfSrc, 'resources/*'), buildDir.replace("\\", "/"))
def compile(self, cp): root = benchUtil.checkoutToUtilPath(self.checkout) perfSrc = os.path.join(root, "src/main") buildDir = os.path.join(root, "build") if not os.path.exists(buildDir): os.makedirs(buildDir) # Try to be faster than ant; this may miss changes, e.g. a static final constant changed in core that is used in another module: if common.getLatestModTime(perfSrc) <= common.getLatestModTime( buildDir, '.class'): print('Skip compile: all .class are up to date') return files = [ '%s/perf/%s' % (perfSrc, x) for x in ( 'Args.java', 'IndexState.java', 'IndexThreads.java', 'NRTPerfTest.java', 'Indexer.java', 'KeepNoCommitsDeletionPolicy.java', 'LineFileDocs.java', 'LocalTaskSource.java', 'OpenDirectory.java', 'PKLookupTask.java', 'PointsPKLookupTask.java', 'PerfUtils.java', 'RandomQuery.java', 'RemoteTaskSource.java', 'RespellTask.java', 'SearchPerfTest.java', 'SearchTask.java', 'StatisticsHelper.java', 'Task.java', 'TaskParser.java', 'TaskSource.java', 'TaskThreads.java', ) ] print('files %s' % files) benchUtil.run( '%s -d %s -classpath "%s" %s' % (self.javacCommand, buildDir, cp, ' '.join(files)), os.path.join(constants.LOGS_DIR, 'compile.log')) # copy resources/META-INF if os.path.exists(os.path.join(perfSrc, 'resources/*')): benchUtil.run('cp -r %s %s' % (os.path.join( perfSrc, 'resources/*'), buildDir.replace("\\", "/")))
def compile(self, cp): root = benchUtil.checkoutToUtilPath(self.checkout) perfSrc = os.path.join(root, "src/main") buildDir = os.path.join(root, "build") if not os.path.exists(buildDir): os.makedirs(buildDir) # Try to be faster than ant; this may miss changes, e.g. a static final constant changed in core that is used in another module: if common.getLatestModTime(perfSrc) <= common.getLatestModTime(buildDir, '.class'): print('Skip compile: all .class are up to date') return files = ['%s/perf/%s' % (perfSrc, x) for x in ( 'Args.java', 'IndexState.java', 'IndexThreads.java', 'NRTPerfTest.java', 'Indexer.java', 'KeepNoCommitsDeletionPolicy.java', 'LineFileDocs.java', 'LocalTaskSource.java', 'OpenDirectory.java', 'PKLookupTask.java', 'PointsPKLookupTask.java', 'PerfUtils.java', 'RandomQuery.java', 'RemoteTaskSource.java', 'RespellTask.java', 'SearchPerfTest.java', 'SearchTask.java', 'StatisticsHelper.java', 'Task.java', 'TaskParser.java', 'TaskSource.java', 'TaskThreads.java', )] print('files %s' % files) benchUtil.run('%s -d %s -classpath "%s" %s' % (self.javacCommand, buildDir, cp, ' '.join(files)), os.path.join(constants.LOGS_DIR, 'compile.log')) # copy resources/META-INF if os.path.exists(os.path.join(perfSrc, 'resources/*')): benchUtil.run('cp -r %s %s' % (os.path.join(perfSrc, 'resources/*'), buildDir.replace("\\", "/")))