Skip to content

Commit

Permalink
Build Improvements (#9855)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Faqa and runningcode committed Feb 6, 2023
1 parent fcb5c54 commit 56a08c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
Expand Down
2 changes: 2 additions & 0 deletions netty/shaded/build.gradle
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 56a08c3

Please sign in to comment.