SecondaryFile

open class SecondaryFile
kotlin.Any
   ↳ com.android.build.api.transform.SecondaryFile

A secondary input file(s) for a Transform. A secondary input is part of the transform inputs and can be decorated to indicate if a change to the input would trigger a non incremental Transform#transform(TransformInvocation). call. The collection should only contain one file.

Summary

Public constructors

<init>(@NonNull secondaryInputFile: File, supportsIncrementalBuild: Boolean)

Public methods

open File!

Returns the file handle for this secondary input to a Transform.

open FileCollection!
getFileCollection(@NonNull project: Project)

Returns the FileCollection handle for this secondary input to a Transform

open FileCollection?

Returns the FileCollection handle for this secondary input to a Transform if this SecondaryFile is constructed with FileCollection.

open static SecondaryFile!
incremental(@NonNull file: File)

Creates a SecondaryFile instance that, when modified, will not trigger a full, non-incremental build.

open static SecondaryFile!
incremental(@NonNull file: FileCollection)

Creates a SecondaryFile instance that, when modified, will not trigger a full, non-incremental build.

open static SecondaryFile!

Creates a SecondaryFile instance that, when modified, will not trigger a full non-incremental build.

open static SecondaryFile!
nonIncremental(@NonNull file: File)

Creates a SecondaryFile instance that, when modified, will always trigger a full, non-incremental build.

open static SecondaryFile!

Creates a SecondaryFile instance that, when modified, will always trigger a full, non-incremental build.

open static SecondaryFile!

Creates a SecondaryFile instance that, when modified, will always trigger a full non-incremental build.

open Boolean

Returns true if this secondary input changes can be handled by the receiving Transform incrementally.

Public constructors

<init>

SecondaryFile(
    @NonNull secondaryInputFile: File,
    supportsIncrementalBuild: Boolean)
Parameters
secondaryInputFile File: the File this SecondaryFile will point to
supportsIncrementalBuild Boolean: if true, changes to the file can be handled incrementally by the transform

Public methods

getFile

open fun getFile(): File!

Deprecated: use getFileCollection

Returns the file handle for this secondary input to a Transform.

Return
File!: a file handle.

getFileCollection

open fun getFileCollection(@NonNull project: Project): FileCollection!

Returns the FileCollection handle for this secondary input to a Transform

If this SecondaryFile is constructed with File, the supplied will be used to create a FileCollection.

Parameters
project Project: for creating a FileCollection when necessary.
Return
FileCollection!: FileCollection of this SecondaryFile

getFileCollection

@Nullable open fun getFileCollection(): FileCollection?

Returns the FileCollection handle for this secondary input to a Transform if this SecondaryFile is constructed with FileCollection. Otherwise, null is returned.

Note this method is not part of the API of SecondaryFile.

Return
FileCollection?: FileCollection of this SecondaryFile

incremental

open static fun incremental(@NonNull file: File): SecondaryFile!

Deprecated: Use incremental(FileCollection)

Creates a SecondaryFile instance that, when modified, will not trigger a full, non-incremental build.

incremental

open static fun incremental(@NonNull file: FileCollection): SecondaryFile!

Creates a SecondaryFile instance that, when modified, will not trigger a full, non-incremental build.

incremental

open static fun incremental(@NonNull file: Supplier<FileCollection!>): SecondaryFile!

Creates a SecondaryFile instance that, when modified, will not trigger a full non-incremental build.

Parameters
file Supplier<FileCollection!>: a supplier of file collection.

nonIncremental

open static fun nonIncremental(@NonNull file: File): SecondaryFile!

Deprecated: Use nonIncremental(FileCollection)

Creates a SecondaryFile instance that, when modified, will always trigger a full, non-incremental build.

nonIncremental

open static fun nonIncremental(@NonNull file: FileCollection): SecondaryFile!

Creates a SecondaryFile instance that, when modified, will always trigger a full, non-incremental build.

nonIncremental

open static fun nonIncremental(@NonNull file: Supplier<FileCollection!>): SecondaryFile!

Creates a SecondaryFile instance that, when modified, will always trigger a full non-incremental build.

Parameters
file Supplier<FileCollection!>: a supplier of file collection.

supportsIncrementalBuild

open fun supportsIncrementalBuild(): Boolean

Returns true if this secondary input changes can be handled by the receiving Transform incrementally. If false, a change to the file returned by getFileCollection will trigger a non incremental build.

Return
Boolean: true when the input file changes can be handled incrementally, false otherwise.