コード例 #1
0
ファイル: competition.py プロジェクト: pombredanne/luceneutil
 def compile(self, cp):
     files = []
     for f in os.listdir('%s/perf' % constants.BENCH_BASE_DIR):
         if not f.startswith('.#') and f.endswith('.java') and f not in (
                 'PKLookupPerfTest.java', 'PKLookupUpdatePerfTest.java'):
             files.append('%s/perf/%s' % (constants.BENCH_BASE_DIR, f))
     benchUtil.run(
         'javac -classpath "%s" %s >> compile.log 2>&1' %
         (cp, ' '.join(files)), 'compile.log')
コード例 #2
0
ファイル: competition.py プロジェクト: mocobeta/luceneutil
  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("\\", "/"))
コード例 #3
0
ファイル: competition.py プロジェクト: sandipnd/luceneutil
    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("\\", "/")))
コード例 #4
0
ファイル: competition.py プロジェクト: sandipnd/luceneutil
  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("\\", "/")))
コード例 #5
0
ファイル: competition.py プロジェクト: davideuler/luceneutil
 def compile(self, cp):
   files = []
   for f in os.listdir('%s/perf' % constants.BENCH_BASE_DIR):
     if not f.startswith('.#') and f.endswith('.java') and f not in ('PKLookupPerfTest.java', 'PKLookupUpdatePerfTest.java'):
       files.append('%s/perf/%s' % (constants.BENCH_BASE_DIR, f))
   benchUtil.run('javac -classpath "%s" %s >> compile.log 2>&1' % (cp, ' '.join(files)), 'compile.log')