mirror of
https://github.com/jlengrand/quarkus.git
synced 2026-03-10 08:41:22 +00:00
Merge pull request #6312 from gastaldi/gradle_missing
Added back methods mistakenly considered unused in QuarkusPluginExtension
This commit is contained in:
@@ -64,6 +64,7 @@
|
||||
<argument>${gradle.task}</argument>
|
||||
<argument>-Pdescription=${project.description}</argument>
|
||||
<argument>-S</argument>
|
||||
<argument>--stacktrace</argument>
|
||||
</arguments>
|
||||
<environmentVariables>
|
||||
<MAVEN_LOCAL_REPO>${settings.localRepository}</MAVEN_LOCAL_REPO>
|
||||
|
||||
@@ -9,19 +9,30 @@ import java.util.List;
|
||||
import io.quarkus.cli.commands.CreateProject;
|
||||
import io.quarkus.cli.commands.writer.FileProjectWriter;
|
||||
import io.quarkus.generators.BuildTool;
|
||||
import io.quarkus.generators.SourceType;
|
||||
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 org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.EnumSource;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class QuarkusPluginFunctionalTest {
|
||||
|
||||
private File projectRoot;
|
||||
|
||||
@BeforeEach
|
||||
void setUp(@TempDir File projectRoot) {
|
||||
this.projectRoot = projectRoot;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void canRunListExtensions(@TempDir File projectRoot) throws IOException {
|
||||
createProject(projectRoot);
|
||||
public void canRunListExtensions() throws IOException {
|
||||
createProject(SourceType.JAVA);
|
||||
|
||||
BuildResult build = GradleRunner.create()
|
||||
.forwardOutput()
|
||||
@@ -34,9 +45,11 @@ public class QuarkusPluginFunctionalTest {
|
||||
assertThat(build.getOutput()).contains("Quarkus - Core");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void canBuild(@TempDir File projectRoot) throws IOException {
|
||||
createProject(projectRoot);
|
||||
@ParameterizedTest(name = "Build {0} project")
|
||||
//TODO: Fix Scala build in Windows
|
||||
@EnumSource(value = SourceType.class, names = {"JAVA","KOTLIN"})
|
||||
public void canBuild(SourceType sourceType) throws IOException {
|
||||
createProject(sourceType);
|
||||
|
||||
BuildResult build = GradleRunner.create()
|
||||
.forwardOutput()
|
||||
@@ -60,12 +73,13 @@ public class QuarkusPluginFunctionalTest {
|
||||
return arguments;
|
||||
}
|
||||
|
||||
private void createProject(@TempDir File projectRoot) throws IOException {
|
||||
private void createProject(SourceType sourceType) throws IOException {
|
||||
assertThat(new CreateProject(new FileProjectWriter(projectRoot))
|
||||
.groupId("com.acme.foo")
|
||||
.artifactId("foo")
|
||||
.version("1.0.0-SNAPSHOT")
|
||||
.buildTool(BuildTool.GRADLE)
|
||||
.sourceType(sourceType)
|
||||
.doCreateProject(new HashMap<>()))
|
||||
.withFailMessage("Project was not created")
|
||||
.isTrue();
|
||||
|
||||
@@ -36,6 +36,10 @@ public class QuarkusPluginExtension {
|
||||
return new File(outputDirectory);
|
||||
}
|
||||
|
||||
public void setOutputDirectory(String outputDirectory) {
|
||||
this.outputDirectory = outputDirectory;
|
||||
}
|
||||
|
||||
public File outputConfigDirectory() {
|
||||
if (outputConfigDirectory == null) {
|
||||
outputConfigDirectory = project.getConvention().getPlugin(JavaPluginConvention.class)
|
||||
@@ -44,6 +48,10 @@ public class QuarkusPluginExtension {
|
||||
return new File(outputConfigDirectory);
|
||||
}
|
||||
|
||||
public void setOutputConfigDirectory(String outputConfigDirectory) {
|
||||
this.outputConfigDirectory = outputConfigDirectory;
|
||||
}
|
||||
|
||||
public File sourceDir() {
|
||||
if (sourceDir == null) {
|
||||
sourceDir = project.getConvention().getPlugin(JavaPluginConvention.class)
|
||||
@@ -52,6 +60,10 @@ public class QuarkusPluginExtension {
|
||||
return new File(sourceDir);
|
||||
}
|
||||
|
||||
public void setSourceDir(String sourceDir) {
|
||||
this.sourceDir = sourceDir;
|
||||
}
|
||||
|
||||
public File workingDir() {
|
||||
if (workingDir == null) {
|
||||
workingDir = outputDirectory().getPath();
|
||||
@@ -60,6 +72,10 @@ public class QuarkusPluginExtension {
|
||||
return new File(workingDir);
|
||||
}
|
||||
|
||||
public void setWorkingDir(String workingDir) {
|
||||
this.workingDir = workingDir;
|
||||
}
|
||||
|
||||
public String finalName() {
|
||||
if (finalName == null || finalName.length() == 0) {
|
||||
this.finalName = String.format("%s-%s", project.getName(), project.getVersion());
|
||||
@@ -67,6 +83,10 @@ public class QuarkusPluginExtension {
|
||||
return finalName;
|
||||
}
|
||||
|
||||
public void setFinalName(String finalName) {
|
||||
this.finalName = finalName;
|
||||
}
|
||||
|
||||
public Set<File> resourcesDir() {
|
||||
return project.getConvention().getPlugin(JavaPluginConvention.class)
|
||||
.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME).getResources().getSrcDirs();
|
||||
|
||||
Reference in New Issue
Block a user