public abstract class AbstractByteBuddyTask extends DefaultTask
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractByteBuddyTask.ByteBuddySkippingUrlClassLoader
A class loader that resolves a source set while still loading Byte Buddy classes from the Gradle plugin.
|
protected static class |
AbstractByteBuddyTask.TransformationLogger
A
Plugin.Engine.Listener that logs several relevant events during the build. |
Task.NamerTASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE| Modifier | Constructor and Description |
|---|---|
protected |
AbstractByteBuddyTask()
Creates a new abstract Byte Buddy task.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract Iterable<File> |
classPath()
Returns the class path to supply to the plugin engine.
|
protected static boolean |
deleteRecursively(File file)
Deletes a file or a folder recursively.
|
protected static boolean |
deleteRecursively(Iterable<File> files)
Deletes a collection of files or a folders recursively.
|
protected abstract Iterable<File> |
discoverySet()
Returns the discovery class path or
null if not specified. |
protected void |
doApply(Plugin.Engine.Source source,
Plugin.Engine.Target target)
Applies the transformation from a source to a target.
|
ClassFileVersion |
getClassFileVersion()
Returns the class file version to use for creating auxiliary types or
null if the
version is determined implicitly. |
Discovery |
getDiscovery()
Determines the discovery for finding plugins on the class path.
|
EntryPoint |
getEntryPoint()
Returns the entry point to use.
|
String |
getSuffix()
Returns the suffix to use for rebased methods or the empty string if a random suffix should be used.
|
int |
getThreads()
Returns the number of threads to use for transforming or
0 if the transformation should be applied in the main thread. |
List<Transformation> |
getTransformations()
Returns the transformations to apply.
|
boolean |
isExtendedParsing()
Returns
true if extended parsing should be used. |
boolean |
isFailFast()
Returns
true if a warning should be issued for an empty type set. |
boolean |
isFailOnLiveInitializer()
Returns
true if the transformation should fail if a live initializer is used. |
boolean |
isWarnOnEmptyTypeSet()
Returns
true if a warning should be issued for an empty type set. |
void |
setClassFileVersion(ClassFileVersion classFileVersion)
Sets the class file version to use for creating auxiliary types or
null if the
version is determined implicitly. |
void |
setDiscovery(Discovery discovery)
Determines the discovery being used for finding plugins on the class path.
|
void |
setEntryPoint(EntryPoint entryPoint)
Sets the entry point to use.
|
void |
setExtendedParsing(boolean extendedParsing)
Determines if extended parsing should be used.
|
void |
setFailFast(boolean failFast)
Determines if a warning should be issued for an empty type set.
|
void |
setFailOnLiveInitializer(boolean failOnLiveInitializer)
Determines if the transformation should fail if a live initializer is used.
|
void |
setSuffix(String suffix)
Sets the suffix to use for rebased methods or the empty string if a random suffix should be used.
|
void |
setThreads(int threads)
Sets the number of threads to use for transforming or
0 if the transformation should be applied in the main thread. |
void |
setWarnOnEmptyTypeSet(boolean warnOnEmptyTypeSet)
Returns
true if a warning should be issued for an empty type set. |
protected abstract File |
source()
Returns the source file or folder.
|
protected abstract File |
target()
Returns the target file or folder.
|
void |
transformation(Action<Transformation> action)
Adds an additional transformation.
|
void |
transformation(groovy.lang.Closure<Transformation> closure)
Adds an additional transformation.
|
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, usesServiceappendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjectsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdoNotTrackState, getConvention, notCompatibleWithConfigurationCacheprotected AbstractByteBuddyTask()
public List<Transformation> getTransformations()
public void transformation(groovy.lang.Closure<Transformation> closure)
closure - The closure to configure the transformation.public void transformation(Action<Transformation> action)
action - The action to configure the transformation.@Input public EntryPoint getEntryPoint()
public void setEntryPoint(EntryPoint entryPoint)
entryPoint - The entry point to use.@Input public String getSuffix()
public void setSuffix(String suffix)
suffix - The suffix to use for rebased methods or the empty string if a random suffix should be used.@Internal public boolean isFailOnLiveInitializer()
true if the transformation should fail if a live initializer is used.true if the transformation should fail if a live initializer is used.public void setFailOnLiveInitializer(boolean failOnLiveInitializer)
failOnLiveInitializer - true if the transformation should fail if a live initializer is used.@Internal public boolean isWarnOnEmptyTypeSet()
true if a warning should be issued for an empty type set.true if a warning should be issued for an empty type set.public void setWarnOnEmptyTypeSet(boolean warnOnEmptyTypeSet)
true if a warning should be issued for an empty type set.warnOnEmptyTypeSet - true if a warning should be issued for an empty type set.@Internal public boolean isFailFast()
true if a warning should be issued for an empty type set.true if a warning should be issued for an empty type set.public void setFailFast(boolean failFast)
failFast - true if a warning should be issued for an empty type set.@Input public boolean isExtendedParsing()
true if extended parsing should be used.true if extended parsing should be used.public void setExtendedParsing(boolean extendedParsing)
extendedParsing - true if extended parsing should be used.@Input public Discovery getDiscovery()
public void setDiscovery(Discovery discovery)
discovery - The discovery for finding plugins on the class path.@Internal public int getThreads()
0 if the transformation should be applied in the main thread.0 if the transformation should be applied in the main thread.public void setThreads(int threads)
0 if the transformation should be applied in the main thread.threads - The number of threads to use for transforming or 0 if the transformation should be applied in the main thread.@MaybeNull @Input @Optional public ClassFileVersion getClassFileVersion()
null if the
version is determined implicitly.public void setClassFileVersion(@MaybeNull ClassFileVersion classFileVersion)
null if the
version is determined implicitly.classFileVersion - The class file version to use for creating auxiliary types.protected abstract File source()
protected abstract File target()
protected abstract Iterable<File> classPath()
@MaybeNull protected abstract Iterable<File> discoverySet()
null if not specified.null if not specified.protected void doApply(Plugin.Engine.Source source, Plugin.Engine.Target target) throws IOException
source - The plugin engine's source.target - The plugin engine's target.IOException - If an I/O exception occurs.protected static boolean deleteRecursively(Iterable<File> files)
files - The files or folders to delete.true if any of the files or folders were deleted.protected static boolean deleteRecursively(File file)
file - The file or folder to delete.true if the file or folders were deleted.