A fairly wide ranging update to bring libjvm up to run on top of libpak 2.x and libcnb 2.x
Also adds support for extensions, by adding a new 'Generate' top level method.
Major changes:
Libcnb dropped the idea of layer contributors, which much of libjvm depends upon. The concept has been maintained within libjvm, with the contributing helpers being "flattened" into layers by a helper function before the result is returned to libcnb. To facilitate testing, the flatten function is configurable. This allows test cases to avoid executing the contribute logic (which was never on the tested code path for release 1.x).
Places that used to pass Buildpack, that needed to deal with Extensions and Buildpacks now pass the common information directly (eg, passing name, version, homepage to logger.title, rather than buildpack).
Uses of BuildpackDependency have been upgraded to BuildModuleDependency as a Buildpack/Extension agnostic choice.
Generate.go added, modelled on Build.go, except places a call to a 'GenerateContentBuilder' that can create data to be used as the build.Dockerfile/run.Dockerfile/extend-config.toml. The interface for the result is kept deliberately similar to the one in packit to reduce developer cognitive impact ;p
Libcnb removed the concept of an info writer for it's logger, references have been switched to the debug logger where invoked.
Libcnb changed from using a struct (that autoinitializes member variables upon construction) to an interface. This had the unexpected repercussion that uninitialized logger instances would go-panic, because the underlying logger impl was not set. This required changes to test cases to ensure the loggers were appropriately initialized.
Libjvm declared as a v2 go module
Note: go.mod references libpak/libcnb as v2.0.0-alpha.1 the work in progress tag for the v2 branches of each.
Use Cases
Extensions performing JDK/JRE installs wanting to remain compatible with buildpacks doing the same are able to use libjvm to perform the version determination, and parse config etc.
Extensions are unable to configure via use of Layers, so helpers etc are not used within the new Generate path, the intent is to provide support for applying config via a companion buildpack calling a new util method to be written later in libjvm.
Checklist
[x] I have viewed, signed, and submitted the Contributor License Agreement.
[x] I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
[x] I have added an integration test, if necessary.
[x] I have reviewed the styleguide for guidance on my code quality.
[x] I'm happy with the commit history on this PR (I have rebased/squashed as needed).
Summary
A fairly wide ranging update to bring libjvm up to run on top of libpak 2.x and libcnb 2.x Also adds support for extensions, by adding a new 'Generate' top level method.
Major changes:
Note: go.mod references libpak/libcnb as v2.0.0-alpha.1 the work in progress tag for the v2 branches of each.
Use Cases
Extensions performing JDK/JRE installs wanting to remain compatible with buildpacks doing the same are able to use libjvm to perform the version determination, and parse config etc.
Extensions are unable to configure via use of Layers, so helpers etc are not used within the new Generate path, the intent is to provide support for applying config via a companion buildpack calling a new util method to be written later in libjvm.
Checklist