From 9f7b52301c0a16e0ad2efc82c2352e6892c600d6 Mon Sep 17 00:00:00 2001 From: Guillaume Le Floch Date: Thu, 15 Jul 2021 10:41:01 +0200 Subject: [PATCH] Init extension gradle plugin --- .../gradle/application-plugin/build.gradle | 21 ++ devtools/gradle/application-plugin/pom.xml | 118 +++++++++++ .../GradleGroovyProjectBuildFile.java | 0 .../GradleKotlinProjectBuildFile.java | 0 .../buildfile/GradleProjectBuildFile.java | 0 .../gradle/AppModelGradleResolver.java | 0 .../java/io/quarkus/gradle/QuarkusPlugin.java | 0 .../gradle/builder/QuarkusModelBuilder.java | 0 ...ApplicationDeploymentClasspathBuilder.java | 0 .../ConditionalDependenciesEnabler.java | 0 .../gradle/dependency/DependencyUtils.java | 0 .../dependency/ExtensionDependency.java | 0 .../extension/QuarkusPluginExtension.java | 0 .../gradle/extension/SourceSetExtension.java | 0 .../gradle/tasks/GradleDevModeLauncher.java | 0 .../io/quarkus/gradle/tasks/GradleLogger.java | 0 .../gradle/tasks/GradleMessageWriter.java | 0 .../gradle/tasks/QuarkusAddExtension.java | 0 .../io/quarkus/gradle/tasks/QuarkusBuild.java | 0 .../io/quarkus/gradle/tasks/QuarkusDev.java | 0 .../gradle/tasks/QuarkusGenerateCode.java | 0 .../gradle/tasks/QuarkusGenerateConfig.java | 0 .../gradle/tasks/QuarkusGradleUtils.java | 0 .../gradle/tasks/QuarkusListCategories.java | 0 .../gradle/tasks/QuarkusListExtensions.java | 0 .../gradle/tasks/QuarkusListPlatforms.java | 0 .../gradle/tasks/QuarkusPlatformTask.java | 0 .../gradle/tasks/QuarkusRemoteDev.java | 0 .../gradle/tasks/QuarkusRemoveExtension.java | 0 .../io/quarkus/gradle/tasks/QuarkusTask.java | 0 .../io/quarkus/gradle/tasks/QuarkusTest.java | 0 .../gradle/tasks/QuarkusTestConfig.java | 0 .../gradle/tasks/QuarkusTestNative.java | 0 .../io/quarkus/gradle/QuarkusPluginTest.java | 0 .../builder/QuarkusModelBuilderTest.java | 0 devtools/gradle/build.gradle | 110 +++++----- devtools/gradle/extension-plugin/build.gradle | 17 ++ .../gradle/extension-plugin/gradle.properties | 1 + devtools/gradle/extension-plugin/pom.xml | 93 +++++++++ .../gradle/QuarkusExtensionPlugin.java | 32 +++ .../gradle/tasks/ExtensionDescriptorTask.java | 190 ++++++++++++++++++ .../extension/gradle/QuarkusPluginTest.java | 65 ++++++ .../quarkus/extension/gradle/TestUtils.java | 58 ++++++ .../gradle/tasks/ExtensionDescriptorTest.java | 93 +++++++++ devtools/gradle/pom.xml | 107 +--------- devtools/gradle/settings.gradle | 3 +- .../maven/ExtensionDescriptorMojo.java | 3 +- integration-tests/gradle/pom.xml | 5 + .../conditional-dependencies/build.gradle | 1 + .../ext-a/build.gradle | 1 + .../ext-a/runtime/build.gradle | 6 + .../META-INF/quarkus-extension.properties | 3 - .../ext-a/settings.gradle | 1 + .../ext-b/runtime/build.gradle | 7 + .../META-INF/quarkus-extension.properties | 3 - .../ext-b/settings.gradle | 1 + .../ext-c/runtime/build.gradle | 5 + .../META-INF/quarkus-extension.properties | 2 - .../ext-c/settings.gradle | 1 + .../ext-d/runtime/build.gradle | 5 + .../META-INF/quarkus-extension.properties | 2 - .../ext-d/settings.gradle | 1 + .../ext-e/runtime/build.gradle | 6 + .../META-INF/quarkus-extension.properties | 2 - .../ext-e/settings.gradle | 1 + .../ext-f/runtime/build.gradle | 5 + .../META-INF/quarkus-extension.properties | 2 - .../ext-f/settings.gradle | 1 + .../ext-g/runtime/build.gradle | 6 + .../META-INF/quarkus-extension.properties | 3 - .../ext-g/settings.gradle | 1 + .../ext-h/runtime/build.gradle | 6 + .../META-INF/quarkus-extension.properties | 3 - .../ext-h/settings.gradle | 1 + .../ext-i/runtime/build.gradle | 6 + .../META-INF/quarkus-extension.properties | 2 - .../ext-i/settings.gradle | 1 + .../ext-j/runtime/build.gradle | 6 + .../META-INF/quarkus-extension.properties | 2 - .../ext-j/settings.gradle | 1 + .../ext-k/runtime/build.gradle | 5 + .../META-INF/quarkus-extension.properties | 2 - .../ext-k/settings.gradle | 1 + .../ext-l/runtime/build.gradle | 5 + .../META-INF/quarkus-extension.properties | 2 - .../ext-l/settings.gradle | 1 + .../ext-m/runtime/build.gradle | 6 + .../META-INF/quarkus-extension.properties | 3 - .../ext-m/settings.gradle | 1 + .../ext-n/runtime/build.gradle | 6 + .../META-INF/quarkus-extension.properties | 3 - .../ext-n/settings.gradle | 1 + .../ext-o/runtime/build.gradle | 6 + .../META-INF/quarkus-extension.properties | 4 - .../ext-o/settings.gradle | 1 + .../ext-p/runtime/build.gradle | 6 + .../META-INF/quarkus-extension.properties | 2 - .../ext-p/settings.gradle | 1 + .../ext-r/runtime/build.gradle | 7 + .../META-INF/quarkus-extension.properties | 3 - .../ext-r/settings.gradle | 1 + .../ext-s/runtime/build.gradle | 6 + .../META-INF/quarkus-extension.properties | 2 - .../ext-s/settings.gradle | 1 + .../ext-t/runtime/build.gradle | 5 + .../META-INF/quarkus-extension.properties | 1 - .../ext-t/settings.gradle | 1 + .../ext-u/runtime/build.gradle | 5 + .../META-INF/quarkus-extension.properties | 1 - .../ext-u/settings.gradle | 1 + .../conditional-dependencies/settings.gradle | 1 + 111 files changed, 893 insertions(+), 208 deletions(-) create mode 100644 devtools/gradle/application-plugin/build.gradle create mode 100644 devtools/gradle/application-plugin/pom.xml rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/devtools/project/buildfile/GradleGroovyProjectBuildFile.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/devtools/project/buildfile/GradleKotlinProjectBuildFile.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/devtools/project/buildfile/GradleProjectBuildFile.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/AppModelGradleResolver.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/QuarkusPlugin.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/builder/QuarkusModelBuilder.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/dependency/ApplicationDeploymentClasspathBuilder.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/dependency/ConditionalDependenciesEnabler.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/dependency/DependencyUtils.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/dependency/ExtensionDependency.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/extension/QuarkusPluginExtension.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/extension/SourceSetExtension.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/GradleDevModeLauncher.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/GradleLogger.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/GradleMessageWriter.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/QuarkusAddExtension.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/QuarkusBuild.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/QuarkusGenerateCode.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/QuarkusGenerateConfig.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/QuarkusGradleUtils.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/QuarkusListCategories.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/QuarkusListExtensions.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/QuarkusListPlatforms.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/QuarkusPlatformTask.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/QuarkusRemoteDev.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/QuarkusRemoveExtension.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/QuarkusTask.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/QuarkusTest.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/QuarkusTestConfig.java (100%) rename devtools/gradle/{ => application-plugin}/src/main/java/io/quarkus/gradle/tasks/QuarkusTestNative.java (100%) rename devtools/gradle/{ => application-plugin}/src/test/java/io/quarkus/gradle/QuarkusPluginTest.java (100%) rename devtools/gradle/{ => application-plugin}/src/test/java/io/quarkus/gradle/builder/QuarkusModelBuilderTest.java (100%) create mode 100644 devtools/gradle/extension-plugin/build.gradle create mode 100644 devtools/gradle/extension-plugin/gradle.properties create mode 100644 devtools/gradle/extension-plugin/pom.xml create mode 100644 devtools/gradle/extension-plugin/src/main/java/io/quarkus/extension/gradle/QuarkusExtensionPlugin.java create mode 100644 devtools/gradle/extension-plugin/src/main/java/io/quarkus/extension/gradle/tasks/ExtensionDescriptorTask.java create mode 100644 devtools/gradle/extension-plugin/src/test/java/io/quarkus/extension/gradle/QuarkusPluginTest.java create mode 100644 devtools/gradle/extension-plugin/src/test/java/io/quarkus/extension/gradle/TestUtils.java create mode 100644 devtools/gradle/extension-plugin/src/test/java/io/quarkus/extension/gradle/tasks/ExtensionDescriptorTest.java delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-a/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-b/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-c/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-d/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-e/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-f/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-g/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-h/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-i/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-j/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-k/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-l/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-m/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-n/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-o/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-p/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-r/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-s/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-t/runtime/src/main/resources/META-INF/quarkus-extension.properties delete mode 100644 integration-tests/gradle/src/main/resources/conditional-dependencies/ext-u/runtime/src/main/resources/META-INF/quarkus-extension.properties diff --git a/devtools/gradle/application-plugin/build.gradle b/devtools/gradle/application-plugin/build.gradle new file mode 100644 index 0000000000000..910c59dc8baee --- /dev/null +++ b/devtools/gradle/application-plugin/build.gradle @@ -0,0 +1,21 @@ +dependencies { + implementation "io.quarkus:quarkus-devtools-common:${version}" + implementation "io.quarkus:quarkus-core-deployment:${version}" + + testImplementation "io.quarkus:quarkus-project-core-extension-codestarts:${version}" + testImplementation "io.quarkus:quarkus-devmode-test-utils:${version}" + testImplementation "io.quarkus:quarkus-devtools-testing:${version}" +} + +group = "io.quarkus" + +gradlePlugin { + plugins { + quarkusPlugin { + id = 'io.quarkus' + 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' + } + } +} diff --git a/devtools/gradle/application-plugin/pom.xml b/devtools/gradle/application-plugin/pom.xml new file mode 100644 index 0000000000000..90f63c838c8a0 --- /dev/null +++ b/devtools/gradle/application-plugin/pom.xml @@ -0,0 +1,118 @@ + + + + io.quarkus + io.quarkus.gradle.plugin.parent + 999-SNAPSHOT + ../pom.xml + + 4.0.0 + + io.quarkus.gradle.plugin + pom + Quarkus - Gradle Plugin + Quarkus - Gradle Plugin + + + + + io.quarkus + quarkus-bootstrap-core + + + io.quarkus + quarkus-core-deployment + + + io.quarkus + quarkus-devtools-common + + + io.quarkus + quarkus-project-core-extension-codestarts + pom + test + + + * + * + + + + + io.quarkus + quarkus-devmode-test-utils + test + + + + + + + org.codehaus.mojo + exec-maven-plugin + + + gradle + prepare-package + + ${gradle.executable} + + clean + ${gradle.task} + -Pdescription=${project.description} + -Dmaven.repo.local=${settings.localRepository} + -S + --stacktrace + --no-daemon + + + ${settings.localRepository} + ${env.MAVEN_OPTS} + + ${skip.gradle.build} + + + exec + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + package + + attach-artifact + + + + + build/libs/application-plugin-${project.version}.jar + jar + + + build/libs/application-plugin-${project.version}-javadoc.jar + jar + javadoc + + + build/libs/application-plugin-${project.version}-sources.jar + jar + sources + + + ${skip.gradle.build} + + + + + + + + \ No newline at end of file diff --git a/devtools/gradle/src/main/java/io/quarkus/devtools/project/buildfile/GradleGroovyProjectBuildFile.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/devtools/project/buildfile/GradleGroovyProjectBuildFile.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/devtools/project/buildfile/GradleGroovyProjectBuildFile.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/devtools/project/buildfile/GradleGroovyProjectBuildFile.java diff --git a/devtools/gradle/src/main/java/io/quarkus/devtools/project/buildfile/GradleKotlinProjectBuildFile.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/devtools/project/buildfile/GradleKotlinProjectBuildFile.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/devtools/project/buildfile/GradleKotlinProjectBuildFile.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/devtools/project/buildfile/GradleKotlinProjectBuildFile.java diff --git a/devtools/gradle/src/main/java/io/quarkus/devtools/project/buildfile/GradleProjectBuildFile.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/devtools/project/buildfile/GradleProjectBuildFile.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/devtools/project/buildfile/GradleProjectBuildFile.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/devtools/project/buildfile/GradleProjectBuildFile.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/AppModelGradleResolver.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/AppModelGradleResolver.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/AppModelGradleResolver.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/AppModelGradleResolver.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/QuarkusPlugin.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/QuarkusPlugin.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/builder/QuarkusModelBuilder.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/builder/QuarkusModelBuilder.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/builder/QuarkusModelBuilder.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/builder/QuarkusModelBuilder.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/dependency/ApplicationDeploymentClasspathBuilder.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/dependency/ApplicationDeploymentClasspathBuilder.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/dependency/ApplicationDeploymentClasspathBuilder.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/dependency/ApplicationDeploymentClasspathBuilder.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/dependency/ConditionalDependenciesEnabler.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/dependency/ConditionalDependenciesEnabler.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/dependency/ConditionalDependenciesEnabler.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/dependency/ConditionalDependenciesEnabler.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/dependency/DependencyUtils.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/dependency/DependencyUtils.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/dependency/DependencyUtils.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/dependency/DependencyUtils.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/dependency/ExtensionDependency.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/dependency/ExtensionDependency.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/dependency/ExtensionDependency.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/dependency/ExtensionDependency.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/extension/QuarkusPluginExtension.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/extension/QuarkusPluginExtension.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/extension/QuarkusPluginExtension.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/extension/QuarkusPluginExtension.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/extension/SourceSetExtension.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/extension/SourceSetExtension.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/extension/SourceSetExtension.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/extension/SourceSetExtension.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/GradleDevModeLauncher.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/GradleDevModeLauncher.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/GradleDevModeLauncher.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/GradleDevModeLauncher.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/GradleLogger.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/GradleLogger.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/GradleLogger.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/GradleLogger.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/GradleMessageWriter.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/GradleMessageWriter.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/GradleMessageWriter.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/GradleMessageWriter.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusAddExtension.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusAddExtension.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusAddExtension.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusAddExtension.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusBuild.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuild.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusBuild.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuild.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusGenerateCode.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusGenerateCode.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusGenerateCode.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusGenerateCode.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusGenerateConfig.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusGenerateConfig.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusGenerateConfig.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusGenerateConfig.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusGradleUtils.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusGradleUtils.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusGradleUtils.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusGradleUtils.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusListCategories.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusListCategories.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusListCategories.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusListCategories.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusListExtensions.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusListExtensions.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusListExtensions.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusListExtensions.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusListPlatforms.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusListPlatforms.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusListPlatforms.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusListPlatforms.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusPlatformTask.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusPlatformTask.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusPlatformTask.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusPlatformTask.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusRemoteDev.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusRemoteDev.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusRemoteDev.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusRemoteDev.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusRemoveExtension.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusRemoveExtension.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusRemoveExtension.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusRemoveExtension.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusTask.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusTask.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusTask.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusTask.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusTest.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusTest.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusTest.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusTest.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusTestConfig.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusTestConfig.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusTestConfig.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusTestConfig.java diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusTestNative.java b/devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusTestNative.java similarity index 100% rename from devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusTestNative.java rename to devtools/gradle/application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusTestNative.java diff --git a/devtools/gradle/src/test/java/io/quarkus/gradle/QuarkusPluginTest.java b/devtools/gradle/application-plugin/src/test/java/io/quarkus/gradle/QuarkusPluginTest.java similarity index 100% rename from devtools/gradle/src/test/java/io/quarkus/gradle/QuarkusPluginTest.java rename to devtools/gradle/application-plugin/src/test/java/io/quarkus/gradle/QuarkusPluginTest.java diff --git a/devtools/gradle/src/test/java/io/quarkus/gradle/builder/QuarkusModelBuilderTest.java b/devtools/gradle/application-plugin/src/test/java/io/quarkus/gradle/builder/QuarkusModelBuilderTest.java similarity index 100% rename from devtools/gradle/src/test/java/io/quarkus/gradle/builder/QuarkusModelBuilderTest.java rename to devtools/gradle/application-plugin/src/test/java/io/quarkus/gradle/builder/QuarkusModelBuilderTest.java diff --git a/devtools/gradle/build.gradle b/devtools/gradle/build.gradle index b78154c0abdb3..995c0f974f229 100644 --- a/devtools/gradle/build.gradle +++ b/devtools/gradle/build.gradle @@ -1,79 +1,69 @@ plugins { - id 'com.gradle.plugin-publish' version '0.16.0' - id 'java-gradle-plugin' -} -if (JavaVersion.current().isJava9Compatible()) { - compileJava.options.compilerArgs.addAll(['--release', '11']) -} -compileJava { - options.encoding = 'UTF-8' - sourceCompatibility = '11' - targetCompatibility = '11' + id 'com.gradle.plugin-publish' version '0.16.0' apply false } -compileTestJava { - options.encoding = 'UTF-8' -} +subprojects { + apply plugin: 'java-gradle-plugin' + apply plugin: 'com.gradle.plugin-publish' -repositories { - // in case a custom local repo is configured we are going to use that instead of the default mavenLocal() - if (System.properties.containsKey('maven.repo.local')) { - maven { - url System.properties.get('maven.repo.local') - } - } else { - mavenLocal() + if (JavaVersion.current().isJava9Compatible()) { + compileJava.options.compilerArgs.addAll(['--release', '11']) + } + compileJava { + options.encoding = 'UTF-8' + sourceCompatibility = '11' + targetCompatibility = '11' } - mavenCentral() -} -dependencies { - api gradleApi() + compileTestJava { + options.encoding = 'UTF-8' + } - implementation "io.quarkus:quarkus-bootstrap-core:${version}" - implementation "io.quarkus:quarkus-devtools-common:${version}" - implementation "io.quarkus:quarkus-core-deployment:${version}" + repositories { + // in case a custom local repo is configured we are going to use that instead of the default mavenLocal() + if (System.properties.containsKey('maven.repo.local')) { + maven { + url System.properties.get('maven.repo.local') + } + } else { + mavenLocal() + } + mavenCentral() + } - testImplementation "io.quarkus:quarkus-project-core-extension-codestarts:${version}" - testImplementation 'org.assertj:assertj-core:3.20.2' - testImplementation 'org.junit.jupiter:junit-jupiter:5.8.0' - testImplementation "io.quarkus:quarkus-devmode-test-utils:${version}" - testImplementation "io.quarkus:quarkus-devtools-testing:${version}" - testImplementation gradleTestKit() -} + dependencies { + api gradleApi() -test { - // propagate the custom local maven repo, in case it's configured - if (System.properties.containsKey('maven.repo.local')) { - systemProperty 'maven.repo.local', System.properties.get('maven.repo.local') - } - testLogging { - events "passed", "skipped", "failed" + implementation "io.quarkus:quarkus-bootstrap-core:${version}" + + testImplementation gradleTestKit() + testImplementation 'org.junit.jupiter:junit-jupiter:5.7.2' + testImplementation 'org.assertj:assertj-core:3.20.2' } - useJUnitPlatform() -} -javadoc { - options.addStringOption('encoding', 'UTF-8') -} + test { + // propagate the custom local maven repo, in case it's configured + if (System.properties.containsKey('maven.repo.local')) { + systemProperty 'maven.repo.local', System.properties.get('maven.repo.local') + } + testLogging { + events "passed", "skipped", "failed" + } + useJUnitPlatform() + } -pluginBundle { - website = 'https://quarkus.io/' - vcsUrl = 'https://github.com/quarkusio/quarkus' - tags = ['quarkus', 'quarkusio', 'graalvm'] -} + javadoc { + options.addStringOption('encoding', 'UTF-8') + } -gradlePlugin { - plugins { - quarkusPlugin { - id = 'io.quarkus' - 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' - } + pluginBundle { + website = 'https://quarkus.io/' + vcsUrl = 'https://github.com/quarkusio/quarkus' + tags = ['quarkus', 'quarkusio', 'graalvm'] } } wrapper { distributionType = Wrapper.DistributionType.ALL } + diff --git a/devtools/gradle/extension-plugin/build.gradle b/devtools/gradle/extension-plugin/build.gradle new file mode 100644 index 0000000000000..02b4256b2ca26 --- /dev/null +++ b/devtools/gradle/extension-plugin/build.gradle @@ -0,0 +1,17 @@ +dependencies { + implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}" + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${jacksonVersion}" +} + +group = "io.quarkus.extension" + +gradlePlugin { + plugins { + quarkusBootstrapPlugin { + id = 'io.quarkus.extension' + implementationClass = 'io.quarkus.extension.gradle.QuarkusExtensionPlugin' + displayName = 'Quarkus Extension Plugin' + description = 'Builds a Quarkus extension' + } + } +} diff --git a/devtools/gradle/extension-plugin/gradle.properties b/devtools/gradle/extension-plugin/gradle.properties new file mode 100644 index 0000000000000..d0e2c670c83d7 --- /dev/null +++ b/devtools/gradle/extension-plugin/gradle.properties @@ -0,0 +1 @@ +jacksonVersion = 2.12.4 \ No newline at end of file diff --git a/devtools/gradle/extension-plugin/pom.xml b/devtools/gradle/extension-plugin/pom.xml new file mode 100644 index 0000000000000..76c41c731c6ea --- /dev/null +++ b/devtools/gradle/extension-plugin/pom.xml @@ -0,0 +1,93 @@ + + + + io.quarkus + io.quarkus.gradle.plugin.parent + 999-SNAPSHOT + ../pom.xml + + 4.0.0 + + io.quarkus.extension + io.quarkus.extension.gradle.plugin + pom + Quarkus - Extension Gradle Plugin + Quarkus - Extension Gradle Plugin + + + + + io.quarkus + quarkus-bootstrap-core + + + + + + + org.codehaus.mojo + exec-maven-plugin + + + gradle + prepare-package + + ${gradle.executable} + + clean + ${gradle.task} + -Pdescription=${project.description} + -Dmaven.repo.local=${settings.localRepository} + -S + --stacktrace + --no-daemon + + + ${settings.localRepository} + ${env.MAVEN_OPTS} + + ${skip.gradle.build} + + + exec + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + package + + attach-artifact + + + + + build/libs/extension-plugin-${project.version}.jar + jar + + + build/libs/extension-plugin-${project.version}-javadoc.jar + jar + javadoc + + + build/libs/extension-plugin-${project.version}-sources.jar + jar + sources + + + ${skip.gradle.build} + + + + + + + \ No newline at end of file diff --git a/devtools/gradle/extension-plugin/src/main/java/io/quarkus/extension/gradle/QuarkusExtensionPlugin.java b/devtools/gradle/extension-plugin/src/main/java/io/quarkus/extension/gradle/QuarkusExtensionPlugin.java new file mode 100644 index 0000000000000..50f6be0f32df6 --- /dev/null +++ b/devtools/gradle/extension-plugin/src/main/java/io/quarkus/extension/gradle/QuarkusExtensionPlugin.java @@ -0,0 +1,32 @@ +package io.quarkus.extension.gradle; + +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.Task; +import org.gradle.api.plugins.JavaPlugin; +import org.gradle.api.tasks.TaskContainer; + +import io.quarkus.extension.gradle.tasks.ExtensionDescriptorTask; + +public class QuarkusExtensionPlugin implements Plugin { + + public static final String EXTENSION_DESCRIPTOR_TASK_NAME = "extensionDescriptor"; + + @Override + public void apply(Project project) { + registerTasks(project); + } + + private void registerTasks(Project project) { + TaskContainer tasks = project.getTasks(); + ExtensionDescriptorTask extensionDescriptorTask = tasks.create(EXTENSION_DESCRIPTOR_TASK_NAME, + ExtensionDescriptorTask.class); + + project.getPlugins().withType( + JavaPlugin.class, + javaPlugin -> { + Task jarTask = tasks.getByName(JavaPlugin.JAR_TASK_NAME); + jarTask.dependsOn(extensionDescriptorTask); + }); + } +} diff --git a/devtools/gradle/extension-plugin/src/main/java/io/quarkus/extension/gradle/tasks/ExtensionDescriptorTask.java b/devtools/gradle/extension-plugin/src/main/java/io/quarkus/extension/gradle/tasks/ExtensionDescriptorTask.java new file mode 100644 index 0000000000000..92a28162d9f26 --- /dev/null +++ b/devtools/gradle/extension-plugin/src/main/java/io/quarkus/extension/gradle/tasks/ExtensionDescriptorTask.java @@ -0,0 +1,190 @@ +package io.quarkus.extension.gradle.tasks; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Properties; + +import org.gradle.api.DefaultTask; +import org.gradle.api.GradleException; +import org.gradle.api.plugins.JavaPluginConvention; +import org.gradle.api.tasks.Input; +import org.gradle.api.tasks.Optional; +import org.gradle.api.tasks.SourceSet; +import org.gradle.api.tasks.TaskAction; +import org.gradle.api.tasks.options.Option; + +import io.quarkus.bootstrap.BootstrapConstants; +import io.quarkus.bootstrap.model.AppArtifactCoords; +import io.quarkus.bootstrap.model.AppArtifactKey; +import io.quarkus.bootstrap.model.AppModel; + +/** + * Task that generates extension descriptor files. + */ +public class ExtensionDescriptorTask extends DefaultTask { + + private String deployment; + private List excludedArtifacts; + private List parentFirstArtifacts; + private List runnerParentFirstArtifacts; + private List lesserPriorityArtifacts; + private List conditionalDependencies; + private List dependencyCondition; + + public ExtensionDescriptorTask() { + setDescription("Generate extension descriptor file"); + setGroup("quarkus"); + } + + @Input + public String getDeployment() { + if (deployment == null) { + String projectName = getProject().getName(); + if (getProject().getParent() != null && projectName.equals("runtime")) { + projectName = getProject().getParent().getName(); + } + return String.format("%s:%s-deployment:%s", getProject().getGroup(), projectName, + getProject().getVersion()); + } + return deployment; + } + + @Option(option = "deployment", description = "GAV of the deployment module") + public void setDeployment(String deployment) { + this.deployment = deployment; + } + + @Input + @Optional + public List getExcludedArtifacts() { + return excludedArtifacts; + } + + @Option(option = "excludedArtifacts", description = "Artifacts that should be excluded from the final build") + public void setExcludedArtifacts(List excludedArtifacts) { + this.excludedArtifacts = excludedArtifacts; + } + + @Input + @Optional + public List getParentFirstArtifacts() { + return parentFirstArtifacts; + } + + @Option(option = "parentFirstArtifacts", description = "Artifacts that should be loaded first when running in dev or test mode") + public void setParentFirstArtifacts(List parentFirstArtifacts) { + this.parentFirstArtifacts = parentFirstArtifacts; + } + + @Input + @Optional + public List getRunnerParentFirstArtifacts() { + return runnerParentFirstArtifacts; + } + + @Option(option = "runnerParentFirstArtifacts", description = "Artifacts that should be loaded first when the fast-jar is used") + public void setRunnerParentFirstArtifacts(List runnerParentFirstArtifacts) { + this.runnerParentFirstArtifacts = runnerParentFirstArtifacts; + } + + @Input + @Optional + public List getLesserPriorityArtifacts() { + return lesserPriorityArtifacts; + } + + @Option(option = "lesserPriorityArtifacts", description = "Artifacts that should be loaded in case no other normal element exists") + public void setLesserPriorityArtifacts(List lesserPriorityArtifacts) { + this.lesserPriorityArtifacts = lesserPriorityArtifacts; + } + + @Input + @Optional + public List getConditionalDependencies() { + return conditionalDependencies; + } + + @Option(option = "conditionalDependencies", description = "Artifacts that could be conditionally loaded") + public void setConditionalDependencies(List conditionalDependencies) { + this.conditionalDependencies = conditionalDependencies; + } + + @Input + @Optional + public List getDependencyCondition() { + return dependencyCondition; + } + + @Option(option = "dependencyCondition", description = "Conditions that should enable this extension (in case this extension is loaded as a conditional dependency)") + public void setDependencyCondition(List dependencyCondition) { + this.dependencyCondition = dependencyCondition; + } + + @TaskAction + public void generateExtensionDescriptor() { + JavaPluginConvention convention = getProject().getConvention().getPlugin(JavaPluginConvention.class); + File resourcesDir = convention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME).getOutput().getResourcesDir(); + + generateQuarkusExtensionProperties(resourcesDir); + } + + private void generateQuarkusExtensionProperties(File outputDir) { + final Properties props = new Properties(); + props.setProperty(BootstrapConstants.PROP_DEPLOYMENT_ARTIFACT, getDeployment()); + + if (conditionalDependencies != null && !conditionalDependencies.isEmpty()) { + final StringBuilder buf = new StringBuilder(); + int i = 0; + buf.append(AppArtifactCoords.fromString(conditionalDependencies.get(i++)).toString()); + while (i < conditionalDependencies.size()) { + buf.append(' ').append(AppArtifactCoords.fromString(conditionalDependencies.get(i++)).toString()); + } + props.setProperty(BootstrapConstants.CONDITIONAL_DEPENDENCIES, buf.toString()); + } + if (dependencyCondition != null && !dependencyCondition.isEmpty()) { + final StringBuilder buf = new StringBuilder(); + int i = 0; + buf.append(AppArtifactKey.fromString(dependencyCondition.get(i++)).toGacString()); + while (i < dependencyCondition.size()) { + buf.append(' ').append(AppArtifactKey.fromString(dependencyCondition.get(i++)).toGacString()); + } + props.setProperty(BootstrapConstants.DEPENDENCY_CONDITION, buf.toString()); + } + if (parentFirstArtifacts != null && !parentFirstArtifacts.isEmpty()) { + String val = String.join(",", parentFirstArtifacts); + props.put(AppModel.PARENT_FIRST_ARTIFACTS, val); + } + + if (runnerParentFirstArtifacts != null && !runnerParentFirstArtifacts.isEmpty()) { + String val = String.join(",", runnerParentFirstArtifacts); + props.put(AppModel.RUNNER_PARENT_FIRST_ARTIFACTS, val); + } + + if (excludedArtifacts != null && !excludedArtifacts.isEmpty()) { + String val = String.join(",", excludedArtifacts); + props.put(AppModel.EXCLUDED_ARTIFACTS, val); + } + + if (lesserPriorityArtifacts != null && !lesserPriorityArtifacts.isEmpty()) { + String val = String.join(",", lesserPriorityArtifacts); + props.put(AppModel.LESSER_PRIORITY_ARTIFACTS, val); + } + + final Path output = outputDir.toPath().resolve(BootstrapConstants.META_INF); + try { + Files.createDirectories(output); + try (BufferedWriter writer = Files + .newBufferedWriter(output.resolve(BootstrapConstants.DESCRIPTOR_FILE_NAME))) { + props.store(writer, "Generated by extension-descriptor"); + } + } catch (IOException e) { + throw new GradleException( + "Failed to persist extension descriptor " + output.resolve(BootstrapConstants.DESCRIPTOR_FILE_NAME), + e); + } + } +} diff --git a/devtools/gradle/extension-plugin/src/test/java/io/quarkus/extension/gradle/QuarkusPluginTest.java b/devtools/gradle/extension-plugin/src/test/java/io/quarkus/extension/gradle/QuarkusPluginTest.java new file mode 100644 index 0000000000000..7cd2db63b219a --- /dev/null +++ b/devtools/gradle/extension-plugin/src/test/java/io/quarkus/extension/gradle/QuarkusPluginTest.java @@ -0,0 +1,65 @@ +package io.quarkus.extension.gradle; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.File; +import java.io.IOException; +import java.nio.file.FileSystem; +import java.nio.file.Path; +import java.util.Properties; + +import org.assertj.core.api.Assertions; +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.GradleRunner; +import org.gradle.testkit.runner.TaskOutcome; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import io.quarkus.bootstrap.BootstrapConstants; +import io.quarkus.bootstrap.util.ZipUtils; + +public class QuarkusPluginTest { + + @TempDir + File testProjectDir; + private File buildFile; + + @BeforeEach + public void setupProject() throws IOException { + buildFile = new File(testProjectDir, "build.gradle"); + + File settingFile = new File(testProjectDir, "settings.gradle"); + String settingsContent = "rootProject.name = 'test'"; + TestUtils.writeFile(settingFile, settingsContent); + } + + @Test + public void jarShouldContainsExtensionPropertiesFile() throws IOException { + TestUtils.writeFile(buildFile, TestUtils.DEFAULT_BUILD_GRADLE_CONTENT); + BuildResult jarResult = GradleRunner.create() + .withPluginClasspath() + .withProjectDir(testProjectDir) + .withArguments("jar", "-S") + .build(); + + assertThat(jarResult.task(":jar").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); + assertThat(jarResult.task(":" + QuarkusExtensionPlugin.EXTENSION_DESCRIPTOR_TASK_NAME).getOutcome()) + .isEqualTo(TaskOutcome.SUCCESS); + + File jarFile = new File(testProjectDir, "build/libs/test-1.0.0.jar"); + assertThat(jarFile).exists(); + assertThat(jarFile).satisfies(f -> { + try (FileSystem jarFs = ZipUtils.newFileSystem(f.toPath())) { + Path descriptorPath = jarFs.getPath(BootstrapConstants.DESCRIPTOR_PATH); + assertThat(descriptorPath).exists(); + + Properties extensionProperty = TestUtils.readPropertyFile(descriptorPath); + assertThat(extensionProperty).containsEntry("deployment-artifact", "org.acme:test-deployment:1.0.0"); + + } catch (IOException e) { + Assertions.fail("Unable to read jar file"); + } + }); + } +} diff --git a/devtools/gradle/extension-plugin/src/test/java/io/quarkus/extension/gradle/TestUtils.java b/devtools/gradle/extension-plugin/src/test/java/io/quarkus/extension/gradle/TestUtils.java new file mode 100644 index 0000000000000..a0bd966764e72 --- /dev/null +++ b/devtools/gradle/extension-plugin/src/test/java/io/quarkus/extension/gradle/TestUtils.java @@ -0,0 +1,58 @@ +package io.quarkus.extension.gradle; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Properties; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.GradleRunner; +import org.gradle.testkit.runner.TaskOutcome; + +public class TestUtils { + + public static final String DEFAULT_BUILD_GRADLE_CONTENT = "plugins {\n" + + "id 'java'\n" + + "id 'io.quarkus.extension'\n" + + "}\n" + + "group 'org.acme'\n" + + "version '1.0.0'\n"; + + public static BuildResult runExtensionDescriptorTask(File testProjectDir) { + BuildResult extensionDescriptorResult = GradleRunner.create() + .withPluginClasspath() + .withProjectDir(testProjectDir) + .withArguments(QuarkusExtensionPlugin.EXTENSION_DESCRIPTOR_TASK_NAME, "-S") + .build(); + + assertThat(extensionDescriptorResult.task(":" + QuarkusExtensionPlugin.EXTENSION_DESCRIPTOR_TASK_NAME).getOutcome()) + .isEqualTo(TaskOutcome.SUCCESS); + return extensionDescriptorResult; + } + + public static void writeFile(File destination, String content) throws IOException { + BufferedWriter output = null; + try { + output = new BufferedWriter(new FileWriter(destination)); + output.write(content); + } finally { + if (output != null) { + output.close(); + } + } + } + + public static Properties readPropertyFile(Path propertyFile) throws IOException { + final Properties extensionProperties = new Properties(); + try (BufferedReader reader = Files.newBufferedReader(propertyFile)) { + extensionProperties.load(reader); + } + return extensionProperties; + } +} diff --git a/devtools/gradle/extension-plugin/src/test/java/io/quarkus/extension/gradle/tasks/ExtensionDescriptorTest.java b/devtools/gradle/extension-plugin/src/test/java/io/quarkus/extension/gradle/tasks/ExtensionDescriptorTest.java new file mode 100644 index 0000000000000..87f4e9e038c59 --- /dev/null +++ b/devtools/gradle/extension-plugin/src/test/java/io/quarkus/extension/gradle/tasks/ExtensionDescriptorTest.java @@ -0,0 +1,93 @@ +package io.quarkus.extension.gradle.tasks; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.File; +import java.io.IOException; +import java.util.Properties; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import io.quarkus.extension.gradle.QuarkusExtensionPlugin; +import io.quarkus.extension.gradle.TestUtils; + +public class ExtensionDescriptorTest { + + @TempDir + File testProjectDir; + private File buildFile; + + @BeforeEach + public void setupProject() throws IOException { + buildFile = new File(testProjectDir, "build.gradle"); + + File settingFile = new File(testProjectDir, "settings.gradle"); + String settingsContent = "rootProject.name = 'test'"; + TestUtils.writeFile(settingFile, settingsContent); + } + + @Test + public void shouldCreateFileWithDefaultValues() throws IOException { + TestUtils.writeFile(buildFile, TestUtils.DEFAULT_BUILD_GRADLE_CONTENT); + TestUtils.runExtensionDescriptorTask(testProjectDir); + + File extensionPropertiesFile = new File(testProjectDir, "build/resources/main/META-INF/quarkus-extension.properties"); + assertThat(extensionPropertiesFile).exists(); + + Properties extensionProperty = TestUtils.readPropertyFile(extensionPropertiesFile.toPath()); + assertThat(extensionProperty).containsEntry("deployment-artifact", "org.acme:test-deployment:1.0.0"); + } + + @Test + public void shouldUseCustomDeploymentArtifactName() throws IOException { + String buildFileContent = TestUtils.DEFAULT_BUILD_GRADLE_CONTENT + + QuarkusExtensionPlugin.EXTENSION_DESCRIPTOR_TASK_NAME + " { " + + "deployment = 'custom.group:custom-deployment-artifact:0.1.0'" + + "}"; + TestUtils.writeFile(buildFile, buildFileContent); + TestUtils.runExtensionDescriptorTask(testProjectDir); + + File extensionPropertiesFile = new File(testProjectDir, "build/resources/main/META-INF/quarkus-extension.properties"); + assertThat(extensionPropertiesFile).exists(); + + Properties extensionProperty = TestUtils.readPropertyFile(extensionPropertiesFile.toPath()); + assertThat(extensionProperty).containsEntry("deployment-artifact", "custom.group:custom-deployment-artifact:0.1.0"); + } + + @Test + public void shouldContainsConditionalDependencies() throws IOException { + String buildFileContent = TestUtils.DEFAULT_BUILD_GRADLE_CONTENT + + QuarkusExtensionPlugin.EXTENSION_DESCRIPTOR_TASK_NAME + " { " + + "conditionalDependencies= ['org.acme:ext-a:0.1.0', 'org.acme:ext-b:0.1.0']" + + "}"; + TestUtils.writeFile(buildFile, buildFileContent); + TestUtils.runExtensionDescriptorTask(testProjectDir); + + File extensionPropertiesFile = new File(testProjectDir, "build/resources/main/META-INF/quarkus-extension.properties"); + assertThat(extensionPropertiesFile).exists(); + + Properties extensionProperty = TestUtils.readPropertyFile(extensionPropertiesFile.toPath()); + assertThat(extensionProperty).containsEntry("deployment-artifact", "org.acme:test-deployment:1.0.0"); + assertThat(extensionProperty).containsEntry("conditional-dependencies", + "org.acme:ext-a::jar:0.1.0 org.acme:ext-b::jar:0.1.0"); + } + + @Test + public void shouldContainsParentFirstArtifacts() throws IOException { + String buildFileContent = TestUtils.DEFAULT_BUILD_GRADLE_CONTENT + + QuarkusExtensionPlugin.EXTENSION_DESCRIPTOR_TASK_NAME + " { " + + "parentFirstArtifacts = ['org.acme:ext-a:0.1.0', 'org.acme:ext-b:0.1.0']" + + "}"; + TestUtils.writeFile(buildFile, buildFileContent); + TestUtils.runExtensionDescriptorTask(testProjectDir); + + File extensionPropertiesFile = new File(testProjectDir, "build/resources/main/META-INF/quarkus-extension.properties"); + assertThat(extensionPropertiesFile).exists(); + + Properties extensionProperty = TestUtils.readPropertyFile(extensionPropertiesFile.toPath()); + assertThat(extensionProperty).containsEntry("deployment-artifact", "org.acme:test-deployment:1.0.0"); + assertThat(extensionProperty).containsEntry("parent-first-artifacts", "org.acme:ext-a:0.1.0,org.acme:ext-b:0.1.0"); + } +} diff --git a/devtools/gradle/pom.xml b/devtools/gradle/pom.xml index b389269b26600..d8725f9bdf1e4 100644 --- a/devtools/gradle/pom.xml +++ b/devtools/gradle/pom.xml @@ -10,113 +10,24 @@ 4.0.0 - io.quarkus.gradle.plugin + io.quarkus.gradle.plugin.parent pom - Quarkus - Gradle Plugin + Quarkus - Gradle Plugin - Parent Quarkus - Gradle Plugin - ./gradlew + ./../gradlew build false - - - - io.quarkus - quarkus-bootstrap-core - - - io.quarkus - quarkus-core-deployment - - - io.quarkus - quarkus-devtools-common - - - io.quarkus - quarkus-project-core-extension-codestarts - pom - test - - - * - * - - - - - io.quarkus - quarkus-devmode-test-utils - test - - + + application-plugin + extension-plugin + + - - org.codehaus.mojo - exec-maven-plugin - - - gradle - prepare-package - - ${gradle.executable} - - clean - ${gradle.task} - -Pdescription=${project.description} - -Dmaven.repo.local=${settings.localRepository} - -S - --stacktrace - --no-daemon - - - ${settings.localRepository} - ${env.MAVEN_OPTS} - - ${skip.gradle.build} - - - exec - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - package - - attach-artifact - - - - - build/libs/quarkus-gradle-plugin-${project.version}.jar - jar - - - build/libs/quarkus-gradle-plugin-${project.version}-javadoc.jar - jar - javadoc - - - build/libs/quarkus-gradle-plugin-${project.version}-sources.jar - jar - sources - - - ${skip.gradle.build} - - - - org.sonatype.plugins @@ -137,7 +48,7 @@ - gradlew.bat + ..\gradlew.bat diff --git a/devtools/gradle/settings.gradle b/devtools/gradle/settings.gradle index 23d13fdee4624..304b2d055e52c 100644 --- a/devtools/gradle/settings.gradle +++ b/devtools/gradle/settings.gradle @@ -12,4 +12,5 @@ gradleEnterprise { } } -rootProject.name = 'quarkus-gradle-plugin' +rootProject.name = 'quarkus-gradle-plugins' +include 'application-plugin', 'extension-plugin' diff --git a/independent-projects/bootstrap/maven-plugin/src/main/java/io/quarkus/maven/ExtensionDescriptorMojo.java b/independent-projects/bootstrap/maven-plugin/src/main/java/io/quarkus/maven/ExtensionDescriptorMojo.java index 06d4d03488e7c..157a82fd3aa5b 100644 --- a/independent-projects/bootstrap/maven-plugin/src/main/java/io/quarkus/maven/ExtensionDescriptorMojo.java +++ b/independent-projects/bootstrap/maven-plugin/src/main/java/io/quarkus/maven/ExtensionDescriptorMojo.java @@ -266,8 +266,6 @@ public void execute() throws MojoExecutionException { props.setProperty(BootstrapConstants.PROP_PROVIDES_CAPABILITIES, buf.toString()); } - final Path output = outputDirectory.toPath().resolve(BootstrapConstants.META_INF); - if (parentFirstArtifacts != null && !parentFirstArtifacts.isEmpty()) { String val = String.join(",", parentFirstArtifacts); props.put(AppModel.PARENT_FIRST_ARTIFACTS, val); @@ -288,6 +286,7 @@ public void execute() throws MojoExecutionException { props.put(AppModel.LESSER_PRIORITY_ARTIFACTS, val); } + final Path output = outputDirectory.toPath().resolve(BootstrapConstants.META_INF); try { Files.createDirectories(output); try (BufferedWriter writer = Files diff --git a/integration-tests/gradle/pom.xml b/integration-tests/gradle/pom.xml index 1d667e2a9a80f..27c3dbeef56d1 100644 --- a/integration-tests/gradle/pom.xml +++ b/integration-tests/gradle/pom.xml @@ -24,6 +24,11 @@ io.quarkus.gradle.plugin ${project.version} + + io.quarkus.extension + io.quarkus.extension.gradle.plugin + ${project.version} + org.assertj assertj-core diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/build.gradle index 9f8ab1103e033..ef5144a190aa1 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java' id 'io.quarkus' apply false + id 'io.quarkus.extension' apply false } repositories { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-a/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-a/build.gradle index 9ee9f442ee098..838a16b6f638d 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-a/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-a/build.gradle @@ -5,6 +5,7 @@ allprojects { apply plugin: 'java' apply plugin: 'maven-publish' + repositories { mavenCentral() // in case a custom local repo is configured we are going to use that instead of the default mavenLocal() diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-a/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-a/runtime/build.gradle index 76e136b702273..942370ff2b1d3 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-a/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-a/runtime/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { @@ -11,6 +12,11 @@ dependencies { api("io.quarkus:quarkus-hibernate-reactive-panache") } +extensionDescriptor { + deployment = "org.acme:ext-a-deployment:1.0-SNAPSHOT" + conditionalDependencies = ["org.acme:ext-b::jar:1.0-SNAPSHOT"] +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-a/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-a/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index 4de3ad53819bf..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-a/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,3 +0,0 @@ -deployment-artifact=org.acme\:ext-a-deployment\:1.0-SNAPSHOT -conditional-dependencies=org.acme\:ext-b\:\:jar\:1.0-SNAPSHOT - diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-a/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-a/settings.gradle index 2813b1c28308c..7b46d41731f73 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-a/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-a/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-b/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-b/runtime/build.gradle index 3aa341d7dcfd8..10a3b8e94ae73 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-b/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-b/runtime/build.gradle @@ -1,12 +1,19 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { implementation platform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") } +extensionDescriptor { + deployment = "org.acme:ext-b-deployment:1.0-SNAPSHOT" + dependencyCondition = ["org.acme:ext-c::jar"] + conditionalDependencies = ["org.acme:ext-e::jar:1.0-SNAPSHOT"] +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-b/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-b/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index f6b0f067d0421..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-b/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,3 +0,0 @@ -deployment-artifact=org.acme\:ext-b-deployment\:1.0-SNAPSHOT -dependency-condition=org.acme\:ext-c\:\:jar -conditional-dependencies=org.acme\:ext-e\:\:jar\:1.0-SNAPSHOT diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-b/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-b/settings.gradle index b87576623ecaf..5a60a7ca513e5 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-b/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-b/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-c/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-c/runtime/build.gradle index acf77bfd6a82a..2740eef971caf 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-c/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-c/runtime/build.gradle @@ -1,12 +1,17 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { implementation platform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") } +extensionDescriptor { + deployment = "org.acme:ext-c-deployment:1.0-SNAPSHOT" +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-c/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-c/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index 5af0d99a15871..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-c/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,2 +0,0 @@ -deployment-artifact=org.acme\:ext-c-deployment\:1.0-SNAPSHOT - diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-c/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-c/settings.gradle index 897c33ec4feeb..6159c3dcdd70d 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-c/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-c/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-d/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-d/runtime/build.gradle index a220c4dbc2b7a..226c8ea17bf84 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-d/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-d/runtime/build.gradle @@ -1,12 +1,17 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { implementation platform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") } +extensionDescriptor { + deployment = "org.acme:ext-d-deployment:1.0-SNAPSHOT" +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-d/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-d/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index 3139116982f83..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-d/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,2 +0,0 @@ -deployment-artifact=org.acme\:ext-d-deployment\:1.0-SNAPSHOT - diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-d/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-d/settings.gradle index 0f4716c91b066..e098e9dc211b5 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-d/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-d/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-e/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-e/runtime/build.gradle index 1ff4a42c23800..fc68d2ab82c9c 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-e/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-e/runtime/build.gradle @@ -1,12 +1,18 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { implementation platform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") } +extensionDescriptor { + deployment = "org.acme:ext-e-deployment:1.0-SNAPSHOT" + dependencyCondition = ["org.acme:ext-c::jar"] +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-e/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-e/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index 906a819ef9843..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-e/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,2 +0,0 @@ -deployment-artifact=org.acme\:ext-e-deployment\:1.0-SNAPSHOT -dependency-condition=org.acme\:ext-c\:\:jar diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-e/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-e/settings.gradle index 5c0d826cd16c4..9fb95a681b7a7 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-e/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-e/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-f/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-f/runtime/build.gradle index f5adf3526dee1..20a67359cc057 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-f/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-f/runtime/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { @@ -8,6 +9,10 @@ dependencies { implementation project(':ext-g:runtime') } +extensionDescriptor { + deployment = "org.acme:ext-f-deployment:1.0-SNAPSHOT" +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-f/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-f/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index 07a01a3b29dee..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-f/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,2 +0,0 @@ -deployment-artifact=org.acme\:ext-f-deployment\:1.0-SNAPSHOT - diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-f/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-f/settings.gradle index 9b1d53861aaac..f1e4508cab70d 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-f/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-f/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-g/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-g/runtime/build.gradle index 5372e8f7d889c..84276b7c44a08 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-g/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-g/runtime/build.gradle @@ -1,12 +1,18 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { implementation platform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") } +extensionDescriptor { + deployment = "org.acme:ext-g-deployment:1.0-SNAPSHOT" + conditionalDependencies = ["org.acme:ext-h::jar:1.0-SNAPSHOT"] +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-g/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-g/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index 26a0f126927aa..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-g/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,3 +0,0 @@ -deployment-artifact=org.acme\:ext-g-deployment\:1.0-SNAPSHOT -conditional-dependencies=org.acme\:ext-h\:\:jar\:1.0-SNAPSHOT - diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-g/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-g/settings.gradle index 3e0835edb12a5..6250fe81d9cbe 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-g/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-g/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-h/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-h/runtime/build.gradle index dec8f131a13bd..1229873cf49d1 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-h/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-h/runtime/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { @@ -8,6 +9,11 @@ dependencies { implementation project(':ext-k:runtime') } +extensionDescriptor { + deployment = "org.acme:ext-h-deployment:1.0-SNAPSHOT" + dependencyCondition = ["org.acme:ext-i::jar", "org.acme:ext-j::jar"] +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-h/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-h/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index def68cf811763..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-h/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,3 +0,0 @@ -deployment-artifact=org.acme\:ext-h-deployment\:1.0-SNAPSHOT -dependency-condition=org.acme\:ext-i\:\:jar org.acme\:ext-j\:\:jar - diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-h/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-h/settings.gradle index e07693bee9e80..eccf58ccd8f1b 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-h/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-h/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-i/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-i/runtime/build.gradle index 2dc10e25a07b0..0a6ce6818a763 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-i/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-i/runtime/build.gradle @@ -1,12 +1,18 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { implementation platform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") } +extensionDescriptor { + deployment = "org.acme:ext-i-deployment:1.0-SNAPSHOT" + conditionalDependencies = ["org.acme:ext-o::jar:1.0-SNAPSHOT"] +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-i/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-i/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index b3a3a3eac81e7..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-i/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,2 +0,0 @@ -deployment-artifact=org.acme\:ext-i-deployment\:1.0-SNAPSHOT -conditional-dependencies=org.acme\:ext-o\:\:jar\:1.0-SNAPSHOT diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-i/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-i/settings.gradle index b611e94cb7028..2a0a618a21220 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-i/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-i/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-j/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-j/runtime/build.gradle index 70877fef9490b..5f8a44eb1f1a4 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-j/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-j/runtime/build.gradle @@ -1,12 +1,18 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { implementation platform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") } +extensionDescriptor { + deployment = "org.acme:ext-j-deployment:1.0-SNAPSHOT" + conditionalDependencies = ["org.acme:ext-p::jar:1.0-SNAPSHOT"] +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-j/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-j/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index ce2264e53b610..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-j/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,2 +0,0 @@ -deployment-artifact=org.acme\:ext-j-deployment\:1.0-SNAPSHOT -conditional-dependencies=org.acme\:ext-p\:\:jar\:1.0-SNAPSHOT diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-j/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-j/settings.gradle index b6e226b550877..a2788922da90d 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-j/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-j/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-k/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-k/runtime/build.gradle index 4219c83a52706..ca4916cc9c401 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-k/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-k/runtime/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { @@ -8,6 +9,10 @@ dependencies { implementation project(':ext-t:runtime') } +extensionDescriptor { + deployment = "org.acme:ext-k-deployment:1.0-SNAPSHOT" +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-k/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-k/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index 8d29de75edbba..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-k/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,2 +0,0 @@ -deployment-artifact=org.acme\:ext-k-deployment\:1.0-SNAPSHOT - diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-k/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-k/settings.gradle index 01676daae5c22..7c4378feaf119 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-k/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-k/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-l/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-l/runtime/build.gradle index 9cbd8b430dcf6..62dfeab095d64 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-l/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-l/runtime/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { @@ -8,6 +9,10 @@ dependencies { implementation project(':ext-j:runtime') } +extensionDescriptor { + deployment = "org.acme:ext-l-deployment:1.0-SNAPSHOT" +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-l/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-l/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index 313bf6f265f67..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-l/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,2 +0,0 @@ -deployment-artifact=org.acme\:ext-l-deployment\:1.0-SNAPSHOT - diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-l/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-l/settings.gradle index 36129e5c2d80a..e6f3c06df0725 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-l/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-l/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-m/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-m/runtime/build.gradle index 4936eea53c00f..fb1fc74e3c81a 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-m/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-m/runtime/build.gradle @@ -1,12 +1,18 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { implementation platform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") } +extensionDescriptor { + deployment = "org.acme:ext-m-deployment:1.0-SNAPSHOT" + conditionalDependencies = ["org.acme:ext-n::jar:1.0-SNAPSHOT", "org.acme:ext-r::jar:1.0-SNAPSHOT"] +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-m/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-m/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index 658fc7a6c3857..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-m/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,3 +0,0 @@ -deployment-artifact=org.acme\:ext-m-deployment\:1.0-SNAPSHOT -conditional-dependencies=org.acme\:ext-n\:\:jar\:1.0-SNAPSHOT org.acme\:ext-r\:\:jar\:1.0-SNAPSHOT - diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-m/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-m/settings.gradle index c6bfbb8ee0dee..d7fbd593c2567 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-m/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-m/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-n/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-n/runtime/build.gradle index 788abe98ca557..ed06c7df07dae 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-n/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-n/runtime/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { @@ -8,6 +9,11 @@ dependencies { implementation project(':ext-i:runtime') } +extensionDescriptor { + deployment = "org.acme:ext-n-deployment:1.0-SNAPSHOT" + dependencyCondition = ["org.acme:ext-k::jar"] +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-n/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-n/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index ce8f420cccf13..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-n/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,3 +0,0 @@ -deployment-artifact=org.acme\:ext-n-deployment\:1.0-SNAPSHOT -dependency-condition=org.acme\:ext-k\:\:jar - diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-n/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-n/settings.gradle index 4dec4cca01e5a..ad933a590966b 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-n/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-n/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-o/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-o/runtime/build.gradle index 7256098019552..aa8755ffe9b64 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-o/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-o/runtime/build.gradle @@ -1,12 +1,18 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { implementation platform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") } +extensionDescriptor { + deployment = "org.acme:ext-o-deployment:1.0-SNAPSHOT" + dependencyCondition = ["org.acme:ext-h::jar"] +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-o/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-o/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index c096d02a3cfd6..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-o/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,4 +0,0 @@ -deployment-artifact=org.acme\:ext-o-deployment\:1.0-SNAPSHOT -dependency-condition=org.acme\:ext-h\:\:jar - - diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-o/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-o/settings.gradle index 9354db49035e8..2479cc4df79e0 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-o/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-o/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-p/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-p/runtime/build.gradle index 72f1e487e67ed..511d4e3992532 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-p/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-p/runtime/build.gradle @@ -1,12 +1,18 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { implementation platform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") } +extensionDescriptor { + deployment = "org.acme:ext-p-deployment:1.0-SNAPSHOT" + dependencyCondition = ["org.acme:ext-o::jar"] +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-p/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-p/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index e8aa545a7c9be..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-p/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,2 +0,0 @@ -deployment-artifact=org.acme\:ext-p-deployment\:1.0-SNAPSHOT -dependency-condition=org.acme\:ext-o\:\:jar diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-p/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-p/settings.gradle index cd9655dee16d1..e3973ee03c6ee 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-p/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-p/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-r/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-r/runtime/build.gradle index a84867fd7cbd3..e5bc22543ecd9 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-r/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-r/runtime/build.gradle @@ -1,12 +1,19 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { implementation platform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") } +extensionDescriptor { + deployment = "org.acme:ext-r-deployment:1.0-SNAPSHOT" + dependencyCondition = ["org.acme:ext-i::jar"] + conditionalDependencies = ["org.acme:ext-s::jar:1.0-SNAPSHOT"] +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-r/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-r/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index 9892d5406557c..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-r/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,3 +0,0 @@ -deployment-artifact=org.acme\:ext-r-deployment\:1.0-SNAPSHOT -dependency-condition=org.acme\:ext-i\:\:jar -conditional-dependencies=org.acme\:ext-s\:\:jar\:1.0-SNAPSHOT \ No newline at end of file diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-r/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-r/settings.gradle index 37669a43ef46b..3c548c49ab531 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-r/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-r/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-s/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-s/runtime/build.gradle index fdff0db83cb02..41c75c4db6979 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-s/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-s/runtime/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { @@ -8,6 +9,11 @@ dependencies { implementation project(':ext-u:runtime') } +extensionDescriptor { + deployment = "org.acme:ext-s-deployment:1.0-SNAPSHOT" + dependencyCondition = ["org.acme:ext-t::jar"] +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-s/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-s/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index 23181f733461e..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-s/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1,2 +0,0 @@ -deployment-artifact=org.acme\:ext-s-deployment\:1.0-SNAPSHOT -dependency-condition=org.acme\:ext-t\:\:jar \ No newline at end of file diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-s/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-s/settings.gradle index ca547bac9261b..f4a90500ad94f 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-s/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-s/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-t/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-t/runtime/build.gradle index 2ba55f42b1e24..b079982a95d99 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-t/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-t/runtime/build.gradle @@ -1,12 +1,17 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { implementation platform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") } +extensionDescriptor { + deployment = "org.acme:ext-t-deployment:1.0-SNAPSHOT" +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-t/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-t/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index ad607f0d7de36..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-t/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1 +0,0 @@ -deployment-artifact=org.acme\:ext-t-deployment\:1.0-SNAPSHOT \ No newline at end of file diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-t/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-t/settings.gradle index 06caf2310c0a2..1c0b3043413a3 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-t/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-t/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-u/runtime/build.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-u/runtime/build.gradle index cb13018ee12ec..76587a02bdc1b 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-u/runtime/build.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-u/runtime/build.gradle @@ -1,12 +1,17 @@ plugins { id 'java-library' id 'maven-publish' + id 'io.quarkus.extension' } dependencies { implementation platform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") } +extensionDescriptor { + deployment = "org.acme:ext-u-deployment:1.0-SNAPSHOT" +} + publishing { publications { mavenJave(MavenPublication) { diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-u/runtime/src/main/resources/META-INF/quarkus-extension.properties b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-u/runtime/src/main/resources/META-INF/quarkus-extension.properties deleted file mode 100644 index 9ad614415367d..0000000000000 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-u/runtime/src/main/resources/META-INF/quarkus-extension.properties +++ /dev/null @@ -1 +0,0 @@ -deployment-artifact=org.acme\:ext-u-deployment\:1.0-SNAPSHOT \ No newline at end of file diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-u/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-u/settings.gradle index e9e894940c7fa..b891a71edde31 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-u/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/ext-u/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { //noinspection GroovyAssignabilityCheck plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } } diff --git a/integration-tests/gradle/src/main/resources/conditional-dependencies/settings.gradle b/integration-tests/gradle/src/main/resources/conditional-dependencies/settings.gradle index f51da33f65e6c..ab87346fdff31 100644 --- a/integration-tests/gradle/src/main/resources/conditional-dependencies/settings.gradle +++ b/integration-tests/gradle/src/main/resources/conditional-dependencies/settings.gradle @@ -13,6 +13,7 @@ pluginManagement { } plugins { id 'io.quarkus' version "${quarkusPluginVersion}" + id 'io.quarkus.extension' version "${quarkusPluginVersion}" } }