I wrote a custom Transform implementation, and it can do the transform 
logic:

public class MyTransform extends Transform {

    private Project project

    public MyTransform(Project project) {
        this.project = project
    }

    @Override
    public String getName() {
        return "MyTransform"
    }

    @Override
    public Set<QualifiedContent.ContentType> getInputTypes() {
        return EnumSet.of(QualifiedContent.DefaultContentType.CLASSES)
    }

    @Override
    public Set<QualifiedContent.Scope> getScopes() {
        return EnumSet.of(QualifiedContent.Scope.PROJECT,
                QualifiedContent.Scope.PROJECT_LOCAL_DEPS,
                QualifiedContent.Scope.SUB_PROJECTS,
                QualifiedContent.Scope.SUB_PROJECTS_LOCAL_DEPS,
                QualifiedContent.Scope.EXTERNAL_LIBRARIES,
                )
    }


    @Override
    public boolean isIncremental() {
        return false
    }

    @Override
    public void transform(TransformInvocation transformInvocation) throws 
TransformException, InterruptedException, IOException {
        super.transform(transformInvocation)
        transformInvocation.inputs.each { input ->
            input.directoryInputs.each { dirInput ->
                File dirOutput = 
transformInvocation.outputProvider.getContentLocation(dirInput.name, 
dirInput.contentTypes, dirInput.scopes, Format.DIRECTORY)
                // Do transform logic here
                FileUtils.copyDirectory(dirInput.file, dirOutput)
            }
            input.jarInputs.each { jarInput ->

            }
        }

    }

}


But now I met another problem. Cause this could only do the transform logic 
for codes in the app module or jar dependencies. My project still has some 
library modules. I want these codes in the library modules could be 
transformed as well.

Is it possible to do that?

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to