<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<packaging>jar</packaging>
- <version>1.9.0.BETA-7</version>
+ <version>1.9.0.RC4</version>
<name>AspectJ runtime</name>
<description>The runtime needed to execute a program using AspectJ</description>
<url>http://www.aspectj.org</url>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<packaging>jar</packaging>
- <version>1.9.0.BETA-7</version>
+ <version>1.9.0.RC4</version>
<name>AspectJ tools</name>
<description>Tools from the AspectJ project</description>
<url>http://www.aspectj.org</url>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<packaging>jar</packaging>
- <version>1.9.0.BETA-7</version>
+ <version>1.9.0.RC4</version>
<name>AspectJ weaver</name>
<description>The AspectJ weaver introduces advices to java classes</description>
<url>http://www.aspectj.org</url>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html> <head>
-<title>AspectJ 1.9.0.RC3 Readme</title>
+<title>AspectJ 1.9.0.RC4 Readme</title>
<style type="text/css">
<!--
P { margin-left: 20px; }
© Copyright 2018 Contributors.
All rights reserved.
</small></div>
-<h1>AspectJ 1.9.0.RC3 Readme</h1>
+<p>The full list of resolved issues in 1.9.0 is available
+<a href="https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&f0=OP&f1=OP&f3=CP&f4=CP&j1=OR&list_id=16866879&product=AspectJ&query_format=advanced&target_milestone=1.9.0">here</a></h2>.</p>
+
+<h1>AspectJ 1.9.0.RC4</h1>
+
+<p>Primary changes in RC4 are to add support for <compilerArg> in the Ant task. This enables users of the Ant task to
+pass in options supported by the underlying AspectJ but not yet surfaced elsewhere. Particularly useful with Java9 which includes
+a number of module related commands. For example, here is an iajc usage with compilerArg that is passing <tt>--add-modules java.xml.bind</tt>:
+
+<pre><code>
+ <iajc destdir="bin" failonerror="true"
+ showWeaveInfo="true" source="1.9" target="1.9"
+ debug="true" fork="true" maxmem="256m">
+ <compilerArg value="--add-modules"/>
+ <compilerArg value="java.xml.bind"/>
+ <src path="src" />
+ <classpath>
+ <pathelement location="${aspectj.home}/lib/aspectjrt.jar"/>
+ </classpath>
+ </iajc>
+</code></pre>
+
+<li>1.9.0.RC4 available 21-Feb-2018</li>
+
+<h1>AspectJ 1.9.0.RC3</h1>
<p>Primary changes in RC3 are to upgrade JDT and pickup all the fixes for Java9 that have gone into it over the last few months.</p>
<li>1.9.0.RC3 available 5-Feb-2018</li>
-<h1>AspectJ 1.9.0.RC2 Readme</h1>
+<h1>AspectJ 1.9.0.RC2</h1>
-<p>The full list of resolved issues in 1.9.0 is available
-<a href="https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&f0=OP&f1=OP&f3=CP&f4=CP&j1=OR&list_id=16866879&product=AspectJ&query_format=advanced&target_milestone=1.9.0">here</a></h2>.</p>
<ul>
<li>1.9.0.RC2 available 9-Nov-2017
</ul>
-<h3>1.9.0.RC2 changes</h3>
-
<p>Key change in 1.9.0.RC2 is actually to be more tolerant of JDK10. The version handling has been somewhat overhauled so AspectJ 9 will
behave better on Java 10 and future JDKs. This should put AspectJ in a better place if new JDK versions are going
to arrive thick and fast.
+<h1>AspectJ 1.9.0.RC1</h1>
<ul>
+
<li>1.9.0.RC1 available 20-Oct-2017
</ul>
-<h3>1.9.0.RC1 changes</h3>
-
<p>This is the first release candidate of AspectJ 1.9.0 - the version of AspectJ to be based on Java9. It includes
a recent version of the Eclipse Java9 compiler (from jdt core, commit #062ac5d7a6bf9).</p>
e.printStackTrace();
}
return lastRunResult;
+ } else if (vmargs!=null && (vmargs.contains("--add-modules") || vmargs.contains("--limit-modules") || vmargs.contains("--add-reads"))) {
+ // If --add-modules supplied, need to fork the test
+ try {
+// if (mp.indexOf("$runtime") != -1) {
+// mp = mp.replace(mp.indexOf("$runtime"),"$runtime".length(),TestUtil.aspectjrtPath().toString());
+// }
+ if (cp.indexOf("aspectjrt")==-1) {
+ cp.append(File.pathSeparator).append(TestUtil.aspectjrtPath().getPath());
+ }
+ String command = LangUtil.getJavaExecutable().getAbsolutePath() + " " +vmargs+ (cp.length()==0?"":" -classpath " + cp) + " " + className ;
+ System.out.println("Command is "+command);
+ // Command is executed using ProcessBuilder to allow setting CWD for ajc sandbox compliance
+ ProcessBuilder pb = new ProcessBuilder(tokenizeCommand(command));
+ pb.directory( new File(ajc.getSandboxDirectory().getAbsolutePath()));
+ exec = pb.start();
+ BufferedReader stdInput = new BufferedReader(new InputStreamReader(exec.getInputStream()));
+ BufferedReader stdError = new BufferedReader(new InputStreamReader(exec.getErrorStream()));
+ exec.waitFor();
+ lastRunResult = createResultFromBufferReaders(command,stdInput, stdError);
+ } catch (Exception e) {
+ System.out.println("Error executing module test: " + e);
+ e.printStackTrace();
+ }
+ return lastRunResult;
} else {
cp.append(DEFAULT_CLASSPATH_ENTRIES);
URL[] urls = getURLs(cp.toString());
--- /dev/null
+import javax.xml.transform.TransformerFactory;\r
+import javax.xml.bind.JAXBContext;\r
+import javax.xml.parsers.DocumentBuilderFactory;\r
+\r
+import org.w3c.dom.Document;\r
+\r
+aspect Azpect {\r
+ before(JAXBContext x): execution(* m(JAXBContext)) && args(x) {\r
+ System.out.println(x);\r
+ }\r
+}\r
JAXBContext context;\r
}\r
\r
+ public void m(JAXBContext jc) {\r
+ }\r
+\r
+ public static void main(String[] argv) {\r
+ System.out.println("UsesJAXB.running...");\r
+ new UsesJAXB().m(null);\r
+ }\r
}\r
public void testWeaveModule() throws Exception {
runTest("weave module");
}
-
- public void testUsesJaxb() {
- runTest("java use of java.xml.bind");
- }
// ---
/**
* Building and weaving with modules in the picture.
*
+ * Module options from http://openjdk.java.net/jeps/261
+ *
* @author Andy Clement
*
*/
// runTest("module path vs classpath 2");
// }
+ // --add-modules
+
// This tests that when using --add-modules with one of the JDK modules (in the jmods subfolder of the JDK)
// that it can be found without needing to set --module-path (this seems to be implicitly included by javac too)
public void testAddModules1() {
- runTest("java use of java.xml.bind");
+ runTest("compile use of java.xml.bind");
+ }
+
+ // This tests that we can use add-modules to pull in something from the JDK jmods package and that
+ // when subsequently weaving we can see types from those modules
+ public void testWovenAfterAddModules() {
+ runTest("weave use of java.xml.bind");
+ }
+
+ // --limit-modules
+ public void testLimitModules1() {
+ runTest("limit modules 1");
+ }
+
+ // --add-reads
+ public void testAddReads1() {
+ runTest("add reads 1");
}
+
+
+ // ---
/* For the specified class, check that each method has a stackmap attribute */
private void checkStackMapExistence(String classname, String toIgnore) throws ClassNotFoundException {
-->
</ajc-test>
- <ajc-test dir="bugs190/modules/iii" title="java use of java.xml.bind">
+ <ajc-test dir="bugs190/modules/iii" title="compile use of java.xml.bind">
<compile files="UsesJAXB.java" options="--add-modules java.xml.bind -1.9"/>
+ <run class="UsesJAXB" vmargs="--add-modules java.xml.bind">
+ <stdout>
+ <line text="UsesJAXB.running..."/>
+ </stdout>
+ </run>
</ajc-test>
+ <ajc-test dir="bugs190/modules/iii" title="weave use of java.xml.bind">
+ <compile files="UsesJAXB.java Azpect.java" options="--add-modules java.xml.bind -1.9"/>
+ <run class="UsesJAXB" vmargs="--add-modules java.xml.bind">
+ <stdout>
+ <line text="UsesJAXB.running..."/>
+ <line text="null"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs190/modules/iii" title="limit modules 1">
+ <compile files="UsesJAXB.java Azpect.java" options="--limit-modules java.xml.bind -1.9"/>
+ <run class="UsesJAXB" vmargs="--limit-modules java.xml.bind">
+ <stdout>
+ <line text="UsesJAXB.running..."/>
+ <line text="null"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs190/modules/iii" title="add reads 1">
+ <compile files="UsesJAXB.java Azpect.java" options="--add-reads java.sql=java.xml.bind --add-modules java.sql -1.9"/>
+ <run class="UsesJAXB" vmargs="--add-modules java.xml.bind ">
+ <stdout>
+ <line text="UsesJAXB.running..."/>
+ <line text="null"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
<!--
<compile files="module-info.java aaa/bbb/A.java" options="-1.9" outjar="module.jar" aspectpath="foo.jar"/>
<compile files="module-info.java aaa/bbb/A.java" options="-1.9" outjar="my.module.jar"/>