Package aQute.bnd.gradle
Class Index
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
aQute.bnd.gradle.Index
- All Implemented Interfaces:
Comparable<org.gradle.api.Task>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.TaskInternal,org.gradle.api.plugins.ExtensionAware,org.gradle.api.Task,org.gradle.util.Configurable<org.gradle.api.Task>
public class Index
extends org.gradle.api.DefaultTask
Index task type for Gradle.
This task type can be used to index a set of bundles.
Here is an example of using the Index task type:
import aQute.bnd.gradle.Index
tasks.register("index", Index) {
destinationDirectory = layout.buildDirectory.dir("libs")
gzip = true
bundles = fileTree(destinationDirectory) {
include "**/*.jar"
exclude "**/*-latest.jar"
exclude "**/*-sources.jar"
exclude "**/*-javadoc.jar"
builtBy tasks.withType(Jar)
}
}
Properties:
- base - The base URI for the generated index. The default is the file: URI of the destinationDirectory. The default value is buildDir.
- bundles - This is the bundles to be indexed. This property must be set.
- destinationDirectory - The destination directory for the index. This is used as the URI base of the generated index.
- gzip - If
true, then a gzip'd copy of the index will be made. Otherwise, only the uncompressed index will be made. The default isfalse. - indexName - The name of the index file. The default is
index.xml. - repositoryName - The name attribute in the generated index. The default is the name of the task.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Task
org.gradle.api.Task.Namer -
Field Summary
Fields 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 TypeMethodDescriptionorg.gradle.api.file.ConfigurableFileCollectionAdd files to the bundles to be indexed.org.gradle.api.provider.Property<URI>getBase()The URI base of the generated index.org.gradle.api.file.ConfigurableFileCollectionThe bundles to be indexed.org.gradle.api.file.DirectoryPropertyThe destination directory for the index.booleangetGzip()Whether a gzip'd index should be made.org.gradle.api.file.RegularFilePropertyThe compressed index file.org.gradle.api.provider.Property<String>The name of the index file.org.gradle.api.file.RegularFilePropertyThe uncompressed index file.org.gradle.api.provider.Property<String>The name attribute in the generated index.voidIndex the bundles.booleanisGzip()Whether a gzip'd index should be made.voidsetBundles(Object path) Set the bundles to be indexed.voidsetGzip(boolean gzip) Set whether a gzip'd index should be made.Methods 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, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceMethods inherited from class org.gradle.api.internal.AbstractTask
appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getOnlyIf, getReasonNotToTrackState, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, 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.Task
doNotTrackState, getConvention
-
Constructor Details
-
Index
public Index()Create an Index task.
-
-
Method Details
-
getBase
The URI base of the generated index.The default is the file: URI of the destinationDir.
- Returns:
- The property for the base of the generated index.
-
getBundles
@InputFiles public org.gradle.api.file.ConfigurableFileCollection getBundles()The bundles to be indexed.- Returns:
- The property for the bundles to be indexed.
-
getDestinationDirectory
@Internal("Represented by indexUncompressed and indexCompressed") public org.gradle.api.file.DirectoryProperty getDestinationDirectory()The destination directory for the index.The default value is project.layout.buildDirectory.
- Returns:
- The property for the destination directory for the index.
-
isGzip
@Input public boolean isGzip()Whether a gzip'd index should be made.- Returns:
trueif a gzip'd copy of the index will be made. Otherwise, only the uncompressed index will be made. The default isfalse.
-
getGzip
@Internal public boolean getGzip()Whether a gzip'd index should be made.An alias for
isGzip().- Returns:
trueif a gzip'd copy of the index will be made. Otherwise, only the uncompressed index will be made. The default isfalse.
-
setGzip
public void setGzip(boolean gzip) Set whether a gzip'd index should be made.- Parameters:
gzip- Iftrue, then a gzip'd copy of the index will be made. Otherwise, only the uncompressed index will be made. The default isfalse.
-
getIndexName
@Internal("Represented by indexUncompressed and indexCompressed") public org.gradle.api.provider.Property<String> getIndexName()The name of the index file.The default is
index.xml.- Returns:
- The name of the index file.
-
getRepositoryName
The name attribute in the generated index.The default is the name of the task.
- Returns:
- The name attribute in the generated index.
-
getIndexUncompressed
@OutputFile public org.gradle.api.file.RegularFileProperty getIndexUncompressed()The uncompressed index file.The default is
destinationDirectory.file(indexName).- Returns:
- The uncompressed index file.
-
getIndexCompressed
@OutputFile public org.gradle.api.file.RegularFileProperty getIndexCompressed()The compressed index file.The default is
destinationDirectory.file(indexName+".gz").- Returns:
- The compressed index file.
-
bundles
Add files to the bundles to be indexed.- Parameters:
paths- The arguments will be handled using ConfigurableFileCollection.from().- Returns:
- The property for the bundles to be indexed.
-
setBundles
Set the bundles to be indexed.- Parameters:
path- The argument will be handled using ConfigurableFileCollection.from().
-
indexerAction
Index the bundles.- Throws:
Exception- An exception during indexing.
-