Skip to content

Commit

Permalink
Make sure compileClasspath is resolved before quarkusGenerateCode task
Browse files Browse the repository at this point in the history
  • Loading branch information
glefloch committed Mar 3, 2021
1 parent 9b1392b commit ddde77b
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 ddde77b

Please sign in to comment.