flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject git commit: [flex-falcon] [refs/heads/develop] - try to be more tolerant of non-subsetted Google Closure Library folders
Date Tue, 28 Mar 2017 04:35:57 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop 50dd25d9d -> 71b84cb90


try to be more tolerant of non-subsetted Google Closure Library folders


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

Branch: refs/heads/develop
Commit: 71b84cb909137202f10235640c59523315f00223
Parents: 50dd25d
Author: Alex Harui <aharui@apache.org>
Authored: Mon Mar 27 19:29:54 2017 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Mon Mar 27 19:29:54 2017 -0700

----------------------------------------------------------------------
 .../mxml/flexjs/MXMLFlexJSPublisher.java        | 93 ++++++++++----------
 1 file changed, 46 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/71b84cb9/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java
index 742d806..838b1f7 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java
@@ -380,57 +380,56 @@ public class MXMLFlexJSPublisher extends JSGoogPublisher implements
IJSPublisher
     protected List<SourceFile> closureFilesInOrder(String path, List<SourceFile>
files, String entryPoint)
     {
     	ArrayList<String> sortedFiles = new ArrayList<String>();
+    	HashMap<String, SourceFile> fileMap = new HashMap<String, SourceFile>();
+    	SourceFile depsFile = null;
     	
     	for (SourceFile sourceFile : files)
     	{
-    		if (sourceFile.getOriginalPath().endsWith("deps.js"))
-    		{
-    			ArrayList<String> deps = new ArrayList<String>();
-    	        try
-    	        {
-    	            BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(path
+ sourceFile.getOriginalPath()), "UTF8"));
-
-    	            while (true)
-    	            {
-	    	            String line = in.readLine();
-	    	            if (line.startsWith("//") || line.trim().length() == 0)
-	    	            	continue;
-	    	            deps.add(line);
-    	            }
-    	        }
-	            catch (Exception e)
-	            {
-	                // nothing to see, move along...
-	            }
-
-	            sortClosureFile(deps, entryPoint, sortedFiles);
-	            
-	            ArrayList<SourceFile> list = new ArrayList<SourceFile>();
-	            ArrayList<String> seen = new ArrayList<String>();
-	            sortedFiles.add("goog/deps.js");
-	            sortedFiles.add("goog/base.js");
-	            int n = sortedFiles.size();
-	            for (int i = n - 1; i >= 0; i--)
-	            {
-	            	String fileName = sortedFiles.get(i);
-	            	if (seen.contains(fileName)) continue;
-	            	seen.add(fileName);
-	            	
-	            	for (SourceFile file : files)
-	            	{
-	            		if (file.getOriginalPath().contains(fileName))
-	            		{
-	            			list.add(file);
-	            			files.remove(file);
-	            			break;
-	            		}
-	            	}
-	            }
-	            list.addAll(files);
-	            return list;
-    		}
+    		if ((sourceFile.getOriginalPath().endsWith("goog/deps.js") || sourceFile.getOriginalPath().endsWith("goog\\deps.js"))
&&
+        		!(sourceFile.getOriginalPath().endsWith("third_party/goog/deps.js") || sourceFile.getOriginalPath().endsWith("third_party\\goog\\deps.js")))
+    			depsFile = sourceFile;
+    		System.out.println("originalPath: " + sourceFile.getOriginalPath());
+    		fileMap.put(sourceFile.getOriginalPath(), sourceFile);
     	}
-    	return null;
+    	
+		ArrayList<String> deps = new ArrayList<String>();
+        try
+        {
+            BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(path
+ depsFile.getOriginalPath()), "UTF8"));
+
+            while (true)
+            {
+	            String line = in.readLine();
+	            if (line.startsWith("//") || line.trim().length() == 0)
+	            	continue;
+	            deps.add(line);
+            }
+        }
+        catch (Exception e)
+        {
+            // nothing to see, move along...
+        }
+
+        sortClosureFile(deps, entryPoint, sortedFiles);
+        
+        ArrayList<SourceFile> list = new ArrayList<SourceFile>();
+        ArrayList<String> seen = new ArrayList<String>();
+        sortedFiles.add("deps.js");
+        sortedFiles.add("base.js");
+        // in dual branch, add this to node publisher
+        sortedFiles.add("bootstrap/nodejs.js");
+        int n = sortedFiles.size();
+        for (int i = n - 1; i >= 0; i--)
+        {
+        	String fileName = sortedFiles.get(i);
+        	System.out.println("sorted filename: " + fileName);
+        	if (seen.contains(fileName)) 
+        		continue;
+        	seen.add(fileName);
+        	
+        	list.add(fileMap.get("goog/" + fileName));
+        }
+        return list;
     }
     
     private void sortClosureFile(List<String> deps, String entryPoint, List<String>
sortedFiles)


Mime
View raw message