aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2020-08-14 13:59:47 -0700
committerGitHub <noreply@github.com>2020-08-14 13:59:47 -0700
commitdbbbac8dbd25a19c56568623b823eba4e6e2906a (patch)
treedf2853082067298bb43fae04ce5288d85328eb41
parentb0b2f50a27499227580852496964e037e9204f22 (diff)
parent6a9b1b729373d774423f45d179cb01b40812898d (diff)
downloadaspectj-dbbbac8dbd25a19c56568623b823eba4e6e2906a.tar.gz
aspectj-dbbbac8dbd25a19c56568623b823eba4e6e2906a.zip
Merge pull request #4 from larsgrefer/feature/github-actions
Fix and improve the CI Jobs
-rw-r--r--.github/workflows/maven.yml5
-rw-r--r--ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java73
-rw-r--r--ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java20
-rw-r--r--loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java2
4 files changed, 9 insertions, 91 deletions
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 9aae7dbf9..ab26f1db3 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -14,13 +14,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
+ fail-fast: false
matrix:
- java: [ 1.8, 11 ]
+ java: [ 8, 9, 10, 11, 12, 13, 14 ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
+ - run: java -version
+ - run: mvn --version
- name: Build with Maven
run: mvn -Dorg.aspectj.tools.ajc.Ajc.verbose=false -B package --file pom.xml
diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java
index 64e53eead..adf22bf12 100644
--- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java
+++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java
@@ -14,8 +14,6 @@
package org.aspectj.tools.ajdoc;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.util.List;
import java.util.Vector;
@@ -30,77 +28,6 @@ import javax.tools.ToolProvider;
*/
class JavadocRunner {
- static boolean has14ToolsAvailable() {
- try {
- Class jdMainClass = com.sun.tools.javadoc.Main.class;
- Class[] paramTypes = new Class[] { String[].class };
- jdMainClass.getMethod("execute", paramTypes);
- } catch (NoClassDefFoundError e) {
- return false;
- } catch (UnsupportedClassVersionError e) {
- return false;
- } catch (NoSuchMethodException e) {
- return false;
- }
- return true;
- }
-
- static void callJavadoc(String[] javadocargs) {
- // final SecurityManager defaultSecurityManager = System.getSecurityManager();
- //
- // System.setSecurityManager( new SecurityManager() {
- // public void checkExit(int status) {
- // if (status == 0) {
- // throw new SecurityException();
- // }
- // else {
- // System.setSecurityManager(defaultSecurityManager);
- // //System.out.println("Error: javadoc exited unexpectedly");
- // System.exit(0);
- // throw new SecurityException();
- // }
- // }
- // public void checkPermission( java.security.Permission permission ) {
- // if ( defaultSecurityManager != null )
- // defaultSecurityManager.checkPermission( permission );
- // }
- // public void checkPermission( java.security.Permission permission,
- // Object context ) {
- // if ( defaultSecurityManager != null )
- // defaultSecurityManager.checkPermission( permission, context );
- // }
- // } );
-
- try {
- // for JDK 1.4 and above call the execute method...
- Class jdMainClass = com.sun.tools.javadoc.Main.class;
- Method executeMethod = null;
- try {
- Class[] paramTypes = new Class[] { String[].class };
- executeMethod = jdMainClass.getMethod("execute", paramTypes);
- } catch (NoSuchMethodException e) {
- com.sun.tools.javadoc.Main.main(javadocargs);
- // throw new UnsupportedOperationException("ajdoc requires a tools library from JDK 1.4 or later.");
- }
- try {
- executeMethod.invoke(null, new Object[] { javadocargs });
- } catch (IllegalArgumentException e1) {
- throw new RuntimeException("Failed to invoke javadoc");
- } catch (IllegalAccessException e1) {
- throw new RuntimeException("Failed to invoke javadoc");
- } catch (InvocationTargetException e1) {
- throw new RuntimeException("Failed to invoke javadoc");
- }
- // main method is documented as calling System.exit() - which stops us dead in our tracks
- // com.sun.tools.javadoc.Main.main( javadocargs );
- } catch (SecurityException se) {
- // Do nothing since we expect it to be thrown
- // System.out.println( ">> se: " + se.getMessage() );
- }
- // Set the security manager back
- // System.setSecurityManager(defaultSecurityManager);
- }
-
public static void callJavadocViaToolProvider(Vector<String> options, List<String> files) {
DocumentationTool doctool = ToolProvider.getSystemDocumentationTool();
StandardJavaFileManager fm = doctool.getStandardFileManager(null, null, null);
diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java
index 2b2a24a26..26857b41c 100644
--- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java
+++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java
@@ -35,7 +35,6 @@ import org.aspectj.asm.AsmManager;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.Version;
import org.aspectj.util.FileUtil;
-import org.aspectj.util.LangUtil;
/**
* This is an old implementation of ajdoc that does not use an OO style. However, it does the job, and should serve to evolve a
@@ -104,11 +103,6 @@ public class Main implements Config {
public static void main(String[] args) {
clearState();
- if (!JavadocRunner.has14ToolsAvailable()) {
- System.err.println("ajdoc requires a JDK 1.4 or later tools jar - exiting");
- aborted = true;
- return;
- }
// STEP 1: parse the command line and do other global setup
sourcepath.addElement("."); // add the current directory to the classapth
@@ -267,11 +261,9 @@ public class Main implements Config {
for (int k = 0; k < fileList.size(); k++) {
javadocargs[numExtraArgs + options.size() + packageList.size() + k] = fileList.elementAt(k);
}
- if (LangUtil.is19VMOrGreater()) {
- options = new Vector<>();
- for (String a: javadocargs) {
- options.add(a);
- }
+ options = new Vector<>();
+ for (String a: javadocargs) {
+ options.add(a);
}
} else {
javadocargs = new String[options.size() + signatureFiles.length];
@@ -285,11 +277,7 @@ public class Main implements Config {
files.add(StructureUtil.translateAjPathName(signatureFile.getCanonicalPath()));
}
}
- if (LangUtil.is19VMOrGreater()) {
- JavadocRunner.callJavadocViaToolProvider(options, files);
- } else {
- JavadocRunner.callJavadoc(javadocargs);
- }
+ JavadocRunner.callJavadocViaToolProvider(options, files);
}
/**
diff --git a/loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java b/loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java
index cd5590914..125a9e95c 100644
--- a/loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java
+++ b/loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java
@@ -54,7 +54,7 @@ public class JRockitAgentTest extends TestCase {
}
public void testJrockitRecursionProtection() {
- if (LangUtil.is11VMOrGreater()) {
+ if (LangUtil.is19VMOrGreater()) {
// Skip test, not castable to URLClassLoader
return;
}