Skip to content

Commit

Permalink
QuarkusBuildTask uses getBuildForkOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
cdsap committed Nov 13, 2024
1 parent 7fa4088 commit dbedbdc
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void generateBuild() {
.collect(Collectors.joining("\n ", "\n ", "")));
}

WorkQueue workQueue = workQueue(quarkusProperties, getExtensionView().getCodeGenForkOptions().get());
WorkQueue workQueue = workQueue(quarkusProperties, getExtensionView().getBuildForkOptions().get());

workQueue.submit(BuildWorker.class, params -> {
params.getBuildSystemProperties()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public QuarkusPluginExtensionView(Project project, QuarkusPluginExtension extens
getCleanupBuildOutput().set(extension.getCleanupBuildOutput());
getFinalName().set(extension.getFinalName());
getCodeGenForkOptions().set(getProviderFactory().provider(() -> extension.codeGenForkOptions));
getBuildForkOptions().set(getProviderFactory().provider(() -> extension.buildForkOptions));
getIgnoredEntries().set(extension.ignoredEntriesProperty());
getMainResources().setFrom(project.getExtensions().getByType(SourceSetContainer.class).getByName(MAIN_SOURCE_SET_NAME)
.getResources().getSourceDirectories());
Expand Down Expand Up @@ -127,6 +128,9 @@ private Provider<Map<String, String>> getQuarkusRelevantProjectProperties(Projec
@Nested
public abstract ListProperty<Action<? super JavaForkOptions>> getCodeGenForkOptions();

@Nested
public abstract ListProperty<Action<? super JavaForkOptions>> getBuildForkOptions();

@Input
@Optional
public abstract Property<Boolean> getJarEnabled();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
plugins {
java
id("io.quarkus")
}

repositories {
mavenCentral()
mavenLocal()
}

val quarkusPlatformGroupId: String by project
val quarkusPlatformArtifactId: String by project
val quarkusPlatformVersion: String by project

dependencies {
implementation(enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}"))
}

quarkus {
buildForkOptions {
println("message!")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
quarkusPlatformArtifactId=quarkus-bom
quarkusPlatformGroupId=io.quarkus
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pluginManagement {
repositories {
mavenLocal {
content {
includeGroupByRegex 'io.quarkus.*'
includeGroup 'org.hibernate.orm'
}
}
mavenCentral()
gradlePluginPortal()
}
plugins {
id 'io.quarkus' version "${quarkusPluginVersion}"
}
}
rootProject.name='code-with-quarkus'
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.acme;



public class EntryPoint {
public static void main(String[] args) {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package io.quarkus.gradle;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

public class BuildForkOptionsAreIncludedInQuarkusBuildTaskTest extends QuarkusGradleWrapperTestBase {

@Test
public void testBuildForkOptionsAreProcessed() throws Exception {
var projectDir = getProjectDir("basic-java-application-with-fork-options");
var buildResult = runGradleWrapper(projectDir, "clean", "quarkusBuild");
assertThat(BuildResult.isSuccessful(buildResult.getTasks().get(":quarkusGenerateCode"))).isTrue();
assertThat(buildResult.getOutput().contains("message!")).isTrue();
}
}

0 comments on commit dbedbdc

Please sign in to comment.