Skip to content

Commit

Permalink
Merge pull request #31159 from snazy/bump-gradle-8.0
Browse files Browse the repository at this point in the history
Bump Gradle to version 8.0
  • Loading branch information
aloubyansky authored Feb 19, 2023
2 parents f250859 + b490f62 commit 5849491
Show file tree
Hide file tree
Showing 28 changed files with 309 additions and 172 deletions.
2 changes: 1 addition & 1 deletion build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<!-- These 2 properties are used by CreateProjectMojo to add the Maven Wrapper -->
<proposed-maven-version>3.8.7</proposed-maven-version>
<maven-wrapper.version>3.1.1</maven-wrapper.version>
<gradle-wrapper.version>7.5.1</gradle-wrapper.version>
<gradle-wrapper.version>8.0.1</gradle-wrapper.version>
<quarkus-gradle-plugin.version>${project.version}</quarkus-gradle-plugin.version>
<quarkus-maven-plugin.version>${project.version}</quarkus-maven-plugin.version>

Expand Down
9 changes: 3 additions & 6 deletions devtools/gradle/gradle-application-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@ gradlePlugin {
implementationClass = 'io.quarkus.gradle.QuarkusPlugin'
displayName = 'Quarkus Plugin'
description = 'Builds a Quarkus application, and provides helpers to launch dev-mode, the Quarkus CLI, building of native images'
tags.addAll(['quarkus', 'quarkusio', 'graalvm'])
}
}
}

pluginBundle {
website = 'https://quarkus.io/'
vcsUrl = 'https://github.com/quarkusio/quarkus'
tags = ['quarkus', 'quarkusio', 'graalvm']
vcsUrl.set("https://github.com/quarkusio/quarkus")
website.set("https://quarkus.io/")
}

test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,23 +210,23 @@ private void registerTasks(Project project, QuarkusPluginExtension quarkusExt) {
TaskProvider<Task> testResourcesTask = tasks.named(JavaPlugin.PROCESS_TEST_RESOURCES_TASK_NAME);

quarkusGenerateCode.configure(task -> {
task.dependsOn(resourcesTask);
task.setCompileClasspath(
project.getConfigurations().getByName(
ApplicationDeploymentClasspathBuilder.getBaseRuntimeConfigName(LaunchMode.NORMAL)));
Configuration config = project.getConfigurations().getByName(
ApplicationDeploymentClasspathBuilder.getBaseRuntimeConfigName(LaunchMode.NORMAL));
task.dependsOn(resourcesTask, config);
task.setCompileClasspath(config);
});
quarkusGenerateCodeDev.configure(task -> {
task.dependsOn(resourcesTask);
task.setCompileClasspath(
project.getConfigurations().getByName(
ApplicationDeploymentClasspathBuilder
.getBaseRuntimeConfigName(LaunchMode.DEVELOPMENT)));
Configuration config = project.getConfigurations().getByName(
ApplicationDeploymentClasspathBuilder
.getBaseRuntimeConfigName(LaunchMode.DEVELOPMENT));
task.dependsOn(resourcesTask, config);
task.setCompileClasspath(config);
});
quarkusGenerateCodeTests.configure(task -> {
task.dependsOn(resourcesTask);
task.setCompileClasspath(
project.getConfigurations().getByName(
ApplicationDeploymentClasspathBuilder.getBaseRuntimeConfigName(LaunchMode.TEST)));
Configuration config = project.getConfigurations().getByName(
ApplicationDeploymentClasspathBuilder.getBaseRuntimeConfigName(LaunchMode.TEST));
task.dependsOn(resourcesTask, config);
task.setCompileClasspath(config);
});

quarkusDev.configure(task -> {
Expand Down
9 changes: 3 additions & 6 deletions devtools/gradle/gradle-extension-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@ gradlePlugin {
implementationClass = 'io.quarkus.extension.gradle.QuarkusExtensionPlugin'
displayName = 'Quarkus Extension Plugin'
description = 'Builds a Quarkus extension'
tags.addAll(['quarkus', 'quarkusio', 'graalvm'])
}
}
}

pluginBundle {
website = 'https://quarkus.io/'
vcsUrl = 'https://github.com/quarkusio/quarkus'
tags = ['quarkus', 'quarkusio', 'graalvm']
vcsUrl.set("https://github.com/quarkusio/quarkus")
website.set("https://quarkus.io/")
}

tasks.withType(Test) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,38 +66,50 @@ public static void initConfigurations(Project project) {
final ConfigurationContainer configContainer = project.getConfigurations();

// Custom configuration for dev mode
configContainer.create(ToolingUtils.DEV_MODE_CONFIGURATION_NAME)
.extendsFrom(configContainer.getByName(JavaPlugin.IMPLEMENTATION_CONFIGURATION_NAME));
configContainer.register(ToolingUtils.DEV_MODE_CONFIGURATION_NAME, config -> {
config.extendsFrom(configContainer.getByName(JavaPlugin.IMPLEMENTATION_CONFIGURATION_NAME));
config.setCanBeConsumed(false);
});

// Base runtime configurations for every launch mode
configContainer.create(ApplicationDeploymentClasspathBuilder.getBaseRuntimeConfigName(LaunchMode.TEST))
.extendsFrom(configContainer.getByName(JavaPlugin.TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME));
configContainer
.register(ApplicationDeploymentClasspathBuilder.getBaseRuntimeConfigName(LaunchMode.TEST), config -> {
config.extendsFrom(configContainer.getByName(JavaPlugin.TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME));
config.setCanBeConsumed(false);
});

configContainer.create(ApplicationDeploymentClasspathBuilder.getBaseRuntimeConfigName(LaunchMode.NORMAL))
.extendsFrom(configContainer.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME));
configContainer
.register(ApplicationDeploymentClasspathBuilder.getBaseRuntimeConfigName(LaunchMode.NORMAL), config -> {
config.extendsFrom(configContainer.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME));
config.setCanBeConsumed(false);
});

