gluonhq / gluonfx-gradle-plugin

Plugin that simplifies using Gluon Client for Java/JavaFX gradle projects
BSD 3-Clause "New" or "Revised" License
100 stars 22 forks source link

Could not create task ':example:nativeRunAgent' error on subprojects #179

Closed nlisker closed 1 year ago

nlisker commented 1 year ago

After https://github.com/openjfx/javafx-gradle-plugin/pull/151, the problem fixed in #107 (#102) was revived.

The critical part of the build file:

plugins {
    id 'org.openjfx.javafxplugin' version '0.0.15-SNAPSHOT' apply false
    id 'com.gluonhq.gluonfx-gradle-plugin' version '+' apply false
}

subprojects {

    if (project.name == 'gui') {
        apply plugin: 'application'
        apply plugin: 'org.openjfx.javafxplugin'
        apply plugin: 'com.gluonhq.gluonfx-gradle-plugin' // this line causes an error
    }

This is the error:

> Failed to apply plugin 'com.gluonhq.gluonfx-gradle-plugin'.
   > Could not create task ':gui:nativeRunAgent'.
      > Could not create task of type 'NativeRunAgentTask'.
         > javafxplugin:configJavafxRun task not found.

When version 0.0.15 if the javafx plugin is released, it will break current applications that use this plugin, so this plugin needs to be patched beforehand.

jjohannes commented 1 year ago

This was expected to happen. See this comment thread for how it should be fixed:

https://github.com/openjfx/javafx-gradle-plugin/pull/151#discussion_r1309803560

jperedadnr commented 1 year ago

@nlisker can you test the latest snapshot and see if this is still an issue? 1.0.21-SNAPSHOT from https://oss.sonatype.org/content/repositories/snapshots

nlisker commented 1 year ago

I can confirm that the error that occurs with 1.0.20 is resolved with 1.0.21-SNAPSHOT.

nlisker commented 1 year ago

Maybe https://github.com/gluonhq/gluonfx-gradle-plugin/issues/128 is also resolved now.