Slackbot
03/07/2023, 8:45 PMSlackbot
03/07/2023, 9:59 PMSlackbot
03/08/2023, 8:51 AMSlackbot
03/08/2023, 2:01 PMSlackbot
03/08/2023, 3:55 PMSlackbot
03/08/2023, 4:32 PMSlackbot
03/08/2023, 11:09 PMAdam
03/09/2023, 11:26 AMDirectoryProperty
or Provider<FileSystemLocation>
that Gradle uses for up-to-date checks?
I'm using a Configuration to share a files between subprojects. The Configuration contains a some directories, and a JSON file that describes some config and lists the directories.
The receiving subproject has a task that uses the config file as well as the directories. It would be convenient if I could add the fingerprint of the directories to the config file, so that the receiving task will be up-to-date.
Otherwise, I have to set up task inputs, or manually compute an md5 for the directories, and I'd lose Gradle's file normalization.Javi
03/09/2023, 1:45 PMJavi
03/09/2023, 7:05 PM:gradle-extensions
(it has no code, it just add more subprojects using api(...), like it was an index of all projects)
• :gradle-extensions-subprojects:gradle-logging-extensions
And the error is this one:
Reason: Task ':gradle-extensions:detekt' uses this output of task ':gradle-extensions-subprojects:gradle-logging-extensions:spotlessKotlin' 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 ':gradle-extensions-subprojects:gradle-logging-extensions:spotlessKotlin' as an input of ':gradle-extensions:detekt'.
2. Declare an explicit dependency on ':gradle-extensions-subprojects:gradle-logging-extensions:spotlessKotlin' from ':gradle-extensions:detekt' using Task#dependsOn.
3. Declare an explicit dependency on ':gradle-extensions-subprojects:gradle-logging-extensions:spotlessKotlin' from ':gradle-extensions:detekt' using Task#mustRunAfter.
As you can see in the Reason
, the detekt
task is on the gradle-extensions
module, and the the spotlessKotlin
in a different module.
I have tried to do detekt.mustRunAfter(_tasks_.findByName("spotlessKotlin"))
, but that dependency would work with tasks on the same projectSlackbot
03/09/2023, 7:54 PMSlackbot
03/10/2023, 6:56 AMjoschi
03/10/2023, 9:44 AMSlackbot
03/10/2023, 1:00 PMSlackbot
03/10/2023, 2:24 PMSlackbot
03/11/2023, 4:06 AMSlackbot
03/11/2023, 10:12 AMSlackbot
03/11/2023, 7:33 PMSlackbot
03/12/2023, 11:04 PMSlackbot
03/13/2023, 2:16 PMSlackbot
03/13/2023, 6:20 PMSlackbot
03/13/2023, 8:00 PMSlackbot
03/13/2023, 8:08 PMtony
03/13/2023, 10:24 PM* What went wrong:
A problem occurred configuring root project 'protos'.
> Could not create task ':updateProtos'.
> Could not create task of type 'UpdateProtosTask'.
> Too many parameters provided for constructor for type UpdateProtosTask. Expected 0, received 1.
When I debug, the "constructor args" are a function call from the plugin's apply method to an instance method on the task that runs some configuration code.
This only happened when I changed the project that this plugin is applied to. In one project, no problem. In another, this error
Yeah, removing the method call and putting all the config code in the plugin's apply method resolved the issue. OddSlackbot
03/14/2023, 5:28 PMSlackbot
03/14/2023, 5:49 PMSlackbot
03/14/2023, 8:38 PMSlackbot
03/15/2023, 9:01 AMSlackbot
03/15/2023, 10:07 AMSlackbot
03/15/2023, 2:08 PM