On Tue, 7 Jul 2026 19:06:55 GMT, Marius Hanl <[email protected]> wrote:

>> Marius Hanl has updated the pull request with a new target base due to a 
>> merge or a rebase. The incremental webrev excludes the unrelated changes 
>> brought in by the merge/rebase. The pull request contains 12 additional 
>> commits since the last revision:
>> 
>>  - Merge branch 'master' of https://github.com/openjdk/jfx into 
>> 833146-mvn-publish
>>  - all task build the publication now
>>  - Merge branch 'master' of https://github.com/openjdk/jfx into 
>> 833146-mvn-publish
>>  - Use defineProperty and fail method from default build.gradle
>>  - Depend maven publishing on the build modules task
>>  - Merge branch 'master' of https://github.com/openjdk/jfx into 
>> 833146-mvn-publish
>>  - remove print
>>  - Use projects directly
>>  - Further reduce coupling between main build.gradle and maven-publish.gradle
>>  - Move MAVEN_GROUP_ID and fail() over to maven-publish.gradle
>>  - ... and 2 more: https://git.openjdk.org/jfx/compare/d9581c92...ea22f852
>
> I think this might be a good candidate after RDP1.

@Maran23 as you asked for feedback: I think this is a good first step.

----

My general recommendation for  improving the build setup in the _openjdk_ 
project is to move things into `buildSrc` as so-called _pre-compiled script 
plugins_. This gives more structure and type-safety. In this approach, every 
"aspect" of the build becomes its own plugin and you then compose the separate 
aspects to one build configuration.

The difference would be that you would place the `.gradle` files here, by which 
they automatically become plugins:


buildSrc/src/main/groovy/javafx.gradle-build.maven-publish.gradle


Then I would eventually replace the big `build.gradle` in the root with 
individual `build.gradle` files in each module. The files have a plugins block 
to identify and their individual dependencies blocks. 


plugins {
  id 'javafx.gradle-build.maven-publish'
  id 'javafx.gradle-build.other-build-featue'
}

dependencies {
  api project(':base') 
}


Further reading Resources:
- An example project that shows this setup with more explanation in the readme:
  https://github.com/jjohannes/gradle-project-setup-howto
- Why you want to separate build logic/config from dependency definitions:
  https://javarca.de

With such a setup, one can also eventually move out `buildSrc` into a different 
repository and build and publish it independently. This repo would then only 
contains the dependency definitions and not all the complex building details. 
(Which, IIRC, was a topic discussed in the PR where I tried – and failed so far 
– to add Gradle Metadata publishing).

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1970#issuecomment-4912012536

Reply via email to