FileReferenceOutputArtifact

data class FileReferenceOutputArtifact(val name: String, val file: FsEntry, val useChecksumInvalidation: Boolean = false, val symlink: Boolean = false) : OutputResource

An OutputResource backed by a filesystem entry. Instead of holding content in memory, it references a file that the exporter reads from directly: disk-backed entries are efficiently copied (or symlinked) by reference, while virtual entries are materialized on the fly.

Parameters

name

the output file name (with extension, since the original file name is used as-is)

file

the source entry (file or directory) to export

useChecksumInvalidation

whether to also create a checksum file for this artifact, used for incremental builds to determine whether the artifact has changed since the last build and should be recreated. Only applies to disk-backed entries

symlink

whether to create a symbolic link to the source file instead of copying it. Takes precedence over useChecksumInvalidation. Only applies to disk-backed entries

Constructors

Link copied to clipboard
constructor(name: String, file: FsEntry, useChecksumInvalidation: Boolean = false, symlink: Boolean = false)

Properties

Link copied to clipboard
Link copied to clipboard

Name of the corresponding file of this resource, without the extension, with symbols removed and spaces replaced with dashes.

Link copied to clipboard
open override val name: String
Link copied to clipboard

Functions

Link copied to clipboard
open override fun <T> accept(visitor: OutputResourceVisitor<T>): T

Accepts a visitor to perform operations on the resource.

Link copied to clipboard
fun OutputResource.copy(name: String = this.name): OutputResource

Creates a copy of this resource with the specified name.

Link copied to clipboard
fun OutputResource.saveTo(directory: File): File

Saves this resource to file in a directory.