You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2026/08/11 16:37:15 UTC

(royale-compiler) branch develop updated: RoyaleJSTarget: add includes, include-resource-bundles and include-libraries to rooted compilation units, similar to RoyaleAppSWFTarget

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

joshtynjala 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 69784e981 RoyaleJSTarget: add includes, include-resource-bundles and include-libraries to rooted compilation units, similar to RoyaleAppSWFTarget
69784e981 is described below

commit 69784e981fa5aa2903cd34e7bd8723a68675ed47
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Tue Aug 11 09:33:30 2026 -0700

    RoyaleJSTarget: add includes, include-resource-bundles and include-libraries to rooted compilation units, similar to RoyaleAppSWFTarget
    
    This ensures that all dependencies are included too.
---
 .../compiler/internal/targets/RoyaleJSTarget.java  | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/targets/RoyaleJSTarget.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/targets/RoyaleJSTarget.java
index 32008025e..73a0a5e75 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/targets/RoyaleJSTarget.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/targets/RoyaleJSTarget.java
@@ -20,6 +20,7 @@
 package org.apache.royale.compiler.internal.targets;
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -259,6 +260,31 @@ public class RoyaleJSTarget extends JSTarget implements IJSTarget
         return super.findAllCompilationUnitsToLink(compilationUnits, problems);
     }
 
+    @Override
+    protected RootedCompilationUnits computeRootedCompilationUnits()
+            throws InterruptedException
+    {
+        final Set<ICompilationUnit> rootCompilationUnits = new HashSet<ICompilationUnit>();
+        final ArrayList<ICompilerProblem> problems = new ArrayList<ICompilerProblem>();
+        if (mainCU != null)
+        {
+            rootCompilationUnits.add(mainCU);
+        }
+
+        // -includes
+        rootCompilationUnits.addAll(getIncludesCompilationUnits());
+
+        // -include-libraries
+        rootCompilationUnits.addAll(getIncludeLibrariesCompilationUnits());
+
+        // -include-resource-bundles
+        rootCompilationUnits.addAll(getIncludedResourceBundlesCompilationUnits(problems));
+
+        return new Target.RootedCompilationUnits(
+                rootCompilationUnits,
+                problems);
+    }
+
     /**
      * Collect CSS from themes.
      */