prepare_resources-ios.py (1524B)
1 #!/usr/bin/env python3 2 3 # this script will create/update info plist files based on config.h 4 5 kAudioUnitType_MusicDevice = "aumu" 6 kAudioUnitType_MusicEffect = "aumf" 7 kAudioUnitType_Effect = "aufx" 8 kAudioUnitType_MIDIProcessor = "aumi" 9 10 import plistlib, os, datetime, fileinput, glob, sys, string, shutil 11 12 scriptpath = os.path.dirname(os.path.realpath(__file__)) 13 projectpath = os.path.abspath(os.path.join(scriptpath, os.pardir)) 14 15 IPLUG2_ROOT = "../../iPlug2" 16 17 sys.path.insert(0, os.path.join(os.getcwd(), IPLUG2_ROOT + "/Scripts")) 18 19 from parse_config import parse_config, parse_xcconfig 20 21 22 def main(): 23 if len(sys.argv) == 2: 24 if sys.argv[1] == "app": 25 print("Copying resources ...") 26 27 dst = ( 28 os.environ["TARGET_BUILD_DIR"] 29 + "/" 30 + os.environ["UNLOCALIZED_RESOURCES_FOLDER_PATH"] 31 ) 32 33 if os.path.exists(projectpath + "/resources/img/"): 34 imgs = os.listdir(projectpath + "/resources/img/") 35 for img in imgs: 36 print("copying " + img + " to " + dst) 37 shutil.copy(projectpath + "/resources/img/" + img, dst) 38 39 if os.path.exists(projectpath + "/resources/fonts/"): 40 fonts = os.listdir(projectpath + "/resources/fonts/") 41 for font in fonts: 42 print("copying " + font + " to " + dst) 43 shutil.copy(projectpath + "/resources/fonts/" + font, dst) 44 45 46 if __name__ == "__main__": 47 main()