diff --git a/.gitignore b/.gitignore index 7507685..4df157e 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,4 @@ atlassian-ide-plugin.xml # NetBeans specific files/directories .nbattrs .nb-gradle +/bin/ diff --git a/build.gradle b/build.gradle index 697f967..50f8a7e 100644 --- a/build.gradle +++ b/build.gradle @@ -64,8 +64,8 @@ project(':jarjar-testdata') { project(':jarjar-core') { dependencies { - compile 'org.ow2.asm:asm-commons:5.0.3' - compile 'org.ow2.asm:asm-util:5.0.3' + compile 'org.ow2.asm:asm-commons:8.0.1' + compile 'org.ow2.asm:asm-util:8.0.1' // compile 'org.ow2.asm:asm-commons:4.0' // testCompile project(':jarjar-testdata') diff --git a/jarjar-core/src/main/java/com/tonicsystems/jarjar/dependencies/DependencyFinderClassVisitor.java b/jarjar-core/src/main/java/com/tonicsystems/jarjar/dependencies/DependencyFinderClassVisitor.java index 968a4c5..aa1f696 100644 --- a/jarjar-core/src/main/java/com/tonicsystems/jarjar/dependencies/DependencyFinderClassVisitor.java +++ b/jarjar-core/src/main/java/com/tonicsystems/jarjar/dependencies/DependencyFinderClassVisitor.java @@ -18,10 +18,11 @@ import com.tonicsystems.jarjar.util.RuntimeIOException; import java.io.IOException; import java.util.Map; + +import org.objectweb.asm.commons.ClassRemapper; import org.objectweb.asm.commons.Remapper; -import org.objectweb.asm.commons.RemappingClassAdapter; -class DependencyFinderClassVisitor extends RemappingClassAdapter { +class DependencyFinderClassVisitor extends ClassRemapper { public DependencyFinderClassVisitor(Map classToArchiveMap, String archiveName, DependencyHandler handler) throws IOException { super(null, new DependencyFinderRemapper(classToArchiveMap, archiveName, handler)); diff --git a/jarjar-core/src/main/java/com/tonicsystems/jarjar/transform/asm/RemappingClassTransformer.java b/jarjar-core/src/main/java/com/tonicsystems/jarjar/transform/asm/RemappingClassTransformer.java index a30341c..7a83e1d 100644 --- a/jarjar-core/src/main/java/com/tonicsystems/jarjar/transform/asm/RemappingClassTransformer.java +++ b/jarjar-core/src/main/java/com/tonicsystems/jarjar/transform/asm/RemappingClassTransformer.java @@ -7,8 +7,8 @@ import javax.annotation.Nonnull; import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.commons.ClassRemapper; import org.objectweb.asm.commons.Remapper; -import org.objectweb.asm.commons.RemappingClassAdapter; /** * @@ -24,7 +24,7 @@ public RemappingClassTransformer(@Nonnull Remapper remapper) { @Override public ClassVisitor transform(ClassVisitor v) { - return new RemappingClassAdapter(v, remapper); + return new ClassRemapper(v, remapper); } } diff --git a/jarjar-core/src/main/java/com/tonicsystems/jarjar/transform/jar/ClassClosureJarProcessor.java b/jarjar-core/src/main/java/com/tonicsystems/jarjar/transform/jar/ClassClosureJarProcessor.java index c5f9318..72c0451 100644 --- a/jarjar-core/src/main/java/com/tonicsystems/jarjar/transform/jar/ClassClosureJarProcessor.java +++ b/jarjar-core/src/main/java/com/tonicsystems/jarjar/transform/jar/ClassClosureJarProcessor.java @@ -31,8 +31,8 @@ import java.util.Set; import javax.annotation.Nonnull; import org.objectweb.asm.ClassReader; +import org.objectweb.asm.commons.ClassRemapper; import org.objectweb.asm.commons.Remapper; -import org.objectweb.asm.commons.RemappingClassAdapter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -106,7 +106,7 @@ public Result scan(Transformable struct) throws IOException { roots.add(name); DependencyCollector collector = new DependencyCollector(); dependencies.put(name, collector.dependencies); - new ClassReader(new ByteArrayInputStream(struct.data)).accept(new RemappingClassAdapter(null, collector), ClassReader.EXPAND_FRAMES); + new ClassReader(new ByteArrayInputStream(struct.data)).accept(new ClassRemapper(null, collector), ClassReader.EXPAND_FRAMES); collector.dependencies.remove(name); } } catch (Exception e) { diff --git a/jarjar-core/src/test/java/com/tonicsystems/jarjar/GenericsTest.java b/jarjar-core/src/test/java/com/tonicsystems/jarjar/GenericsTest.java index a707947..6895f51 100644 --- a/jarjar-core/src/test/java/com/tonicsystems/jarjar/GenericsTest.java +++ b/jarjar-core/src/test/java/com/tonicsystems/jarjar/GenericsTest.java @@ -19,14 +19,14 @@ import com.tonicsystems.jarjar.transform.config.ClassRename; import org.junit.Test; import org.objectweb.asm.ClassReader; -import org.objectweb.asm.commons.RemappingClassAdapter; +import org.objectweb.asm.commons.ClassRemapper; public class GenericsTest { @Test public void testTransform() throws Exception { ClassRename rule = new ClassRename("java.lang.String", "com.tonicsystems.String"); - RemappingClassAdapter t = new RemappingClassAdapter(null, new PackageRemapper(rule)); + ClassRemapper t = new ClassRemapper(null, new PackageRemapper(rule)); ClassReader reader = new ClassReader(getClass().getResourceAsStream("/Generics.class")); reader.accept(t, 0); } diff --git a/jarjar-gradle/src/main/java/org/anarres/gradle/plugin/jarjar/JarjarTask.java b/jarjar-gradle/src/main/java/org/anarres/gradle/plugin/jarjar/JarjarTask.java index 190fb47..39fe709 100644 --- a/jarjar-gradle/src/main/java/org/anarres/gradle/plugin/jarjar/JarjarTask.java +++ b/jarjar-gradle/src/main/java/org/anarres/gradle/plugin/jarjar/JarjarTask.java @@ -31,6 +31,7 @@ import org.gradle.api.specs.Spec; import org.gradle.api.tasks.Input; import org.gradle.api.tasks.InputFiles; +import org.gradle.api.tasks.OutputDirectory; import org.gradle.api.tasks.OutputFile; import org.gradle.api.tasks.OutputFiles; import org.gradle.api.tasks.TaskAction; @@ -100,7 +101,7 @@ private static Iterable toPatterns(@Nonnull Iterable. @Input private final Set archiveExcludes = new HashSet(); - @OutputFile + @OutputDirectory private File destinationDir; @Input