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 9c1556260 royaleunit-ant-tasks: parse Adobe AIR version including both
major and minor
9c1556260 is described below
commit 9c1556260f6b33ecf5ad551a8713cb24de2a090a
Author: Josh Tynjala <[email protected]>
AuthorDate: Thu Feb 19 16:11:13 2026 -0800
royaleunit-ant-tasks: parse Adobe AIR version including both major and minor
When the version number went into the double-digits, the minor part started
getting ignored. This wasn't a huge issue because the minor part was usually 0.
However, Harman started using minor versions again, like 33.1 and 51.2.
---
.../ant/launcher/commands/player/AdlCommand.java | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 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 ccc6d191d..269165b1e 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
@@ -136,21 +136,33 @@ public class AdlCommand extends DefaultPlayerCommand
private double parseAdtVersionNumber( String versionString )
{
- double version;
+ double version;
//AIR 2.6 and greater only returns the version number.
if( versionString.startsWith("adt") )
{
- //Parse version number and return as int
+ //Parse version number and return as int
int prefixIndex = versionString.indexOf("adt version \"");
version = Double.parseDouble(versionString.substring(prefixIndex +
13, prefixIndex + 16));
- }else
+ }
+ else
{
- version = Double.parseDouble(versionString.substring(0, 3) );
+ // the version number typically contains four parts, but we need
+ // the first two only.
+ int endIndex = versionString.indexOf(".");
+ endIndex = versionString.indexOf(".", endIndex + 1);
+ if (endIndex == -1)
+ {
+ // this shouldn't happen, but if some specific version of adt
+ // reports a version number with two parts only, we'll fall
back
+ // to the original behavior that parses exactly three
characters
+ endIndex = 3;
+ }
+ version = Double.parseDouble(versionString.substring(0, endIndex));
}
- return version;
+ return version;
}
@Override