SecondaryFile

public class 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. call. The collection should only contain one file.

Summary

Public constructors

SecondaryFile(
    File secondaryInputFile,
    boolean supportsIncrementalBuild
)

Public methods

File

This method is deprecated.

use getFileCollection

FileCollection

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

FileCollection

Returns the FileCollection handle for this secondary input to a Transform

static SecondaryFile

This method is deprecated.

Use incremental

static SecondaryFile

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

static SecondaryFile

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

static SecondaryFile

This method is deprecated.

Use nonIncremental

static SecondaryFile

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

static SecondaryFile

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

boolean

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

Public constructors

SecondaryFile

public SecondaryFile(
    File secondaryInputFile,
    boolean supportsIncrementalBuild
)
Parameters
File secondaryInputFile

the File this SecondaryFile will point to

boolean supportsIncrementalBuild

if true, changes to the file can be handled incrementally by the transform

Public methods

getFile

public File getFile()

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

Returns
File

a file handle.

getFileCollection

public FileCollection getFileCollection()

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.

Returns
FileCollection

FileCollection of this SecondaryFile

getFileCollection

public FileCollection getFileCollection(Project project)

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.

Returns
FileCollection

FileCollection of this SecondaryFile

incremental

public static SecondaryFile incremental(File file)

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

incremental

public static SecondaryFile incremental(FileCollection file)

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

incremental

public static SecondaryFile incremental(Supplier<FileCollection> file)

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

Parameters
Supplier<FileCollection> file

a supplier of file collection.

nonIncremental

public static SecondaryFile nonIncremental(File file)

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

nonIncremental

public static SecondaryFile nonIncremental(FileCollection file)

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

nonIncremental

public static SecondaryFile nonIncremental(Supplier<FileCollection> file)

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

Parameters
Supplier<FileCollection> file

a supplier of file collection.

supportsIncrementalBuild

public boolean supportsIncrementalBuild()

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.

Returns
boolean

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