You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jo...@apache.org on 2016/11/11 16:20:06 UTC
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
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 <jo...@gmail.com>
Authored: Fri Nov 11 08:19:59 2016 -0800
Committer: Josh Tynjala <jo...@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) {