You can do that, but not in the
sourceSets section. In your build.gradle, you can have
android {
packagingOptions {
exclude 'assets/unused1' exclude 'assets/unused2' }}
Unfortunately, with
PackagingOptions you cannot
exclude everything, and on top of that
add only
resources. But if you can find a pattern, e.g. assets/unused*, then it will probably help to make your script shorter.BR,Alex Cohn
On Saturday, September 12, 2020 at 1:22:54 AM UTC+3
[hidden email] wrote:
In my build.gradle, I have the following snippet:
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
assets.srcDirs 'C:\\Users\\phildo\\Desktop\\projects\\gnometower\\build\\resources'
}
}
With this snippet, in order to access `C:\Users\phildo\Desktop\projects\gnometower\build\resources\my_asset.png`, I reference `"my_asset.png"` (via AAssetManager). This works fine.
However, in the PC version of my codebase, all my asset filepaths would access the above via `"resources\my_asset.png"`. So, in order to keep it consistent, I could simply remove the `resources` appendation from the assets.srcDirs gradle build snippet. The issue there is that the `build` folder contains a bunch of other noise I would not want to include in my APK.
So: how can I include the resources folder, while keeping the root as the folder ABOVE that, and without including anything else?
I assume there is something like
assets.srcDirs 'C:\\Users\\phildo\\Desktop\\projects\\gnometower\\build'
assets.ignore '*'
assets.add 'resources'
or something?
though I can't find the syntax for any such thing.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
[hidden email].
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-ndk/5d91cebb-1fe4-4ea4-bd3b-6156a76edf87n%40googlegroups.com.