Stay organized with collections
Save and categorize content based on your preferences.
interface DirectoryInput : QualifiedContent
A QualifiedContent
of type directory.
This means the getFile()
is the root directory containing the content.
This also contains incremental data if the transform is in incremental mode through getChangedFiles()
.
For a transform to run in incremental mode:
If the transform is not in incremental mode,
getChangedFiles()
will not contain any information (it will
not contain the list of all the files with state
Status#NOTCHANGED
.)
When a root level directory is removed, and incremental mode is on, the instance will receive a DirectoryInput
instance for the removed folder, but QualifiedContent#getFile()
will return a directory that does not exist. In this case, the transform should prcess this as a removed input.
Summary
Inherited functions
|
From class QualifiedContent
MutableSet<QualifiedContent.ContentType!> |
getContentTypes()
Returns the type of content that the stream represents.
Even though this may return only DefaultContentType#RESOURCES or DefaultContentType#CLASSES , the actual content (the folder or the jar) may contain files representing other content types. This is because the transform mechanism avoids duplicating files around to remove unwanted types for performance.
For each input, transforms should always take care to read and process only the files associated with the types returned by this method.
|
File |
getFile()
Returns he location of the content.
|
String |
getName()
Returns the name of the content. Can be used to differentiate different content using the same scope. This is not reliably usable at every stage of the transformations, but can be used for logging for instance.
|
MutableSet<in QualifiedContent.Scope!> |
getScopes()
Returns the scope of the content.
|
|
Public methods
getChangedFiles
@NonNull abstract fun getChangedFiles(): MutableMap<File!, Status!>
Returns the changed files. This is only valid if the transform is in incremental mode.
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,["# DirectoryInput\n==============\n\n```\ninterface DirectoryInput : QualifiedContent\n```\n\n|-----------------------------------------------------|\n| [com.android.build.api.transform.DirectoryInput](#) |\n\nA [QualifiedContent](/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent) of type directory.\n\nThis means the [getFile()](/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent#getFile()) is the root directory containing the content.\n\nThis also contains incremental data if the transform is in incremental mode through [getChangedFiles()](#getChangedFiles()).\n\nFor a transform to run in incremental mode:\n\n- [Transform#isIncremental()](/reference/tools/gradle-api/7.0/com/android/build/api/transform/Transform#isIncremental()) must return `true`\n- The parameter isIncremental of [Transform#transform(Context, Collection, Collection, TransformOutputProvider, boolean)](/reference/tools/gradle-api/7.0/com/android/build/api/transform/Transform#transform(com.android.build.api.transform.Context,%20kotlin.collections.MutableCollection,%20kotlin.collections.MutableCollection,%20com.android.build.api.transform.TransformOutputProvider,%20kotlin.Boolean)) must be `true`.\n\nIf the transform is not in incremental mode, [getChangedFiles()](#getChangedFiles()) will not contain any information (it will **not** contain the list of all the files with state [Status#NOTCHANGED](/reference/tools/gradle-api/7.0/com/android/build/api/transform/Status).)\n\nWhen a root level directory is removed, and incremental mode is on, the instance will receive a [DirectoryInput](#) instance for the removed folder, but [QualifiedContent#getFile()](/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent#getFile()) will return a directory that does not exist. In this case, the transform should prcess this as a removed input.\n\nSummary\n-------\n\n| ### Public methods ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|\n| abstract [MutableMap](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html)\\\u003c[File](http://docs.oracle.com/javase/8/docs/api/java/io/File.html)!, [Status](/reference/tools/gradle-api/7.0/com/android/build/api/transform/Status)!\\\u003e | [getChangedFiles](#getChangedFiles())`()` Returns the changed files. |\n\n| ### Inherited functions ||\n|---|---|\n| From class [QualifiedContent](/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent) |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\u003c[QualifiedContent.ContentType](/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent.ContentType)!\u003e | [getContentTypes](/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent#getContentTypes())`()` Returns the type of content that the stream represents. Even though this may return only [DefaultContentType#RESOURCES](/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent.DefaultContentType) or [DefaultContentType#CLASSES](/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent.DefaultContentType), the actual content (the folder or the jar) may contain files representing other content types. This is because the transform mechanism avoids duplicating files around to remove unwanted types for performance. For each input, transforms should always take care to read and process only the files associated with the types returned by this method. \u003cbr /\u003e | | [File](http://docs.oracle.com/javase/8/docs/api/java/io/File.html) | [getFile](/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent#getFile())`()` Returns he location of the content. \u003cbr /\u003e | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getName](/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent#getName())`()` Returns the name of the content. Can be used to differentiate different content using the same scope. This is not reliably usable at every stage of the transformations, but can be used for logging for instance. \u003cbr /\u003e | | [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\u003cin` `[QualifiedContent.Scope](/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent.Scope)!\u003e | [getScopes](/reference/tools/gradle-api/7.0/com/android/build/api/transform/QualifiedContent#getScopes())`()` Returns the scope of the content. \u003cbr /\u003e | ||\n\nPublic methods\n--------------\n\n### getChangedFiles\n\n```\n@NonNull abstract fun getChangedFiles(): MutableMap\u003cFile!, Status!\u003e\n```\n\nReturns the changed files. This is only valid if the transform is in incremental mode."]]