Build Improvements (#9855)

* Made dependency on build.gradle in protobuf tasks relative so as to make downstream tasks cacheable

* Made transformer cacheable

* Add property name to path to root build.gradle

Co-authored-by: Nelson Osacky <nelson@osacky.com>
This commit is contained in:
Asaf Flescher 2023-02-06 17:57:09 -05:00 committed by GitHub
parent fcb5c54e4b
commit 56a08c3506
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -70,7 +70,9 @@ subprojects {
all().each { task ->
// Recompile protos when build.gradle has been changed, because
// it's possible the version of protoc has been changed.
task.inputs.file "${rootProject.projectDir}/build.gradle"
task.inputs.file("${rootProject.projectDir}/build.gradle")
.withPathSensitivity(PathSensitivity.RELATIVE)
.withPropertyName('root build.gradle')
if (isAndroid) {
task.builtins {
java { option 'lite' }

View File

@ -1,4 +1,5 @@
import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer
import com.github.jengelman.gradle.plugins.shadow.transformers.CacheableTransformer
import com.github.jengelman.gradle.plugins.shadow.transformers.TransformerContext
import org.gradle.api.file.FileTreeElement
import shadow.org.apache.tools.zip.ZipOutputStream
@ -140,6 +141,7 @@ tasks.named("test").configure {
* A Transformer which updates the Netty JAR META-INF/ resources to accurately
* reference shaded class names.
*/
@CacheableTransformer
class NettyResourceTransformer implements Transformer {
// A map of resource file paths to be modified