api / org.gradle.api / DefaultTask

DefaultTask

open class DefaultTask : AbstractTask

DefaultTask is the standard Task implementation. You can extend this to implement your own task types.

Constructors

<init>

DefaultTask()

DefaultTask is the standard Task implementation. You can extend this to implement your own task types.

Inheritors

AbstractLinkTask

abstract class AbstractLinkTask : DefaultTask, ObjectFilesToBinary

Base task for linking a native binary from object files and libraries.

AbstractNativeCompileTask

abstract class AbstractNativeCompileTask : DefaultTask

Compiles native source files into object files.

AbstractPublishToMaven

abstract class AbstractPublishToMaven : DefaultTask

Base class for tasks that publish a org.gradle.api.publish.maven.MavenPublication.

Assemble

open class Assemble : DefaultTask

Translates Assembly language source files into object files.

BrowserEvaluate

open class BrowserEvaluate : DefaultTask

BuildEnvironmentReportTask

open class BuildEnvironmentReportTask : DefaultTask

Provides information about the build environment for the project that the task is associated with.

Currently, this information is limited to the project's declared build script dependencies visualised in a similar manner as provided by DependencyReportTask.

It is not necessary to manually add a task of this type to your project, as every project automatically has a task of this type by the name "buildEnvironment".

CompareGradleBuilds

open class CompareGradleBuilds : DefaultTask, VerificationTask

Executes two Gradle builds (that can be the same build) with specified versions and compares the outcomes. Please see the “Comparing Builds” chapter of the Gradle User Guide for more information.

ComponentReport

open class ComponentReport : DefaultTask

Displays some details about the software components produced by the project.

CreateStaticLibrary

open class CreateStaticLibrary : DefaultTask, ObjectFilesToBinary

Assembles a static library from object files.

DependencyInsightReportTask

open class DependencyInsightReportTask : DefaultTask

Generates a report that attempts to answer questions like:

  • Why is this dependency in the dependency graph?
  • Exactly which dependencies are pulling this dependency into the graph?
  • What is the actual version (i.e. *selected* version) of the dependency that will be used? Is it the same as what was *requested*?
  • Why is the *selected* version of a dependency different to the *requested*?
Use this task to get insight into a particular dependency (or dependencies) and find out what exactly happens during dependency resolution and conflict resolution. If the dependency version was forced or selected by the conflict resolution this information will be available in the report.

While the regular dependencies report (DependencyReportTask) shows the path from the top level dependencies down through the transitive dependencies, the dependency insight report shows the path from a particular dependency to the dependencies that pulled it in. That is, it is an inverted view of the regular dependencies report.

The task requires setting the dependency spec and the configuration. For more information on how to configure those please refer to docs for DependencyInsightReportTask#setDependencySpec(Object) and DependencyInsightReportTask#setConfiguration(String).

The task can also be configured from the command line. For more information please refer to DependencyInsightReportTask#setDependencySpec(Object) and DependencyInsightReportTask#setConfiguration(String)

DependentComponentsReport

open class DependentComponentsReport : DefaultTask

Displays dependent components.

ExtractSymbols

open class ExtractSymbols : DefaultTask

Extracts the debug symbols from a binary and stores them in a separate file.

GenerateBuildDashboard

open class GenerateBuildDashboard : DefaultTask, Reporting<BuildDashboardReports>

Generates build dashboard report.

GenerateCUnitLauncher

open class GenerateCUnitLauncher : DefaultTask

Generated the Gradle CUnit launcher: main method and header.

GenerateIvyDescriptor

open class GenerateIvyDescriptor : DefaultTask

Generates an Ivy XML Module Descriptor file.

GenerateMavenPom

open class GenerateMavenPom : DefaultTask

Generates a Maven module descriptor (POM) file.

GenerateModuleMetadata

open class GenerateModuleMetadata : DefaultTask

Generates a Gradle metadata file to represent a published org.gradle.api.component.SoftwareComponent instance.

GenerateSwiftPackageManagerManifest

open class GenerateSwiftPackageManagerManifest : DefaultTask

A task that produces a Swift Package Manager manifest.

InitBuild

open class InitBuild : DefaultTask

Generates a Gradle project structure.

InstallExecutable

open class InstallExecutable : DefaultTask

Installs an executable with it's dependent libraries so it can be easily executed.

InstallXCTestBundle

open class InstallXCTestBundle : DefaultTask

Creates a XCTest bundle with a run script so it can be easily executed.

JDepend

open class JDepend : DefaultTask, Reporting<JDependReports>

Analyzes code with JDepend.

JacocoBase

abstract class JacocoBase : DefaultTask

Base class for Jacoco tasks.

ModelReport

open class ModelReport : DefaultTask

Displays some details about the configuration model of the project. An instance of this type is used when you execute the model task from the command-line.

PluginUnderTestMetadata

open class PluginUnderTestMetadata : DefaultTask

Custom task for generating the metadata for a plugin user test.

PrefixHeaderFileGenerateTask

open class PrefixHeaderFileGenerateTask : DefaultTask

Generates a prefix header file from a list of headers to be precompiled.

PublishToIvyRepository

open class PublishToIvyRepository : DefaultTask

Publishes an IvyPublication to an IvyArtifactRepository.

Sign

open class Sign : DefaultTask, SignatureSpec

A task for creating digital signature files for one or more; tasks, files, publishable artifacts or configurations.

The task produces Signature

objects that are publishable artifacts and can be assigned to another configuration.

The signature objects are created with defaults and using this tasks signatory and signature type.

StripSymbols

open class StripSymbols : DefaultTask

Strips the debug symbols from a binary

SwiftCompile

open class SwiftCompile : DefaultTask

Compiles Swift source files into object files.

TestReport

open class TestReport : DefaultTask

Generates an HTML test report from the results of one or more Test tasks.

UnexportMainSymbol

open class UnexportMainSymbol : DefaultTask

Unexports the main entry point symbol in an object file, so the object file can be linked with an executable.

WindowsResourceCompile

open class WindowsResourceCompile : DefaultTask

Compiles Windows Resource scripts into .res files.

Wrapper

open class Wrapper : DefaultTask

Generates scripts (for *nix and windows) which allow you to build your project with Gradle, without having to install Gradle.

When a user executes a wrapper script the first time, the script downloads and installs the appropriate Gradle distribution and runs the build against this downloaded distribution. Any installed Gradle distribution is ignored when using the wrapper scripts.

The scripts generated by this task are intended to be committed to your version control system. This task also generates a small gradle-wrapper.jar bootstrap JAR file and properties file which should also be committed to your VCS. The scripts delegates to this JAR.

WriteProperties

open class WriteProperties : DefaultTask

Writes a java.util.Properties in a way that the results can be expected to be reproducible.

There are a number of differences compared to how properties are stored:

  • no timestamp comment is generated at the beginning of the file
  • the lines in the resulting files are separated by a pre-set separator (defaults to '\n') instead of the system default line separator
  • the properties are sorted alphabetically

Like with java.util.Properties, Unicode characters are escaped when using the default Latin-1 (ISO-8559-1) encoding.