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

Allow running the task on subprojects too. #107

Merged
merged 14 commits into from
May 13, 2021
Merged
Changes from 11 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 @@ -50,6 +50,8 @@

public class ClientNativeRunAgent extends ClientNativeBase {

private static final String CONFIG_JAVAFX_RUN_TASK = "configJavafxRun";

private static final String AGENTLIB_NATIVE_IMAGE_AGENT_STRING =
"-agentlib:native-image-agent=access-filter-file=src/main/resources/META-INF/native-image/filter-file.json,config-merge-dir=src/main/resources/META-INF/native-image";

Expand All @@ -66,9 +68,9 @@ public ClientNativeRunAgent(Project project) {
super(project);
clientExtension = project.getExtensions().getByType(ClientExtension.class);

Task javafxRun = project.getTasks().findByPath(":configJavafxRun");
Task javafxRun = project.getTasks().findByName(CONFIG_JAVAFX_RUN_TASK);
if (javafxRun == null) {
throw new GradleException("javafxplugin:configJavafxRun task not found.");
throw new GradleException("javafxplugin:" + CONFIG_JAVAFX_RUN_TASK + " task not found.");
}
this.dependsOn(javafxRun.getPath());
}
Expand All @@ -87,7 +89,7 @@ public void action() {

try {
// folder
Path path = Path.of(project.getRootDir().getAbsolutePath(), "src", "main", "resources", "META-INF", "native-image");
Path path = Path.of(project.getProjectDir().getAbsolutePath(), "src", "main", "resources", "META-INF", "native-image");
if (Files.exists(path)) {
// TODO: Delete files
// otherwise it keeps merging results from different runs
Expand Down