Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Resolves a cache miss caused by an absolute path present in Checkstyle's
configProperties
extension property. Thecache_file
entry inconfigProperties
was previously being set to the absolute path of the cache file.The value of the
cache_file
entry has been updated to the relative path to the cache file from Checkstyle'sconfigDir
. The value ofconfigDir
is available incheckstyle.xml
asconfig_loc
, per the Gradle documentation here. Incheckstyle.xml
, thecache_file
relative path is then appended toconfig_loc
to construct the full path to the cache file.Updating
configProperties
to only contain relative paths avoids cache misses that may occur based on the absolute path of the repository.Task input comparison showing
configProperties
differences causing a cache missTask input comparison showing no differences in inputs with this fix applied
Motivation and Context
Avoiding absolute paths in input properties ensures that the project can take full advantage of both the local and remote build caches from either local or CI builds independent of the absolute path of the repository.
How Has This Been Tested?
Running a clean build shows that the Checkstyle cache file is still written at the correct path -
build/checkstyle/cacheFile
.Gradle's build validation scripts show
configProperties
input differences before this fix was applied, and no input differences with the fix applied.Types of changes
Checklist: