Search in sources :

Example 26 with DslObject

use of org.gradle.api.internal.plugins.DslObject in project gradle-apt-plugin by tbroyer.

the class AptPlugin43to44 method configureCompileTaskForSourceSet.

@Override
protected void configureCompileTaskForSourceSet(Project project, final SourceSet sourceSet, AbstractCompile task, CompileOptions compileOptions) {
    compileOptions.setAnnotationProcessorPath(project.files(new Callable<FileCollection>() {

        @Override
        public FileCollection call() {
            return new DslObject(sourceSet).getConvention().getPlugin(AptPlugin.AptSourceSetConvention.class).getAnnotationProcessorPath();
        }
    }));
    compileOptions.setAnnotationProcessorGeneratedSourcesDirectory(project.provider(new Callable<File>() {

        @Override
        public File call() {
            return new DslObject(sourceSet.getOutput()).getConvention().getPlugin(AptPlugin.AptSourceSetOutputConvention.class).getGeneratedSourcesDir();
        }
    }));
}
Also used : DslObject(org.gradle.api.internal.plugins.DslObject) Callable(java.util.concurrent.Callable)

Aggregations

DslObject (org.gradle.api.internal.plugins.DslObject)26 File (java.io.File)10 Test (org.junit.Test)8 Action (org.gradle.api.Action)6 Configuration (org.gradle.api.artifacts.Configuration)5 ConventionMapping (org.gradle.api.internal.ConventionMapping)5 Project (org.gradle.api.Project)4 GroovyObject (groovy.lang.GroovyObject)3 Task (org.gradle.api.Task)3 SourceSet (org.gradle.api.tasks.SourceSet)3 BeanDynamicObject (org.gradle.internal.metaobject.BeanDynamicObject)3 DynamicObject (org.gradle.internal.metaobject.DynamicObject)3 Node (groovy.util.Node)2 NodeList (groovy.util.NodeList)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Callable (java.util.concurrent.Callable)2 MethodClosure (org.codehaus.groovy.runtime.MethodClosure)2 XmlProvider (org.gradle.api.XmlProvider)2 DynamicObjectAware (org.gradle.api.internal.DynamicObjectAware)2