Skip to content

Commit

Permalink
Merge kt files (#1256)
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler authored Feb 17, 2025
1 parent d35f47e commit 5509b55
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 20 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.github.jengelman.gradle.plugins.shadow.relocation

import com.github.jengelman.gradle.plugins.shadow.transformers.CacheableTransformer

/**
* Modified from [org.apache.maven.plugins.shade.relocation.Relocator.java](https://github.com/apache/maven-shade-plugin/blob/master/src/main/java/org/apache/maven/plugins/shade/relocation/Relocator.java).
*
Expand All @@ -21,3 +23,14 @@ public interface Relocator {
public val ROLE: String = Relocator::class.java.name
}
}

/**
* Marks that a given instance of [Relocator] is compatible with the Gradle build cache.
* In other words, it has its appropriate inputs annotated so that Gradle can consider them when
* determining the cache key.
*
* @see CacheableTransformer
*/
@Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.CLASS)
public annotation class CacheableRelocator

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.jengelman.gradle.plugins.shadow.transformers

import com.github.jengelman.gradle.plugins.shadow.relocation.CacheableRelocator
import java.io.IOException
import org.apache.tools.zip.ZipOutputStream
import org.gradle.api.Named
Expand Down Expand Up @@ -54,6 +55,17 @@ public interface Transformer : Named {
}
}

/**
* Marks that a given instance of [Transformer] is compatible with the Gradle build cache.
* In other words, it has its appropriate inputs annotated so that Gradle can consider them when
* determining the cache key.
*
* @see CacheableRelocator
*/
@Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.CLASS)
public annotation class CacheableTransformer

public object NoOpTransformer : Transformer {
public override fun canTransformResource(element: FileTreeElement): Boolean = false
public override fun transform(context: TransformerContext): Unit = Unit
Expand Down

0 comments on commit 5509b55

Please sign in to comment.