flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [27/50] git commit: [flex-falcon] [refs/heads/master] - handle early exits where source files and mainCU are not available
Date Mon, 26 Jun 2017 15:45:07 GMT
handle early exits where source files and mainCU are not available


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

Branch: refs/heads/master
Commit: f5a9cc40a78aa20937aa8c72fa0ffd9712447d85
Parents: b36ee03
Author: Alex Harui <aharui@apache.org>
Authored: Wed May 17 23:34:10 2017 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Wed May 17 23:34:10 2017 -0700

----------------------------------------------------------------------
 .../org/apache/flex/compiler/clients/MXMLC.java |  1 +
 .../src/main/java/flex2/tools/oem/Library.java  | 50 ++++++++++----------
 2 files changed, 27 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/f5a9cc40/compiler/src/main/java/org/apache/flex/compiler/clients/MXMLC.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/clients/MXMLC.java b/compiler/src/main/java/org/apache/flex/compiler/clients/MXMLC.java
index d77db73..473f48d 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/clients/MXMLC.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/clients/MXMLC.java
@@ -1141,6 +1141,7 @@ public class MXMLC implements FlexTool
     
     public String getMainSource()
     {
+    	if (mainCU == null) return "";
         return mainCU.getAbsoluteFilename();
     }
     

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/f5a9cc40/flex-compiler-oem/src/main/java/flex2/tools/oem/Library.java
----------------------------------------------------------------------
diff --git a/flex-compiler-oem/src/main/java/flex2/tools/oem/Library.java b/flex-compiler-oem/src/main/java/flex2/tools/oem/Library.java
index 182c325..e6f4eb8 100644
--- a/flex-compiler-oem/src/main/java/flex2/tools/oem/Library.java
+++ b/flex-compiler-oem/src/main/java/flex2/tools/oem/Library.java
@@ -928,32 +928,34 @@ public class Library implements Builder, Cloneable
         List<String> sourceFiles = compc.getSourceList();
         String mainFile = compc.getMainSource();
         VirtualFile mainVirtualFile = null;
-        for (String sourceFile : sourceFiles)
+        if (sourceFiles != null)
         {
-            for (VirtualFile sourcePath : sourcePaths)
-            {
-                String pathName = sourcePath.getName();
-                if (sourceFile.indexOf(pathName) == 0)
-                {
-                    String relPath = sourceFile.substring(pathName.length());
-                    int lastSep = relPath.lastIndexOf(File.separator);
-                    String shortName = relPath.substring(lastSep + 1);
-                    relPath = relPath.substring(0, lastSep);
-                    boolean isRoot = sourceFile.equals(mainFile);
-                    Source source = new Source(sourcePath, relPath, shortName, null, false,
isRoot);
-                    compiledSources.add(source);
-                    if (mainFile != null && pathName.equals(mainFile))
-                    	mainVirtualFile = sourcePath;
-                }
-            }
+	        for (String sourceFile : sourceFiles)
+	        {
+	            for (VirtualFile sourcePath : sourcePaths)
+	            {
+	                String pathName = sourcePath.getName();
+	                if (sourceFile.indexOf(pathName) == 0)
+	                {
+	                    String relPath = sourceFile.substring(pathName.length());
+	                    int lastSep = relPath.lastIndexOf(File.separator);
+	                    String shortName = relPath.substring(lastSep + 1);
+	                    relPath = relPath.substring(0, lastSep);
+	                    boolean isRoot = sourceFile.equals(mainFile);
+	                    Source source = new Source(sourcePath, relPath, shortName, null, false,
isRoot);
+	                    compiledSources.add(source);
+	                    if (mainFile != null && pathName.equals(mainFile))
+	                    	mainVirtualFile = sourcePath;
+	                }
+	            }
+	        }
+	        try {
+				sourceList = new SourceList(new ArrayList<VirtualFile>(), sourcePaths, mainVirtualFile,
new String[0]);
+			} catch (CompilerException e2) {
+				// TODO Auto-generated catch block
+				e2.printStackTrace();
+			}
         }
-        try {
-			sourceList = new SourceList(new ArrayList<VirtualFile>(), sourcePaths, mainVirtualFile,
new String[0]);
-		} catch (CompilerException e2) {
-			// TODO Auto-generated catch block
-			e2.printStackTrace();
-		}
-
         convertMessages(compc.getProblemQuery());
         
         clean(returnValue != OK, false, false);


Mime
View raw message