Skip to content

Commit

Permalink
Add missing javadoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Sep 13, 2023
1 parent e5491cf commit 08a29de
Showing 1 changed file with 34 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public class ByteBuddyAndroidPlugin implements Plugin<Project> {
*/
private static final String BYTE_BUDDY_JAR_TYPE = "bytebuddy-jar";

/*
* Resolves the dispatcher.
*/
static {
TransformationDispatcher dispatcher;
try {
Expand Down Expand Up @@ -440,11 +443,19 @@ public void execute(CompatibilityCheckDetails<String> details) {
*/
protected interface TransformationDispatcher {

/**
* A dispatcher that is used for Android versions that do not support APK version 7.4 or newer.
*/
enum ForLegacyAndroid implements TransformationDispatcher {

/**
* The singleton instance.
*/
INSTANCE;

@Override
/**
* {@inheritDoc}
*/
public void accept(Project project, Variant variant, Configuration configuration, FileCollection classPath) {
TaskProvider<LegacyByteBuddyLocalClassesEnhancerTask> provider = project.getTasks().register(variant.getName() + "BytebuddyLocalTransform",
LegacyByteBuddyLocalClassesEnhancerTask.class,
Expand All @@ -456,21 +467,42 @@ public void accept(Project project, Variant variant, Configuration configuration
}
}

/**
* A dispatcher that is used for Android versions that do support APK version 7.4 or newer.
*/
class ForApk74CompatibleAndroid implements TransformationDispatcher {

/**
* The {@code com.android.build.api.variant.ScopedArtifacts$Scope#forScope} method.
*/
private final Method forScope;

/**
* The {@code com.android.build.api.variant.ScopedArtifacts$Scope#PROJECT} value.
*/
private final Object scope;

/**
* The {@code com.android.build.api.artifact.ScopedArtifact$CLASSES#INSTANCE} value.
*/
private final Artifact artifact;

/**
* Creates a new dispatcher.
*
* @param forScope The {@code com.android.build.api.variant.ScopedArtifacts$Scope#forScope} method.
* @param scope The {@code com.android.build.api.variant.ScopedArtifacts$Scope#PROJECT} value.
* @param artifact The {@code com.android.build.api.artifact.ScopedArtifact$CLASSES#INSTANCE} value.
*/
protected ForApk74CompatibleAndroid(Method forScope, Object scope, Artifact artifact) {
this.forScope = forScope;
this.scope = scope;
this.artifact = artifact;
}

@Override
/**
* {@inheritDoc}
*/
public void accept(Project project, Variant variant, Configuration configuration, FileCollection classPath) {
TaskProvider<ByteBuddyLocalClassesEnhancerTask> provider = project.getTasks().register(variant.getName() + "BytebuddyLocalTransform",
ByteBuddyLocalClassesEnhancerTask.class,
Expand Down

0 comments on commit 08a29de

Please sign in to comment.