Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using BuildForkOptions in QuarkusBuildTask #44493

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
}
}
Loading