类 InfraJar

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
cn.taketoday.gradle.tasks.bundling.InfraJar
所有已实现的接口:
InfraArchive, 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.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.api.tasks.util.PatternFilterable, org.gradle.util.Configurable<org.gradle.api.Task>

@DisableCachingByDefault(because="Not worth caching") public abstract class InfraJar extends org.gradle.api.tasks.bundling.Jar implements InfraArchive
A custom Jar task that produces a Infra executable jar.
从以下版本开始:
4.0
作者:
Andy Wilkinson, Madhura Bhave, Scott Frederick, Phillip Webb, Harry Yang
  • 嵌套类概要

    嵌套类
    修饰符和类型
    说明
    private final class 
     
    private final class 
     

    从接口继承的嵌套类/接口 org.gradle.api.Task

    org.gradle.api.Task.Namer
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    private final org.gradle.api.file.CopySpec
     
    private static final String
     
    private org.gradle.api.file.FileCollection
     
    private static final String
     
    private static final String
     
    private final LayeredSpec
     
    private static final String
     
    private static final String
     
    private final org.gradle.api.provider.Provider<String>
     
    private final org.gradle.api.provider.Provider<Object>
     
    private final ResolvedDependencies
     
    private final InfraArchiveSupport
     

    从类继承的字段 org.gradle.jvm.tasks.Jar

    DEFAULT_EXTENSION

    从类继承的字段 org.gradle.api.tasks.bundling.Zip

    ZIP_EXTENSION

    从接口继承的字段 org.gradle.api.Task

    TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
  • 构造器概要

    构造器
    构造器
    说明
    Creates a new InfraJar task.
  • 方法概要

    修饰符和类型
    方法
    说明
    org.gradle.api.file.CopySpec
    appInf(org.gradle.api.Action<org.gradle.api.file.CopySpec> action)
    Calls the given action to add content to the APP-INF directory of the jar.
    private static <T> Callable<T>
    callTo(Callable<T> callable)
    Syntactic sugar that makes CopySpec.from(java.lang.Object...) calls a little easier to read.
    void
    classpath(Object... classpath)
    Adds files to the classpath to include in the archive.
    private Iterable<File>
     
    private Iterable<File>
    classpathEntries(org.gradle.api.specs.Spec<File> filter)
     
    private Iterable<File>
     
    private void
    configureAppInfSpec(org.gradle.api.file.CopySpec appInfSpec)
     
    void
     
    protected org.gradle.api.internal.file.copy.CopyAction
     
     
    private static <T> org.gradle.api.Action<org.gradle.api.file.CopySpec>
    fromCallTo(Callable<T> callable)
    Syntactic sugar that makes CopySpec.into(java.lang.Object) calls a little easier to read.
    org.gradle.api.file.CopySpec
    Returns a CopySpec that can be used to add content to the APP-INF directory of the jar.
    org.gradle.api.file.FileCollection
    Returns the classpath that will be included in the archive.
    Returns the LaunchScriptConfiguration that will control the script that is prepended to the archive.
    Returns the spec that describes the layers in a layered jar.
    (专用程序包) ResolvedDependencies
     
    private boolean
     
    protected boolean
    isLibrary(org.gradle.api.file.FileCopyDetails details)
    Return if the FileCopyDetails are for a library.
    void
    Configures the archive to have a prepended launch script.
    void
    launchScript(org.gradle.api.Action<LaunchScriptConfiguration> action)
    Configures the archive to have a prepended launch script, customizing its configuration using the given action.
    void
    layered(org.gradle.api.Action<LayeredSpec> action)
    Configures the jar's layering using the given action.
    private void
    moveMetaInfToApp(org.gradle.api.file.CopySpec spec)
     
    void
    requiresUnpack(String... patterns)
    Adds Ant-style patterns that identify files that must be unpacked from the archive when it is launched.
    void
    requiresUnpack(org.gradle.api.specs.Spec<org.gradle.api.file.FileTreeElement> spec)
    Adds a spec that identifies files that must be unpacked from the archive when it is launched.
    void
    resolvedArtifacts(org.gradle.api.provider.Provider<Set<org.gradle.api.artifacts.result.ResolvedArtifactResult>> resolvedArtifacts)
    Registers the given lazily provided resolvedArtifacts.
    protected ZipCompression
    resolveZipCompression(org.gradle.api.file.FileCopyDetails details)
    Return the ZipCompression that should be used when adding the file represented by the given details to the jar.
    void
    setClasspath(Object classpath)
    Sets the classpath to include in the archive.
    void
    setClasspath(org.gradle.api.file.FileCollection classpath)
    Sets the classpath to include in the archive.

    从类继承的方法 org.gradle.api.tasks.bundling.Jar

    manifest

    从类继承的方法 org.gradle.jvm.tasks.Jar

    getManifest, getManifestContentCharset, getMetadataCharset, getMetaInf, manifest, metaInf, metaInf, setManifest, setManifestContentCharset, setMetadataCharset

    从类继承的方法 org.gradle.api.tasks.bundling.Zip

    getCompressor, getEntryCompression, isZip64, setEntryCompression, setZip64

    从类继承的方法 org.gradle.api.tasks.bundling.AbstractArchiveTask

    createCopyActionExecuter, getArchiveAppendix, getArchiveBaseName, getArchiveClassifier, getArchiveExtension, getArchiveFile, getArchiveFileName, getArchivePath, getArchiveVersion, getDestinationDirectory, into, into, into, isPreserveFileTimestamps, isReproducibleFileOrder, setPreserveFileTimestamps, setReproducibleFileOrder

    从类继承的方法 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, with

    从类继承的方法 org.gradle.api.internal.ConventionTask

    conventionMapping, conventionMapping, getConventionMapping

    从类继承的方法 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, usesService

    从类继承的方法 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, setImpliesSubProjects

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    从接口继承的方法 java.lang.Comparable

    compareTo

    从接口继承的方法 org.gradle.api.plugins.ExtensionAware

    getExtensions

    从接口继承的方法 cn.taketoday.gradle.tasks.bundling.InfraArchive

    getMainClass, getTargetJavaVersion

    从接口继承的方法 org.gradle.api.Task

    configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, doNotTrackState, finalizedBy, getActions, getAnt, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getFinalizedBy, getGroup, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getPath, getProject, getShouldRunAfter, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, notCompatibleWithConfigurationCache, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
  • 字段详细资料

    • LAUNCHER

      private static final String LAUNCHER
      另请参阅:
    • CLASSES_DIRECTORY

      private static final String CLASSES_DIRECTORY
      另请参阅:
    • LIB_DIRECTORY

      private static final String LIB_DIRECTORY
      另请参阅:
    • LAYERS_INDEX

      private static final String LAYERS_INDEX
      另请参阅:
    • CLASSPATH_INDEX

      private static final String CLASSPATH_INDEX
      另请参阅:
    • support

      private final InfraArchiveSupport support
    • appInfSpec

      private final org.gradle.api.file.CopySpec appInfSpec
    • layered

      private final LayeredSpec layered
    • projectName

      private final org.gradle.api.provider.Provider<String> projectName
    • projectVersion

      private final org.gradle.api.provider.Provider<Object> projectVersion
    • resolvedDependencies

      private final ResolvedDependencies resolvedDependencies
    • classpath

      private org.gradle.api.file.FileCollection classpath
  • 构造器详细资料

    • InfraJar

      public InfraJar()
      Creates a new InfraJar task.
  • 方法详细资料

    • configureAppInfSpec

      private void configureAppInfSpec(org.gradle.api.file.CopySpec appInfSpec)
    • classpathDirectories

      private Iterable<File> classpathDirectories()
    • classpathFiles

      private Iterable<File> classpathFiles()
    • classpathEntries

      private Iterable<File> classpathEntries(org.gradle.api.specs.Spec<File> filter)
    • moveMetaInfToApp

      private void moveMetaInfToApp(org.gradle.api.file.CopySpec spec)
    • resolvedArtifacts

      public void resolvedArtifacts(org.gradle.api.provider.Provider<Set<org.gradle.api.artifacts.result.ResolvedArtifactResult>> resolvedArtifacts)
      从接口复制的说明: InfraArchive
      Registers the given lazily provided resolvedArtifacts. They are used to map from the files in the classpath to their dependency coordinates.
      指定者:
      resolvedArtifacts 在接口中 InfraArchive
      参数:
      resolvedArtifacts - the lazily provided resolved artifacts
    • getResolvedDependencies

      ResolvedDependencies getResolvedDependencies()
    • copy

      public void copy()
      覆盖:
      copy 在类中 org.gradle.api.tasks.AbstractCopyTask
    • isLayeredDisabled

      private boolean isLayeredDisabled()
    • createCopyAction

      protected org.gradle.api.internal.file.copy.CopyAction createCopyAction()
      覆盖:
      createCopyAction 在类中 org.gradle.api.tasks.bundling.Zip
    • requiresUnpack

      public void requiresUnpack(String... patterns)
      从接口复制的说明: InfraArchive
      Adds Ant-style patterns that identify files that must be unpacked from the archive when it is launched.
      指定者:
      requiresUnpack 在接口中 InfraArchive
      参数:
      patterns - the patterns
    • requiresUnpack

      public void requiresUnpack(org.gradle.api.specs.Spec<org.gradle.api.file.FileTreeElement> spec)
      从接口复制的说明: InfraArchive
      Adds a spec that identifies files that must be unpacked from the archive when it is launched.
      指定者:
      requiresUnpack 在接口中 InfraArchive
      参数:
      spec - the spec
    • getLaunchScript

      public LaunchScriptConfiguration getLaunchScript()
      从接口复制的说明: InfraArchive
      Returns the LaunchScriptConfiguration that will control the script that is prepended to the archive.
      指定者:
      getLaunchScript 在接口中 InfraArchive
      返回:
      the launch script configuration, or null if the launch script has not been configured.
    • launchScript

      public void launchScript()
      从接口复制的说明: InfraArchive
      Configures the archive to have a prepended launch script.
      指定者:
      launchScript 在接口中 InfraArchive
    • launchScript

      public void launchScript(org.gradle.api.Action<LaunchScriptConfiguration> action)
      从接口复制的说明: InfraArchive
      Configures the archive to have a prepended launch script, customizing its configuration using the given action.
      指定者:
      launchScript 在接口中 InfraArchive
      参数:
      action - the action to apply
    • getLayered

      public LayeredSpec getLayered()
      Returns the spec that describes the layers in a layered jar.
      返回:
      the spec for the layers
    • layered

      public void layered(org.gradle.api.Action<LayeredSpec> action)
      Configures the jar's layering using the given action.
      参数:
      action - the action to apply
    • getClasspath

      public org.gradle.api.file.FileCollection getClasspath()
      从接口复制的说明: InfraArchive
      Returns the classpath that will be included in the archive.
      指定者:
      getClasspath 在接口中 InfraArchive
      返回:
      the classpath
    • classpath

      public void classpath(Object... classpath)
      从接口复制的说明: InfraArchive
      Adds files to the classpath to include in the archive. The given classpath is evaluated as per Project.files(Object...).
      指定者:
      classpath 在接口中 InfraArchive
      参数:
      classpath - the additions to the classpath
    • setClasspath

      public void setClasspath(Object classpath)
      从接口复制的说明: InfraArchive
      Sets the classpath to include in the archive. The given classpath is evaluated as per Project.files(Object...).
      指定者:
      setClasspath 在接口中 InfraArchive
      参数:
      classpath - the classpath
    • setClasspath

      public void setClasspath(org.gradle.api.file.FileCollection classpath)
      从接口复制的说明: InfraArchive
      Sets the classpath to include in the archive.
      指定者:
      setClasspath 在接口中 InfraArchive
      参数:
      classpath - the classpath
    • getAppInf

      @Internal public org.gradle.api.file.CopySpec getAppInf()
      Returns a CopySpec that can be used to add content to the APP-INF directory of the jar.
      返回:
      a CopySpec for APP-INF
    • appInf

      public org.gradle.api.file.CopySpec appInf(org.gradle.api.Action<org.gradle.api.file.CopySpec> action)
      Calls the given action to add content to the APP-INF directory of the jar.
      参数:
      action - the Action to call
      返回:
      the CopySpec for APP-INF that was passed to the Action
    • resolveZipCompression

      protected ZipCompression resolveZipCompression(org.gradle.api.file.FileCopyDetails details)
      Return the ZipCompression that should be used when adding the file represented by the given details to the jar. By default, any library is stored and all other files are deflated.
      参数:
      details - the file copy details
      返回:
      the compression to use
    • isLibrary

      protected boolean isLibrary(org.gradle.api.file.FileCopyDetails details)
      Return if the FileCopyDetails are for a library. By default any file in APP-INF/lib is considered to be a library.
      参数:
      details - the file copy details
      返回:
      true if the details are for a library
    • enableLaunchScriptIfNecessary

      private LaunchScriptConfiguration enableLaunchScriptIfNecessary()
    • fromCallTo

      private static <T> org.gradle.api.Action<org.gradle.api.file.CopySpec> fromCallTo(Callable<T> callable)
      Syntactic sugar that makes CopySpec.into(java.lang.Object) calls a little easier to read.
      类型参数:
      T - the result type
      参数:
      callable - the callable
      返回:
      an action to add the callable to the spec
    • callTo

      private static <T> Callable<T> callTo(Callable<T> callable)
      Syntactic sugar that makes CopySpec.from(java.lang.Object...) calls a little easier to read.
      类型参数:
      T - the result type
      参数:
      callable - the callable
      返回:
      the callable