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 a6a7f83a9 royaleunit-ant-tasks: prefer AIR_HOME over ROYALE_HOME, if 
available, to find adl and adt executables
a6a7f83a9 is described below

commit a6a7f83a9f30d7affabb3f7b46cab5faf9e6b978
Author: Josh Tynjala <[email protected]>
AuthorDate: Mon Feb 2 14:41:56 2026 -0800

    royaleunit-ant-tasks: prefer AIR_HOME over ROYALE_HOME, if available, to 
find adl and adt executables
---
 .../ant/launcher/commands/player/AdlCommand.java   | 47 +++++++++++++++++++++-
 1 file changed, 45 insertions(+), 2 deletions(-)

diff --git 
a/royaleunit-ant-tasks/src/main/java/org/apache/royale/test/ant/launcher/commands/player/AdlCommand.java
 
b/royaleunit-ant-tasks/src/main/java/org/apache/royale/test/ant/launcher/commands/player/AdlCommand.java
index 734327feb..ccc6d191d 100644
--- 
a/royaleunit-ant-tasks/src/main/java/org/apache/royale/test/ant/launcher/commands/player/AdlCommand.java
+++ 
b/royaleunit-ant-tasks/src/main/java/org/apache/royale/test/ant/launcher/commands/player/AdlCommand.java
@@ -95,11 +95,31 @@ public class AdlCommand extends DefaultPlayerCommand
     {
         String outputProperty = "AIR_VERSION";
 
+        File adtJarFile = null;
+        String airHomePath = getProject().getProperty("AIR_HOME");
+        if (airHomePath != null)
+        {
+            File airHome = new File(airHomePath);
+            if (airHome.exists() && airHome.isDirectory())
+            {
+                adtJarFile = new File(airHome, ADT_JAR_PATH);
+            }
+        }
+        if (adtJarFile == null || !adtJarFile.exists())
+        {
+            String royaleHomePath = getProject().getProperty("ROYALE_HOME");
+            if (royaleHomePath != null)
+            {
+                File royaleHome = new File(royaleHomePath);
+                adtJarFile = new File(royaleHome, ADT_JAR_PATH);
+            }
+        }
+
         //Execute mxmlc to find SDK version number
         Java task = new Java();
         task.setFork(true);
         task.setFailonerror(true);
-        task.setJar(new File(getProject().getProperty("ROYALE_HOME") + 
File.separatorChar + ADT_JAR_PATH));
+        task.setJar(adtJarFile);
         task.setProject(getProject());
         task.setDir(getProject().getBaseDir());
         task.setOutputproperty(outputProperty);
@@ -148,7 +168,30 @@ public class AdlCommand extends DefaultPlayerCommand
 
     private String generateExecutable()
     {
-        return getProject().getProperty("ROYALE_HOME") + "/bin/" + 
getDefaults().getAdlCommand();
+        File adlJarFile = null;
+        String airHomePath = getProject().getProperty("AIR_HOME");
+        if (airHomePath != null)
+        {
+            File airHome = new File(airHomePath);
+            if (airHome.exists() && airHome.isDirectory())
+            {
+                adlJarFile = new File(airHome, "/bin/" + 
getDefaults().getAdlCommand());
+            }
+        }
+        if (adlJarFile == null || !adlJarFile.exists())
+        {
+            String royaleHomePath = getProject().getProperty("ROYALE_HOME");
+            if (royaleHomePath != null)
+            {
+                File royaleHome = new File(royaleHomePath);
+                adlJarFile = new File(royaleHome, "/bin/" + 
getDefaults().getAdlCommand());
+            }
+        }
+        if (adlJarFile == null)
+        {
+            return null;
+        }
+        return adlJarFile.getAbsolutePath();
     }
 
     public File getPrecompiledAppDescriptor()

Reply via email to