Stay organized with collections
Save and categorize content based on your preferences.
Context
interface Context
Context for the transform.
This gives access to a limited amount of context when the transform is run.
Summary
Public methods
|
abstract LoggingManager! |
Returns the LoggingManager which can be used to control the logging level and standard output/error capture for this task.
|
abstract String! |
Returns the path of the task, which is a fully qualified name for the task.
|
abstract String! |
Returns the project name containing the task.
|
abstract File! |
Returns a directory which this task can use to write temporary files to.
|
abstract String |
Returns the name of the variant.
|
abstract WorkerExecutor |
Returns the org.gradle.workers.WorkerExecutor to enlist runnable pieces of work.
|
Public methods
getLogging
abstract fun getLogging(): LoggingManager!
Returns the LoggingManager which can be used to control the logging level and standard output/error capture for this task. By default, System.out is redirected to the Gradle logging system at the QUIET log level, and System.err is redirected at the ERROR log level.
getPath
abstract fun getPath(): String!
Returns the path of the task, which is a fully qualified name for the task. The path of a task is the path of its Project
plus the name of the task, separated by :
.
Return |
String!: the path of the task, which is equal to the path of the project plus the name of the task. |
getProjectName
abstract fun getProjectName(): String!
Returns the project name containing the task.
getTemporaryDir
abstract fun getTemporaryDir(): File!
Returns a directory which this task can use to write temporary files to. Each task instance is provided with a separate temporary directory. There are no guarantees that the contents of this directory will be kept beyond the execution of the task.
Return |
File!: The directory. Never returns null. The directory will already exist. |
getVariantName
@NonNull abstract fun getVariantName(): String
Returns the name of the variant.
Return |
String: the name of the variant. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Context\n=======\n\n```\ninterface Context\n```\n\n|----------------------------------------------|\n| [com.android.build.api.transform.Context](#) |\n\nContext for the transform.\n\nThis gives access to a limited amount of context when the transform is run.\n\nSummary\n-------\n\n| ### Public methods ||\n|----------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [LoggingManager](https://docs.gradle.org/current/javadoc/org/gradle/api/logging/LoggingManager.html)! | [getLogging](#getLogging())`()` Returns the LoggingManager which can be used to control the logging level and standard output/error capture for this task. |\n| abstract [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getPath](#getPath())`()` Returns the path of the task, which is a fully qualified name for the task. |\n| abstract [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getProjectName](#getProjectName())`()` Returns the project name containing the task. |\n| abstract [File](http://docs.oracle.com/javase/8/docs/api/java/io/File.html)! | [getTemporaryDir](#getTemporaryDir())`()` Returns a directory which this task can use to write temporary files to. |\n| abstract [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getVariantName](#getVariantName())`()` Returns the name of the variant. |\n| abstract [WorkerExecutor](https://docs.gradle.org/current/javadoc/org/gradle/workers/WorkerExecutor.html) | [getWorkerExecutor](#getWorkerExecutor())`()` Returns the [org.gradle.workers.WorkerExecutor](https://docs.gradle.org/current/javadoc/org/gradle/workers/WorkerExecutor.html) to enlist runnable pieces of work. |\n\nPublic methods\n--------------\n\n### getLogging\n\n```\nabstract fun getLogging(): LoggingManager!\n```\n\nReturns the LoggingManager which can be used to control the logging level and standard output/error capture for this task. By default, System.out is redirected to the Gradle logging system at the QUIET log level, and System.err is redirected at the ERROR log level.\n\n| Return ||\n|---|---|\n| [LoggingManager](https://docs.gradle.org/current/javadoc/org/gradle/api/logging/LoggingManager.html)!: the LoggingManager. Never returns null. ||\n\n### getPath\n\n```\nabstract fun getPath(): String!\n```\n\nReturns the path of the task, which is a fully qualified name for the task. The path of a task is the path of its `Project` plus the name of the task, separated by `:`.\n\n| Return ||\n|---|---|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: the path of the task, which is equal to the path of the project plus the name of the task. ||\n\n### getProjectName\n\n```\nabstract fun getProjectName(): String!\n```\n\nReturns the project name containing the task.\n\n| Return ||\n|---|---|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: the [Project#getName()](https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html#getName()) ||\n\n### getTemporaryDir\n\n```\nabstract fun getTemporaryDir(): File!\n```\n\nReturns a directory which this task can use to write temporary files to. Each task instance is provided with a separate temporary directory. There are no guarantees that the contents of this directory will be kept beyond the execution of the task.\n\n| Return ||\n|---|---|\n| [File](http://docs.oracle.com/javase/8/docs/api/java/io/File.html)!: The directory. Never returns null. The directory will already exist. ||\n\n### getVariantName\n\n```\n@NonNull abstract fun getVariantName(): String\n```\n\nReturns the name of the variant.\n\n| Return ||\n|---|---|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): the name of the variant. ||\n\n### getWorkerExecutor\n\n```\n@NonNull abstract fun getWorkerExecutor(): WorkerExecutor\n```\n\nReturns the [org.gradle.workers.WorkerExecutor](https://docs.gradle.org/current/javadoc/org/gradle/workers/WorkerExecutor.html) to enlist runnable pieces of work.\n\n| Return ||\n|---|---|\n| [WorkerExecutor](https://docs.gradle.org/current/javadoc/org/gradle/workers/WorkerExecutor.html): a task level shared instance. ||"]]