incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From josebarra...@apache.org
Subject svn commit: r1420049 - in /incubator/flex/utilities/trunk/mavenizer/src/main/java: SDKDeployer.java flex/FlexFrameworkGenerator.java
Date Tue, 11 Dec 2012 09:25:29 GMT
Author: josebarragan
Date: Tue Dec 11 09:25:28 2012
New Revision: 1420049

URL: http://svn.apache.org/viewvc?rev=1420049&view=rev
Log:
[FLEX-33290] Fixed.
https://issues.apache.org/jira/browse/FLEX-33290

BTW typo resolved in FlexFrameworkGenerator

Modified:
    incubator/flex/utilities/trunk/mavenizer/src/main/java/SDKDeployer.java
    incubator/flex/utilities/trunk/mavenizer/src/main/java/flex/FlexFrameworkGenerator.java

Modified: incubator/flex/utilities/trunk/mavenizer/src/main/java/SDKDeployer.java
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/mavenizer/src/main/java/SDKDeployer.java?rev=1420049&r1=1420048&r2=1420049&view=diff
==============================================================================
--- incubator/flex/utilities/trunk/mavenizer/src/main/java/SDKDeployer.java (original)
+++ incubator/flex/utilities/trunk/mavenizer/src/main/java/SDKDeployer.java Tue Dec 11 09:25:28
2012
@@ -15,12 +15,17 @@
  * limitations under the License.
  */
 import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * Created with IntelliJ IDEA.
  * User: fthomas
  * Date: 11.08.12
  * Time: 18:17
+ *
+ * @author Frederic Thomas
+ * @author Jose Barragan
  */
 public class SDKDeployer {
     private String directory;
@@ -87,13 +92,18 @@ public class SDKDeployer {
 
         if (artifactName != null) {
             final File artifacts[] = new File(pom.getParent()).listFiles(new ArtifactFilter());
-            final String DEPLOY = mvn + " deploy:deploy-file -DrepositoryId=" + repositoryId
+ " -Durl=" + url;
+	        final List<String> processCmd = new ArrayList<String>(10);
+	        processCmd.add(mvn);
+	        processCmd.add("deploy:deploy-file");
+	        processCmd.add("-DrepositoryId=" + repositoryId);
+	        processCmd.add("-Durl=" + url);
+
+	        ProcessBuilder processBuilder = null;
+
 
             String packaging;
             String classifier = null;
 
-            String mavenDeploy = DEPLOY;
-
             if (artifacts != null && artifacts.length > 0) {
                 for (File artifact : artifacts) {
                     classifier = packaging = null;
@@ -105,28 +115,27 @@ public class SDKDeployer {
                         classifier = artifactName
                                 .substring(artifactName.indexOf(base.getName()) + base.getName().length()
+ 1, artifactName.length() - packaging.length() - 1);
                     } catch (StringIndexOutOfBoundsException ex) {/*has no classifier*/}
-                    ;
 
-                    mavenDeploy = DEPLOY;
-                    mavenDeploy += " -Dfile=\"" + artifact.getAbsolutePath() + "\"";
-                    mavenDeploy += " -DpomFile=\"" + pom.getAbsolutePath() + "\"";
+	                processCmd.add("-Dfile=" + artifact.getAbsolutePath());
+	                processCmd.add("-DpomFile=" + pom.getAbsolutePath());
                     if (classifier != null && classifier.length() > 0) {
-                        mavenDeploy += " -Dclassifier=\"" + classifier + "\"";
+	                    processCmd.add("-Dclassifier=" + classifier);
                     }
-                    mavenDeploy += " -Dpackaging=\"" + packaging + "\"";
-                    exec(mavenDeploy);
+	                processCmd.add("-Dpackaging=" + packaging);
+	                processBuilder = new ProcessBuilder(processCmd);
+	                exec(processBuilder.start());
                 }
             } else {
-                mavenDeploy += " -Dfile=\"" + pom.getAbsolutePath() + "\"";
-                mavenDeploy += " -DpomFile=\"" + pom.getAbsolutePath() + "\"";
-                exec(mavenDeploy);
+	            processCmd.add("-Dfile=" + pom.getAbsolutePath());
+	            processCmd.add("-DpomFile=" + pom.getAbsolutePath());
+	            processBuilder = new ProcessBuilder(processCmd);
+	            exec(processBuilder.start());
             }
+
         }
     }
 
-    private void exec(String exec) throws InterruptedException, IOException {
-        System.out.println(exec);
-        Process p = Runtime.getRuntime().exec(exec);
+    private void exec(Process p) throws InterruptedException, IOException {
         String line;
         BufferedReader bri = new BufferedReader(new InputStreamReader(p.getInputStream()));
         BufferedReader bre = new BufferedReader(new InputStreamReader(p.getErrorStream()));

Modified: incubator/flex/utilities/trunk/mavenizer/src/main/java/flex/FlexFrameworkGenerator.java
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/mavenizer/src/main/java/flex/FlexFrameworkGenerator.java?rev=1420049&r1=1420048&r2=1420049&view=diff
==============================================================================
--- incubator/flex/utilities/trunk/mavenizer/src/main/java/flex/FlexFrameworkGenerator.java
(original)
+++ incubator/flex/utilities/trunk/mavenizer/src/main/java/flex/FlexFrameworkGenerator.java
Tue Dec 11 09:25:28 2012
@@ -626,10 +626,10 @@ public class FlexFrameworkGenerator exte
         }
     }
 
-    private File generateThemeSwc(File themeDirectroy, File targetFile) throws Exception
{
+    private File generateThemeSwc(File themeDirectory, File targetFile) throws Exception
{
         // Prepare the command.
         final StringBuilder cmd = new StringBuilder();
-        final File fdkHomeDir = themeDirectroy.getParentFile().getParentFile().getParentFile();
+        final File fdkHomeDir = themeDirectory.getParentFile().getParentFile().getParentFile();
         final File fdkLibDir = new File(fdkHomeDir, "lib");
         if(fdkLibDir.exists() && fdkLibDir.isDirectory()) {
             final File compcLibrary = new File(fdkLibDir, "compc.jar");
@@ -642,7 +642,7 @@ public class FlexFrameworkGenerator exte
             cmd.append("\"");
 
             // Add all the content files.
-            final File contents[] = themeDirectroy.listFiles(new FileFilter() {
+            final File contents[] = themeDirectory.listFiles(new FileFilter() {
                 @Override
                 public boolean accept(File pathname) {
                     return !(pathname.isDirectory() && "src".equals(pathname.getName()))
&&
@@ -670,10 +670,10 @@ public class FlexFrameworkGenerator exte
 
             // Execute the command.
             try {
-                System.out.println("Geneating theme '" + themeDirectroy.getName() + "'");
+                System.out.println("Geneating theme '" + themeDirectory.getName() + "'");
                 final String[] envps = new String[1];
                 envps[0] = "PLAYERGLOBAL_HOME=" + new File(new File(
-                        themeDirectroy.getParentFile().getParentFile(), "libs"), "player").getAbsolutePath();
+                        themeDirectory.getParentFile().getParentFile(), "libs"), "player").getAbsolutePath();
                 envps[0] = envps[0].replace("\\", "/");
                 final Process child = Runtime.getRuntime().exec(cmd.toString(), envps);
                 final int exitValue = child.waitFor();



Mime
View raw message