just configuring common conventions on java based projects without
adding opinionated sourcesets. Reduces the configuration overhead for
yaml rest test only projects.
In the end we create less tasks and configure less for test only projects.
This converts the system property feature flag 'es.shutdown_feature_flag_enabled' to a regular
non-dynamic node setting. This setting can only be set to 'true' on a snapshot build of
Elasticsearch (not a release build).
Relates to #70338
After breaking up build logic between internal and external we can remove BuildParams.isInternal().
We also resolve bwc versions lazy and not eagerly. This makes configuration of non bwc builds easier and
also makes integration tests easier to setup.
Add more IntelliJ config to `.editorconfig` for formatting `.gradle`
and `.groovy` files. This formatting isn't enforced, but is broadly
in line with our Spotless config. This work is helpful is useful
because the Eclipse Groovy formatter that Spotless can use doesn't
give us good results.
- Fix new introduced deprecated usages
- Update to newer ospackage snapshot to include provided PR for fixing deprecated usage
This gradle release comes with improvements on incremental compilation which we should benefit from
Change the formatter config to sort / order imports, and reformat the
codebase. We already had a config file for Eclipse users, so Spotless now
uses that.
The "Eclipse Code Formatter" plugin ought to be able to use this file as
well for import ordering, but in my experiments the results were poor.
Instead, use IntelliJ's `.editorconfig` support to configure import
ordering.
I've also added a config file for the formatter plugin.
Other changes:
* I've quietly enabled the `toggleOnOff` option for Spotless. It was
already possible to disable formatting for sections using the markers
for docs snippets, so enabling this option just accepts this reality
and makes it possible via `formatter:off` and `formatter:on` without
the restrictions around line length. It should still only be used as
a very last resort and with good reason.
* I've removed mention of the `paddedCell` option from the contributing
guide, since I haven't had to use that option for a very long time. I
moved the docs to the spotless config.
Adds a Spotless opt-in for certain packages in `:server`, and opts-in
the packages related to snapshots & repositories.
Co-authored-by: David Turner <david.turner@elastic.co>
Modularization of the JDK has been ongoing for several years. Recently
in Java 16 the JDK began enforcing module boundaries by default. While
Elasticsearch does not yet use the module system directly, there are
some side effects even for those projects not modularized (eg #73517).
Before we can even begin to think about how to modularize, we must
Prepare The Way by enforcing packages only exist in a single jar file,
since the module system does not allow packages to coexist in multiple
modules.
This commit adds a precommit check to the build which detects split
packages. The expectation is that we will add the existing split
packages to the ignore list so that any new classes will not exacerbate
the problem, and the work to cleanup these split packages can be
parallelized.
relates #73525
When libs/core was created, several classes were moved from server's
o.e.common package, but they were not moved to a new package. Split
packages need to go away long term, so that Elasticsearch can even think
about modularization. This commit moves all the classes under o.e.common
in core to o.e.core.
relates #73784
This was accidentally set to 15.
should be 11 not 15 taken from the minimumRuntimeVersion file and not from minimumCompilerVersion
this also fixes the checkstyle ides setup
The recent upgrade of the Azure SDK has caused a few test failures that
have been difficult to debug and do not yet have a fix. In particular, a
change to the netty reactor resolving
(https://github.com/reactor/reactor-netty/issues/1655). We need to wait
for a fix for that issue, so this reverts commit
6c4c4a0ecb.
relates #73493
In preparation for formatting the enitre Elasticsearch codebase,
spotless was added for all projects using the BuildPlugin, with an
explicit list of existing projects ignored. This ensured new projects
would use spotless from the start. However, after that change, the
ElasticsearchJavaPlugin was added, which subsumed much of the
functionality of the BuildPlugin. Unfortunately this means that many new
java projects (mostly for tests) were added without auto formatting.
This commit adds spotless to all Elasticsearch java projects, adding
those projects that were missed to the ignore list. These can be
migrated separately or as part of the big migration when 8.x is cut.
The org.elasticsearch.bootstrap package exists in server with classes
for starting up Elasticsearch. The elasticsearch-core jar has a handful
of classes that were split out from there, namely java version parsing
and jarhell. This commit moves those classes to a new
org.elasticsearch.jdk package so as to not split the server owned
bootstrap package.
relates #73784
The minimum compiler version is that which we require a developer to use
when building Elasticsearch. This version is updated as newer versions
of Java are released. In contrast, the minimum runtime version is that
which Elasticsearch itself needs. In 7.x this is Java 8, and in master
this is Java 11. Historically the version we require for gradle code has
had to be the minimum runtime version since all the gradle code was
distributed for plugin developers.
Now that the external build tools is separated from our internal tools,
the internal tools are no longer bound by that runtime requirement.
Instead, they can use the latest Java, so that we can use new features
within our internal tools. This commit switches the source compatibiltiy
version for the internal build tools to use the minimum compiler version.
* Remove buildSrc directory
version properties moved to build-tools-internal and plugin descriptor
moved to build-tools. The docs build has been updated accordingly
* More cleanup
Since Java 16, the default value for illegal-access is deny. This means
the latest release of Elasticsearch, and all current integration tests,
run with deny (since we don't explicitly set it in jvm options). Yet
tests run with illegal-access=warn, for legacy reasons. #71908
proposed to remove the setting from test jvms, but concerns were raised
there about whether this would cause some test failures.
This commit explicitly sets tests to deny. This has the added benefit
that any failures will be caught even when running tests with older
jvms.
This moves the public build api and plugins into a separete included build called 'build-tools'
and we removed the duplication of included buildSrc twice (2nd import as build-tools).
The elasticsearch internal build logic is kept in build-tools-internal as included build which allows us better handling of this project that its just being an buildSrc project (e.g. we can reference tasks directly from the root build etc.)
Convention logic applied to both projects will live in a new build-conventions project.