Class ShadowJar
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.gradle.api.internal.ConventionTask
org.gradle.api.tasks.AbstractCopyTask
org.gradle.api.tasks.bundling.AbstractArchiveTask
org.gradle.api.tasks.bundling.Zip
org.gradle.jvm.tasks.Jar
org.gradle.api.tasks.bundling.Jar
com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
- All Implemented Interfaces:
Comparable<org.gradle.api.Task>,org.gradle.api.file.ContentFilterable,org.gradle.api.file.CopyProcessingSpec,org.gradle.api.file.CopySourceSpec,org.gradle.api.file.CopySpec,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.file.copy.CopySpecSource,org.gradle.api.internal.IConventionAware,org.gradle.api.internal.TaskInternal,org.gradle.api.Named,org.gradle.api.plugins.ExtensionAware,org.gradle.api.Task,org.gradle.api.tasks.util.PatternFilterable,org.gradle.util.Configurable<org.gradle.api.Task>
@CacheableTask
public class ShadowJar
extends org.gradle.api.tasks.bundling.Jar
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Task
org.gradle.api.Task.Namer -
Field Summary
Fields inherited from class org.gradle.jvm.tasks.Jar
DEFAULT_EXTENSIONFields inherited from class org.gradle.api.tasks.bundling.Zip
ZIP_EXTENSIONFields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSyntax sugar for merging service files in JARsprotected voidcopy()protected @NotNull org.gradle.api.internal.file.copy.CopyActiondependencies(org.gradle.api.Action<com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilter> c) Configure inclusion/exclusion of module and project dependencies into uber jar.List<org.gradle.api.file.FileCollection> com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilterorg.gradle.api.file.FileCollectionprotected com.github.jengelman.gradle.plugins.shadow.internal.ZipCompressorcom.github.jengelman.gradle.plugins.shadow.tasks.InheritManifestList<com.github.jengelman.gradle.plugins.shadow.relocation.Relocator> protected org.gradle.api.tasks.util.PatternSetUtility method for assisting between changes in Gradle 1.12 and 2.x.com.github.jengelman.gradle.plugins.shadow.ShadowStatsgetStats()List<com.github.jengelman.gradle.plugins.shadow.transformers.Transformer> booleanSyntactic sugar for merging Groovy extension module descriptor files in JARsSyntactic sugar for merging service files in JARs.mergeServiceFiles(String rootPath) Syntactic sugar for merging service files in JARs.mergeServiceFiles(org.gradle.api.Action<com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer> configureClosure) Syntactic sugar for merging service files in JARs.minimize()minimize(org.gradle.api.Action<com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilter> c) relocate(com.github.jengelman.gradle.plugins.shadow.relocation.Relocator relocator) Add a relocator instance.relocate(Class<? extends com.github.jengelman.gradle.plugins.shadow.relocation.Relocator> relocatorClass) Add a relocator of the provided class.<R extends com.github.jengelman.gradle.plugins.shadow.relocation.Relocator>
ShadowJarAdd a relocator of the provided class and configure.Add a class relocator that maps each class in the pattern to the provided destination.relocate(String pattern, String destination, org.gradle.api.Action<com.github.jengelman.gradle.plugins.shadow.relocation.SimpleRelocator> configure) Add a class relocator that maps each class in the pattern to the provided destination.voidsetConfigurations(List<org.gradle.api.file.FileCollection> configurations) voidsetDependencyFilter(com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilter filter) voidsetEnableRelocation(boolean enableRelocation) voidsetRelocationPrefix(String relocationPrefix) voidsetRelocators(List<com.github.jengelman.gradle.plugins.shadow.relocation.Relocator> relocators) voidsetTransformers(List<com.github.jengelman.gradle.plugins.shadow.transformers.Transformer> transformers) transform(com.github.jengelman.gradle.plugins.shadow.transformers.Transformer transformer) Add a preconfigured transformer instance.transform(Class<? extends com.github.jengelman.gradle.plugins.shadow.transformers.Transformer> clazz) Add a Transformer instance for modifying JAR resources and configure.<T extends com.github.jengelman.gradle.plugins.shadow.transformers.Transformer>
ShadowJarAdd a Transformer instance for modifying JAR resources and configure.Methods inherited from class org.gradle.api.tasks.bundling.Jar
manifestMethods inherited from class org.gradle.jvm.tasks.Jar
getManifestContentCharset, getMetadataCharset, getMetaInf, manifest, metaInf, metaInf, setManifest, setManifestContentCharset, setMetadataCharsetMethods inherited from class org.gradle.api.tasks.bundling.Zip
getCompressor, getEntryCompression, isZip64, setEntryCompression, setZip64Methods inherited from class org.gradle.api.tasks.bundling.AbstractArchiveTask
createCopyActionExecuter, getArchiveAppendix, getArchiveBaseName, getArchiveClassifier, getArchiveExtension, getArchiveFile, getArchiveFileName, getArchivePath, getArchiveVersion, getDestinationDirectory, into, into, into, isPreserveFileTimestamps, isReproducibleFileOrder, setPreserveFileTimestamps, setReproducibleFileOrderMethods inherited from class org.gradle.api.tasks.AbstractCopyTask
createRootSpec, dirPermissions, eachFile, eachFile, exclude, exclude, exclude, exclude, expand, expand, filePermissions, filesMatching, filesMatching, filesNotMatching, filesNotMatching, filter, filter, filter, filter, from, from, from, getDirectoryFileTreeFactory, getDirMode, getDirPermissions, getDocumentationRegistry, getDuplicatesStrategy, getExcludes, getFileLookup, getFileMode, getFilePermissions, getFileResolver, getFileSystem, getFilteringCharset, getIncludeEmptyDirs, getIncludes, getInstantiator, getMainSpec, getObjectFactory, getRootSpec, getSource, include, include, include, include, isCaseSensitive, rename, rename, rename, rename, setCaseSensitive, setDirMode, setDuplicatesStrategy, setExcludes, setFileMode, setFilteringCharset, setIncludeEmptyDirs, setIncludes, withMethods inherited from class org.gradle.api.internal.ConventionTask
conventionMapping, conventionMapping, getConventionMappingMethods inherited from class org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceMethods inherited from class org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjectsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.file.CopyProcessingSpec
dirPermissions, filePermissions, getDirMode, getDirPermissions, getFileMode, getFilePermissions, setDirMode, setFileModeMethods inherited from interface org.gradle.api.file.CopySpec
eachFile, eachFile, exclude, exclude, exclude, exclude, expand, expand, filesMatching, filesMatching, filesNotMatching, filesNotMatching, filter, filter, filter, filter, from, from, from, getDuplicatesStrategy, getFilteringCharset, getIncludeEmptyDirs, include, include, include, include, into, into, into, isCaseSensitive, rename, rename, rename, rename, setCaseSensitive, setDuplicatesStrategy, setExcludes, setFilteringCharset, setIncludeEmptyDirs, setIncludes, withMethods inherited from interface org.gradle.api.tasks.util.PatternFilterable
getExcludes, getIncludesMethods inherited from interface org.gradle.api.Task
doNotTrackState, getConvention, notCompatibleWithConfigurationCache
-
Constructor Details
-
ShadowJar
public ShadowJar()
-
-
Method Details
-
minimize
-
minimize
public ShadowJar minimize(org.gradle.api.Action<com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilter> c) -
getStats
@Internal public com.github.jengelman.gradle.plugins.shadow.ShadowStats getStats() -
getManifest
public com.github.jengelman.gradle.plugins.shadow.tasks.InheritManifest getManifest()- Overrides:
getManifestin classorg.gradle.jvm.tasks.Jar
-
createCopyAction
@NotNull protected @NotNull org.gradle.api.internal.file.copy.CopyAction createCopyAction()- Overrides:
createCopyActionin classorg.gradle.api.tasks.bundling.Zip
-
getInternalCompressor
@Internal protected com.github.jengelman.gradle.plugins.shadow.internal.ZipCompressor getInternalCompressor() -
copy
protected void copy()- Overrides:
copyin classorg.gradle.api.tasks.AbstractCopyTask
-
getIncludedDependencies
@Classpath public org.gradle.api.file.FileCollection getIncludedDependencies() -
getRootPatternSet
@Internal protected org.gradle.api.tasks.util.PatternSet getRootPatternSet()Utility method for assisting between changes in Gradle 1.12 and 2.x.- Returns:
- this
-
dependencies
public ShadowJar dependencies(org.gradle.api.Action<com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilter> c) Configure inclusion/exclusion of module and project dependencies into uber jar.- Parameters:
c- the configuration of the filter- Returns:
- this
-
transform
public ShadowJar transform(Class<? extends com.github.jengelman.gradle.plugins.shadow.transformers.Transformer> clazz) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException Add a Transformer instance for modifying JAR resources and configure.- Parameters:
clazz- the transformer to add. Must have a no-arg constructor- Returns:
- this
- Throws:
InstantiationExceptionIllegalAccessExceptionNoSuchMethodExceptionInvocationTargetException
-
transform
public <T extends com.github.jengelman.gradle.plugins.shadow.transformers.Transformer> ShadowJar transform(Class<T> clazz, org.gradle.api.Action<T> c) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException Add a Transformer instance for modifying JAR resources and configure.- Parameters:
clazz- the transformer class to add. Must have no-arg constructorc- the configuration for the transformer- Returns:
- this
- Throws:
InstantiationExceptionIllegalAccessExceptionNoSuchMethodExceptionInvocationTargetException
-
transform
public ShadowJar transform(com.github.jengelman.gradle.plugins.shadow.transformers.Transformer transformer) Add a preconfigured transformer instance.- Parameters:
transformer- the transformer instance to add- Returns:
- this
-
mergeServiceFiles
Syntactic sugar for merging service files in JARs.- Returns:
- this
-
mergeServiceFiles
Syntactic sugar for merging service files in JARs.- Returns:
- this
-
mergeServiceFiles
public ShadowJar mergeServiceFiles(org.gradle.api.Action<com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer> configureClosure) Syntactic sugar for merging service files in JARs.- Returns:
- this
-
mergeGroovyExtensionModules
Syntactic sugar for merging Groovy extension module descriptor files in JARs- Returns:
- this
-
append
Syntax sugar for merging service files in JARs- Returns:
- this
-
relocate
Add a class relocator that maps each class in the pattern to the provided destination.- Parameters:
pattern- the source pattern to relocatedestination- the destination package- Returns:
- this
-
relocate
public ShadowJar relocate(String pattern, String destination, org.gradle.api.Action<com.github.jengelman.gradle.plugins.shadow.relocation.SimpleRelocator> configure) Add a class relocator that maps each class in the pattern to the provided destination.- Parameters:
pattern- the source pattern to relocatedestination- the destination packageconfigure- the configuration of the relocator- Returns:
- this
-
relocate
public ShadowJar relocate(com.github.jengelman.gradle.plugins.shadow.relocation.Relocator relocator) Add a relocator instance.- Parameters:
relocator- the relocator instance to add- Returns:
- this
-
relocate
public ShadowJar relocate(Class<? extends com.github.jengelman.gradle.plugins.shadow.relocation.Relocator> relocatorClass) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException Add a relocator of the provided class.- Parameters:
relocatorClass- the relocator class to add. Must have a no-arg constructor.- Returns:
- this
- Throws:
InstantiationExceptionIllegalAccessExceptionNoSuchMethodExceptionInvocationTargetException
-
relocate
public <R extends com.github.jengelman.gradle.plugins.shadow.relocation.Relocator> ShadowJar relocate(Class<R> relocatorClass, org.gradle.api.Action<R> configure) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException Add a relocator of the provided class and configure.- Parameters:
relocatorClass- the relocator class to add. Must have a no-arg constructorconfigure- the configuration for the relocator- Returns:
- this
- Throws:
InstantiationExceptionIllegalAccessExceptionNoSuchMethodExceptionInvocationTargetException
-
getTransformers
-
setTransformers
public void setTransformers(List<com.github.jengelman.gradle.plugins.shadow.transformers.Transformer> transformers) -
getRelocators
-
setRelocators
public void setRelocators(List<com.github.jengelman.gradle.plugins.shadow.relocation.Relocator> relocators) -
getConfigurations
-
setConfigurations
-
getDependencyFilter
@Internal public com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilter getDependencyFilter() -
setDependencyFilter
public void setDependencyFilter(com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilter filter) -
isEnableRelocation
@Input public boolean isEnableRelocation() -
setEnableRelocation
public void setEnableRelocation(boolean enableRelocation) -
getRelocationPrefix
-
setRelocationPrefix
-