Skip to content

Commit

Permalink
Ignore manifest file for jars when computing task inputs (#5153)
Browse files Browse the repository at this point in the history
Motivation:

The shaded jar contains a manifest file which contains the build java
version including the patch version.
![Screenshot 2023-08-29 at 4 27 16
PM](https://github.com/line/armeria/assets/8510579/559e41ae-2d8e-4c5d-87fc-74dbfd486113)
I propose that we ignore the manifest file for all projects since it
doesn't really affect the output.
Note that the `trimShadedJar` is still executed, but I still think this
is a big improvement. The `trimShadedJar` task isn't cached because of
the `libraryJarFileCollection` input which I'm not sure there's much we
can do about

https://ge.armeria.dev/c/vll4rsgncwdai/zawmc5it7jzkw/task-inputs?expanded=WyJkZ3hnY3Zsc2hua3R3LWxpYnJhcnlqYXJmaWxlY29sbGVjdGlvbiJd&task-text=trim

ref: https://ge.armeria.dev/s/coxkiutevscp4

Modifications:

- Added a normalization for all projects which ignores
`META-INF/MANIFEST.MF` file

Result:

- Better caching even for different build jdk versions

<!--
Visit this URL to learn more about how to write a pull request
description:

https://armeria.dev/community/developer-guide#how-to-write-pull-request-description
-->
  • Loading branch information
jrhee17 authored Sep 5, 2023
1 parent b604f3f commit 1c93fee
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -446,3 +446,14 @@ gradleEnterprise {
}
}
}

allprojects {
normalization {
runtimeClasspath {
metaInf {
ignoreAttribute("Ant-Version")
ignoreAttribute("Created-By")
}
}
}
}

0 comments on commit 1c93fee

Please sign in to comment.