diff --git a/buildozer/default.spec b/buildozer/default.spec index c48488c75..7a0f7dcb9 100644 --- a/buildozer/default.spec +++ b/buildozer/default.spec @@ -25,6 +25,7 @@ source.include_exts = py,png,jpg,kv,atlas #source.exclude_dirs = tests, bin, venv # (list) List of exclusions using pattern matching +# Do not prefix with './' #source.exclude_patterns = license,images/*/*.jpg # (str) Application versioning (method 1) @@ -179,6 +180,12 @@ fullscreen = 0 # (list) Android AAR archives to add #android.add_aars = +# (list) Put these files or directories in the apk assets directory. +# Either form may be used, and assets need not be in 'source.include_exts'. +# 1) android.add_assets = source_asset_relative_path +# 2) android.add_assets = source_asset_path:destination_asset_relative_path +#android.add_assets = + # (list) Gradle dependencies to add #android.gradle_dependencies = diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index b4373e704..e3f8a656b 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -903,6 +903,17 @@ def execute_build_package(self, build_cmd): cmd.append('--add-aar') cmd.append(realpath(expanduser(aar))) + # support for assets folder + assets = self.buildozer.config.getlist('app', 'android.add_assets', []) + for asset in assets: + cmd.append('--add-asset') + if ':' in asset: + asset_src, asset_dest = asset.split(":") + else: + asset_src = asset + asset_dest = asset + cmd.append(realpath(expanduser(asset_src)) + ':' + asset_dest) + # support for uses-lib uses_library = self.buildozer.config.getlist( 'app', 'android.uses_library', '')