flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshtynj...@apache.org
Subject git commit: [flex-falcon] [refs/heads/develop] - compiler-jx: fixed issue where MXMLFlexJSPublisher could not find Closure lib if not in classpath and not specified explicitly as compiler option
Date Fri, 11 Nov 2016 16:20:06 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop 53d64d6be -> 494693b7f


compiler-jx: fixed issue where MXMLFlexJSPublisher could not find Closure lib if not in classpath
and not specified explicitly as compiler option


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

Branch: refs/heads/develop
Commit: 494693b7f9a9200858ff13773adb801c4184251e
Parents: 53d64d6
Author: Josh Tynjala <joshtynjala@gmail.com>
Authored: Fri Nov 11 08:19:59 2016 -0800
Committer: Josh Tynjala <joshtynjala@gmail.com>
Committed: Fri Nov 11 08:19:59 2016 -0800

----------------------------------------------------------------------
 .../mxml/flexjs/MXMLFlexJSPublisher.java        | 36 ++++++++++++++------
 1 file changed, 25 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/494693b7/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 d742162..2d979db 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
@@ -212,18 +212,13 @@ public class MXMLFlexJSPublisher extends JSGoogPublisher implements
IJSPublisher
         // List of source files we need to pass into the closure compiler. As we have to
         // read the content in order to dump it to the intermediate, we can just keep it
         // and eventually use it in case of a release build.
-        List<SourceFile> closureSourceFiles;
+        List<SourceFile> closureSourceFiles = null;
 
         // If the closure lib dir is explicitly set, use that directory. If it
         // is not set, check if its content is available in the classpath. If
         // it is found in the classpath, use that as closure lib dir.
-        if (googConfiguration.isClosureLibSet()) {
-            File closureLibDir = new File(googConfiguration.getClosureLib());
-            if(!closureLibDir.exists() || !closureLibDir.isDirectory()) {
-                throw new RuntimeException("Parameter 'closure-lib' doesn't point to a valid
directory.");
-            }
-            closureSourceFiles = getDirectoryResources(new File(closureLibDir, "closure"));
-        } else {
+        if (!googConfiguration.isClosureLibSet())
+        {
             // Check if the "goog/deps.js" is available in the classpath.
             File closureLibraryJar = getJarThatContainsClasspathResources("goog/deps.js");
             if (closureLibraryJar != null)
@@ -236,11 +231,30 @@ public class MXMLFlexJSPublisher extends JSGoogPublisher implements
IJSPublisher
 
                 // Add the closure files from classpath.
                 closureSourceFiles = getClasspathResources(closureLibraryJar, whiteList);
-            } else {
-                throw new RuntimeException(
-                        "Parameter 'closure-lib' not specified and closure resources not
available in classpath.");
             }
         }
+        if (closureSourceFiles == null)
+        {
+            File closureLibDir = new File(googConfiguration.getClosureLib());
+            if (!closureLibDir.exists() || !closureLibDir.isDirectory())
+            {
+                //only throw this error if closure-lib is set because it
+                //wouldn't make sense with the default fallback path
+                if (googConfiguration.isClosureLibSet())
+                {
+                    throw new RuntimeException("Parameter 'closure-lib' doesn't point to
a valid directory.");
+                }
+            }
+            else
+            {
+                closureSourceFiles = getDirectoryResources(new File(closureLibDir, "closure"));
+            }
+        }
+        if (closureSourceFiles == null || closureSourceFiles.size() == 0)
+        {
+            throw new RuntimeException(
+                    "Parameter 'closure-lib' not specified and closure resources not available
in classpath.");
+        }
         // Dump a copy of the closure lib files to the intermediate directory. Without this
         // the application will not be able to run.
         for(SourceFile closureSourceFile : closureSourceFiles) {


Mime
View raw message