Turn 'cleanup' into script plugin and move to right package
Introduce GradleDistributionsPlugin and multiple distribution projects
We can now have different distributions, containing different sets of
jars/functionality. For this, one subproject per distribution type is
created. Initially we introduce:
- _core_ (absolute minimum needed to run Gradle)
- _basics_ (Basic functionalities on top of core)
- _jvm_ (Everything needed for JVM ecosystem support)
- _native_ (everything for Native support)
- _publishing_ (everything to publish to Maven/Ivy repositories)
This is just an initial structure which we can now easily change. The
main point here is to enable a setup like this at all. New/different
distributions can now simply be added by adding a new subproject that
applies `gradlebuild.distribution.packaging` and defines the content of
the distribution in terms of dependencies.
Projects needing a distribution for testing, then depend on that project
While introducing this, a lot of changes/improvements are done.
(See also previous commits and documentation in code.) Some major things:
- The embedded test runner now no longer supports running against a full
distribution as fallback. This has the advantage that we do not need to
assemble the distribution in embedded running, where the huge majority
of tests does not need it. To allow more tests still to run embedded,
the embedded support with TestKit/KotlinDSL involvement has been
improved. Some tests won't run with the embedded runner at all
now, but compared to the overall amount of tests, these are just a few.
And the "forking" tests always run as part of the PR pipeline.
- Cacheability of tests is highly improved. We broke some things
recently when adding inputs for distributed testing.
These regressions are addressed. Other things were
improved along the line (local Tooling API repo no longer uses timestamp
version, local bin distribution without timestamp for wrapper tests,
sample tests no longer rely on absolute path and timestamp version, ...)
- The `docs.jar` is no longer part of the distribution. It almost had no
content and what it had was runtime metadata and not documentation.
Instead, a distribution project now encapsulates all the runtime
metadata creation and produces a `runtime-api-info.jar` that is specific
to the distribution.
- In the past we had flakiness issues causes by different distributions
sharing the same user home/daemon registry. With the fixed set of
distributions defined, we now use different user home/daemon registry
for each distribution.
- Cross-project configurations are removed. There was some code
central to distribution building and runtime metadata generation that
reached into all subprojects. This is now replaced by using proper
variant aware dependency management to share artifacts between
distribution subprojects and the other subprojects.