Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8344728

☂ Gradle build modernization

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • jfx11, jfx24
    • javafx

      The Gradle build process relies on old Gradle code and conventions (probably 2.X) and has not been refactored since. As a result, it has many flaws that degrade its performance and makes any change dangerous. Some of its issues are:

      * It is written as a monolith that configures subprojects instead of each project configuring itself.
      * It couples inner-dependencies of any module with other modules (for example, the SWT dependencies are configured on all other modules too).
      * The build file contains configuration that should be in the settings file.
      * It contains obsolete functionality, such as cross-compilation, and possibly obsolete dependencies, such as Libav.
      * It contains non-build-related tasks, such as publication.

      A multistep process is required to bring the build process up to date. [~kcr] suggested these steps:
      """
      1. Remove the logic and support for multiple compile targets (the COMPILE_TARGETS and compileTargets variables and all occurrences of the "compileTargets { t -> ... }" loops
      2. Split build.gradle into multiple pieces
      3. Use standard gradle plugins instead of the custom groovy scripts for native compilation

      1 should ideally be done before 2 (or at the same time). 3 is independent.

      Another thing to consider:

      4. Remove or refactor the support for building JavaFX modules to be included with the JDK -- the code qualified by "HAS_JAVAFX_MODULES". This might still be in use by some vendors, so would need to be discussed first.
      """

      Adding to these:
      * Offload configuration from the build file to the settings file
      * Remove unused dependencies and properties
      * Unify the buildSrc scripts into their respective modules (for example, CompileHLSLTask.groovy is only relevant for the graphics module). buildSrc is an old convention folder that is not required anymore.
      * Possibly rearrange (or just create) tasks to give more granular control over the build and reduce the amount of configuration needed to run common tasks by baking them in for convenience.

      Splitting of the monolithic build file should be done with convention plugins. These encapsulate shared code that can then be applied to subprojects as needed.

      This issue serves as an umbrella for issues related to the Gradle build process. It serves mainly the reweite/split effort outlined above, but also accumulates issues that were already reported and can be fixed (at least partially) during this effort.

            nlisker Nir Lisker
            nlisker Nir Lisker
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: