ShadowJar

@CacheableTask
abstract class ShadowJar : Jar

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open var actions: List<Action<in Task>>
Link copied to clipboard
@get:Input
open val addMultiReleaseAttribute: Property<Boolean>

Adds the java.util.jar.Attributes.Name.MULTI_RELEASE attribute to the manifest of the shadow JAR if any dependencies contain the attribute.

Link copied to clipboard
open val ant: AntBuilder
Link copied to clipboard
@get:Classpath
open val apiJars: ConfigurableFileCollection
Link copied to clipboard
@get:Internal(value = "Represented as part of archiveFile")
open val archiveAppendix: Property<String>
Link copied to clipboard
@get:Internal(value = "Represented as part of archiveFile")
open val archiveBaseName: Property<String>
Link copied to clipboard
@get:Internal(value = "Represented as part of archiveFile")
open val archiveClassifier: Property<String>
Link copied to clipboard
@get:Internal(value = "Represented as part of archiveFile")
open val archiveExtension: Property<String>
Link copied to clipboard
@get:OutputFile
open val archiveFile: Provider<RegularFile>
Link copied to clipboard
@get:Internal(value = "Represented as part of archiveFile")
open val archiveFileName: Property<String>
Link copied to clipboard
@get:Internal(value = "Represented as part of archiveFile")
open val archiveVersion: Property<String>
Link copied to clipboard
@get:Internal
open val asDynamicObject: DynamicObject
Link copied to clipboard
@get:Classpath
open val configurations: SetProperty<Configuration>

The configurations to include dependencies from.

Link copied to clipboard
@get:Internal
open val conventionMapping: ConventionMapping
Link copied to clipboard
@get:Input
open val dependencyFilter: Property<DependencyFilter>
Link copied to clipboard
open val dependsOn: Set<Any>
Link copied to clipboard
open var description: @Nullable String?
Link copied to clipboard
@get:Internal(value = "Represented by the archiveFile")
open val destinationDirectory: DirectoryProperty
Link copied to clipboard
open val destroyables: TaskDestroyables
Link copied to clipboard
open var didWork: Boolean
Link copied to clipboard
@get:Internal
open val dirPermissions: Property<ConfigurableFilePermissions>
Link copied to clipboard
open override var duplicatesStrategy: DuplicatesStrategy
Link copied to clipboard
@get:Input
open val enableAutoRelocation: Property<Boolean>

Enables auto relocation of packages in the dependencies.

Link copied to clipboard
open var enabled: Boolean
Link copied to clipboard
@get:Input
open var entryCompression: ZipEntryCompression
Link copied to clipboard
@get:Input
open override val excludes: MutableSet<String>
Link copied to clipboard
open val extensions: ExtensionContainer
Link copied to clipboard
@get:Input
open val failOnDuplicateEntries: Property<Boolean>

Fails build if the ZIP entries in the shadowed JAR are duplicate.

Link copied to clipboard
@get:Internal
open val filePermissions: Property<ConfigurableFilePermissions>
Link copied to clipboard
@get:Internal
open var filteringCharset: String
Link copied to clipboard
open val finalizedBy: TaskDependency
Link copied to clipboard
open var group: @Nullable String?
Link copied to clipboard
open val identityPath: Path
Link copied to clipboard
Link copied to clipboard
@get:Classpath
open val includedDependencies: ConfigurableFileCollection

Final dependencies to be shadowed.

Link copied to clipboard
@get:Internal
open var includeEmptyDirs: Boolean
Link copied to clipboard
@get:Input
open override val includes: MutableSet<String>
Link copied to clipboard
open val inputs: TaskInputsInternal
Link copied to clipboard
@get:Internal
open var isCaseSensitive: Boolean
Link copied to clipboard
@get:Internal
open var isEnabled: Boolean
Link copied to clipboard
Link copied to clipboard
@get:Input
open var isPreserveFileTimestamps: Boolean
Link copied to clipboard
@get:Input
open var isReproducibleFileOrder: Boolean
Link copied to clipboard
@get:Input
open var isZip64: Boolean
Link copied to clipboard
@get:Internal
open val lifecycleDependencies: TaskDependencyInternal
Link copied to clipboard
open val localState: TaskLocalState
Link copied to clipboard
open val logger: Logger
Link copied to clipboard
open val logging: LoggingManager
Link copied to clipboard
@get:Optional
@get:Input
open val mainClass: Property<String>

Main class attribute to add to manifest.

Link copied to clipboard
@get:Internal
open override var manifest: InheritManifest
Link copied to clipboard
@get:Input
open var manifestContentCharset: String?
Link copied to clipboard
Link copied to clipboard
@get:Internal
open val metaInf: CopySpec?
Link copied to clipboard
@get:Input
open val minimizeJar: Property<Boolean>

Minimizes the jar by removing unused classes.

Link copied to clipboard
open val mustRunAfter: TaskDependency
Link copied to clipboard
open val name: String
Link copied to clipboard
open val onlyIf: Spec<in TaskInternal>
Link copied to clipboard
open val outputs: TaskOutputsInternal
Link copied to clipboard
open val path: String
Link copied to clipboard
open val project: Project
Link copied to clipboard
Link copied to clipboard
@get:Input
open val relocationPrefix: Property<String>

