harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r814067 - in /harmony/enhanced/jdktools/trunk/modules/jdktools: META-INF/MANIFEST.MF build.xml src/main/java/org/apache/harmony/tools/javac/Compiler.java src/main/java/org/apache/harmony/tools/javac/Main.java
Date Fri, 11 Sep 2009 22:30:52 GMT
Author: tellison
Date: Fri Sep 11 22:30:50 2009
New Revision: 814067

URL: http://svn.apache.org/viewvc?rev=814067&view=rev
Log:
Simplify the javac code to specify the Eclipse ECJ jar using the manifest Class-Path attribute.
Fix the javac behavior so that it compiles 1.5 code by default (was 1.4 only)

Removed:
    harmony/enhanced/jdktools/trunk/modules/jdktools/src/main/java/org/apache/harmony/tools/javac/Compiler.java
Modified:
    harmony/enhanced/jdktools/trunk/modules/jdktools/META-INF/MANIFEST.MF
    harmony/enhanced/jdktools/trunk/modules/jdktools/build.xml
    harmony/enhanced/jdktools/trunk/modules/jdktools/src/main/java/org/apache/harmony/tools/javac/Main.java

Modified: harmony/enhanced/jdktools/trunk/modules/jdktools/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jdktools/META-INF/MANIFEST.MF?rev=814067&r1=814066&r2=814067&view=diff
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jdktools/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/jdktools/trunk/modules/jdktools/META-INF/MANIFEST.MF Fri Sep 11 22:30:50
2009
@@ -4,7 +4,8 @@
 Implementation-Title: Apache Harmony
 Implementation-Vendor: The Apache Software Foundation
 Implementation-Vendor-Id: org.apache.harmony
-Implementation-URL: http://incubator.apache.org/harmony
+Implementation-URL: http://harmony.apache.org
+Class-Path: ecj-3.4.2.jar,jdi.jar,jdimodel.jar,bcel-5.2.jar
 Bundle-ManifestVersion: 2
 Bundle-Name: Harmony Tools
 Bundle-SymbolicName: org.apache.harmony.tools
@@ -28,21 +29,21 @@
  org.apache.harmony.kernel.vm,
  org.apache.harmony.luni.util,
  org.apache.harmony.pack200,
- org.apache.harmony.security.asn1;version="1.0.0",
- org.apache.harmony.security.pkcs10;version="1.0.0",
- org.apache.harmony.security.provider.cert;version="1.0.0",
- org.apache.harmony.security.utils;version="1.0.0",
- org.apache.harmony.security.x501;version="1.0.0",
- org.apache.harmony.security.x509;version="1.0.0"
+ org.apache.harmony.rmi.activation,
+ org.apache.harmony.rmi.compiler,
+ org.apache.harmony.rmi.registry,
+ org.apache.harmony.security.asn1,
+ org.apache.harmony.security.pkcs10,
+ org.apache.harmony.security.pkcs7,
+ org.apache.harmony.security.provider.cert,
+ org.apache.harmony.security.utils,
+ org.apache.harmony.security.x501,
+ org.apache.harmony.security.x509,
+ org.apache.harmony.security.x509.tsp
 Export-Package: org.apache.harmony.tools.javac,
  org.apache.harmony.tools.javah,
  org.apache.harmony.tools.javadoc,
  org.apache.harmony.tools.jarsigner,
  org.apache.harmony.tools.keytool,
- org.apache.harmony.tools.unpack200,
- org.apache.harmony.tools.pack200,
  com.sun.tools.javac,
- com.sun.tools.jdi,
- com.sun.tools.jdi.connect,
- com.sun.tools.jdi.event,
- com.sun.tools.jdi.request
+ com.sun.jdi

Modified: harmony/enhanced/jdktools/trunk/modules/jdktools/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jdktools/build.xml?rev=814067&r1=814066&r2=814067&view=diff
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jdktools/build.xml (original)
+++ harmony/enhanced/jdktools/trunk/modules/jdktools/build.xml Fri Sep 11 22:30:50 2009
@@ -48,6 +48,7 @@
         <check-one-file src="${jdt.jdimodel.jar.url}"
                         dest="${jdt.jdimodel.jar}" />
         <check-one-file src="${icu.url}" dest="${icu.jar}" />