configContainer.create(ApplicationDeploymentClasspathBuilder.getBaseRuntimeConfigName(LaunchMode.DEVELOPMENT))
.extendsFrom(
configContainer.getByName(ToolingUtils.DEV_MODE_CONFIGURATION_NAME),
configContainer.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME),
configContainer.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME));
configContainer
.register(ApplicationDeploymentClasspathBuilder.getBaseRuntimeConfigName(LaunchMode.DEVELOPMENT), config -> {
config.extendsFrom(
configContainer.getByName(ToolingUtils.DEV_MODE_CONFIGURATION_NAME),
configContainer.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME),
configContainer.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME));
config.setCanBeConsumed(false);
});

// enable the Panache annotation processor on the classpath, if it's found among the dependencies
configContainer.getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME)
.withDependencies(annotationProcessors -> {
Set<ResolvedArtifact> compileClasspathArtifacts = DependencyUtils
.duplicateConfiguration(project, configContainer
.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME))
.getResolvedConfiguration()
.getResolvedArtifacts();
for (ResolvedArtifact artifact : compileClasspathArtifacts) {
if ("quarkus-panache-common".equals(artifact.getName())
&& "io.quarkus".equals(artifact.getModuleVersion().getId().getGroup())) {
project.getDependencies().add(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME,
"io.quarkus:quarkus-panache-common:" + artifact.getModuleVersion().getId().getVersion());
}
configContainer.named(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME, config -> {
config.withDependencies(annotationProcessors -> {
Set<ResolvedArtifact> compileClasspathArtifacts = DependencyUtils
.duplicateConfiguration(project, configContainer
.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME))
.getResolvedConfiguration()
.getResolvedArtifacts();
for (ResolvedArtifact artifact : compileClasspathArtifacts) {
if ("quarkus-panache-common".equals(artifact.getName())
&& "io.quarkus".equals(artifact.getModuleVersion().getId().getGroup())) {
project.getDependencies().add(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME,
"io.quarkus:quarkus-panache-common:" + artifact.getModuleVersion().getId().getVersion());
}
});
}
});
});
}