Prefix used for auto relocation of packages in the dependencies.

Link copied to clipboard
open val relocators: SetProperty<Relocator>

Relocators to be applied in the shadow steps.

Link copied to clipboard
open val requiredServices: TaskRequiredServices
Link copied to clipboard
@get:Internal
open val rootSpec: CopySpecInternal
Link copied to clipboard
open val sharedResources: List<ResourceLock>
Link copied to clipboard
open val shouldRunAfter: TaskDependency
Link copied to clipboard
@get:Internal
open val source: FileCollection
Link copied to clipboard
@get:InputFiles
@get:PathSensitive(value = PathSensitivity.RELATIVE)
open val sourceSetsClassesDirs: ConfigurableFileCollection
Link copied to clipboard
open val standardOutputCapture: StandardOutputCapture
Link copied to clipboard
open val state: TaskStateInternal
Link copied to clipboard
open val taskActions: List<InputChangesAwareTaskAction>
Link copied to clipboard
open val taskDependencies: TaskDependencyInternal
Link copied to clipboard
open val taskIdentity: TaskIdentity<*>
Link copied to clipboard
open val temporaryDir: File
Link copied to clipboard
open val temporaryDirFactory: Factory<File>
Link copied to clipboard
open val timeout: Property<Duration>
Link copied to clipboard
@get:Classpath
open val toMinimize: ConfigurableFileCollection
Link copied to clipboard
open val transformers: SetProperty<ResourceTransformer>

ResourceTransformers to be applied in the shadow steps.

Functions

Link copied to clipboard
open fun acceptServiceReferences(serviceReferences: Set<ServiceReferenceSpec>)
Link copied to clipboard
open fun append(resourcePath: String, separator: String = AppendingTransformer.DEFAULT_SEPARATOR)

Append contents to a resource in the jar.

Link copied to clipboard
open fun appendParallelSafeAction(action: Action<in Task>)
Link copied to clipboard
open operator fun compareTo(otherTask: Task): Int
Link copied to clipboard
open fun configure(closure: Closure<*>): Task
Link copied to clipboard
open fun conventionMapping(property: String, mapping: Closure<*>): Task
open fun conventionMapping(property: String, mapping: Callable<*>): Task
Link copied to clipboard
open fun dependencies(action: Action<DependencyFilter>)

Extra dependency operations to be applied in the shadow steps.

Link copied to clipboard
open fun dependsOn(vararg paths: Any): Task
Link copied to clipboard
open fun dirPermissions(configureAction: Action<in ConfigurableFilePermissions>): CopyProcessingSpec
Link copied to clipboard
open fun doFirst(action: Closure<*>): Task
open fun doFirst(action: Action<in Task>): Task
open fun doFirst(actionName: String, action: Action<in Task>): Task
Link copied to clipboard
open fun doLast(action: Closure<*>): Task
open fun doLast(action: Action<in Task>): Task
open fun doLast(actionName: String, action: Action<in Task>): Task
Link copied to clipboard
open fun doNotTrackState(reasonNotToTrackState: String)
Link copied to clipboard
open fun eachFile(closure: Closure<*>): AbstractCopyTask
open fun eachFile(action: Action<in FileCopyDetails>): AbstractCopyTask
Link copied to clipboard
open fun exclude(excludeSpec: Closure<*>): AbstractCopyTask
open fun exclude(vararg excludes: String): AbstractCopyTask
open fun exclude(excludes: Iterable<String>): AbstractCopyTask
open fun exclude(excludeSpec: Spec<FileTreeElement>): AbstractCopyTask
Link copied to clipboard
open fun expand(properties: Map<String, *>): AbstractCopyTask
open fun expand(properties: Map<String, *>, action: Action<in ExpandDetails>): AbstractCopyTask
Link copied to clipboard
open fun filePermissions(configureAction: Action<in ConfigurableFilePermissions>): CopyProcessingSpec
Link copied to clipboard
open fun filesMatching(pattern: String, action: Action<in FileCopyDetails>): AbstractCopyTask
open fun filesMatching(patterns: Iterable<String>, action: Action<in FileCopyDetails>): AbstractCopyTask
Link copied to clipboard
open fun filesNotMatching(pattern: String, action: Action<in FileCopyDetails>): AbstractCopyTask
open fun filesNotMatching(patterns: Iterable<String>, action: Action<in FileCopyDetails>): AbstractCopyTask
Link copied to clipboard
open fun filter(closure: Closure<*>): AbstractCopyTask
open fun filter(filterType: Class<out FilterReader>): AbstractCopyTask
open fun filter(transformer: Transformer<@Nullable String?, String>): AbstractCopyTask
open fun filter(properties: Map<String, *>, filterType: Class<out FilterReader>): AbstractCopyTask
Link copied to clipboard
open fun finalizedBy(vararg paths: Any): Task
Link copied to clipboard
open fun from(vararg sourcePaths: @Nullable Any?): AbstractCopyTask
open fun from(sourcePath: Any, c: Closure<*>): AbstractCopyTask
open fun from(sourcePath: Any, configureAction: Action<in CopySpec>): AbstractCopyTask
Link copied to clipboard
open override fun getDuplicatesStrategy(): DuplicatesStrategy

