RFR: Streamline gradle task dependencies
Jorn Vernee
jvernee at openjdk.org
Wed Feb 7 14:48:13 UTC 2024
The main point of this PR is to remove the `verify` task as a dependency of the `createRuntimeImageForTest` task. Sometimes you have a broken jextract that you want to debug, which requires a test image, but the `verify` task is failing, meaning the `createRuntimeImageForTest` can not run. Removing `verify` as a dependency allows the test image to be built and debugged
I've added both the `verify` and `jtreg` tasks as dependencies of `test`, so now the `test` task can be used to run all tests.
I also took a look at the dependency setups of the other tasks. `copyLibClang` was depending on `jar` which is not required. I added the `jar` dependency to `createJextractJmod` instead which actually uses the jar file. This allows `copyLibClang` to run in parallel with other tasks. I had to slightly change it though: since it was using: `into("$buildDir")`, the entire build dir was treated as an output of the copy task, and this made gradle throw up several warnings because other tasks didn't have `copyLibClang` as a dependency. I've changed `copyLibClang` to copy the files into a build dir subdirectory instead, which is used exclusively as an output of the copy task.
Lastly, I removed some redundant inputs from tasks. A task is rebuilt if a dependency ran and the outputs changed, so there is no need to set the jar file as an explicit input. The images will be recreated if the jmod file changed, which will be recreated if the jar file changed. However, in this new setup, if the jar file was rebuilt, but the jmod didn't change as a result, we don't need to rebuild the images.
-------------
Commit messages:
- streamline gradle task dependencies
- Don't have verify as dependency of test image
Changes: https://git.openjdk.org/jextract/pull/200/files
Webrev: https://webrevs.openjdk.org/?repo=jextract&pr=200&range=00
Stats: 20 lines in 1 file changed: 2 ins; 10 del; 8 mod
Patch: https://git.openjdk.org/jextract/pull/200.diff
Fetch: git fetch https://git.openjdk.org/jextract.git pull/200/head:pull/200
PR: https://git.openjdk.org/jextract/pull/200
More information about the jextract-dev
mailing list