Fixing the build process for Java8

This commit is contained in:
Andy Clement
2014-02-18 09:27:23 -08:00
parent da7045b350
commit db06b6f619
12 changed files with 29 additions and 13 deletions

View File

@@ -5,6 +5,9 @@ allprojects {
repositories {
mavenCentral()
maven {
url "http://maven.springframework.org/milestone"
}
}
}
@@ -13,10 +16,10 @@ subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = 1.6
targetCompatibility = 1.6
sourceCompatibility = 1.6
targetCompatibility = 1.6
}
configure(subprojects.findAll { it.name.startsWith('testdata')}) {
tasks.findByPath("artifactoryPublish")?.enabled = false
}
}

View File

@@ -1,5 +1,7 @@
include "springloaded"
include "springloaded-java8"
include "testdata"
include "testdata-java8"
include "testdata-groovy"
include "testdata-plugin"
include "testdata-subloader"

View File

@@ -42,6 +42,7 @@ dependencies {
compile 'org.ow2.asm:asm:5.0_BETA'
compile 'org.ow2.asm:asm-tree:5.0_BETA'
compile project(':springloaded-java8')
testCompile 'junit:junit:4.11'

View File

@@ -255,7 +255,7 @@ public class ClassRenamer {
}
@Override
public void visitInvokeDynamicInsn(String name, String desc, org.objectweb.asm.Handle bsm, Object... bsmArgs) {
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) {
// System.out.println("visitInvokeDynamicInsn(name="+name+",desc="+desc+",bsm="+toString(bsm)+",bsmArgs="+toString(bsmArgs)+")");
// Example:
// visitInvokeDynamicInsn(name=m,desc=()Lbasic/LambdaA2$Foo;,

View File

@@ -990,7 +990,7 @@ public class MethodInvokerRewriter {
}
@Override
public void visitInvokeDynamicInsn(String name, String desc, org.objectweb.asm.Handle bsm, Object... bsmArgs) {
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) {
// TODO *shudder* what about invoke dynamic calls that target reflective APIs
int classId = typeRegistry.getTypeIdFor(slashedclassname, false);
if (classId==-1) {

View File

@@ -1119,7 +1119,7 @@ public class TypeRegistry {
}
/**
*Used to determine if the invokedynamic needs to be intercepted. Currently very basic.
*Used to determine if the invokedynamic needs to be intercepted.
*
* @return null if nothing has been reloaded
*/

View File

@@ -56,7 +56,7 @@ public class MethodPrinter extends MethodVisitor implements Opcodes {
}
@Override
public void visitInvokeDynamicInsn(String name, String desc, org.objectweb.asm.Handle bsm, Object... bsmArgs) {
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) {
to.println(" INVOKEDYNAMIC " + name+"."+desc+" bsm="+toString(bsm));
}

View File

@@ -79,6 +79,7 @@ public class SpringLoadedTestsInSeparateJVM extends SpringLoadedTests {
@Test
public void githubIssue34_2() throws Exception {
jvm.copyToTestdataDirectory("issue34.InnerEnum$sorters");
jvm.copyToTestdataDirectory("issue34.InnerEnum$MyComparator");
jvm.copyToTestdataDirectory("issue34.InnerEnum$sorters$1");
JVMOutput output = jvm.run("issue34.InnerEnum");
assertStdout("Hello World!\n", output);

View File

@@ -1,3 +1,4 @@
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8

View File

@@ -1,4 +1,4 @@
def aspectjVersion = "1.7.1"
def aspectjVersion = "1.8.0.M1"
configurations {
aspects
@@ -9,8 +9,8 @@ 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 'asm:asm:3.2'
compile 'asm:asm-tree:3.2'
compile 'org.ow2.asm:asm:5.0_BETA'
compile 'org.ow2.asm:asm-tree:5.0_BETA'
compile files("code.jar")
}

View File

@@ -13,10 +13,17 @@ public class InnerEnum {
@SuppressWarnings("unused")
public static void main(String[] args) {
System.out.println("Hello World!");
Map<String, String> map = new TreeMap<String, String>(sorters.string);
Object o = sorters.string;
// Map<String, String> map = new TreeMap<String, String>(sorters.string);
}
// May be able to switch back to using Comparator (and the TreeMap line above) once AspectJ 1.8.0 is out
interface MyComparator<T> {
int compare(T a,T b);
boolean equals(Object o);
}
private static enum sorters implements Comparator<String> {
private static enum sorters implements MyComparator<String> {
string {
private static final long serialVersionUID = 1L;
@@ -24,6 +31,7 @@ public class InnerEnum {
public int compare(String o1, String o2) {
return o1.compareTo(o2);
}
}
}
}

View File

@@ -6,7 +6,7 @@ public class GenericClass002<K extends Comparable<K>> implements GenericInterfac
//what we need in this v002 class...
// Same as in original class, but also with methods added (fore these cases)
// Same as in original class, but also with methods added (for these cases)
public Iterator<K> iterator() {
return null;