Mercurial > hg > truffle
comparison mxtool/mx.py @ 14915:32121774dfea
When building with javac, use the one from JAVA_HOME but set the booclasspath, extdirs and endorseddirs to the correct JDK for cross-compilation.
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Tue, 01 Apr 2014 16:22:05 +0200 |
parents | a6bd486b1b44 |
children | 66e9855f4ae8 |
comparison
equal
deleted
inserted
replaced
14914:a6bd486b1b44 | 14915:32121774dfea |
---|---|
1864 processorArgs += ['-proc:none'] | 1864 processorArgs += ['-proc:none'] |
1865 | 1865 |
1866 toBeDeleted = [argfileName] | 1866 toBeDeleted = [argfileName] |
1867 try: | 1867 try: |
1868 if not jdtJar: | 1868 if not jdtJar: |
1869 mainJava = java() | |
1869 if not args.error_prone: | 1870 if not args.error_prone: |
1870 log('Compiling Java sources for {0} with javac...'.format(p.name)) | 1871 log('Compiling Java sources for {0} with javac...'.format(p.name)) |
1871 javacCmd = [jdk.javac, '-g', '-J-Xmx1g', '-source', compliance, '-target', compliance, '-classpath', cp, '-d', outputDir] | 1872 javacCmd = [mainJava.javac, '-g', '-J-Xmx1g', '-source', compliance, '-target', compliance, '-classpath', cp, '-d', outputDir, '-bootclasspath', jdk.bootclasspath(), '-endorseddirs', jdk.endorseddirs(), '-extdirs', jdk.extdirs()] |
1872 if jdk.debug_port is not None: | 1873 if jdk.debug_port is not None: |
1873 javacCmd += ['-J-Xdebug', '-J-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=' + str(jdk.debug_port)] | 1874 javacCmd += ['-J-Xdebug', '-J-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=' + str(jdk.debug_port)] |
1874 javacCmd += processorArgs | 1875 javacCmd += processorArgs |
1875 javacCmd += ['@' + argfile.name] | 1876 javacCmd += ['@' + argfile.name] |
1876 | 1877 |
1878 javacCmd.append('-XDignore.symbol.file') | 1879 javacCmd.append('-XDignore.symbol.file') |
1879 run(javacCmd) | 1880 run(javacCmd) |
1880 else: | 1881 else: |
1881 log('Compiling Java sources for {0} with javac (with error-prone)...'.format(p.name)) | 1882 log('Compiling Java sources for {0} with javac (with error-prone)...'.format(p.name)) |
1882 javaArgs = ['-Xmx1g'] | 1883 javaArgs = ['-Xmx1g'] |
1883 javacArgs = ['-g', '-source', compliance, '-target', compliance, '-classpath', cp, '-d', outputDir] | 1884 javacArgs = ['-g', '-source', compliance, '-target', compliance, '-classpath', cp, '-d', outputDir, '-bootclasspath', jdk.bootclasspath(), '-endorseddirs', jdk.endorseddirs(), '-extdirs', jdk.extdirs()] |
1884 javacArgs += processorArgs | 1885 javacArgs += processorArgs |
1885 javacArgs += ['@' + argfile.name] | 1886 javacArgs += ['@' + argfile.name] |
1886 if not args.warnAPI: | 1887 if not args.warnAPI: |
1887 javacArgs.append('-XDignore.symbol.file') | 1888 javacArgs.append('-XDignore.symbol.file') |
1888 run_java(javaArgs + ['-cp', os.pathsep.join([jdk.toolsjar, args.error_prone]), 'com.google.errorprone.ErrorProneCompiler'] + javacArgs, javaConfig=jdk) | 1889 run_java(javaArgs + ['-cp', os.pathsep.join([mainJava.toolsjar, args.error_prone]), 'com.google.errorprone.ErrorProneCompiler'] + javacArgs) |
1889 else: | 1890 else: |
1890 log('Compiling Java sources for {0} with JDT...'.format(p.name)) | 1891 log('Compiling Java sources for {0} with JDT...'.format(p.name)) |
1891 | 1892 |
1892 jdtArgs = [jdk.java, '-Xmx1g'] | 1893 jdtArgs = [jdk.java, '-Xmx1g'] |
1893 if jdk.debug_port is not None: | 1894 if jdk.debug_port is not None: |