You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/03/23 22:50:59 UTC

[royale-compiler] branch develop updated: only combine royale-swf in swf builds

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
     new 4f26c95  only combine royale-swf in swf builds
4f26c95 is described below

commit 4f26c958c81c171ee50cf8fc675c4d5d25234b11
Author: Alex Harui <ah...@apache.org>
AuthorDate: Fri Mar 23 15:50:49 2018 -0700

    only combine royale-swf in swf builds
---
 .../internal/driver/js/royale/JSCSSCompilationSession.java     |  4 ++--
 .../compiler/internal/css/codegen/CSSCompilationSession.java   | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/driver/js/royale/JSCSSCompilationSession.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/driver/js/royale/JSCSSCompilationSession.java
index 8d79948..0e0a637 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/driver/js/royale/JSCSSCompilationSession.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/driver/js/royale/JSCSSCompilationSession.java
@@ -53,7 +53,7 @@ public class JSCSSCompilationSession extends CSSCompilationSession
     
     public String getEncodedCSS()
     {
-        final ICSSDocument css = synthesisNormalizedCSS();
+        final ICSSDocument css = synthesisNormalizedCSS(false);
         StringBuilder sb = new StringBuilder();
         requires = new ArrayList<String>();
         encodeCSS(css, sb);
@@ -70,7 +70,7 @@ public class JSCSSCompilationSession extends CSSCompilationSession
     
     public String emitCSS()
     {
-        final ICSSDocument css = synthesisNormalizedCSS();
+        final ICSSDocument css = synthesisNormalizedCSS(false);
         StringBuilder sb = new StringBuilder();
         sb.append("/* Generated by Apache Royale Compiler */\n");
         walkCSS(css, sb);
diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/css/codegen/CSSCompilationSession.java b/compiler/src/main/java/org/apache/royale/compiler/internal/css/codegen/CSSCompilationSession.java
index 82747b1..cd81b8b 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/css/codegen/CSSCompilationSession.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/css/codegen/CSSCompilationSession.java
@@ -188,7 +188,7 @@ public class CSSCompilationSession
      * 
      * @return A synthesized CSS model from normalized CSS model.
      */
-    protected ICSSDocument synthesisNormalizedCSS()
+    protected ICSSDocument synthesisNormalizedCSS(boolean isSWF)
     {
         fontFaces = new ArrayList<CSSFontFace>();
         
@@ -201,7 +201,7 @@ public class CSSCompilationSession
             {
                 if (keepRule(newRule))
                 {
-                    addRuleToCodeGeneration(newRule);
+                    addRuleToCodeGeneration(newRule, isSWF);
                 }
             }
             for (final ICSSFontFace fontFace : cssDocument.getFontFaces())
@@ -230,10 +230,10 @@ public class CSSCompilationSession
      * 
      * @param newRule A CSS rule to be added to the synthesized CSS document.
      */
-    private void addRuleToCodeGeneration(final ICSSRule newRule)
+    private void addRuleToCodeGeneration(final ICSSRule newRule, boolean isSWF)
     {
     	ImmutableList<ICSSMediaQueryCondition> mq = newRule.getMediaQueryConditions();
-        if (mq.isEmpty() || (mq.size() == 1 && mq.get(0).getValue().toString().equals("-royale-swf")))
+        if (mq.isEmpty() || (isSWF && mq.size() == 1 && mq.get(0).getValue().toString().equals("-royale-swf")))
         {
             // Normalize the rule and clobber properties if the rule has no media query.
             final ImmutableList<CSSProperty> properties = ImmutableList.copyOf(
@@ -282,7 +282,7 @@ public class CSSCompilationSession
      */
     public ICSSCodeGenResult emitStyleDataClass(final IRoyaleProject project, final IABCVisitor abcVisitor) throws Exception
     {
-        final ICSSDocument css = synthesisNormalizedCSS();
+        final ICSSDocument css = synthesisNormalizedCSS(true);
         //LoggingProfiler.onSynthesisCSS(css);
         final CSSReducer reducer = new CSSReducer(project, css, abcVisitor, this, true, 0);
         final CSSEmitter emitter = new CSSEmitter(reducer);

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