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 d22b10d08 externc: create all directories for generated .as files 
beforehand
d22b10d08 is described below

commit d22b10d088edfcff3488ddebb464c406d7adce4e
Author: Josh Tynjala <[email protected]>
AuthorDate: Thu Jan 15 13:30:45 2026 -0800

    externc: create all directories for generated .as files beforehand
    
    In particular, duplicates needs to be created because on case-sensitive 
file systems, there may end up being no duplicates, like there would be on 
case-insensitive file systems. In royale-typedefs, node creates Buffer.as and 
buffer.as. On Linux, they both go into classes. On Windows and macOS, one goes 
into classes, and one duplicates. The configuration for the SWC compiler 
expects duplicates to exist because it needs to on Windows and macOS, but it 
didn't on Linux, breaking the SWC build.
    
    I could have created duplicates only, but it felt weird to single that one 
out, so I created them all. Some may be empty, but that shouldn't break 
anything.
---
 .../codegen/typedefs/emit/ReferenceEmitter.java        | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git 
a/compiler-externc/src/main/java/org/apache/royale/compiler/internal/codegen/typedefs/emit/ReferenceEmitter.java
 
b/compiler-externc/src/main/java/org/apache/royale/compiler/internal/codegen/typedefs/emit/ReferenceEmitter.java
index ed493f2aa..3481bc50b 100644
--- 
a/compiler-externc/src/main/java/org/apache/royale/compiler/internal/codegen/typedefs/emit/ReferenceEmitter.java
+++ 
b/compiler-externc/src/main/java/org/apache/royale/compiler/internal/codegen/typedefs/emit/ReferenceEmitter.java
@@ -46,6 +46,24 @@ public class ReferenceEmitter
         final File asRoot = model.getConfiguration().getAsRoot();
         if (!asRoot.exists())
             asRoot.mkdirs();
+        final File asClassRoot = model.getConfiguration().getAsClassRoot();
+        if (!asClassRoot.exists())
+            asClassRoot.mkdirs();
+        final File asInterfaceRoot = 
model.getConfiguration().getAsInterfaceRoot();
+        if (!asInterfaceRoot.exists())
+            asInterfaceRoot.mkdirs();
+        final File asTypeDefRoot = model.getConfiguration().getAsTypeDefRoot();
+        if (!asTypeDefRoot.exists())
+            asTypeDefRoot.mkdirs();
+        final File asFunctionRoot = 
model.getConfiguration().getAsFunctionRoot();
+        if (!asFunctionRoot.exists())
+            asFunctionRoot.mkdirs();
+        final File asConstantRoot = 
model.getConfiguration().getAsConstantRoot();
+        if (!asConstantRoot.exists())
+            asConstantRoot.mkdirs();
+        final File asDuplicatesRoot = 
model.getConfiguration().getAsDuplicatesRoot();
+        if (!asDuplicatesRoot.exists())
+            asDuplicatesRoot.mkdirs();
 
         emitClasses();
         emitInterfaces();

Reply via email to