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/02/26 07:02:16 UTC

[royale-compiler] 01/04: add other CSS files found in SWCs

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

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

commit f0042b0e4fb6f23e038b5d2a9e0be42662b8e2cc
Author: Alex Harui <ah...@apache.org>
AuthorDate: Sun Feb 18 21:56:16 2018 -0800

    add other CSS files found in SWCs
---
 .../royale/compiler/internal/css/CSSManager.java     | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSManager.java b/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSManager.java
index a454e19..3b13a88 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSManager.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSManager.java
@@ -25,6 +25,7 @@ import java.io.File;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
+import java.util.Map;
 import java.util.Set;
 
 import org.apache.commons.io.FilenameUtils;
@@ -46,6 +47,7 @@ import org.apache.royale.compiler.problems.CSSUnresolvedClassReferenceProblem;
 import org.apache.royale.compiler.problems.ICompilerProblem;
 import org.apache.royale.compiler.units.ICompilationUnit;
 import org.apache.royale.swc.ISWC;
+import org.apache.royale.swc.ISWCFileEntry;
 import org.apache.royale.swc.ISWCManager;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
@@ -258,6 +260,24 @@ public class CSSManager implements ICSSManager
                 // Ignore theme file without a defaults CSS.
                 if (css != null && css != CSSDocumentCache.EMPTY_CSS_DOCUMENT)
                     builder.add(css);
+                
+                if ("swc".equalsIgnoreCase(extension))
+                {
+                    final ISWC swc = swcManager.get(new File(themeFile.getPath()));
+                    // add other css files.
+                    Map<String, ISWCFileEntry> files = swc.getFiles();
+                    Set<String> fileNames = files.keySet();
+                    for (String fileName : fileNames)
+                    {
+                    	String suffix = FilenameUtils.getExtension(fileName);
+                    	if ("css".equalsIgnoreCase(suffix) && !fileName.contains("default"))
+                    	{
+                            final CacheStoreKeyBase key = CSSDocumentCache.createKey(swc, fileName);
+                            final ICSSDocument extracss = cssCache.get(key);
+                            builder.add(extracss);
+                    	}
+                    }
+                }
             }
             catch (CSSDocumentCache.ProblemParsingCSSRuntimeException cssError)
             {

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