Hi there, I'm trying to create a (buildSrc) Gradl...
# android
d
Hi there, I'm trying to create a (buildSrc) Gradle plugin for my Android project. Most of it works, but when building an APK, the file that I was generating was not included in the apk, which caused an "Unresolved reference" error. I was using
variant.registerJavaGeneratingTask(myTask, outputFile)
until now, which didn't work. So I asked the question somewhere else and was told to use this:
Copy code
project.tasks.named("compile${variant.name.capitalize()}Kotlin").configure {
            this.dependsOn(myTask)
            (this as KotlinCompile).source(outputDir)
        }
This worked, but I was wondering if there wasn't an official way (which actually works) for Android?