This message was deleted.
# plugin-development
s
This message was deleted.
j
Copy code
val yourTaskThatGeneratesTheYaml = tasks.register<YourTaskType>(...) { }

kotlin.sourceSets.main.resources.srcDirs(yourTaskThatGeneratesTheYaml)
You can generate it wherever you want, for example
build/generated/detekt/resources/detekt.yml/
To pick it, you know where you are saving it, so you can just use something like
layout.buildDirectory.file(...)
v
It depends on the exact details you need. To get a
RegularFile
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
Copy code
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, ...