Integrated: Streamline gradle task dependencies
Jorn Vernee
jvernee at openjdk.org
Wed Feb 7 22:25:04 UTC 2024
On Wed, 7 Feb 2024 14:44:17 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
> 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.~ (P.S. this added an invisible dependency of the `clean` task on the `jtreg` task, which makes the GHA build fail. I've remove this again)
>
> 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.
This pull request has now been integrated.
Changeset: a982e977
Author: Jorn Vernee <jvernee at openjdk.org>
URL: https://git.openjdk.org/jextract/commit/a982e97754c937c3208f9b070600e0281087460f
Stats: 18 lines in 1 file changed: 0 ins; 10 del; 8 mod
Streamline gradle task dependencies
Reviewed-by: mcimadamore
-------------
PR: https://git.openjdk.org/jextract/pull/200
More information about the jextract-dev
mailing list