Skip to content

Commit

Permalink
Merge pull request #44141 from gsmet/quarkiverse-without-tests
Browse files Browse the repository at this point in the history
Codestarts - Do not reference ITs module if extension without ITs
  • Loading branch information
gsmet authored Oct 29, 2024
2 parents a6a9f85 + a09e715 commit f7930ce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</pluginManagement>
</build>
{/if}
{#if has-integration-tests-module}
<profiles>
<profile>
<id>it</id>
Expand All @@ -35,4 +36,5 @@
</modules>
</profile>
</profiles>
{/if}
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public enum QuarkusExtensionData implements DataKey {
IT_PARENT_RELATIVE_PATH("it-parent.relative-path"),
MAVEN_QUARKUS_EXTENSION_PLUGIN("maven.quarkus-extension-plugin"),
MAVEN_COMPILER_PLUGIN_VERSION("maven.compiler-plugin-version"),
HAS_DOCS_MODULE("has-docs-module");
HAS_DOCS_MODULE("has-docs-module"),
HAS_INTEGRATION_TESTS_MODULE("has-integration-tests-module");

private final String key;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import static io.quarkus.devtools.codestarts.extension.QuarkusExtensionCodestartCatalog.QuarkusExtensionData.EXTENSION_NAME;
import static io.quarkus.devtools.codestarts.extension.QuarkusExtensionCodestartCatalog.QuarkusExtensionData.GROUP_ID;
import static io.quarkus.devtools.codestarts.extension.QuarkusExtensionCodestartCatalog.QuarkusExtensionData.HAS_DOCS_MODULE;
import static io.quarkus.devtools.codestarts.extension.QuarkusExtensionCodestartCatalog.QuarkusExtensionData.HAS_INTEGRATION_TESTS_MODULE;
import static io.quarkus.devtools.codestarts.extension.QuarkusExtensionCodestartCatalog.QuarkusExtensionData.IT_PARENT_ARTIFACT_ID;
import static io.quarkus.devtools.codestarts.extension.QuarkusExtensionCodestartCatalog.QuarkusExtensionData.IT_PARENT_GROUP_ID;
import static io.quarkus.devtools.codestarts.extension.QuarkusExtensionCodestartCatalog.QuarkusExtensionData.IT_PARENT_RELATIVE_PATH;
Expand Down Expand Up @@ -105,6 +106,7 @@ public enum LayoutType {
private String extensionsRelativeDir = "extensions";
private boolean withCodestart;
private String javaVersion;
private boolean hasIntegrationTestsModule;

public CreateExtension(final Path baseDir) {
this.baseDir = requireNonNull(baseDir, "extensionDirPath is required");
Expand Down Expand Up @@ -218,6 +220,7 @@ public CreateExtension withoutDevModeTest(boolean withoutDevModeTest) {
}

public CreateExtension withoutIntegrationTests(boolean withoutIntegrationTest) {
hasIntegrationTestsModule = !withoutIntegrationTest;
this.builder.withoutIntegrationTests(withoutIntegrationTest);
return this;
}
Expand Down Expand Up @@ -263,6 +266,7 @@ public CreateExtensionCommandHandler prepare() throws QuarkusCommandException {
data.putIfAbsent(CLASS_NAME_BASE, toCapCamelCase(extensionId));
data.put(EXTENSION_FULL_NAME,
data.getRequiredStringValue(NAMESPACE_NAME) + data.getRequiredStringValue(EXTENSION_NAME));
data.put(HAS_INTEGRATION_TESTS_MODULE, hasIntegrationTestsModule);

// for now, we only support Java extensions
data.put(JAVA_VERSION, javaVersion == null ? JavaVersion.DEFAULT_JAVA_VERSION_FOR_EXTENSION
Expand Down

0 comments on commit f7930ce

Please sign in to comment.