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

Update Gradle plugins build #32668

Merged
merged 8 commits into from
Apr 19, 2023

Conversation

grossws
Copy link
Contributor

@grossws grossws commented Apr 16, 2023

  • migration to Gradle Kotlin DSL (much more streamlined IDE support)
  • use convention plugins in build-logic/src/main/kotlin to simplify actual build.gradle.kts build scripts
  • use version catalog for deps (see https://docs.gradle.org/current/userguide/platforms.html#header)
  • use java toolchain to build plugins (see https://docs.gradle.org/current/userguide/toolchains.html) UPD use JavaCompile#options#release to set javac --release option to effectively consistently configure source/target compatibility and bootstrap classpath
  • use JavaPluginExtension#withSourcesJar/withJavadocJar instead of older packaging them manually
  • update gradle wrapper (UPD: for both devtools/gradle and integration-tests/gradle)
  • fix dependencies on gradle plugin markers in integration-tests/gradle, <type>pom</type> should be used since com.gradle.plugin-publish plugin publishes only pom.xml to io.quarkus:io.quarkus.gradle.plugin GA coords (see https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_markers)
  • add org.bouncycastle:bcpkix-jdk18on to integration test fixtures in integration-tests/gradle to fix test failure when ECDSA keys/certs present in local .kube/config
  • use task.getLogger() instead of task.getProject().getLogger() (little bit towards potential configuration cache compatibility)

grossws added 5 commits April 16, 2023 07:47
Changes:
* migration to Gradle Kotlin DSL (much more streamlined IDE support)
* use convention plugins in `build-logic/src/main/kotlin` to simplify actual `build.gradle.kts` build scripts
* use version catalog for deps (see https://docs.gradle.org/current/userguide/platforms.html#header)
* use java toolchain to build plugins (see https://docs.gradle.org/current/userguide/toolchains.html)
* use `JavaPluginExtension#withSourcesJar`/`withJavadocJar` instead of older packaging them manually

Signed-off-by: Konstantin Gribov <[email protected]>
Updated with `(cd devtools/gradle ; ./gradlew wrapper ; ./gradlew wrapper)`

Signed-off-by: Konstantin Gribov <[email protected]>
Only `pom.xml` is published at `io.quarkus:io.quarkus.gradle.plugin` GA coordinates. Same for `io.quarkus.extension`.

See https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_markers

Signed-off-by: Konstantin Gribov <[email protected]>
Accessing project from task actions is prohibited when configuration cache is used.

If Quarkus plugin is to be compatible with CC eventually it should be avoided.

Signed-off-by: Konstantin Gribov <[email protected]>
Fixes `integration-tests/gradle` when `.kube/config` has ECDSA keys/certs

Signed-off-by: Konstantin Gribov <[email protected]>
@quarkus-bot quarkus-bot bot added area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle labels Apr 16, 2023
@gsmet gsmet requested a review from aloubyansky April 17, 2023 14:59
@gsmet
Copy link
Member

gsmet commented Apr 17, 2023

@snazy could you have a look at this one?

@grossws
Copy link
Contributor Author

grossws commented Apr 17, 2023

At least I should use options.release instead of toolchains.

And since Quarkus 3.x requires java 11+ we could drop sourceCompatibility/targetCompatibility and use release instead.

@snazy
Copy link
Contributor

snazy commented Apr 17, 2023

LGTM - especially since I'm a fan of the Kotlin DSL ;)

Mind updating the gradlew[.bat] + gradle-wrapper.jar in integration-tests/gradle as well?

At least I should use options.release instead of toolchains.

Yea, that makes sense.

@snazy
Copy link
Contributor

snazy commented Apr 17, 2023

Hm, I guess, the toolchain-change is required (see CI):

Caused by: org.gradle.jvm.toolchain.internal.ToolchainDownloadFailedException: No locally installed toolchains match (see https://docs.gradle.org/8.1/userguide/toolchains.html#sec:auto_detection) and toolchain download repositories have not been configured (see https://docs.gradle.org/8.1/userguide/toolchains.html#sub:download_repositories).

@quarkus-bot

This comment has been minimized.

@grossws
Copy link
Contributor Author

grossws commented Apr 19, 2023

Yeah, it seems gradle discovered where tooling cache lives on Linux runners but not on Windows ones.

@grossws
Copy link
Contributor Author

grossws commented Apr 19, 2023

PR updated:

  • wrapper in integration-tests/gradle with dummy build.gradle.kts and settings.gradle.kts to simplify future updates
  • reverted to setting --release in JavaCompile tasks instead of using newer java toolchains (since Quarkus requires Java 11 to build now sourceCompatibility/targetCompatibility are unnecessary when options.release is set)

@quarkus-bot
Copy link

quarkus-bot bot commented Apr 19, 2023

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Copy link
Member

@aloubyansky aloubyansky left a comment

Choose a reason for hiding this comment

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

Thanks @grossws

@aloubyansky aloubyansky merged commit 08b2235 into quarkusio:main Apr 19, 2023
@quarkus-bot quarkus-bot bot added this to the 3.1 - main milestone Apr 19, 2023
Copy link
Contributor

@snazy snazy left a comment

Choose a reason for hiding this comment

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

Really minor nits - current state of the PR looks good to me. +1

@grossws grossws deleted the gradle-plugins-update-build branch April 20, 2023 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants