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 9fd223b41 ApproveBuildTools.xml: don't require ANT_HOME environment 
variable, and download Apache Rat JARs to basedir when they're not found
9fd223b41 is described below

commit 9fd223b41d542c3b180bbd548ed919af054cffc5
Author: Josh Tynjala <[email protected]>
AuthorDate: Mon Apr 13 09:14:13 2026 -0700

    ApproveBuildTools.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.
    
    Also, added description to main-no-download.
---
 compiler-build-tools/ApproveBuildTools.xml | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/compiler-build-tools/ApproveBuildTools.xml 
b/compiler-build-tools/ApproveBuildTools.xml
index f4fe2aaa7..706861943 100644
--- a/compiler-build-tools/ApproveBuildTools.xml
+++ b/compiler-build-tools/ApproveBuildTools.xml
@@ -79,6 +79,12 @@
                <isset property="download.cache.dir" /> 
        </condition>
                
+    <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"/>
@@ -128,22 +134,29 @@
        
        <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="main" 
depends="write-out-jars-list,install-rat,download,check-sigs,uncompress,rat-check,examine-jars,check-notices,build,approve"
 description="Perform required release approval steps">
     </target>
     
-    <target name="main-no-download" 
depends="write-out-jars-list,install-rat,check-sigs,uncompress,rat-check,examine-jars,check-notices,build,approve"
 description="Perform required release approval steps">
+    <target name="main-no-download" 
depends="write-out-jars-list,install-rat,check-sigs,uncompress,rat-check,examine-jars,check-notices,build,approve"
 description="Perform required release approval steps without downloading 
release distribution (archive and signatures must already exist in same 
directory)">
     </target>
        
     <target name="test" >
@@ -250,7 +263,7 @@
                 dest="${basedir}/${bin.package.url.name}"/>-->
     </target>
 
-    <target name="rat-check" >
+    <target name="rat-check" depends="rat-taskdef">
 
         <echo message="Checking files at ${basedir}/${src.package.url.name}, 
report is ${src.rat.report}"/>
 
@@ -326,7 +339,7 @@
         -->
     </target>
 
-    <target name="binary-rat" >
+    <target name="binary-rat" depends="rat-taskdef">
         <echo>${jars-list}</echo>
         <rat:report xmlns:rat="antlib:org.apache.rat.anttasks"
             reportFile="${bin.rat.report}">

Reply via email to