Skip to content

Commit

Permalink
* upgrade asm to latest
Browse files Browse the repository at this point in the history
* mark output folder
  • Loading branch information
mschaaf committed Jun 23, 2020
1 parent 2f67e1f commit de4f7c8
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ atlassian-ide-plugin.xml
# NetBeans specific files/directories
.nbattrs
.nb-gradle
/bin/
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> classToArchiveMap, String archiveName, DependencyHandler handler) throws IOException {
super(null, new DependencyFinderRemapper(classToArchiveMap, archiveName, handler));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
*
Expand All @@ -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);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -100,7 +101,7 @@ private static Iterable<Pattern> toPatterns(@Nonnull Iterable<? extends String>.
@Input
private final Set<String> archiveExcludes = new HashSet<String>();

@OutputFile
@OutputDirectory
private File destinationDir;

@Input
Expand Down

0 comments on commit de4f7c8

Please sign in to comment.