+        <check-one-file src="${ecj.jar.url}" dest="${ecj.jar}" />
     </target>
     
     <target name="fetch-depends">
@@ -109,6 +110,7 @@
 
             <classpath>
                 <pathelement path="${jdt.jdi.jar}"/>
+                <pathelement path="${ecj.jar}" />
             </classpath>
         </hy.javac>
     </target>

Modified: harmony/enhanced/jdktools/trunk/modules/jdktools/src/main/java/org/apache/harmony/tools/javac/Main.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jdktools/src/main/java/org/apache/harmony/tools/javac/Main.java?rev=814067&r1=814066&r2=814067&view=diff
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jdktools/src/main/java/org/apache/harmony/tools/javac/Main.java
(original)
+++ harmony/enhanced/jdktools/trunk/modules/jdktools/src/main/java/org/apache/harmony/tools/javac/Main.java
Fri Sep 11 22:30:50 2009
@@ -17,9 +17,11 @@
 
 package org.apache.harmony.tools.javac;
 
-import java.io.PrintWriter;
 import java.io.File;
+import java.io.PrintWriter;
+
 import org.apache.harmony.tools.toolutils.Util;
+import org.eclipse.jdt.core.compiler.batch.BatchCompiler;
 
 /**
  * This is the entry point for the javac tool.
@@ -54,8 +56,9 @@
      * @return a return code as defined by this class
      */
     public int compile(String[] args) {
-
-        return compile(args,Util.getDefaultWriter(System.out), Util.getDefaultWriter(System.err));
+        return compile(args,
+                Util.getDefaultWriter(System.out),
+                Util.getDefaultWriter(System.err));
     }
 
     /**
@@ -71,17 +74,17 @@
      */
     public int compile(String[] args, PrintWriter out, PrintWriter err) {
 
-        /* Give me something to do */
+        /* Give me something to do, or print usage message */
         if (args == null || args.length == 0) {
-            new Compiler(out, err).printUsage();
+            BatchCompiler.compile("-help", out, err, null); //$NON-NLS-1$
             return RC_USAGE_ERROR;
         }
 
         /* Add in the base class library code to compile against */
-        String[] newArgs = addBootclasspath(args);
+        String[] newArgs = addLocalArgs(args);
 
         /* Invoke the compiler */
-        boolean success = Compiler.main(newArgs, out, err);
+        boolean success = BatchCompiler.compile(newArgs, out, err, null);
         return success ? RC_SUCCESS : RC_COMPILE_ERROR;
     }
 
@@ -89,20 +92,20 @@
      * Set up the compiler option to compile against the running JRE class
      * libraries.
      */
-    private String[] addBootclasspath(String[] args) {
+    private String[] addLocalArgs(String[] args) {
         StringBuilder sb = new StringBuilder();
-        String[] result = new String[args.length + 2];
+        String[] result = new String[args.length + 3];
 
         System.arraycopy(args, 0, result, 0, args.length);
         result[args.length] = "-classpath"; //$NON-NLS-1$
         sb.append(System.getProperty(
-                 "org.apache.harmony.boot.class.path", ".")); //$NON-NLS-1$ //$NON-NLS-2$
+                        "org.apache.harmony.boot.class.path", ".")); //$NON-NLS-1$ //$NON-NLS-2$
         sb.append(File.pathSeparator);
-        sb.append(System.getProperty(
-                 "sun.boot.class.path", ".")); //$NON-NLS-1$ //$NON-NLS-2$
+        sb.append(System.getProperty("sun.boot.class.path", ".")); //$NON-NLS-1$ //$NON-NLS-2$
         sb.append(File.pathSeparator);
         sb.append("."); //$NON-NLS-1$
         result[args.length + 1] = sb.toString();
+        result[args.length + 2] = "-1.5"; //$NON-NLS-1$
         return result;
     }
 }



Mime
View raw message