In
|
it.assetDirs = baseExtension |
the plugin determines all configured assets directories of a specific build variant to be able to copy the generated resources to it.
IMHO this is the wrong approach, because this leads to a "duplicate assets" issue as shown below:
> Task :app:mergeDebugAssets FAILED
ERROR:/path/to/app/src/main/assets/open_source_licenses.html /path/to/app/build/generated/other-generated-assets/open_source_licenses.html: Resource and asset merger: Duplicate resources
It doesn't make much sense to just take "the first" or only the first not in /build either, because you cannot foresee what the module owner had in mind when (s)he configured his module with multiple asset directories. A better approach would be
- Add your own build directory to the assets source set, so it can be merged with the rest of the assets, or
- Allow users to configure a specific asset directory where generated assets should be copied to
Obviously, these two options should be mutual exclusive, otherwise people will stumble upon the same error above.
In
gradle-license-plugin/gradle-license-plugin/src/main/kotlin/com/jaredsburrows/license/projectAndroid.kt
Line 97 in a441c46
IMHO this is the wrong approach, because this leads to a "duplicate assets" issue as shown below:
It doesn't make much sense to just take "the first" or only the first not in
/buildeither, because you cannot foresee what the module owner had in mind when (s)he configured his module with multiple asset directories. A better approach would beObviously, these two options should be mutual exclusive, otherwise people will stumble upon the same error above.