You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2015/12/09 22:47:39 UTC
[5/6] git commit: [flex-falcon] [refs/heads/develop] - use externs
from swcs in GCC compile
use externs from swcs in GCC compile
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/31aad75a
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/31aad75a
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/31aad75a
Branch: refs/heads/develop
Commit: 31aad75ae90370627d6aac30b5d33e2fdd5b5b8d
Parents: 808fd16
Author: Alex Harui <ah...@apache.org>
Authored: Wed Dec 9 13:35:11 2015 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Dec 9 13:35:11 2015 -0800
----------------------------------------------------------------------
.../mxml/flexjs/MXMLFlexJSPublisher.java | 56 +++++++++++---------
1 file changed, 30 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/31aad75a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java
index 0f7e54d..1cf3855 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java
@@ -30,6 +30,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
+import java.util.Map;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
@@ -295,32 +296,35 @@ public class MXMLFlexJSPublisher extends JSGoogPublisher implements IJSPublisher
// about them fancy externs we've been working so hard on
for (ISWC swc : swcs)
{
- String srcName = swc.getSWCFile().getName().replace(".swc", ".js");
- String srcPath = FLEXJS_EXTERNS + File.separator + srcName;
-
- ISWCFileEntry fileEntry = swc.getFile(FLEXJS_EXTERNS + File.separator + srcName);
- if (fileEntry != null)
- {
- File destFile = new File(intermediateDirPath + File.separator + srcPath);
-
- InputStream inStream = fileEntry.createInputStream();
- OutputStream outStream = FileUtils.openOutputStream(destFile);
- byte[] b = new byte[1024 * 1024];
- int bytes_read;
- while ((bytes_read = inStream.read(b)) != -1)
- {
- outStream.write(b, 0, bytes_read);
- }
- outStream.flush();
- outStream.close();
- inStream.close();
-
- String destPath = destFile.getAbsolutePath();
-
- System.out.println("using extern: " + destPath);
-
- compilerWrapper.addJSExternsFile(destPath);
- }
+ Map<String, ISWCFileEntry> files = swc.getFiles();
+ for (String key : files.keySet())
+ {
+ if (key.startsWith(FLEXJS_EXTERNS))
+ {
+ ISWCFileEntry fileEntry = swc.getFile(key);
+ if (fileEntry != null)
+ {
+ File destFile = new File(intermediateDirPath + File.separator + key);
+ InputStream inStream = fileEntry.createInputStream();
+ OutputStream outStream = FileUtils.openOutputStream(destFile);
+ byte[] b = new byte[1024 * 1024];
+ int bytes_read;
+ while ((bytes_read = inStream.read(b)) != -1)
+ {
+ outStream.write(b, 0, bytes_read);
+ }
+ outStream.flush();
+ outStream.close();
+ inStream.close();
+
+ String destPath = destFile.getAbsolutePath();
+
+ System.out.println("using extern: " + destPath);
+
+ compilerWrapper.addJSExternsFile(destPath);
+ }
+ }
+ }
}
GoogDepsWriter gdw = new GoogDepsWriter(intermediateDir, projectName, (JSGoogConfiguration) configuration, swcs);