]> source.dussan.org Git - aspectj.git/commitdiff
Remove managing obsolete folder lib/asm
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Fri, 16 Apr 2021 05:22:46 +0000 (12:22 +0700)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Fri, 16 Apr 2021 06:19:45 +0000 (13:19 +0700)
The new string AjcTestCase.CLASSPATH_ASM_RENAMED dynamically determines
the 'asm-renamed' location from the classpath, system property
'java.class.path'.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
.gitignore
lib/pom.xml
org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java
pom.xml

index f279fa9bc3409efefe8ab1b5eeb3e36acd58bd3c..002bcb352f16e2be43824e9e24fe58cee640887c 100644 (file)
@@ -33,7 +33,6 @@ bin/
 
 # Downloaded libraries used during tests
 /lib/ant/
-/lib/asm/
 /lib/commons/
 /lib/docbook/
 /lib/jarjar/
index 7685058a1847f7e75367843eab143d6fbe5a7bfd..1e624c460ef4f950e58eaf75035c442d0167697c 100644 (file)
                   <destFileName>jdtcore-for-aspectj-src.zip</destFileName>
                 </artifactItem>
 
-                <artifactItem>
-                  <!-- Available from GitHub Packages (needs special repository declaration) -->
-                  <groupId>org.aspectj</groupId>
-                  <artifactId>asm-renamed</artifactId>
-                  <version>${asm.version}</version>
-                  <type>jar</type>
-                  <overWrite>false</overWrite>
-                  <outputDirectory>asm</outputDirectory>
-                  <destFileName>asm-${asm.version}.renamed.jar</destFileName>
-                </artifactItem>
-                <artifactItem>
-                  <!-- Available from GitHub Packages (needs special repository declaration) -->
-                  <groupId>org.aspectj</groupId>
-                  <artifactId>asm-renamed</artifactId>
-                  <version>${asm.version}</version>
-                  <type>java-source</type>
-                  <classifier>sources</classifier>
-                  <overWrite>false</overWrite>
-                  <outputDirectory>asm</outputDirectory>
-                  <destFileName>asm-${asm.version}.renamed-src.zip</destFileName>
-                </artifactItem>
                 <artifactItem>
                   <!-- Binary is identical to committed version in branch 'jdtcore-new' -->
                   <groupId>com.googlecode.jarjar</groupId>
                   <directory>.</directory>
                   <includes>
                     <include>ant/**</include>
-                    <include>asm/**</include>
                     <include>commons/**</include>
                     <include>docbook/**</include>
                     <include>jarjar/**</include>
   </build>
 
   <dependencies>
-    <dependency>
-      <groupId>org.aspectj</groupId>
-      <artifactId>asm-renamed</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.aspectj</groupId>
       <artifactId>org.eclipse.jdt.core</artifactId>
index c326c0a694bd02486caf58d4d2c2ca9aa606ed5d..e13f9e2243fa4ceeed499feaccba0c4a1abf8d32 100644 (file)
@@ -25,6 +25,7 @@ import java.lang.reflect.Method;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.StringTokenizer;
@@ -62,52 +63,33 @@ public abstract class AjcTestCase extends TestCase {
         */
        protected Ajc ajc;
 
+       public static final String CLASSPATH_ASM_RENAMED =
+               Arrays.stream(System.getProperty("java.class.path")
+                       .split(File.pathSeparator))
+                       .filter(path -> path.contains("asm-renamed"))
+                       .findFirst()
+                       .orElseThrow(() -> new RuntimeException("library 'asm-renamed' not found on classpath"));
+
        // see Ajc and AntSpec
        public static final String DEFAULT_CLASSPATH_ENTRIES =
                        Ajc.outputFolders("bridge","util","loadtime","weaver","asm","testing-client","runtime","org.aspectj.matcher")
