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 some adjustments to bundle up runtime code for native packaging.
Date Sat, 18 Jul 2015 18:10:32 GMT
Repository: flex-utilities
Updated Branches:
  refs/heads/develop 7bf813f98 -> a48b166a4


- Added some adjustments to bundle up runtime code for native packaging.


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

Branch: refs/heads/develop
Commit: a48b166a46e40ba6bdb1e73c70fd729bd4cd02bc
Parents: 7bf813f
Author: Christofer Dutz <christofer.dutz@codecentric.de>
Authored: Sat Jul 18 20:10:23 2015 +0200
Committer: Christofer Dutz <christofer.dutz@codecentric.de>
Committed: Sat Jul 18 20:10:23 2015 +0200

----------------------------------------------------------------------
 .../utilities/converter/air/AirConverter.java   | 109 ++++++++++++++++++-
 1 file changed, 107 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a48b166a/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 4dd9260..1c32f05 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
@@ -125,6 +125,20 @@ public class AirConverter extends BaseConverter implements Converter
{
                         }
                     }
                 }
+                File binDir = new File(rootSourceDirectory, "bin");
+                if(binDir.exists() && binDir.isDirectory()) {
+                    zipfiles = binDir.listFiles(new FilenameFilter() {
+                        public boolean accept(File dir, String name) {
+                            return name.equals("adt") || name.equals("adt.bat") ||
+                                    name.equals("adl") || name.equals("adl.exe");
+                        }
+                    });
+                    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);
@@ -137,7 +151,34 @@ public class AirConverter extends BaseConverter implements Converter
{
             final File iosZip = new File(rootTargetDirectory,
                     "com.adobe.air.compiler.adt.".replace(".", File.separator) + airSdkVersion
+
                             File.separator + "adt-" + airSdkVersion + "-ios.zip");
-            generateZip(iosDir.listFiles(), iosZip);
+            try {
+                // Add all the content to a zip-file.
+                final ZipOutputStream zipOutputStream = new ZipOutputStream(new FileOutputStream(iosZip));
+                // Package all the compiler parts.
+                File[] zipfiles = iosDir.listFiles();
+                if(zipfiles != null) {
+                    for (final File file : zipfiles) {
+                        addFileToZip(zipOutputStream, file, rootSourceDirectory);
+                    }
+                }
+                File binDir = new File(rootSourceDirectory, "bin");
+                if(binDir.exists() && binDir.isDirectory()) {
+                    zipfiles = binDir.listFiles(new FilenameFilter() {
+                        public boolean accept(File dir, String name) {
+                            return name.equals("adt") || name.equals("adt.bat") ||
+                                    name.equals("adl") || name.equals("adl.exe");
+                        }
+                    });
+                    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 exe, dmg, deb, rpm packages (nai directory)
@@ -146,7 +187,71 @@ public class AirConverter extends BaseConverter implements Converter
{
             final File desktopZip = new File(rootTargetDirectory,
                     "com.adobe.air.compiler.adt.".replace(".", File.separator) + airSdkVersion
+
                             File.separator + "adt-" + airSdkVersion + "-desktop.zip");
-            generateZip(desktopDir.listFiles(), desktopZip);
+            try {
+                // Add all the content to a zip-file.
+                final ZipOutputStream zipOutputStream = new ZipOutputStream(new FileOutputStream(desktopZip));
+                // Package all the compiler parts.
+                File[] zipfiles = desktopDir.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/win");
+                if(runtimesDir.exists() && runtimesDir.isDirectory()) {
+                    zipfiles = runtimesDir.listFiles();
+                    if (zipfiles != null) {
+                        for (final File file : zipfiles) {
+                            addFileToZip(zipOutputStream, file, rootSourceDirectory);
+                        }
+                    }
+                }
+                runtimesDir = new File(rootSourceDirectory, "runtimes/air/mac/Adobe AIR.framework/Versions/1.0");
+                if(runtimesDir.exists() && runtimesDir.isDirectory()) {
+                    zipfiles = runtimesDir.listFiles();
+                    if (zipfiles != null) {
+                        for (final File file : zipfiles) {
+                            addFileToZip(zipOutputStream, file, rootSourceDirectory);
+                        }
+                    }
+                }
+                runtimesDir = new File(rootSourceDirectory, "runtimes/air-captive/win");
+                if(runtimesDir.exists() && runtimesDir.isDirectory()) {
+                    zipfiles = runtimesDir.listFiles();
+                    if (zipfiles != null) {
+                        for (final File file : zipfiles) {
+                            addFileToZip(zipOutputStream, file, rootSourceDirectory);
+                        }
+                    }
+                }
+                runtimesDir = new File(rootSourceDirectory, "runtimes/air-captive/mac/Adobe
AIR.framework/Versions/1.0");
+                if(runtimesDir.exists() && runtimesDir.isDirectory()) {
+                    zipfiles = runtimesDir.listFiles();
+                    if (zipfiles != null) {
+                        for (final File file : zipfiles) {
+                            addFileToZip(zipOutputStream, file, rootSourceDirectory);
+                        }
+                    }
+                }
+                File binDir = new File(rootSourceDirectory, "bin");
+                if(binDir.exists() && binDir.isDirectory()) {
+                    zipfiles = binDir.listFiles(new FilenameFilter() {
+                        public boolean accept(File dir, String name) {
+                            return name.equals("adt") || name.equals("adt.bat") ||
+                                    name.equals("adl") || name.equals("adl.exe");
+                        }
+                    });
+                    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);
+            }
         }
 
         // Write this artifact to file.


Mime
View raw message