Slackbot
02/15/2024, 5:45 PMJavi
02/15/2024, 6:00 PMval yourTaskThatGeneratesTheYaml = tasks.register<YourTaskType>(...) { }
kotlin.sourceSets.main.resources.srcDirs(yourTaskThatGeneratesTheYaml)Javi
02/15/2024, 6:00 PMbuild/generated/detekt/resources/detekt.yml/Javi
02/15/2024, 6:06 PMlayout.buildDirectory.file(...)Vampire
02/16/2024, 1:38 PMRegularFile pointing to that file from the resources, you have to get the resource as file onto disk any way.
One way is to just read it from resources and write it to some file that you then use.
Another way would be to let gradle do it for you for example like
layout.file(provider { project.resources.text.fromUri(MyPlugin::class.java.getResource("index.html")).asFile() }).get()
Which though would have the detail that the file name will be different on each build run, so if you use it somewhere where PathSensitivity is NONE for example it might be ok but if not, then not, ...