|
| 1 | +import ostools.LoggerHandler as lh |
| 2 | +import os_android_files_injector.AppFilesInjectorBp as bp |
| 3 | + |
| 4 | + |
| 5 | +################################################################################## |
| 6 | +# |
| 7 | +# this module meant to inject android app files into a designated android project. |
| 8 | +# |
| 9 | +################################################################################## |
| 10 | + |
| 11 | +def run(project_path, strings_file=None, logo_file=None, google_services_file=None, asset_paths_list=None, clear_old_assets=False): |
| 12 | + """ |
| 13 | + Will inject files into an android project. |
| 14 | +
|
| 15 | + Args: |
| 16 | + project_path: your android's app path |
| 17 | + strings_file: the path to the new strings.xml file |
| 18 | + logo_file: the path to the new logo file |
| 19 | + google_services_file: the path to the new Firebase json file |
| 20 | + asset_paths_list: an array of all of the assets you want to inject to the app |
| 21 | + clear_old_assets: toggle to true to remove old assets from your project |
| 22 | + """ |
| 23 | + |
| 24 | + logger = lh.Logger(__file__) |
| 25 | + |
| 26 | + # copy all of the stuff |
| 27 | + if strings_file is not None: |
| 28 | + bp.inject_strings(project_path, strings_file) |
| 29 | + logger.info('strings.xml injected') |
| 30 | + |
| 31 | + if google_services_file is not None: |
| 32 | + bp.inject_google_services(project_path, google_services_file) |
| 33 | + logger.info('google_services.json injected') |
| 34 | + |
| 35 | + if logo_file is not None: |
| 36 | + bp.inject_logo(project_path, logo_file) |
| 37 | + logger.info('logo injected') |
| 38 | + |
| 39 | + if clear_old_assets is True: |
| 40 | + bp.clear_old_assets(project_path) |
| 41 | + logger.info('old assets cleared') |
| 42 | + |
| 43 | + if asset_paths_list is not None: |
| 44 | + bp.inject_assets(project_path, asset_paths_list) |
| 45 | + logger.info('all ' + str(len(asset_paths_list)) + ' assets injected') |
0 commit comments