-                       //                      File.pathSeparator + ".." + File.separator + "bridge" + File.separator
-                       //                      + "bin" + File.pathSeparator + ".." + File.separator + "util" + File.separator + "bin" + File.pathSeparator + ".."
-                       //                      + File.separator + "loadtime" + File.separator + "bin" + File.pathSeparator + ".." + File.separator + "weaver"
-                       //                      + File.separator + "bin" + File.pathSeparator + ".." + File.separator + "weaver5" + File.separator + "bin"
-                       //                      + File.pathSeparator + ".." + File.separator + "asm" + File.separator + "bin" + File.pathSeparator + ".."
-                       //                      + File.separator + "testing-client" + File.separator + "bin" + File.pathSeparator + ".." + File.separator + "runtime"
-                       //                      + File.separator + "bin" + File.pathSeparator + ".." + File.separator + "aspectj5rt" + File.separator + "bin"
-                       //                      + File.pathSeparator + ".." + File.separator + "org.aspectj.matcher" + File.separator + "bin"
-                       + File.pathSeparator
-                       + ".." + File.separator + "lib" + File.separator + "junit" + File.separator
-                       + "junit.jar"
-                       + File.pathSeparator
-                       + ".."
-                       + File.separator
-                       + "lib"
-                       + File.separator
-                       + "bcel"
-                       + File.separator
-                       + "bcel.jar"
-                       + File.pathSeparator
-                       + ".."
-                       + File.separator
-                       + "lib"
-                       + File.separator
-                       + "bcel"
-                       + File.separator
-                       + "bcel-verifier.jar"
-
-                       + File.pathSeparator + ".." +  File.separator + "lib" + File.separator + "asm" + File.separator + "asm-9.1.renamed.jar"
-
-                       // When the build machine executes the tests, it is using code built into jars rather than code build into
-                       // bin directories. This means for the necessary types to be found we have to put these jars on the classpath:
-                       + File.pathSeparator + ".." + File.separator + "aj-build" + File.separator + "jars" + File.separator + "bridge.jar"
-                       + File.pathSeparator + ".." + File.separator + "aj-build" + File.separator + "jars" + File.separator + "util.jar"
-                       + File.pathSeparator + ".." + File.separator + "aj-build" + File.separator + "jars" + File.separator
-                       + "org.aspectj.matcher.jar" + File.pathSeparator + ".." + File.separator + "aj-build" + File.separator + "jars"
-                       + File.separator + "loadtime.jar" + File.pathSeparator + ".." + File.separator + "aj-build" + File.separator + "jars"
-                       + File.separator + "weaver.jar" + File.pathSeparator + ".." + File.separator + "aj-build" + File.separator + "jars"
-                       + File.pathSeparator + ".." + File.separator + "aj-build" + File.separator + "jars"
-                       + File.separator + "asm.jar" + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "test"
-                       + File.separator + "testing-client.jar"
-                       // hmmm, this next one should perhaps point to an aj-build jar...
-                       + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "test" + File.separator + "aspectjrt.jar";
+                               + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "junit" + File.separator + "junit.jar"
+                               + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "bcel" + File.separator + "bcel.jar"
+                               + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "bcel" + File.separator + "bcel-verifier.jar"
+                               + File.pathSeparator + CLASSPATH_ASM_RENAMED
+                               // When the build machine executes the tests, it is using code built into jars rather than code build into
+                               // target/classes directories. This means for the necessary types to be found we have to put these jars on the classpath:
+                               + File.pathSeparator + ".." + File.separator + "aj-build" + File.separator + "jars" + File.separator + "bridge.jar"
+                               + File.pathSeparator + ".." + File.separator + "aj-build" + File.separator + "jars" + File.separator + "util.jar"
+                               + File.pathSeparator + ".." + File.separator + "aj-build" + File.separator + "jars" + File.separator + "org.aspectj.matcher.jar"
+                               + File.pathSeparator + ".." + File.separator + "aj-build" + File.separator + "jars" + File.separator + "loadtime.jar"
+                               + File.pathSeparator + ".." + File.separator + "aj-build" + File.separator + "jars" + File.separator + "weaver.jar"
+                               + File.pathSeparator + ".." + File.separator + "aj-build" + File.separator + "jars"
+                               + File.pathSeparator + ".." + File.separator + "aj-build" + File.separator + "jars" + File.separator + "asm.jar"
+                               + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "test" + File.separator + "testing-client.jar"
+                               // hmmm, this next one should perhaps point to an aj-build jar...
+                               + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "test" + File.separator + "aspectjrt.jar"
+                       ;
 
        /*
         * Save reference to real stderr and stdout before starting redirection
diff --git a/pom.xml b/pom.xml
index 5f958f35e55784c28d4a4141fceaff18a8b998a6..61f8d90adc86d244ae04ce53bcf80960d18a632e 100644 (file)
--- a/pom.xml
+++ b/pom.xml
                                                                        <files>
                                                                                <file>${lib.directory}/ant/bin/ant.bat</file>
                                                                                <file>${lib.directory}/ant/lib/junit.jar</file>
-                                                                               <file>${lib.directory}/asm/asm-${asm.version}.renamed.jar</file>
                                                                                <file>${lib.directory}/commons/commons.jar</file>
                                                                                <file>${lib.directory}/docbook/docbook-dtd/docbookx.dtd</file>
                                                                                <file>${lib.directory}/docbook/docbook-xsl/html/chunk.xsl</file>