-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make shadowJar task cacheable (#524)
* Make shadowJar a cacheable task * Use annotations to mark Transformers and Relocators as cacheable * Add relocatability checks when task is cached * Refactor cacheability checks in shadowJar task * Change shadowJar file collection inputs to use @classpath
- Loading branch information
1 parent
4067dd1
commit 57a26d6
Showing
14 changed files
with
993 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...in/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/CacheableRelocator.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.github.jengelman.gradle.plugins.shadow.relocation | ||
|
||
import java.lang.annotation.ElementType | ||
import java.lang.annotation.Retention | ||
import java.lang.annotation.RetentionPolicy | ||
import java.lang.annotation.Target | ||
|
||
/** | ||
* Marks that a given instance of {@link Relocator} is 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. | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.TYPE) | ||
@interface CacheableRelocator { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...roovy/com/github/jengelman/gradle/plugins/shadow/transformers/CacheableTransformer.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.github.jengelman.gradle.plugins.shadow.transformers | ||
|
||
import java.lang.annotation.ElementType | ||
import java.lang.annotation.Retention | ||
import java.lang.annotation.RetentionPolicy | ||
import java.lang.annotation.Target | ||
|
||
/** | ||
* Marks that a given instance of {@link Transformer} is 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. | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.TYPE) | ||
@interface CacheableTransformer { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.