Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the Gradle build #7048

Merged
merged 6 commits into from
Mar 24, 2022
Merged

Refactor the Gradle build #7048

merged 6 commits into from
Mar 24, 2022

Conversation

melix
Copy link
Contributor

@melix melix commented Mar 10, 2022

This commit refactors the Gradle build to use the new Micronaut
build plugins and move it to the new build template (which makes
use of convention plugins).

The build is obviously more complex than for external Micronaut
modules, in particular because some modules are providing core
functionalities but also depend on external Micronaut modules
for tests (e.g Micronaut Test).

@melix melix added the relates-to: build label for issues related to the build file or CI label Mar 10, 2022
@melix melix self-assigned this Mar 10, 2022
@sdelamo sdelamo modified the milestones: 3.5.0, 3.4.1 Mar 10, 2022
This commit refactors the Gradle build to use the new Micronaut
build plugins and move it to the new build template (which makes
use of convention plugins).

The build is obviously more complex than for external Micronaut
modules, in particular because some modules are providing core
functionalities but also depend on external Micronaut modules
for tests (e.g Micronaut Test).
@melix melix force-pushed the cc/migrate-build-plugins branch from 271f8b0 to bf1fa81 Compare March 10, 2022 16:43
@sdelamo sdelamo requested review from timyates and sdelamo March 22, 2022 15:19
@sdelamo
Copy link
Contributor

sdelamo commented Mar 22, 2022

@timyates please check this PR. I would like to move this forward for 3.4.1

Copy link
Contributor

@timyates timyates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪😎

buildSrc/build.gradle Outdated Show resolved Hide resolved
buildSrc/build.gradle Show resolved Hide resolved
core/build.gradle Show resolved Hide resolved
http/build.gradle Outdated Show resolved Hide resolved
inject-kotlin-test/build.gradle Outdated Show resolved Hide resolved
ext {
shadowJarEnabled = true
plugins {
id "io.micronaut.build.internal.convention-core-library"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is session a core library? I assume you added because shadowJarEnabled=true but does it need to be a core library?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is simply remodeling what existed before, session was treated differently like the other core-library. I am not familiar enough with that module to say if it should be done differently.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@melix
Copy link
Contributor Author

melix commented Mar 23, 2022

The build won't pass: after upgrading to build tools 5.3.0 it now detects binary breaking changes:

image

image

image

@melix
Copy link
Contributor Author

melix commented Mar 23, 2022

For clarity here are the BOM validation problems which are now detected: https://ge.micronaut.io/s/zphruxszgq6d4/console-log#L560-L579

BOM io.micronaut.serde:micronaut-serde-bom:1.0.0 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.serde:micronaut-serde-bom:1.0.0) declares a non-resolvable dependency: io.micronaut.serde:micronaut-serde-tck:1.0.0
BOM io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1) declares a non-resolvable dependency: io.micronaut.oraclecloud:micronaut-oraclecloud-sdk-processor:2.1.1
BOM io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1) declares a non-resolvable dependency: io.micronaut.oraclecloud:micronaut-oraclecloud-atp-hikari-test:2.1.1
BOM io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1) declares a non-resolvable dependency: io.micronaut.oraclecloud:micronaut-oraclecloud-atp-ucp-test:2.1.1
BOM io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1) declares a non-resolvable dependency: io.micronaut.oraclecloud:micronaut-example-http-function-java:2.1.1
BOM io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1) declares a non-resolvable dependency: io.micronaut.oraclecloud:micronaut-example-function-groovy:2.1.1
BOM io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1) declares a non-resolvable dependency: io.micronaut.oraclecloud:micronaut-example-http-function-kotlin:2.1.1
BOM io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1) declares a non-resolvable dependency: io.micronaut.oraclecloud:micronaut-example-groovy:2.1.1
BOM io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1) declares a non-resolvable dependency: io.micronaut.oraclecloud:micronaut-example-function-java:2.1.1
BOM io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1) declares a non-resolvable dependency: io.micronaut.oraclecloud:micronaut-example-java:2.1.1
BOM io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1) declares a non-resolvable dependency: io.micronaut.oraclecloud:micronaut-example-http-function-groovy:2.1.1
BOM io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1) declares a non-resolvable dependency: io.micronaut.oraclecloud:micronaut-example-function-kotlin:2.1.1
BOM io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.oraclecloud:micronaut-oraclecloud-bom:2.1.1) declares a non-resolvable dependency: io.micronaut.oraclecloud:micronaut-example-kotlin:2.1.1
BOM io.micronaut.data:micronaut-data-bom:3.3.0 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.data:micronaut-data-bom:3.3.0) declares a non-resolvable dependency: io.micronaut.data:micronaut-data-document-tck:3.3.0
BOM io.micronaut.data:micronaut-data-bom:3.3.0 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.data:micronaut-data-bom:3.3.0) declares a non-resolvable dependency: io.micronaut.data:micronaut-data-tck:3.3.0
BOM io.micronaut.servlet:micronaut-servlet-bom:3.2.1 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.servlet:micronaut-servlet-bom:3.2.1) declares a non-resolvable dependency: io.micronaut.servlet:micronaut-test-kotlin-jetty:3.2.1
BOM org.jdbi:jdbi3-bom:3.20.1 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.sql:micronaut-sql-bom:4.2.2 -> org.jdbi:jdbi3-bom:3.20.1) declares a non-resolvable dependency: org.jdbi:jdbi3-sqlobject:3.20.1
BOM io.r2dbc:r2dbc-bom:Arabba-SR11 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.r2dbc:micronaut-r2dbc-bom:2.1.0 -> io.r2dbc:r2dbc-bom:Arabba-SR11) declares dependency on com.google.cloud:cloud-spanner-r2dbc:0.6.0 which doesn't belong to group io.r2dbc.
BOM io.r2dbc:r2dbc-bom:Arabba-SR11 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.r2dbc:micronaut-r2dbc-bom:2.1.0 -> io.r2dbc:r2dbc-bom:Arabba-SR11) declares dependency on com.oracle.database.r2dbc:oracle-r2dbc:0.1.0 which doesn't belong to group io.r2dbc.
BOM io.r2dbc:r2dbc-bom:Arabba-SR11 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.r2dbc:micronaut-r2dbc-bom:2.1.0 -> io.r2dbc:r2dbc-bom:Arabba-SR11) declares dependency on org.mariadb:r2dbc-mariadb:1.0.2 which doesn't belong to group io.r2dbc.
BOM io.r2dbc:r2dbc-bom:Arabba-SR11 (via io.micronaut:micronaut-bom:3.4.1-SNAPSHOT -> io.micronaut.r2dbc:micronaut-r2dbc-bom:2.1.0 -> io.r2dbc:r2dbc-bom:Arabba-SR11) declares dependency on dev.miku:r2dbc-mysql:0.8.2.RELEASE which doesn't belong to group io.r2dbc.

@melix
Copy link
Contributor Author

melix commented Mar 23, 2022

I have added suppressions for the problems above and created issues in the respective problematic projects.

@sdelamo
Copy link
Contributor

sdelamo commented Mar 23, 2022

I have added suppressions for the problems above and created issues in the respective problematic projects.

Ok, after I merge it I will create a PR to remove the suppressions in a different PR. So that we don't forget.

@melix
Copy link
Contributor Author

melix commented Mar 23, 2022

Ok, after I merge it I will create a PR to remove the suppressions in a different PR

You'll have to keep the r2dbc one.

@sdelamo
Copy link
Contributor

sdelamo commented Mar 24, 2022

Ok, after I merge it I will create a PR to remove the suppressions in a different PR

You'll have to keep the r2dbc one.

Should not we keep the r2dbc suppression in the 2rdbc module instead?

@melix
Copy link
Contributor Author

melix commented Mar 24, 2022

Should not we keep the r2dbc suppression in the 2rdbc module instead?

You need both: validation will fail in the r2dbc module, but it will also fail here since we check transitively.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@sdelamo sdelamo merged commit cc68819 into 3.4.x Mar 24, 2022
@sdelamo sdelamo deleted the cc/migrate-build-plugins branch March 24, 2022 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relates-to: build label for issues related to the build file or CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants