royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pio...@apache.org
Subject [royale-compiler] 01/01: Get JS compiler to report error or warning (reference #21)
Date Wed, 07 Feb 2018 08:32:35 GMT
This is an automated email from the ASF dual-hosted git repository.

piotrz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit 14c151cd5f58e03e46be95e6d320e03a04076250
Author: Alex Harui <aharui@apache.org>
AuthorDate: Tue Feb 6 23:29:21 2018 -0800

    Get JS compiler to report error or warning (reference #21)
---
 .../apache/royale/compiler/clients/MXMLJSC.java    | 23 +++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSC.java b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSC.java
index c09d37b..d527469 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSC.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSC.java
@@ -34,6 +34,7 @@ import java.util.Set;
 import java.util.TreeSet;
 
 import org.apache.commons.io.FilenameUtils;
+import org.apache.royale.compiler.clients.problems.CompilerProblemCategorizer;
 import org.apache.royale.compiler.clients.problems.ProblemPrinter;
 import org.apache.royale.compiler.clients.problems.ProblemQuery;
 import org.apache.royale.compiler.clients.problems.ProblemQueryProvider;
@@ -44,6 +45,7 @@ import org.apache.royale.compiler.common.VersionInfo;
 import org.apache.royale.compiler.config.Configuration;
 import org.apache.royale.compiler.config.ConfigurationBuffer;
 import org.apache.royale.compiler.config.Configurator;
+import org.apache.royale.compiler.config.ICompilerProblemSettings;
 import org.apache.royale.compiler.config.ICompilerSettingsConstants;
 import org.apache.royale.compiler.driver.js.IJSApplication;
 import org.apache.royale.compiler.exceptions.ConfigurationException;
@@ -289,7 +291,7 @@ public class MXMLJSC implements JSCompilerEntryPoint, ProblemQueryProvider,
                 if (printProblems)
                 {
                     final WorkspaceProblemFormatter formatter = new WorkspaceProblemFormatter(
-                            workspace);
+                            workspace, createProblemCategorizer());
                     final ProblemPrinter printer = new ProblemPrinter(formatter);
                     printer.printProblems(problems);
                 }
@@ -984,4 +986,23 @@ public class MXMLJSC implements JSCompilerEntryPoint, ProblemQueryProvider,
                code == ExitCode.FAILED_WITH_CONFIG_PROBLEMS.getCode();
     }
 
+    /**
+     * Set up any user defines customization of the problem severities.
+     * 
+     */
+    private CompilerProblemCategorizer createProblemCategorizer()
+    {
+        ICompilerProblemSettings problemSettings = null;
+        try
+        {
+            problemSettings = projectConfigurator.getCompilerProblemSettings();
+        }
+        catch (Exception e)
+        {
+            // Create a categorizer that will only use default settings.
+        }
+
+        return new CompilerProblemCategorizer(problemSettings);
+    }
+
 }

-- 
To stop receiving notification emails like this one, please contact
piotrz@apache.org.

Mime
View raw message