Integrated: CODETOOLS-7903106: Reduce dependence on the "form" of dependencies

Jonathan Gibbons jjg at openjdk.java.net
Thu Feb 24 18:37:24 UTC 2022


On Wed, 23 Feb 2022 02:57:04 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

> Please review a medium-sized refactoring of the `jtreg` build and top level of the code.
> 
> The underlying goal is to eliminate knowledge from the makefiles and source code of specific transitive dependencies for dependencies like JUnit and TestNG, so that it is easier/simpler to update the (versions of the) dependencies without having to update the makefiles or source code. It becomes sufficient to just update scripts like `build.sh` that download dependencies before invoking the makefiles.   In particular, it isolates the makefiles and code from the choice to use discrete jars or "uber-jars" for the dependencies.
> 
> To this end, the makefile variables for a dependency and its dependencies are replace by a single variable that lists them all. For example, `TESTNG_JAR`, `GOOGLE_GUICE_JAR` and `JCOMMANDER_JAR` are combined into a single variable, `TESTNG_JARS`.   Likewise `JUNIT_JAR` and `HAMCREST_JAR` are combined into `JUNIT_JARS`.  Similarly, the makefile variables for the various legal notices are combined into `TESTNG_NOTICES` and `JUNIT_NOTICES`.
> 
> Code in `Tool.java` used to have specific knowledge of these dependencies and their transitive dependencies.
> To address this, the makefiles now create a new `jar.properties` file, listing one or more jar files for each named dependency.  Within the code, the old `JarFinder` class is replaced by a new `JarManager` class that reads the new `jar.properties` file to determine the set of jar files needed for each dependence.
> 
> For anyone building `jtreg` with `build.sh`, the change should be completely transparent.
> For anyone running `jtreg`, the change should be completely transparent.
> 
> For anyone using custom scripts that invoke the makefiles directly, the set of variables that need to be specified has changed.
> 
> As part of this work, the README in the repo has been split into a list of references to other documentation, with the content about building `jtreg` moved and updated to a new file, `doc/building.md`.
> 
> A side effect of this work is that version numbers in the names of imported jar files are now preserved, where previously each file was renamed as it was imported, to eliminate the version. This has a (beneficial) ripple effect on the code for `-version` that reports the versions of dependencies; it also has a ripple effect into some tests that previously assumed simple names for these jar files.

This pull request has now been integrated.

Changeset: b246c75a
Author:    Jonathan Gibbons <jjg at openjdk.org>
URL:       https://git.openjdk.java.net/jtreg/commit/b246c75a964f95cab0b0c62b455cce6f6a9422df
Stats:     1291 lines in 19 files changed: 364 ins; 820 del; 107 mod

7903106: Reduce dependence on the "form" of dependencies

Reviewed-by: iris

-------------

PR: https://git.openjdk.java.net/jtreg/pull/61


More information about the jtreg-dev mailing list