Stay organized with collections
Save and categorize content based on your preferences.
interface TransformOutputProvider
The output of a transform.
There is no direct access to a location to write. Instead, Transforms can ask to get the location for given scopes, content-types and a format.
Summary
Public methods
|
abstract Unit |
Delete all content.
|
abstract File |
Returns the location of content for a given set of Scopes, Content Types, and Format.
|
Public methods
deleteAll
abstract fun deleteAll(): Unit
Delete all content. This is useful when running in non-incremental mode
Exceptions |
IOException |
if deleting the output failed. |
getContentLocation
@NonNull abstract fun getContentLocation(
@NonNull name: String,
@NonNull types: MutableSet<QualifiedContent.ContentType!>,
@NonNull scopes: MutableSet<in QualifiedContent.Scope!>,
@NonNull format: Format
): File
Returns the location of content for a given set of Scopes, Content Types, and Format.
If the format is Format#DIRECTORY
then the result is the file location of the directory.
If the format is Format#JAR
then the result is a file representing the jar to create.
Non of the directories or files are created by querying this method, and there is no checks regarding the existence of content in this location.
In case of incremental processing of removed files, it is safe to query the method to get the location of the files to removed.
Return |
File: the location of the content. |
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,["# TransformOutputProvider\n=======================\n\n```\ninterface TransformOutputProvider\n```\n\n|--------------------------------------------------------------|\n| [com.android.build.api.transform.TransformOutputProvider](#) |\n\nThe output of a transform.\n\nThere is no direct access to a location to write. Instead, Transforms can ask to get the location for given scopes, content-types and a format.\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [deleteAll](#deleteAll())`()` Delete all content. |\n| abstract [File](http://docs.oracle.com/javase/8/docs/api/java/io/File.html) | [getContentLocation](#getContentLocation(kotlin.String,%20kotlin.collections.MutableSet,%20kotlin.collections.MutableSet,%20com.android.build.api.transform.Format))`(`@NonNull` `name:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `@NonNull` `types:` `[MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\u003c[QualifiedContent.ContentType](/reference/tools/gradle-api/4.2/com/android/build/api/transform/QualifiedContent.ContentType)!\u003e`, `@NonNull` `scopes:` `[MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\u003cin` `[QualifiedContent.Scope](/reference/tools/gradle-api/4.2/com/android/build/api/transform/QualifiedContent.Scope)!\u003e`, `@NonNull` `format:` `[Format](/reference/tools/gradle-api/4.2/com/android/build/api/transform/Format)`)` Returns the location of content for a given set of Scopes, Content Types, and Format. |\n\nPublic methods\n--------------\n\n### deleteAll\n\n```\nabstract fun deleteAll(): Unit\n```\n\nDelete all content. This is useful when running in non-incremental mode\n\n| Exceptions ||\n|---------------|--------------------------------|\n| `IOException` | if deleting the output failed. |\n\n### getContentLocation\n\n```\n@NonNull abstract fun getContentLocation(\n @NonNull name: String, \n @NonNull types: MutableSet\u003cQualifiedContent.ContentType!\u003e, \n @NonNull scopes: MutableSet\u003cin QualifiedContent.Scope!\u003e, \n @NonNull format: Format\n): File\n```\n\nReturns the location of content for a given set of Scopes, Content Types, and Format.\n\nIf the format is [Format#DIRECTORY](/reference/tools/gradle-api/4.2/com/android/build/api/transform/Format) then the result is the file location of the directory. \nIf the format is [Format#JAR](/reference/tools/gradle-api/4.2/com/android/build/api/transform/Format) then the result is a file representing the jar to create.\n\nNon of the directories or files are created by querying this method, and there is no checks regarding the existence of content in this location.\n\nIn case of incremental processing of removed files, it is safe to query the method to get the location of the files to removed.\n\n| Parameters ||\n|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): a unique name for the content. For a given set of scopes/types/format it must be unique. |\n| `types` | [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\\\u003c[QualifiedContent.ContentType](/reference/tools/gradle-api/4.2/com/android/build/api/transform/QualifiedContent.ContentType)!\\\u003e: the content types associated with this content. |\n| `scopes` | [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\\\u003cin [QualifiedContent.Scope](/reference/tools/gradle-api/4.2/com/android/build/api/transform/QualifiedContent.Scope)!\\\u003e: the scopes associated with this content. |\n| `format` | [Format](/reference/tools/gradle-api/4.2/com/android/build/api/transform/Format): the format of the content. |\n\n| Return ||\n|---|---|\n| [File](http://docs.oracle.com/javase/8/docs/api/java/io/File.html): the location of the content. ||"]]