Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: tools/compile_java/compile_java.py

Issue 350483003: Build Tools Cleanup (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: more cleanup Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/compile_java/compile_java.py
diff --git a/tools/compile_java/compile_java.py b/tools/compile_java/compile_java.py
index bc35bf1b3c8f26ad78fb6db270b63cb283d0617c..5b6f9c62468ce7f7ef6c9f05232327b78bf68007 100644
--- a/tools/compile_java/compile_java.py
+++ b/tools/compile_java/compile_java.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
@@ -13,7 +13,7 @@ from optparse import OptionParser
# Filters out all arguments until the next '--' argument
# occurs.
-def ListArgCallback(option, opt_str, value, parser):
+def ListArgCallback(option, value, parser):
if value is None:
value = []
@@ -45,7 +45,7 @@ def javaCompile(javac, srcDirectories, srcList, classpath,
javaFilesTempFile = os.fdopen(tempFileDescriptor, "w")
try:
if srcDirectories:
- def findJavaFiles(arg, dirName, names):
+ def findJavaFiles(dirName, names):
for fileName in names:
(base, ext) = os.path.splitext(fileName)
if ext == '.java':
@@ -63,11 +63,10 @@ def javaCompile(javac, srcDirectories, srcList, classpath,
javaFilesTempFile.close()
# Prepare javac command.
- command = [javac]
+ command = [javac, '-J-Xmx256m']
# Use a large enough heap to be able to compile all of the classes in one
# big compilation step.
kustermann 2014/06/23 07:56:42 Please move this comment up to where the heap sett
- command.append('-J-Xmx256m')
if buildConfig == 'Debug':
command.append('-g')
@@ -102,16 +101,16 @@ def javaCompile(javac, srcDirectories, srcList, classpath,
os.remove(javaFilesTempFileName)
def copyProperties(propertyFiles, classOutputDir):
- for file in propertyFiles:
- if not os.path.isfile(file):
- sys.stderr.write('property file not found: ' + file + '\n')
+ for the_file in propertyFiles:
ricow1 2014/06/24 07:41:55 the_file -> propertyFile
+ if not os.path.isfile(the_file):
+ sys.stderr.write('property file not found: ' + the_file + '\n')
return False
if not os.path.exists(classOutputDir):
sys.stderr.write('classes dir not found: ' + classOutputDir + '\n')
return False
- if propertyFiles == []:
ricow1 2014/06/24 07:41:55 this is probably more saying, we already assume ab
+ if not propertyFiles:
return True
command = ['cp'] + propertyFiles + [classOutputDir]
@@ -136,7 +135,7 @@ def createJar(classOutputDir, jarFileName):
return True
-def main(args):
+def main():
try:
# Parse input.
parser = OptionParser()
@@ -180,7 +179,7 @@ def main(args):
sys.stderr.write('--jarFileName not specified\n')
return -1
if len(options.sourceDirs) > 0 and options.sourceList:
- sys.stderr.write("--sourceDir and --sourceList cannot be both specified");
+ sys.stderr.write("--sourceDir and --sourceList cannot be both specified")
return -1
# Compile and put into .jar file.
@@ -201,4 +200,4 @@ def main(args):
return -1
if __name__ == '__main__':
- sys.exit(main(sys.argv))
+ sys.exit(main())

Powered by Google App Engine
This is Rietveld 408576698