Returns the strategy to use when trying to copy more than one file to the same destination.

Link copied to clipboard
@Input
open override fun getExcludes(): MutableSet<String>
Link copied to clipboard
@Input
open override fun getIncludes(): MutableSet<String>
Link copied to clipboard
@Internal
open override fun getManifest(): InheritManifest
Link copied to clipboard
open fun hasProperty(propertyName: String): Boolean
Link copied to clipboard
Link copied to clipboard
open fun include(includeSpec: Closure<*>): AbstractCopyTask
open fun include(vararg includes: String): AbstractCopyTask
open fun include(includes: Iterable<String>): AbstractCopyTask
open fun include(includeSpec: Spec<FileTreeElement>): AbstractCopyTask
Link copied to clipboard
open fun into(destPath: Any): AbstractArchiveTask
open fun into(destPath: Any, configureClosure: Closure<*>): AbstractArchiveTask
open fun into(destPath: Any, copySpec: Action<in CopySpec>): CopySpec
Link copied to clipboard
open fun manifest(configureClosure: Closure<*>): Jar
open fun manifest(configureAction: Action<in Manifest>?): Jar?
Link copied to clipboard

Merge Groovy extension modules (META-INF/**/org.codehaus.groovy.runtime.ExtensionModule).

Link copied to clipboard
open fun mergeServiceFiles(rootPath: String)

Merge Java services files with rootPath.

open fun mergeServiceFiles(action: Action<ServiceFileTransformer> = Action {})

Merge Java services files with action.

Link copied to clipboard
open fun metaInf(@DelegatesTo(value = CopySpec::class) configureClosure: Closure<*>?): CopySpec?
open fun metaInf(configureAction: Action<in CopySpec>?): CopySpec?
Link copied to clipboard
open fun minimize(action: Action<DependencyFilter> = Action {})

Enable minimizeJar and execute the action with the DependencyFilter for minimize.

Link copied to clipboard
open fun mustRunAfter(vararg paths: Any): Task
Link copied to clipboard
open fun onlyIf(onlyIfClosure: Closure<*>)
open fun onlyIf(spec: Spec<in Task>)
open fun onlyIf(onlyIfReason: String, spec: Spec<in Task>)
Link copied to clipboard
open fun prependParallelSafeAction(action: Action<in Task>)
Link copied to clipboard
open fun property(propertyName: String): Any
Link copied to clipboard
inline fun <R : Relocator> relocate(action: Action<R> = Action {})
open fun <R : Relocator> relocate(relocator: R, action: Action<R> = Action {})
open fun <R : Relocator> relocate(clazz: Class<R>, action: Action<R> = Action {})

Relocate classes and resources using a Relocator.

open fun relocate(pattern: String, destination: String, action: Action<SimpleRelocator> = Action {})

Relocate classes and resources matching pattern to destination using SimpleRelocator.

Link copied to clipboard
open fun rename(closure: Closure<*>): AbstractCopyTask
open fun rename(renamer: Transformer<@Nullable String?, String>): AbstractCopyTask
open fun rename(sourceRegEx: Pattern, replaceWith: String): AbstractCopyTask
open fun rename(sourceRegEx: String, replaceWith: String): AbstractCopyTask
Link copied to clipboard
open fun setDependsOn(dependsOn: Iterable<*>)
Link copied to clipboard
open fun setExcludes(excludes: Iterable<String>): AbstractCopyTask
Link copied to clipboard
open fun setFinalizedBy(finalizedByTasks: Iterable<*>)
Link copied to clipboard
open fun setIncludes(includes: Iterable<String>): AbstractCopyTask
Link copied to clipboard
open fun setMetadataCharset(metadataCharset: String)
Link copied to clipboard
open fun setMustRunAfter(mustRunAfterTasks: Iterable<*>)
Link copied to clipboard
open fun setOnlyIf(onlyIfClosure: Closure<*>)
open fun setOnlyIf(spec: Spec<in Task>)
open fun setOnlyIf(onlyIfReason: String, spec: Spec<in Task>)
Link copied to clipboard
open fun setProperty(name: String, value: Any)
Link copied to clipboard
open fun setShouldRunAfter(shouldRunAfterTasks: Iterable<*>)
Link copied to clipboard
open fun shouldRunAfter(vararg paths: Any): TaskDependency
Link copied to clipboard
inline fun <T : ResourceTransformer> transform(action: Action<T> = Action {})
open fun <T : ResourceTransformer> transform(transformer: T, action: Action<T> = Action {})
open fun <T : ResourceTransformer> transform(clazz: Class<T>, action: Action<T> = Action {})

Transform resources using a ResourceTransformer.

Link copied to clipboard
@Incubating
open fun useFileSystemPermissions()
Link copied to clipboard
open fun usesService(service: Provider<out BuildService<*>>)
Link copied to clipboard
open fun with(vararg sourceSpecs: CopySpec): CopySpec