private final Project project;
Expand Down Expand Up @@ -135,7 +147,7 @@ private void setUpPlatformConfiguration() {
PlatformImportsImpl platformImports = ApplicationDeploymentClasspathBuilder.platformImports
.computeIfAbsent(this.platformImportName, (ignored) -> new PlatformImportsImpl());

project.getConfigurations().create(this.platformConfigurationName, configuration -> {
project.getConfigurations().register(this.platformConfigurationName, configuration -> {
// Platform configuration is just implementation, filtered to platform dependencies
ListProperty<Dependency> dependencyListProperty = project.getObjects().listProperty(Dependency.class);
configuration.getDependencies()
Expand Down Expand Up @@ -184,16 +196,16 @@ private void setUpPlatformConfiguration() {
}

private void setUpRuntimeConfiguration() {
if (project.getConfigurations().findByName(this.runtimeConfigurationName) == null) {
project.getConfigurations().create(this.runtimeConfigurationName, configuration -> configuration.extendsFrom(
if (!project.getConfigurations().getNames().contains(this.runtimeConfigurationName)) {
project.getConfigurations().register(this.runtimeConfigurationName, configuration -> configuration.extendsFrom(
project.getConfigurations()
.getByName(ApplicationDeploymentClasspathBuilder.getBaseRuntimeConfigName(mode))));
}
}

private void setUpDeploymentConfiguration() {
if (project.getConfigurations().findByName(this.deploymentConfigurationName) == null) {
project.getConfigurations().create(this.deploymentConfigurationName, configuration -> {
if (!project.getConfigurations().getNames().contains(this.deploymentConfigurationName)) {
project.getConfigurations().register(this.deploymentConfigurationName, configuration -> {
Configuration enforcedPlatforms = this.getPlatformConfiguration();
configuration.extendsFrom(enforcedPlatforms);
ListProperty<Dependency> dependencyListProperty = project.getObjects().listProperty(Dependency.class);
Expand Down
Binary file modified devtools/gradle/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion devtools/gradle/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
distributionSha256Sum=948d1e4ccc2f6ae36cbfa087d827aaca51403acae5411e664a6000bb47946f22
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion independent-projects/bootstrap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<graal-sdk.version>22.3.0</graal-sdk.version>
<plexus-classworlds.version>2.6.0</plexus-classworlds.version> <!-- not actually used but ClassRealm class is referenced from the API used in BootstrapWagonConfigurator -->
<smallrye-common.version>2.0.0</smallrye-common.version>
<gradle-tooling.version>7.5.1</gradle-tooling.version>
<gradle-tooling.version>8.0.1</gradle-tooling.version>
<quarkus-fs-util.version>0.0.9</quarkus-fs-util.version>
<org-crac.version>0.1.3</org-crac.version>
<formatter-maven-plugin.version>2.22.0</formatter-maven-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ language:
base:
data:
gradle:
version: 7.5.1
version: 8.0.1
shared-data:
buildtool:
cli: ./gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@
"supported-maven-versions": "[3.6.2,)",
"proposed-maven-version": "3.8.7",
"maven-wrapper-version": "3.1.1",
"gradle-wrapper-version": "7.5.1"
"gradle-wrapper-version": "8.0.1"
}
},
"codestarts-artifacts": [
Expand Down
2 changes: 1 addition & 1 deletion independent-projects/tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<!-- These properties are used by CreateProjectMojo to add the Maven Wrapper -->
<proposed-maven-version>3.8.7</proposed-maven-version>
<maven-wrapper.version>3.1.1</maven-wrapper.version>
<gradle-wrapper.version>7.5.1</gradle-wrapper.version>
<gradle-wrapper.version>8.0.1</gradle-wrapper.version>

<!-- These properties are needed in order for them to be resolvable by the generated projects -->
<!-- Quarkus uses jboss-parent and it comes with 3.8.1-jboss-1, we don't want that in the templates -->
Expand Down
Binary file modified integration-tests/gradle/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionSha256Sum=948d1e4ccc2f6ae36cbfa087d827aaca51403acae5411e664a6000bb47946f22
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
id 'io.quarkus'
}

dependencies {
implementation project(":common")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import io.quarkus.gradle.tasks.QuarkusGenerateCode

plugins {
id 'io.quarkus'
}

dependencies {
implementation files("../common/build/libs/common.jar")
}

tasks.withType(QuarkusGenerateCode).configureEach { t -> t.dependsOn(project(":common").tasks.named("jar")) }
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.acme.quarkus.sample;

import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

import org.acme.common.CommonBean;

@Path("/hello")
public class HelloResource {

@Inject
CommonBean common;

@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
return "hello " + common.getName();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Configuration file
# key = value

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ pluginManagement {
rootProject.name = 'quarkus-basic-multi-module-build'

include ':common'
include ':application'

include ':application-files'
include ':application-dep'
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ configurations {
}

task testJar (type: Jar) {
classifier = 'test'
archiveClassifier.set('test')
from sourceSets.test.output
}

Expand Down
Loading

0 comments on commit 5849491

Please sign in to comment.