From ba170ce0aa7c28aa7d05a57c5e9469b9c9c2f84f Mon Sep 17 00:00:00 2001 From: antonwiens <> Date: Thu, 13 Aug 2020 15:57:01 +0200 Subject: [PATCH] add module to gradle test projekt to verify changes ignore modules with javaConvention but no "main" sourceSets --- .../io/quarkus/gradle/builder/QuarkusModelBuilder.java | 2 +- .../resources/multi-module-project/nomain/build.gradle | 8 ++++++++ .../test/resources/multi-module-project/settings.gradle | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 devtools/gradle/src/test/resources/multi-module-project/nomain/build.gradle diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/builder/QuarkusModelBuilder.java b/devtools/gradle/src/main/java/io/quarkus/gradle/builder/QuarkusModelBuilder.java index f7958d06a7fe6..c13f9412e3ae1 100644 --- a/devtools/gradle/src/main/java/io/quarkus/gradle/builder/QuarkusModelBuilder.java +++ b/devtools/gradle/src/main/java/io/quarkus/gradle/builder/QuarkusModelBuilder.java @@ -107,7 +107,7 @@ public Set getWorkspace(Project project, LaunchMode mode) { for (Project subproject : project.getAllprojects()) { final Convention convention = subproject.getConvention(); JavaPluginConvention javaConvention = convention.findPlugin(JavaPluginConvention.class); - if (javaConvention == null) { + if (javaConvention == null || !javaConvention.getSourceSets().getNames().contains(SourceSet.MAIN_SOURCE_SET_NAME)) { continue; } modules.add(getWorkspaceModule(subproject, mode)); diff --git a/devtools/gradle/src/test/resources/multi-module-project/nomain/build.gradle b/devtools/gradle/src/test/resources/multi-module-project/nomain/build.gradle new file mode 100644 index 0000000000000..b8cf19cf75668 --- /dev/null +++ b/devtools/gradle/src/test/resources/multi-module-project/nomain/build.gradle @@ -0,0 +1,8 @@ +plugins { + id 'java-library' +} + + +sourceSets { + remove(named("main")) +} diff --git a/devtools/gradle/src/test/resources/multi-module-project/settings.gradle b/devtools/gradle/src/test/resources/multi-module-project/settings.gradle index 88b65c1ce09c9..671852ed649a6 100644 --- a/devtools/gradle/src/test/resources/multi-module-project/settings.gradle +++ b/devtools/gradle/src/test/resources/multi-module-project/settings.gradle @@ -16,4 +16,4 @@ pluginManagement { } rootProject.name='mutli-module-project' -include 'common', 'application' \ No newline at end of file +include 'common', 'application', 'nomain'