This pull requests enables caching for the native image building task and improves the caching effectiveness of some of the test tasks in the project.
the native image building is a generic Exec tasks for which caching needs to be enabled explicitly (see docs) as the build tool doesn't have natively have enough information to cache it effectively -- furthermore some steps need to be taken to normalize the classpath (JARs come with an embedded timestamp in their manifest and this needs to be ignored), as well as not rely on absolute paths
while tests are usually cacheable, path relativity needs to be added as a property to ensure the results can be retrieved from a cache without relying on the environment of the machine running the task
All touched properties got a name to make sure it was easy to find them with Build Scan®.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/apple/pkl/pull/409
**Author:** [@stefanobaghino](https://github.com/stefanobaghino)
**Created:** 4/8/2024
**Status:** ✅ Merged
**Merged:** 4/18/2024
**Merged by:** [@bioball](https://github.com/bioball)
**Base:** `main` ← **Head:** `leverage-build-caching`
---
### 📝 Commits (2)
- [`edcbec4`](https://github.com/apple/pkl/commit/edcbec4b688bad2c1a44b20b0139e332e59f3d00) Enable caching of native image building and test tasks
- [`dff32c0`](https://github.com/apple/pkl/commit/dff32c022f92483bc4b55f99b82637bf778d2e56) Update pkl-cli/pkl-cli.gradle.kts
### 📊 Changes
**4 files changed** (+16 additions, -14 deletions)
<details>
<summary>View changed files</summary>
📝 `docs/docs.gradle.kts` (+1 -1)
📝 `pkl-cli/pkl-cli.gradle.kts` (+4 -2)
📝 `pkl-core/pkl-core.gradle.kts` (+9 -9)
📝 `pkl-server/pkl-server.gradle.kts` (+2 -2)
</details>
### 📄 Description
This pull requests enables caching for the native image building task and improves the caching effectiveness of some of the test tasks in the project.
1. the native image building is a generic `Exec` tasks for which caching needs to be enabled explicitly (see [docs](https://docs.gradle.org/current/userguide/build_cache.html#using_the_runtime_api)) as the build tool doesn't have natively have enough information to cache it effectively -- furthermore some steps need to be taken to normalize the classpath (JARs come with an embedded timestamp in their manifest and this needs to be ignored), as well as not rely on absolute paths
2. while tests are usually cacheable, path relativity needs to be added as a property to ensure the results can be retrieved from a cache without relying on the environment of the machine running the task
All touched properties got a name to make sure it was easy to find them with [Build Scan®](https://scans.gradle.com/).
These issues have been diagnosed using [the build validation scripts by Gradle](https://github.com/gradle/gradle-enterprise-build-validation-scripts/blob/bf70ec7e5e57ab0996d68a970745512b79462134/Gradle.md).
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/409
Author: @stefanobaghino
Created: 4/8/2024
Status: ✅ Merged
Merged: 4/18/2024
Merged by: @bioball
Base:
main← Head:leverage-build-caching📝 Commits (2)
edcbec4Enable caching of native image building and test tasksdff32c0Update pkl-cli/pkl-cli.gradle.kts📊 Changes
4 files changed (+16 additions, -14 deletions)
View changed files
📝
docs/docs.gradle.kts(+1 -1)📝
pkl-cli/pkl-cli.gradle.kts(+4 -2)📝
pkl-core/pkl-core.gradle.kts(+9 -9)📝
pkl-server/pkl-server.gradle.kts(+2 -2)📄 Description
This pull requests enables caching for the native image building task and improves the caching effectiveness of some of the test tasks in the project.
Exectasks for which caching needs to be enabled explicitly (see docs) as the build tool doesn't have natively have enough information to cache it effectively -- furthermore some steps need to be taken to normalize the classpath (JARs come with an embedded timestamp in their manifest and this needs to be ignored), as well as not rely on absolute pathsAll touched properties got a name to make sure it was easy to find them with Build Scan®.
These issues have been diagnosed using the build validation scripts by Gradle.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.