Skip to content

Commit

Permalink
Merge pull request #15454 from glefloch/fix/flaky-gradle-test
Browse files Browse the repository at this point in the history
Make sure compileClasspath is resolved before quarkusGenerateCode task
  • Loading branch information
gsmet authored Mar 4, 2021
2 parents 64bce75 + ddde77b commit 5488d19
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
import java.util.function.Consumer;

import org.gradle.api.GradleException;
import org.gradle.api.file.FileCollection;
import org.gradle.api.plugins.Convention;
import org.gradle.api.plugins.JavaPluginConvention;
import org.gradle.api.tasks.CompileClasspath;
import org.gradle.api.tasks.SourceSet;
import org.gradle.api.tasks.TaskAction;

Expand Down Expand Up @@ -41,6 +43,16 @@ public QuarkusGenerateCode() {
super("Performs Quarkus pre-build preparations, such as sources generation");
}

/**
* Create a dependency on classpath resolution. This makes sure included build are build this task runs.
*
* @return resolved compile classpath
*/
@CompileClasspath
public FileCollection getClasspath() {
return QuarkusGradleUtils.getSourceSet(getProject(), SourceSet.MAIN_SOURCE_SET_NAME).getCompileClasspath();
}

@TaskAction
public void prepareQuarkus() {
getLogger().lifecycle("preparing quarkus application");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected String projectDirectoryName() {

@Override
protected String[] buildArguments() {
return new String[] { "clean", "--include-build", "../external-library", "quarkusDev" };
return new String[] { "--include-build", "../external-library", "clean", "quarkusDev" };
}

@Override
Expand Down

0 comments on commit 5488d19

Please sign in to comment.