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/12/16 23:26:22 UTC
[4/6] git commit: [flex-falcon] [refs/heads/develop] - compiler-jx:
updated main js compilers to use Closure compiler v20161201
compiler-jx: updated main js compilers to use Closure compiler v20161201
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/5a121f9c
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/5a121f9c
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/5a121f9c
Branch: refs/heads/develop
Commit: 5a121f9c4562878d80f6882568c7ac2a3fece23a
Parents: 5275e02
Author: Josh Tynjala <jo...@gmail.com>
Authored: Thu Dec 15 17:10:22 2016 -0800
Committer: Josh Tynjala <jo...@gmail.com>
Committed: Fri Dec 16 15:25:39 2016 -0800
----------------------------------------------------------------------
.../internal/codegen/js/goog/JSGoogPublisher.java | 3 ++-
.../flex/compiler/utils/JSClosureCompilerWrapper.java | 12 +++++-------
2 files changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/5a121f9c/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogPublisher.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogPublisher.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogPublisher.java
index e2c28d5..33f2262 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogPublisher.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogPublisher.java
@@ -48,6 +48,7 @@ import com.google.javascript.jscomp.SourceFile;
import com.google.javascript.jscomp.SourceMap;
import com.google.javascript.jscomp.deps.DepsGenerator;
import com.google.javascript.jscomp.deps.DepsGenerator.InclusionStrategy;
+import com.google.javascript.jscomp.deps.ModuleLoader;
public class JSGoogPublisher extends JSPublisher implements IJSPublisher
{
@@ -123,7 +124,7 @@ public class JSGoogPublisher extends JSPublisher implements IJSPublisher
ErrorManager errorManager = new JSGoogErrorManager();
DepsGenerator depsGenerator = new DepsGenerator(deps, inputs,
InclusionStrategy.ALWAYS, closureGoogTgtLibDir.getCanonicalPath(),
- errorManager);
+ errorManager, ModuleLoader.EMPTY);
writeFile(depsTgtFile, depsGenerator.computeDependencyCalls(),false);
FileUtils.deleteQuietly(depsSrcFile);
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/5a121f9c/compiler-jx/src/main/java/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java b/compiler-jx/src/main/java/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
index 668194c..1757727 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
@@ -36,6 +36,7 @@ import com.google.javascript.jscomp.CompilerOptions.LanguageMode;
import com.google.javascript.jscomp.DependencyOptions;
import com.google.javascript.jscomp.DiagnosticGroups;
import com.google.javascript.jscomp.FlexJSDiagnosticGroups;
+import com.google.javascript.jscomp.ModuleIdentifier;
import com.google.javascript.jscomp.SourceFile;
import com.google.javascript.jscomp.SourceMap;
import com.google.javascript.jscomp.WarningLevel;
@@ -203,17 +204,15 @@ public class JSClosureCompilerWrapper
options_.setCrossModuleCodeMotion(true);
options_.setCoalesceVariableNames(true);
options_.setCrossModuleMethodMotion(true);
- options_.setInlineGetters(true);
+ options_.setInlineProperties(true);
options_.setInlineVariables(true);
options_.setSmartNameRemoval(true);
options_.setRemoveDeadCode(true);
- options_.setCheckMissingReturn(CheckLevel.WARNING);
options_.setExtractPrototypeMemberDeclarations(true);
options_.setRemoveUnusedPrototypeProperties(true);
options_.setRemoveUnusedPrototypePropertiesInExterns(false);
options_.setRemoveUnusedClassProperties(true);
- options_.setRemoveUnusedVars(true);
- options_.setRemoveUnusedLocalVars(true);
+ options_.setRemoveUnusedVariables(CompilerOptions.Reach.ALL);
options_.setCollapseVariableDeclarations(true);
options_.setCollapseAnonymousFunctions(true);
options_.setAliasAllStrings(true);
@@ -227,8 +226,8 @@ public class JSClosureCompilerWrapper
options_.setExportLocalPropertyDefinitions(true);
DependencyOptions dopts = new DependencyOptions();
- ArrayList<String> entryPoints = new ArrayList<String>();
- entryPoints.add(projectName);
+ ArrayList<ModuleIdentifier> entryPoints = new ArrayList<ModuleIdentifier>();
+ entryPoints.add(ModuleIdentifier.forClosure(projectName));
dopts.setDependencyPruning(true)
.setDependencySorting(true)
.setMoocherDropping(true)
@@ -276,7 +275,6 @@ public class JSClosureCompilerWrapper
options_.setWarningLevel(DiagnosticGroups.UNDEFINED_NAMES, CheckLevel.WARNING);
options_.setWarningLevel(DiagnosticGroups.UNDEFINED_VARIABLES, CheckLevel.WARNING);
options_.setWarningLevel(DiagnosticGroups.UNKNOWN_DEFINES, CheckLevel.WARNING);
- options_.setWarningLevel(DiagnosticGroups.UNNECESSARY_CASTS, CheckLevel.OFF); // OFF
options_.setWarningLevel(DiagnosticGroups.USE_OF_GOOG_BASE, CheckLevel.WARNING);
options_.setWarningLevel(DiagnosticGroups.VIOLATED_MODULE_DEP, CheckLevel.WARNING);