Working Java8 build!

- Split the AspectJ testcode out of the general testdata project.
- Adjusted tests to handle that JDT produces different code to AspectJ.
- Modified some tests to work better with javac compiled testdata (which
  is what happens when building on the command line or build machine)
This commit is contained in:
Andy Clement
2014-02-20 09:13:14 -08:00
parent 526a4d0901
commit e400e2da63
20 changed files with 140 additions and 55 deletions

1
testdata/.classpath vendored
View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="con" path="org.eclipse.ajdt.core.ASPECTJRT_CONTAINER"/>
<classpathentry kind="lib" path="code.jar"/>
<classpathentry kind="lib" path="lib/cglib-nodep-2.2.jar"/>
<classpathentry kind="lib" path="/springloaded/lib/asm-3.2.jar"/>

3
testdata/.project vendored
View File

@@ -6,13 +6,12 @@
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.ajdt.core.ajbuilder</name>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.ajdt.ui.ajnature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

39
testdata/build.gradle vendored
View File

@@ -1,40 +1,17 @@
def aspectjVersion = "1.8.0.M1"
configurations {
aspects
ajInpath
}
dependencies {
/*
tools "org.aspectj:aspectjtools:$aspectjVersion"
compile "org.aspectj:aspectjrt:$aspectjVersion"
*/
compile("cglib:cglib:2.2.2") { exclude group: 'asm' } // cglib 2.2.2 depends on asm 3.3
compile 'org.ow2.asm:asm:5.0_BETA'
compile 'org.ow2.asm:asm-tree:5.0_BETA'
compile files("code.jar")
}
compileJava.deleteAllActions()
task aspectJ(dependsOn: JavaPlugin.PROCESS_RESOURCES_TASK_NAME) {
dependsOn configurations.tools.getTaskDependencyFromProjectDependency(true, "compileJava")
def srcDirs = sourceSets.main.java.srcDirs
srcDirs.each { inputs.dir it }
def destDir = sourceSets.main.output.classesDir
outputs.dir destDir
doLast {
ant.taskdef(resource: "org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties", classpath: configurations.tools.asPath)
ant.iajc(source:sourceCompatibility, target:targetCompatibility, destDir: destDir.absolutePath, maxmem:"512m", fork:"true",
aspectPath: configurations.aspects.asPath, inpath:configurations.ajInpath.asPath, sourceRootCopyFilter:"**/.svn/*,**/*.java",classpath:configurations.compile.asPath ){
sourceroots {
srcDirs.each {
if (it.exists()) pathelement location: it.absolutePath
}
}
}
}
sourceSets {
main {
java {
srcDir 'src'
}
}
}
compileJava.dependsOn aspectJ

View File

@@ -1,13 +0,0 @@
package data;
public aspect AnAspect {
before(): execution(!static * AspectReceiver.*(..)) {
System.out.println("Foo");
}
pointcut boo(String foo,String bar): execution(* *(..)) && args(foo,bar);
before(String foo): boo(foo,*) {
}
}

View File

@@ -1,15 +0,0 @@
package data;
public class AspectReceiver {
public static void main2() {
main(null);
}
public static void main(String[] args) {
new AspectReceiver().foo();
}
public void foo() {
}
}