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/flex-sdk.git

commit c5df8b78d7c85c4852c7ce0bbcb90a8b373634d3
Author: Josh Tynjala <[email protected]>
AuthorDate: Thu Apr 23 10:53:30 2026 -0700

    ApproveSDK.xml: don't require ANT_HOME environment variable, and download 
Apache Rat JARs to basedir when they're not found
    
    On both macOS and Linux, I've been forced to use sudo in a terminal to 
manually copy the Apache Rat JARs into env.ANT_HOME, so the approval script 
always fails when the JARs are missing. Instead, if the script doesn't find the 
Rat JARs, it should simply download them into ${basedir} instead of 
env.ANT_HOME. This will make it easier for PMCs to use the approval script.
    
    However, if ANT_HOME is configured, this path will still be searched for 
previously copied JAR files. This will allow PMCs to keep using the script the 
old way, if they're already set things up. I made sure that specifying ANT_HOME 
without the Rat JARs present won't fail either.
---
 ApproveSDK.xml | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/ApproveSDK.xml b/ApproveSDK.xml
index 58792a4934..9d06260e83 100644
--- a/ApproveSDK.xml
+++ b/ApproveSDK.xml
@@ -100,6 +100,12 @@
     <fail message="The FLASHPLAYER_DEBUGGER property is not set in environment 
or command-line."
         unless="FLASHPLAYER_DEBUGGER"/>
         
+    <available file="${basedir}/${apache.rat.jar}"
+        type="file"
+        property="apache.rat.found"/>
+    <available file="${basedir}/${apache.rat.tasks.jar}"
+        type="file"
+        property="apache.rat.tasks.found"/>
     <available file="${env.ANT_HOME}/lib/${apache.rat.jar}"
         type="file"
         property="apache.rat.found"/>
@@ -162,16 +168,23 @@
        
        <target name="install-rat" 
depends="install-rat.jar,install-rat.tasks.jar" />
     <target name="install-rat.jar" unless="apache.rat.found">
-        <get src="${apache.rat.url}/${apache.rat.jar}" 
dest="${env.ANT_HOME}/lib/${apache.rat.jar}" />
+        <get src="${apache.rat.url}/${apache.rat.jar}" 
dest="${basedir}/${apache.rat.jar}" />
     </target>
     <target name="install-rat.tasks.jar" unless="apache.rat.tasks.found">
-        <get src="${apache.rat.tasks.url}/${apache.rat.tasks.jar}" 
dest="${env.ANT_HOME}/lib/${apache.rat.tasks.jar}" />
+        <get src="${apache.rat.tasks.url}/${apache.rat.tasks.jar}" 
dest="${basedir}/${apache.rat.tasks.jar}" />
     </target>
        
     <target name="rat-taskdef" description="Rat taskdef">
-        <typedef resource="org/apache/rat/anttasks/antlib.xml"
-        uri="antlib:org.apache.rat.anttasks"
-        classpathref="anttask.classpath"/>
+        <taskdef
+            uri="antlib:org.apache.rat.anttasks"
+            resource="org/apache/rat/anttasks/antlib.xml">
+            <classpath>
+                <pathelement location="${basedir}/${apache.rat.jar}"/>
+                <pathelement location="${basedir}/${apache.rat.tasks.jar}"/>
+                <pathelement location="${env.ANT_HOME}/lib/${apache.rat.jar}"/>
+                <pathelement 
location="${env.ANT_HOME}/lib/${apache.rat.tasks.jar}"/>
+            </classpath>
+        </taskdef>
     </target>
 
     <target name="echo-mode" depends="echo-rc, echo-nightly" />

Reply via email to