Search in sources :

Example 16 with TaskAction

use of org.gradle.api.tasks.TaskAction in project gradle by gradle.

the class JavaScriptMinify method compileJavaScriptSources.

@TaskAction
void compileJavaScriptSources() {
    StaleClassCleaner cleaner = new SimpleStaleClassCleaner(getOutputs());
    cleaner.setDestinationDir(getDestinationDir());
    cleaner.execute();
    MinifyFileVisitor visitor = new MinifyFileVisitor();
    getSource().visit(visitor);
    JavaScriptCompileSpec spec = new DefaultJavaScriptCompileSpec(visitor.relativeFiles, getDestinationDir(), getForkOptions());
    getCompiler().execute(spec);
}
Also used : SimpleStaleClassCleaner(org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner) StaleClassCleaner(org.gradle.language.base.internal.tasks.StaleClassCleaner) SimpleStaleClassCleaner(org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner) DefaultJavaScriptCompileSpec(org.gradle.play.internal.javascript.DefaultJavaScriptCompileSpec) JavaScriptCompileSpec(org.gradle.play.internal.javascript.JavaScriptCompileSpec) DefaultJavaScriptCompileSpec(org.gradle.play.internal.javascript.DefaultJavaScriptCompileSpec) TaskAction(org.gradle.api.tasks.TaskAction)

Example 17 with TaskAction

use of org.gradle.api.tasks.TaskAction in project gradle by gradle.

the class RoutesCompile method compile.

@TaskAction
void compile() {
    RoutesCompileSpec spec = new DefaultRoutesCompileSpec(getSource().getFiles(), getOutputDirectory(), getForkOptions(), isJavaProject(), isNamespaceReverseRouter(), isGenerateReverseRoutes(), getInjectedRoutesGenerator(), getAdditionalImports());
    new CleaningPlayToolCompiler<RoutesCompileSpec>(getCompiler(), getOutputs()).execute(spec);
}
Also used : DefaultRoutesCompileSpec(org.gradle.play.internal.routes.DefaultRoutesCompileSpec) DefaultRoutesCompileSpec(org.gradle.play.internal.routes.DefaultRoutesCompileSpec) RoutesCompileSpec(org.gradle.play.internal.routes.RoutesCompileSpec) TaskAction(org.gradle.api.tasks.TaskAction)

Example 18 with TaskAction

use of org.gradle.api.tasks.TaskAction in project gradle by gradle.

the class GeneratePluginDescriptors method generatePluginDescriptors.

@TaskAction
public void generatePluginDescriptors() {
    clearOutputDirectory();
    for (PluginDeclaration declaration : getDeclarations()) {
        File descriptorFile = new File(getOutputDirectory(), declaration.getId() + ".properties");
        Properties properties = new Properties();
        properties.setProperty("implementation-class", declaration.getImplementationClass());
        writePropertiesTo(properties, descriptorFile);
    }
}
Also used : PluginDeclaration(org.gradle.plugin.devel.PluginDeclaration) Properties(java.util.Properties) File(java.io.File) TaskAction(org.gradle.api.tasks.TaskAction)

Example 19 with TaskAction

use of org.gradle.api.tasks.TaskAction in project gradle by gradle.

the class GenerateBuildDashboard method run.

@TaskAction
void run() {
    if (getReports().getHtml().isEnabled()) {
        BuildDashboardGenerator generator = new BuildDashboardGenerator();
        generator.render(getEnabledInputReports(), reports.getHtml().getEntryPoint());
    } else {
        setDidWork(false);
    }
}
Also used : BuildDashboardGenerator(org.gradle.api.reporting.internal.BuildDashboardGenerator) TaskAction(org.gradle.api.tasks.TaskAction)

Example 20 with TaskAction

use of org.gradle.api.tasks.TaskAction in project gradle by gradle.

the class AbstractScalaCompile method compile.

@Override
@TaskAction
protected void compile() {
    ScalaJavaJointCompileSpec spec = createSpec();
    configureIncrementalCompilation(spec);
    getCompiler(spec).execute(spec);
}
Also used : ScalaJavaJointCompileSpec(org.gradle.api.internal.tasks.scala.ScalaJavaJointCompileSpec) DefaultScalaJavaJointCompileSpec(org.gradle.api.internal.tasks.scala.DefaultScalaJavaJointCompileSpec) TaskAction(org.gradle.api.tasks.TaskAction)

Aggregations

TaskAction (org.gradle.api.tasks.TaskAction)167 File (java.io.File)66 GradleException (org.gradle.api.GradleException)38 IOException (java.io.IOException)35 MtlBaseTaskAction (com.taobao.android.builder.tasks.manager.MtlBaseTaskAction)32 ArrayList (java.util.ArrayList)29 Project (org.gradle.api.Project)18 AwbBundle (com.taobao.android.builder.dependency.model.AwbBundle)16 InputFile (org.gradle.api.tasks.InputFile)16 OutputFile (org.gradle.api.tasks.OutputFile)15 FileCollection (org.gradle.api.file.FileCollection)13 AtlasDependencyTree (com.taobao.android.builder.dependency.AtlasDependencyTree)12 ExecutorServicesHelper (com.taobao.android.builder.tools.concurrent.ExecutorServicesHelper)12 Map (java.util.Map)12 DefaultTask (org.gradle.api.DefaultTask)12 HashMap (java.util.HashMap)10 InvalidUserDataException (org.gradle.api.InvalidUserDataException)9 AndroidLibrary (com.android.builder.model.AndroidLibrary)8 URLClassLoader (java.net.URLClassLoader)8 WorkResult (org.gradle.api.tasks.WorkResult)8