beryx/badass-jlink-plugin

gradle 8 - task without declaring an explicit or implicit dependency

whateverUsernameAvailable opened this issue · 2 comments

Because I am using proguard I first do some proguard magic with the jars before they are processed by jlink, but with Gradle 8 there is now following issue:

Some problems were found with the configuration of task ':jlink' (type 'JlinkTask').
  - Gradle detected a problem with the following location: '\build\jlinkbase\jlinkjars'.
    
    Reason: Task ':jlink' uses this output of task ':postProguardCopyProguardedJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':postProguardCopyProguardedJar' as an input of ':jlink'.
      2. Declare an explicit dependency on ':postProguardCopyProguardedJar' from ':jlink' using Task#dependsOn.
      3. Declare an explicit dependency on ':postProguardCopyProguardedJar' from ':jlink' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/8.3/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.

It seems that I cannot use any of the 3 solutions proposed by gradle because jlink is not a regular task and it says that dependsOn/mustRUnAfter or the 1. inputFile.from(jar) are not known when used in the scope of jlink.

Could not find method dependsOn() for arguments [task ':postProguardCopyProguardedJar'] on extension 'jlink' of type org.beryx.jlink.data.JlinkPluginExtension.

I am very bad with Gradle/Groovy so there might be some obvious solution I just cannot find it.

Try doing tasks.jlink.dependsOn instead.

Try doing tasks.jlink.dependsOn instead.

Thank you, it works.