flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cd...@apache.org
Subject git commit: [flex-utilities] [refs/heads/develop] - - Added code to zip up stuff needed for packaging AIR applications using adt
Date Fri, 17 Jul 2015 13:20:13 GMT
Repository: flex-utilities
Updated Branches:
  refs/heads/develop 7c1240c90 -> 7bf813f98


- Added code to zip up stuff needed for packaging AIR applications using adt


Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/7bf813f9
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/7bf813f9
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/7bf813f9

Branch: refs/heads/develop
Commit: 7bf813f98aabf8d21f4b58087646437d32883e9b
Parents: 7c1240c
Author: Christofer Dutz <christofer.dutz@codecentric.de>
Authored: Fri Jul 17 15:20:04 2015 +0200
Committer: Christofer Dutz <christofer.dutz@codecentric.de>
Committed: Fri Jul 17 15:20:04 2015 +0200

----------------------------------------------------------------------
 .../utilities/converter/air/AirConverter.java   | 26 +++++++++++++++++++-
 .../flex/utilities/converter/BaseConverter.java |  2 +-
 .../utilities/converter/flex/FlexConverter.java |  2 +-
 3 files changed, 27 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/7bf813f9/flex-maven-tools/mavenizer/converters/air/src/main/java/org/apache/flex/utilities/converter/air/AirConverter.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/mavenizer/converters/air/src/main/java/org/apache/flex/utilities/converter/air/AirConverter.java
b/flex-maven-tools/mavenizer/converters/air/src/main/java/org/apache/flex/utilities/converter/air/AirConverter.java
index 00a06fe..4dd9260 100644
--- a/flex-maven-tools/mavenizer/converters/air/src/main/java/org/apache/flex/utilities/converter/air/AirConverter.java
+++ b/flex-maven-tools/mavenizer/converters/air/src/main/java/org/apache/flex/utilities/converter/air/AirConverter.java
@@ -25,6 +25,7 @@ import java.io.*;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.zip.ZipOutputStream;
 
 /**
  * Created by cdutz on 22.04.2014.
@@ -104,7 +105,30 @@ public class AirConverter extends BaseConverter implements Converter
{
             final File androidZip = new File(rootTargetDirectory,
                     "com.adobe.air.compiler.adt.".replace(".", File.separator) + airSdkVersion
+
                             File.separator + "adt-" + airSdkVersion + "-android.zip");
-            generateZip(androidDir.listFiles(), androidZip);
+            try {
+                // Add all the content to a zip-file.
+                final ZipOutputStream zipOutputStream = new ZipOutputStream(new FileOutputStream(androidZip));
+                // Package all the compiler parts.
+                File[] zipfiles = androidDir.listFiles();
+                if(zipfiles != null) {
+                    for (final File file : zipfiles) {
+                        addFileToZip(zipOutputStream, file, rootSourceDirectory);
+                    }
+                }
+                // Package all the runtime parts.
+                File runtimesDir = new File(rootSourceDirectory, "runtimes/air/android");
+                if(runtimesDir.exists() && runtimesDir.isDirectory()) {
+                    zipfiles = runtimesDir.listFiles();
+                    if (zipfiles != null) {
+                        for (final File file : zipfiles) {
+                            addFileToZip(zipOutputStream, file, rootSourceDirectory);
+                        }
+                    }
+                }
+                zipOutputStream.close();
+            } catch(IOException e) {
+                throw new ConverterException("Error generating android package zip.", e);
+            }
         }
 
         // Generate the ios package (aot directory)

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/7bf813f9/flex-maven-tools/mavenizer/converters/base/src/main/java/org/apache/flex/utilities/converter/BaseConverter.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/mavenizer/converters/base/src/main/java/org/apache/flex/utilities/converter/BaseConverter.java
b/flex-maven-tools/mavenizer/converters/base/src/main/java/org/apache/flex/utilities/converter/BaseConverter.java
index 5d904dd..65e5bd7 100644
--- a/flex-maven-tools/mavenizer/converters/base/src/main/java/org/apache/flex/utilities/converter/BaseConverter.java
+++ b/flex-maven-tools/mavenizer/converters/base/src/main/java/org/apache/flex/utilities/converter/BaseConverter.java
@@ -387,7 +387,7 @@ public abstract class BaseConverter {
         }
     }
 
-    private void addFileToZip(ZipOutputStream zipOutputStream, File inputFile, File rootDirectory)
+    protected void addFileToZip(ZipOutputStream zipOutputStream, File inputFile, File rootDirectory)
           throws ConverterException {
 
         if (inputFile == null) {

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/7bf813f9/flex-maven-tools/mavenizer/converters/flex/src/main/java/org/apache/flex/utilities/converter/flex/FlexConverter.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/mavenizer/converters/flex/src/main/java/org/apache/flex/utilities/converter/flex/FlexConverter.java
b/flex-maven-tools/mavenizer/converters/flex/src/main/java/org/apache/flex/utilities/converter/flex/FlexConverter.java
index 6def8a1..9fda04f 100644
--- a/flex-maven-tools/mavenizer/converters/flex/src/main/java/org/apache/flex/utilities/converter/flex/FlexConverter.java
+++ b/flex-maven-tools/mavenizer/converters/flex/src/main/java/org/apache/flex/utilities/converter/flex/FlexConverter.java
@@ -523,7 +523,7 @@ public class FlexConverter extends BaseConverter implements Converter
{
         return result;
     }
 
-    private void addFileToZip(ZipOutputStream zipOutputStream, File inputFile, File rootDirectory)
+    protected void addFileToZip(ZipOutputStream zipOutputStream, File inputFile, File rootDirectory)
             throws ConverterException {
         if (inputFile == null) {
             return;


Mime
View raw message