cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1130181 - in /cxf/trunk: common/common/src/main/java/org/apache/cxf/common/util/Compiler.java rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/codegen/CodeGeneratorProviderTest.java
Date Wed, 01 Jun 2011 15:10:10 GMT
Author: dkulp
Date: Wed Jun  1 15:10:09 2011
New Revision: 1130181

URL: http://svn.apache.org/viewvc?rev=1130181&view=rev
Log:
Use the methods in Compiler class to find javac

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/codegen/CodeGeneratorProviderTest.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java?rev=1130181&r1=1130180&r2=1130181&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java Wed Jun
 1 15:10:09 2011
@@ -100,7 +100,20 @@ public class Compiler {
         }
 
     }
-    
+    public boolean compileFiles(File[] files) {
+        List<String> f = new ArrayList<String>(files.length);
+        for (File file : files) {
+            f.add(file.getAbsolutePath());
+        }
+        return compileFiles(f.toArray(new String[files.length]));
+    }
+    public boolean compileFiles(List<File> files) {
+        List<String> f = new ArrayList<String>(files.size());
+        for (File file : files) {
+            f.add(file.getAbsolutePath());
+        }
+        return compileFiles(f.toArray(new String[files.size()]));
+    }
     public boolean compileFiles(String[] files) {
         String endorsed = System.getProperty("java.endorsed.dirs");
         if (!forceFork) {

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/codegen/CodeGeneratorProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/codegen/CodeGeneratorProviderTest.java?rev=1130181&r1=1130180&r2=1130181&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/codegen/CodeGeneratorProviderTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/codegen/CodeGeneratorProviderTest.java
Wed Jun  1 15:10:09 2011
@@ -197,24 +197,13 @@ public class CodeGeneratorProviderTest e
     }
     
     protected boolean compileJavaSrc(String classPath, List<File> srcList, String dest)
{
-        String[] javacCommand = new String[srcList.size() + 7];
-        
-        javacCommand[0] = "javac";
-        javacCommand[1] = "-classpath";
-        javacCommand[2] = classPath;        
-        javacCommand[3] = "-d";
-        javacCommand[4] = dest;
-        javacCommand[5] = "-target";
-        javacCommand[6] = "1.5";
-        
-        int i = 7;
-        for (File f : srcList) {
-            javacCommand[i++] = f.getAbsolutePath();            
-        }
+
         org.apache.cxf.common.util.Compiler javaCompiler 
             = new org.apache.cxf.common.util.Compiler();
-        
-        return javaCompiler.internalCompile(javacCommand, 7); 
+        javaCompiler.setTarget("1.5");
+        javaCompiler.setClassPath(classPath);
+        javaCompiler.setOutputDir(dest);
+        return javaCompiler.compileFiles(srcList); 
     }
     
     static void setupClasspath(StringBuilder classPath, ClassLoader classLoader)



Mime
View raw message