This message was deleted.
# dependency-management
s
This message was deleted.
t
I’m having no success writing my own
TransformAction
. No matter what I try, Gradle isn’t calling my
TransformAction
.
v
An artifact transform is not what you are after. An artifact transform takes the artifact that was resolved (e.g. the JAR file) and transforms it in some way like unpacking it to a directory, or doing some instrumentation or something similar.
If you want the
.editorconfig
artifact, you would request it like
foo:bar:1.2.3@editorconfig
for example. But it might be better to use a feature variant for it, actually.
t
Incredible, I’ll take a look. Thank you!
👌 1
I can’t wrap my head around the feature variant and how it will help me achieve. It will take me a few more readings to understand. I decided to create a task to copy the file out of the configuration. I’m not quite sure if this will work well in the long run, but it works 😞
Copy code
val ktlint by configurations.creating

dependencies {
    ktlint("com.company.android:ktlint-rules:1.0.0")
}

val editorconfigDir = layout.buildDirectory.file("ktlint/")
val editorconfig = layout.buildDirectory.file("ktlint/ktlint-rules.editorconfig")

tasks.register("copyEditorConfig", Copy::class) {
    from(ktlint.files) {
        include("*.editorconfig")
    }
    into(editorconfigDir)
    rename("(.+)", "ktlint-rules.editorconfig")
}