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

Side by Side Diff: editor/tools/compile_analyzer.py

Issue 13982010: Use intermediate file containing javac arguments to overcome windows limitations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « editor/analyzer.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 # 5 #
6 # Script to compile the analyzer. 6 # Script to compile the analyzer.
7 # 7 #
8 # Usage: compile_analyzer.py OPTIONS files 8 # Usage: compile_analyzer.py OPTIONS files
9 # 9 #
10 10
(...skipping 17 matching lines...) Expand all
28 options.add_option("--jar_entry_directory", 28 options.add_option("--jar_entry_directory",
29 help='Which directory within output to pack into the jar files') 29 help='Which directory within output to pack into the jar files')
30 options.add_option("--entry_point", 30 options.add_option("--entry_point",
31 help='The entry point for running the program.') 31 help='The entry point for running the program.')
32 options.add_option("--dependent_jar_files", 32 options.add_option("--dependent_jar_files",
33 help='The jar files that we link against, space separated.') 33 help='The jar files that we link against, space separated.')
34 return options.parse_args() 34 return options.parse_args()
35 35
36 def CompileAnalyzer(options, args): 36 def CompileAnalyzer(options, args):
37 # We rely on all jar files being copied to the output dir. 37 # We rely on all jar files being copied to the output dir.
38 class_path = options.output_dir + '*' 38 if sys.platform == 'win32':
39 class_path = options.output_dir + '*;'
40 else:
41 class_path = options.output_dir + '*'
39 cmd = [GetJavacPath(), 42 cmd = [GetJavacPath(),
40 '-sourcepath', 'foobar', 43 '-sourcepath', 'foobar',
41 '-source', '6', 44 '-source', '6',
42 '-target', '6', 45 '-target', '6',
43 '-implicit:none', 46 '-implicit:none',
44 '-d', options.output_dir, 47 '-d', options.output_dir,
45 '-cp', class_path, 48 '-cp', class_path,
46 ] 49 ]
47 cmd.extend(args) 50 cmd.extend(args)
48 subprocess.call(cmd) 51 exit_code = subprocess.call(cmd)
52 if exit_code:
53 raise Exception("Executing command [%s] failed" % cmd)
49 54
50 def CreateJarFile(options): 55 def CreateJarFile(options):
51 class_path_file_name = options.output_dir + options.class_path_file 56 class_path_file_name = options.output_dir + options.class_path_file
52 jar_file_name = options.output_dir + options.jar_file_name 57 jar_file_name = options.output_dir + options.jar_file_name
53 cmd = [GetJarToolPath(), 'cfem', jar_file_name, options.entry_point, 58 cmd = [GetJarToolPath(), 'cfem', jar_file_name, options.entry_point,
54 class_path_file_name, 59 class_path_file_name,
55 '-C', options.output_dir, options.jar_entry_directory] 60 '-C', options.output_dir, options.jar_entry_directory]
56 subprocess.call(cmd) 61 exit_code = subprocess.call(cmd)
62 if exit_code:
63 raise Exception("Executing command [%s] failed" % cmd)
57 64
58 def CopyFiles(options): 65 def CopyFiles(options):
59 # Strip " from the string 66 # Strip " from the string
60 files = options.dependent_jar_files.replace('"', '') 67 files = options.dependent_jar_files.replace('"', '')
61 for f in files.split(" "): 68 for f in files.split(" "):
62 shutil.copy(f, options.output_dir) 69 shutil.copy(f, options.output_dir)
63 70
64 def CreateClassPathFile(options): 71 def CreateClassPathFile(options):
65 class_path_file_name = options.output_dir + options.class_path_file 72 class_path_file_name = options.output_dir + options.class_path_file
66 with open(class_path_file_name, 'w') as output: 73 with open(class_path_file_name, 'w') as output:
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 os.makedirs(options.output_dir) 106 os.makedirs(options.output_dir)
100 107
101 CopyFiles(options) 108 CopyFiles(options)
102 CreateClassPathFile(options) 109 CreateClassPathFile(options)
103 CompileAnalyzer(options, args) 110 CompileAnalyzer(options, args)
104 CreateJarFile(options) 111 CreateJarFile(options)
105 112
106 113
107 if __name__=='__main__': 114 if __name__=='__main__':
108 main() 115 main()
OLDNEW
« no previous file with comments | « editor/analyzer.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698