I have the following project structure
MyProject
|-- build.gradle
|-- client.private
|-- server.public
|-- app
| |-- build.gradle
| |-- lint.xml
| |-- proguard-project.txt
| |-- project.properties
| `-- src
and would like to include client.private
and server.public
files into the assets folder of the final apk but unfortunately not able to do so.
Have the following in my app/build.gradle
...
android {
...
applicationVariants.all { variant ->
variant.mergeAssets.doLast {
copy {
from(['../client.private', '../server.public'])
into("${buildDir}/assets/${variant.dirName}")
}
}
}
}
but it only copies the files to app/build/assets/debug
, its not packaged with the apk.
EDITED
Please try to use sourceSets
. (Path edited)
android {
sourceSets {
main {
assets.srcDirs = ['../client.private','../server.public']
}
}
}
You can check path each assets directories.
afterEvaluate {
android.sourceSets.main.assets.srcDirs.each{println it}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With