Last active
July 19, 2018 14:32
-
-
Save zskamljic/40439cb7e9b22c9d91e0884570bcb021 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomTransform extends Transform { | |
@Override | |
public String getName() { | |
return "CustomProc"; | |
} | |
@Override | |
public Set<QualifiedContent.ContentType> getInputTypes() { | |
return ImmutableSet.of(QualifiedContent.DefaultContentType.CLASSES); | |
} | |
@Override | |
public Set<? super QualifiedContent.Scope> getScopes() { | |
return ImmutableSet.of(QualifiedContent.Scope.PROJECT); | |
} | |
@Override | |
public void transform(TransformInvocation transformInvocation) { | |
Set<String> classNames = getClassNames(transformInvocation.getInputs()); | |
ClassPool classPool = createClassPool(transformInvocation.getInputs(), | |
transformInvocation.getReferencedInputs()); | |
Set<CtClass> ctClasses = getCtClasses(classPool, classNames); | |
processClasses(new ProviderGenerator(), classPool, ctClasses); | |
String outputPath = getOutputPath(transformInvocation.getOutputProvider()); | |
saveClasses(outputPath, ctClasses); | |
} | |
@Override | |
public boolean isIncremental() { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment