-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Open
Labels
:Delivery/BuildBuild or test infrastructureBuild or test infrastructure>refactoringTeam:DeliveryMeta label for Delivery teamMeta label for Delivery teamgood first issuelow hanging fruitlow hanging fruit
Description
We want to have build code implemented in Java to make it easier to maintain.
We can easily mix java and groovy implementations and everything is already set up to do so, so it's already easy to create new classes in Java.
It would also be great to take this opportunity to add tests for the newly written Java code.
The ingredients of a great rewrite:
- the groovy code is removed, the java implementation is actually used by the build
- the java implementation does not use the Groovy SDK ( no groovy imports in Java).
- note that the "convert to java" option in IDEA does add calls to it
- Existing Groovy tests are also ported to Java
- when there are no existing tests, new unit and/or integration tests are created. There is a precedent for both. Integration tests use Gradle Test Kit. We should have tests for basic functionality, making sure that the test is up-to-date when the inputs/outputs don't change and in some cases for error conditions.
- follow conventions showcased in Gradle example plugin and detailed in the Gradle user guide: writing custom tasks and writing plugins. Make sure to follow the instructions on making tasks incremental.
- Don't use, and replace the use of
project.afterEvaluatein custom task implementations as well as any other configuration logic from the task constructor. The custom task constructor should not referenceproject. Gradle calls methods annotated with@TaskActionas well as@Input,@Outputand the like at execution time rather than configuration time as defined by the
Gradle build lifecycle.
Here's a list of what is still in Groovy. Note that it goes from simple to complex and there are some inner dependencies :
- stand alone tasks and plugins
- ConcatFilesTask (convert ConcatFilesTask.groovy to .java #34476, Implement ConcatFilesTask from Groovy to Java issues#34459 #37497)
- NoticeTask (refactor: convert NoticeTask to java #34769)
- PluginPropertiesTask Convert PluginPropertiesExtension Groovy to Java #39605
- PluginPropertiesExtension Convert PluginPropertiesExtension Groovy to Java #39605
- MavenFilteringHack
- FileContentsTask (refactor: convert FileContentsTask to Java #34539)
- DependenciesInfoTask
- VersionCollection (Implement VersionCollection in Java #34050)
- MessyTestPlugin ( possibly dead code elastic/x-plugins/issues/724 )
- EmptyDirTask (convert EmptyDirTask.groovy to .java #34672)
- precommit
- FilePermissionsTask (convert FilePermissionsTask.groovy to .java #34674)
- ForbiddenPatternsTask (converting ForbiddenPatternsTask to .java #36194)
- UpdateShasTask ( Converting DependencyLicensesTask and UpdateShasTask to java #35231 , Converting DependencyLicensesTask and UpdateShasTask to java #41921 )
- DependencyLicensesTask (Converting DependencyLicensesTask and UpdateShasTask to java #35231 , Converting DependencyLicensesTask and UpdateShasTask to java #41921)
- PrecommitTasks
- doc
- RestTestFromSnippetsTaskTests
- RestTestsFromSnippetsTask
- DocsTestPlugin
- SnippetsTask
- RestTestsFromSnippetsTask
- ant and and fixtures
- LicenseHeadersTask
- AntTask
- dependent on the new testclusters implementation
- AntFixture ( used in multipe build scripts )
- RestTestPlugin
- StandaloneRestTestPlugin
- Fixture
- RestIntegTestTask
- [x ]RunTask
- ClusterConfiguration
- [x ]NodeInfo
- ClusterFormationTasks
- vagrant
- VagrantFixture
- VagrantLoggerOutputStream
- VagrantCommandTask
- VagrantTestPlugin
- BatsOverVagrantTask
- TapLoggerOutputStream
- VagrantPropertiesExtension
- plugins
- BuildPlugin
- StandaloneTestPlugin
- PluginBuildPlugin
- RestTestPlugin
- StandaloneRestTestPlugin
- VagrantSupportPlugin
- TestWithDependenciesPlugin
- carrotsearch : either push changes upstream or replace with Gradle runner ( Run tests with Gradle test runner instead of randomizedtesting.junit4-ant #31496 )
Metadata
Metadata
Assignees
Labels
:Delivery/BuildBuild or test infrastructureBuild or test infrastructure>refactoringTeam:DeliveryMeta label for Delivery teamMeta label for Delivery teamgood first issuelow hanging fruitlow hanging fruit