incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ftho...@apache.org
Subject svn commit: r1421232 - /incubator/flex/utilities/trunk/mavenizer/src/main/java/SDKDeployer.java
Date Thu, 13 Dec 2012 11:29:55 GMT
Author: fthomas
Date: Thu Dec 13 11:29:54 2012
New Revision: 1421232

URL: http://svn.apache.org/viewvc?rev=1421232&view=rev
Log:
FLEX-33296 Apache Flex Mavenized SDK Bug - Clean code

Modified:
    incubator/flex/utilities/trunk/mavenizer/src/main/java/SDKDeployer.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=1421232&r1=1421231&r2=1421232&view=diff
==============================================================================
--- incubator/flex/utilities/trunk/mavenizer/src/main/java/SDKDeployer.java (original)
+++ incubator/flex/utilities/trunk/mavenizer/src/main/java/SDKDeployer.java Thu Dec 13 11:29:54
2012
@@ -45,20 +45,24 @@ public class SDKDeployer {
     }
 
     public static void main(String[] args) {
-        if (args.length < 4) {
-            System.out.println("\nUsage: java -cp flex-sdk-converter-1.0.jar SDKDeployer
\"directory\" \"repositoryId\" \"url\" \"mvn\"\n");
-            System.out.println("The SDKDeployer needs 4 ordered parameters separated by spaces:");
-            System.out.println("\t1- directory: The path to the directory to deploy.");
-            System.out.println("\t2- repositoryId: Server Id to map on the <id> under
<server> section of settings.xml.");
-            System.out.println("\t3- url: URL where the artifacts will be deployed.");
-            System.out.println("\t4- mvn: The path to the mvn.bat / mvn.sh.");
-            return;
+        if (args.length != 4) {
+            printUsage();
+            System.exit(0);
         }
 
         SDKDeployer deployer = new SDKDeployer(args);
         deployer.start();
     }
 
+    private static void printUsage() {
+        System.out.println("\nUsage: java -cp flex-sdk-converter-1.0.jar SDKDeployer \"directory\"
\"repositoryId\" \"url\" \"mvn\"\n");
+        System.out.println("The SDKDeployer needs 4 ordered parameters separated by spaces:");
+        System.out.println("\t1- directory: The path to the directory to deploy.");
+        System.out.println("\t2- repositoryId: Server Id to map on the <id> under <server>
section of settings.xml.");
+        System.out.println("\t3- url: URL where the artifacts will be deployed.");
+        System.out.println("\t4- mvn: The path to the mvn.bat / mvn.sh.");
+    }
+
     private void start() {
         try {
             File dir = new File(directory);
@@ -147,12 +151,12 @@ public class SDKDeployer {
         while ((line = bri.readLine()) != null) {
             System.out.println(line);
         }
-        bri.close();
         while ((line = bre.readLine()) != null) {
             System.out.println(line);
         }
-        bre.close();
         p.waitFor();
+        bri.close();
+        bre.close();
         System.out.println("Done.");
     }
 



Mime
View raw message