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
commit 67708534f9e841b61b0bde715bc7e4b446d20d87 Author: Alex Harui <[email protected]> AuthorDate: Wed Mar 14 09:32:34 2018 -0700 add theme swcs to definition set so ClassReferences to themes will work. Helps fix apache/royale-asjs#127 --- .../internal/codegen/mxml/royale/MXMLRoyalePublisher.java | 9 +++++++-- .../compiler/internal/projects/RoyaleProjectConfigurator.java | 10 ++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyalePublisher.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyalePublisher.java index 7b75e49..1c3e943 100644 --- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyalePublisher.java +++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyalePublisher.java @@ -192,6 +192,7 @@ public class MXMLRoyalePublisher extends JSGoogPublisher implements IJSPublisher // Iterate over all themes SWCs and add the contents of any included files in // an assets folder to an assets folder in the destination folder. final ISWCManager swcManager = project.getWorkspace().getSWCManager(); + List<ISWC> themeSWCs = new ArrayList<ISWC>(); List<IFileSpecification> themes = project.getThemeFiles(); for (final IFileSpecification themeFile : themes) { @@ -199,6 +200,7 @@ public class MXMLRoyalePublisher extends JSGoogPublisher implements IJSPublisher if ("swc".equalsIgnoreCase(extension)) { final ISWC swc = swcManager.get(new File(themeFile.getPath())); + themeSWCs.add(swc); Map<String, ISWCFileEntry> files = swc.getFiles(); for (String key : files.keySet()) { @@ -312,7 +314,10 @@ public class MXMLRoyalePublisher extends JSGoogPublisher implements IJSPublisher // Iterate over all swc dependencies and add all the externs they contain. // (Externs are located in a "externs" directory in the root of the SWC) List<ISWC> swcs = project.getLibraries(); - for (ISWC swc : swcs) + List<ISWC> allswcs = new ArrayList<ISWC>(); + allswcs.addAll(swcs); + allswcs.addAll(themeSWCs); + for (ISWC swc : allswcs) { Map<String, ISWCFileEntry> files = swc.getFiles(); for (String key : files.keySet()) @@ -342,7 +347,7 @@ public class MXMLRoyalePublisher extends JSGoogPublisher implements IJSPublisher // Add all files generated by the compiler to the compilation unit. ///////////////////////////////////////////////////////////////////////////////// - GoogDepsWriter gdw = getGoogDepsWriter(intermediateDir, projectName, googConfiguration, swcs); + GoogDepsWriter gdw = getGoogDepsWriter(intermediateDir, projectName, googConfiguration, allswcs); // This list contains all files generated by the compiler, this is both the // compiled js files created by the sources of the current project plus the // js files of used dependencies. diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProjectConfigurator.java b/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProjectConfigurator.java index d8ec777..31295fd 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProjectConfigurator.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProjectConfigurator.java @@ -398,6 +398,16 @@ public class RoyaleProjectConfigurator extends Configurator // add Library Path libraries.addAll(toFileList(project.getCompilerLibraryPath(configuration))); + + List<String> themes = configuration.getCompilerThemeFiles(); + for (String theme : themes) + { + if (theme.endsWith(".swc")) + { + File f = new File(theme); + libraries.add(f); + } + } project.setLibraries(new ArrayList<File>(libraries)); -- To stop receiving notification emails like this one, please contact [email protected].
