def main(): config = parse_config(projectpath) xcconfig = parse_xcconfig(projectpath + '/../../common-mac.xcconfig') CFBundleGetInfoString = config['BUNDLE_NAME'] + " v" + config['FULL_VER_STR'] + " " + config['PLUG_COPYRIGHT_STR'] CFBundleVersion = config['FULL_VER_STR'] CFBundlePackageType = "BNDL" CSResourcesFileMapped = True LSMinimumSystemVersion = xcconfig['DEPLOYMENT_TARGET'] print "Copying resources ..." if config['PLUG_SHARED_RESOURCES']: dst = os.path.expanduser("~") + "/Music/" + config['BUNDLE_NAME'] + "/Resources" else: dst = os.environ["TARGET_BUILD_DIR"] + os.environ["UNLOCALIZED_RESOURCES_FOLDER_PATH"] if os.path.exists(dst) == False: os.makedirs(dst + "/", 0755 ) if os.path.exists(projectpath + "/resources/img/"): imgs = os.listdir(projectpath + "/resources/img/") for img in imgs: print "copying " + img + " to " + dst shutil.copy(projectpath + "/resources/img/" + img, dst) if os.path.exists(projectpath + "/resources/fonts/"): fonts = os.listdir(projectpath + "/resources/fonts/") for font in fonts: print "copying " + font + " to " + dst shutil.copy(projectpath + "/resources/fonts/" + font, dst) print "Processing Info.plist files..." # APP plistpath = projectpath + "/resources/" + config['BUNDLE_NAME'] + "-macOS-Info.plist" macOSapp = plistlib.readPlist(plistpath) macOSapp['CFBundleExecutable'] = config['BUNDLE_NAME'] macOSapp['CFBundleGetInfoString'] = CFBundleGetInfoString macOSapp['CFBundleIdentifier'] = config['BUNDLE_DOMAIN'] + "." + config['BUNDLE_MFR'] + ".app." + config['BUNDLE_NAME'] + "" macOSapp['CFBundleName'] = config['BUNDLE_NAME'] macOSapp['CFBundleVersion'] = CFBundleVersion macOSapp['CFBundleShortVersionString'] = CFBundleVersion macOSapp['LSMinimumSystemVersion'] = LSMinimumSystemVersion macOSapp['CFBundlePackageType'] = CFBundlePackageType macOSapp['CFBundleSignature'] = config['PLUG_UNIQUE_ID'] macOSapp['CSResourcesFileMapped'] = CSResourcesFileMapped macOSapp['NSPrincipalClass'] = "SWELLApplication" macOSapp['NSMainNibFile'] = config['BUNDLE_NAME'] + "-macOS-MainMenu" macOSapp['LSApplicationCategoryType'] = "public.app-category.music" macOSapp['CFBundleIconFile'] = config['BUNDLE_NAME'] + ".icns" plistlib.writePlist(macOSapp, plistpath)
def main(): if (len(sys.argv) == 2): if (sys.argv[1] == "app"): print("Copying resources ...") dst = os.environ["TARGET_BUILD_DIR"] + "/" + os.environ[ "UNLOCALIZED_RESOURCES_FOLDER_PATH"] if os.path.exists(projectpath + "/resources/img/"): imgs = os.listdir(projectpath + "/resources/img/") for img in imgs: print("copying " + img + " to " + dst) shutil.copy(projectpath + "/resources/img/" + img, dst) if os.path.exists(projectpath + "/resources/fonts/"): fonts = os.listdir(projectpath + "/resources/fonts/") for font in fonts: print("copying " + font + " to " + dst) shutil.copy(projectpath + "/resources/fonts/" + font, dst) config = parse_config(projectpath) xcconfig = parse_xcconfig( os.path.join(os.getcwd(), IPLUG2_ROOT + '/common-ios.xcconfig')) CFBundleGetInfoString = config['BUNDLE_NAME'] + " v" + config[ 'FULL_VER_STR'] + " " + config['PLUG_COPYRIGHT_STR'] CFBundleVersion = config['FULL_VER_STR'] CFBundlePackageType = "BNDL" CSResourcesFileMapped = True LSMinimumSystemVersion = xcconfig['DEPLOYMENT_TARGET'] print("Processing Info.plist files...") # AUDIOUNIT v3 if config['PLUG_TYPE'] == 0: if config['PLUG_DOES_MIDI_IN']: COMPONENT_TYPE = kAudioUnitType_MusicEffect else: COMPONENT_TYPE = kAudioUnitType_Effect elif config['PLUG_TYPE'] == 1: COMPONENT_TYPE = kAudioUnitType_MusicDevice elif config['PLUG_TYPE'] == 2: COMPONENT_TYPE = kAudioUnitType_MIDIProcessor if config['PLUG_HAS_UI'] == 1: NSEXTENSIONPOINTIDENTIFIER = "com.apple.AudioUnit-UI" else: NSEXTENSIONPOINTIDENTIFIER = "com.apple.AudioUnit" plistpath = projectpath + "/resources/" + config[ 'BUNDLE_NAME'] + "-iOS-AUv3-Info.plist" NSEXTENSIONATTRDICT = dict( NSExtensionAttributes=dict(AudioComponents=[{}]), NSExtensionPointIdentifier=NSEXTENSIONPOINTIDENTIFIER) with open(plistpath, 'rb') as fp: auv3 = plistlib.load(fp) auv3['CFBundleExecutable'] = config['BUNDLE_NAME'] + "AppExtension" auv3['CFBundleIdentifier'] = "$(PRODUCT_BUNDLE_IDENTIFIER)" auv3['CFBundleName'] = config['BUNDLE_NAME'] + "AppExtension" auv3['CFBundleDisplayName'] = config['BUNDLE_NAME'] + "AppExtension" auv3['CFBundleVersion'] = CFBundleVersion auv3['CFBundleShortVersionString'] = CFBundleVersion auv3['CFBundlePackageType'] = "XPC!" auv3['NSExtension'] = NSEXTENSIONATTRDICT auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'] = [{}] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'description'] = config['PLUG_NAME'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'manufacturer'] = config['PLUG_MFR_ID'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'name'] = config['PLUG_MFR'] + ": " + config['PLUG_NAME'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'subtype'] = config['PLUG_UNIQUE_ID'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'type'] = COMPONENT_TYPE auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'version'] = config['PLUG_VERSION_INT'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'sandboxSafe'] = True auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'tags'] = ["", ""] if config['PLUG_TYPE'] == 1: auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'tags'][0] = "Synth" else: auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'tags'][0] = "Effects" if config['PLUG_HAS_UI'] == 1: auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'tags'][1] = "size:{" + str(config['PLUG_WIDTH']) + "," + str( config['PLUG_HEIGHT']) + "}" auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'factoryFunction'] = "IPlugAUViewController_vIPlugChunks" auv3['NSExtension']['NSExtensionMainStoryboard'] = config[ 'BUNDLE_NAME'] + "-iOS-MainInterface" else: auv3['NSExtension'][ 'NSExtensionPrincipalClass'] = "IPlugAUViewController_vIPlugChunks" with open(plistpath, 'wb') as fp: plistlib.dump(auv3, fp) # Standalone APP plistpath = projectpath + "/resources/" + config[ 'BUNDLE_NAME'] + "-iOS-Info.plist" with open(plistpath, 'rb') as fp: iOSapp = plistlib.load(fp) iOSapp['CFBundleExecutable'] = config['BUNDLE_NAME'] iOSapp['CFBundleIdentifier'] = "$(PRODUCT_BUNDLE_IDENTIFIER)" iOSapp['CFBundleName'] = config['BUNDLE_NAME'] iOSapp['CFBundleVersion'] = CFBundleVersion iOSapp['CFBundleShortVersionString'] = CFBundleVersion iOSapp['CFBundlePackageType'] = "APPL" iOSapp['LSApplicationCategoryType'] = "public.app-category.music" with open(plistpath, 'wb') as fp: plistlib.dump(iOSapp, fp)
def main(): global VERSION print("\nIPlug Project Duplicator v" + VERSION + " by Oli Larkin ------------------------------\n") numargs = len(sys.argv) - 1 if not (numargs == 3 or numargs == 4): print( "Usage: duplicate.py inputprojectname outputprojectname manufacturername (outputprojectpath)" ) sys.exit(1) else: inputprojectname = sys.argv[1] outputprojectname = sys.argv[2] manufacturer = sys.argv[3] if numargs == 4: outputbasepath = os.path.abspath(sys.argv[4]) else: outputbasepath = os.getcwd() if not (os.path.isdir(outputbasepath)): print("error: Output path does not exist") sys.exit(1) outputpath = os.path.join(outputbasepath, outputprojectname) if ' ' in inputprojectname: print("error: input project name has spaces") sys.exit(1) if inputprojectname not in os.listdir(os.curdir): print("error: input project " + inputprojectname + " doesn't exist, check spelling/case?") sys.exit(1) if ' ' in outputprojectname: print("error: output project name has spaces") sys.exit(1) if ' ' in manufacturer: print("error: manufacturer name has spaces") sys.exit(1) # remove a trailing slash if it exists if inputprojectname[-1:] == "/": inputprojectname = inputprojectname[0:-1] if outputprojectname[-1:] == "/": outputprojectname = outputprojectname[0:-1] #check that the folders are OK if os.path.isdir(inputprojectname) == False: print("error: input project not found") sys.exit(1) if os.path.isdir(outputpath): print("error: output project allready exists") sys.exit(1) # rmtree(output) print("copying " + inputprojectname + " folder to " + outputpath) copytree(inputprojectname, outputpath, ignore=ignore_patterns(*DONT_COPY)) oldroot = "" newroot = "" if numargs == 4: configpath = os.path.join(inputprojectname, "config") xcconfig = parse_xcconfig(configpath + "/" + inputprojectname + "-mac.xcconfig") oldroot = xcconfig["IPLUG2_ROOT"] iplug2folder = os.path.abspath(os.path.join(configpath, oldroot)) newroot = os.path.relpath(iplug2folder, os.path.join(outputpath, "config")) else: newroot = "" #replace manufacturer name strings for dir in dirwalk(outputpath, inputprojectname, outputprojectname, "AcmeInc", manufacturer, oldroot, newroot): pass print("\ncopying gitignore template into project folder\n") copy('gitignore_template', outputpath + "/.gitignore") config = parse_config(outputpath) config["PLUG_UNIQUE_ID"] = randomFourChar() set_uniqueid(outputpath, config["PLUG_UNIQUE_ID"]) pp = pprint.PrettyPrinter(indent=4) pp.pprint(config) print("\ndone - don't forget to change PLUG_MFR_UID in config.h")
def main(): config = parse_config(projectpath) xcconfig = parse_xcconfig(os.path.join(os.getcwd(), IPLUG2_ROOT + '/common-mac.xcconfig')) CFBundleGetInfoString = config['BUNDLE_NAME'] + " v" + config['FULL_VER_STR'] + " " + config['PLUG_COPYRIGHT_STR'] CFBundleVersion = config['FULL_VER_STR'] CFBundlePackageType = "BNDL" CSResourcesFileMapped = True LSMinimumSystemVersion = xcconfig['DEPLOYMENT_TARGET'] print "Copying resources ..." if config['PLUG_SHARED_RESOURCES']: dst = os.path.expanduser("~") + "/Music/" + config['BUNDLE_NAME'] + "/Resources" else: dst = os.environ["TARGET_BUILD_DIR"] + os.environ["UNLOCALIZED_RESOURCES_FOLDER_PATH"] if os.path.exists(dst) == False: os.makedirs(dst + "/", 0755 ) if os.path.exists(projectpath + "/resources/img/"): imgs = os.listdir(projectpath + "/resources/img/") for img in imgs: print "copying " + img + " to " + dst shutil.copy(projectpath + "/resources/img/" + img, dst) if os.path.exists(projectpath + "/resources/fonts/"): fonts = os.listdir(projectpath + "/resources/fonts/") for font in fonts: print "copying " + font + " to " + dst shutil.copy(projectpath + "/resources/fonts/" + font, dst) print "Processing Info.plist files..." # VST3 plistpath = projectpath + "/resources/" + config['BUNDLE_NAME'] + "-VST3-Info.plist" vst3 = plistlib.readPlist(plistpath) vst3['CFBundleExecutable'] = config['BUNDLE_NAME'] vst3['CFBundleGetInfoString'] = CFBundleGetInfoString vst3['CFBundleIdentifier'] = config['BUNDLE_DOMAIN'] + "." + config['BUNDLE_MFR'] + ".vst3." + config['BUNDLE_NAME'] + "" vst3['CFBundleName'] = config['BUNDLE_NAME'] vst3['CFBundleVersion'] = CFBundleVersion vst3['CFBundleShortVersionString'] = CFBundleVersion vst3['LSMinimumSystemVersion'] = LSMinimumSystemVersion vst3['CFBundlePackageType'] = CFBundlePackageType vst3['CFBundleSignature'] = config['PLUG_UNIQUE_ID'] vst3['CSResourcesFileMapped'] = CSResourcesFileMapped plistlib.writePlist(vst3, plistpath) # VST2 plistpath = projectpath + "/resources/" + config['BUNDLE_NAME'] + "-VST2-Info.plist" vst2 = plistlib.readPlist(plistpath) vst2['CFBundleExecutable'] = config['BUNDLE_NAME'] vst2['CFBundleGetInfoString'] = CFBundleGetInfoString vst2['CFBundleIdentifier'] = config['BUNDLE_DOMAIN'] + "." + config['BUNDLE_MFR'] + ".vst." + config['BUNDLE_NAME'] + "" vst2['CFBundleName'] = config['BUNDLE_NAME'] vst2['CFBundleVersion'] = CFBundleVersion vst2['CFBundleShortVersionString'] = CFBundleVersion vst2['LSMinimumSystemVersion'] = LSMinimumSystemVersion vst2['CFBundlePackageType'] = CFBundlePackageType vst2['CFBundleSignature'] = config['PLUG_UNIQUE_ID'] vst2['CSResourcesFileMapped'] = CSResourcesFileMapped plistlib.writePlist(vst2, plistpath) # AUDIOUNIT v2 plistpath = projectpath + "/resources/" + config['BUNDLE_NAME'] + "-AU-Info.plist" auv2 = plistlib.readPlist(plistpath) auv2['CFBundleExecutable'] = config['BUNDLE_NAME'] auv2['CFBundleGetInfoString'] = CFBundleGetInfoString auv2['CFBundleIdentifier'] = config['BUNDLE_DOMAIN'] + "." + config['BUNDLE_MFR'] + ".audiounit." + config['BUNDLE_NAME'] + "" auv2['CFBundleName'] = config['BUNDLE_NAME'] auv2['CFBundleVersion'] = CFBundleVersion auv2['CFBundleShortVersionString'] = CFBundleVersion auv2['LSMinimumSystemVersion'] = LSMinimumSystemVersion auv2['CFBundlePackageType'] = CFBundlePackageType auv2['CFBundleSignature'] = config['PLUG_UNIQUE_ID'] auv2['CSResourcesFileMapped'] = CSResourcesFileMapped if config['PLUG_TYPE'] == 0: if config['PLUG_DOES_MIDI_IN']: COMPONENT_TYPE = kAudioUnitType_MusicEffect else: COMPONENT_TYPE = kAudioUnitType_Effect elif config['PLUG_TYPE'] == 1: COMPONENT_TYPE = kAudioUnitType_MusicDevice elif config['PLUG_TYPE'] == 2: COMPONENT_TYPE = kAudioUnitType_MIDIProcessor auv2['AudioUnit Version'] = config['PLUG_VERSION_HEX'] auv2['AudioComponents'] = [{}] auv2['AudioComponents'][0]['description'] = config['PLUG_NAME'] auv2['AudioComponents'][0]['factoryFunction'] = config['AUV2_FACTORY'] auv2['AudioComponents'][0]['manufacturer'] = config['PLUG_MFR_ID'] auv2['AudioComponents'][0]['name'] = config['PLUG_MFR'] + ": " + config['PLUG_NAME'] auv2['AudioComponents'][0]['subtype'] = config['PLUG_UNIQUE_ID'] auv2['AudioComponents'][0]['type'] = COMPONENT_TYPE auv2['AudioComponents'][0]['version'] = config['PLUG_VERSION_INT'] auv2['AudioComponents'][0]['sandboxSafe'] = True plistlib.writePlist(auv2, plistpath) # AUDIOUNIT v3 if config['PLUG_HAS_UI']: NSEXTENSIONPOINTIDENTIFIER = "com.apple.AudioUnit-UI" else: NSEXTENSIONPOINTIDENTIFIER = "com.apple.AudioUnit" plistpath = projectpath + "/resources/" + config['BUNDLE_NAME'] + "-macOS-AUv3-Info.plist" auv3 = plistlib.readPlist(plistpath) auv3['CFBundleExecutable'] = config['BUNDLE_NAME'] auv3['CFBundleGetInfoString'] = CFBundleGetInfoString auv3['CFBundleIdentifier'] = config['BUNDLE_DOMAIN'] + "." + config['BUNDLE_MFR'] + ".app." + config['BUNDLE_NAME'] + ".AUv3" auv3['CFBundleName'] = config['BUNDLE_NAME'] auv3['CFBundleVersion'] = CFBundleVersion auv3['CFBundleShortVersionString'] = CFBundleVersion auv3['LSMinimumSystemVersion'] = "10.12.0" auv3['CFBundlePackageType'] = "XPC!" auv3['NSExtension'] = dict( NSExtensionAttributes = dict( AudioComponentBundle = "com.NeverEngineLabs.app." + config['BUNDLE_NAME'] + ".AUv3Framework", AudioComponents = [{}]), # NSExtensionServiceRoleType = "NSExtensionServiceRoleTypeEditor", NSExtensionPointIdentifier = NSEXTENSIONPOINTIDENTIFIER, NSExtensionPrincipalClass = "IPlugAUViewController" ) auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'] = [{}] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0]['description'] = config['PLUG_NAME'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0]['manufacturer'] = config['PLUG_MFR_ID'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0]['name'] = config['PLUG_MFR'] + ": " + config['PLUG_NAME'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0]['subtype'] = config['PLUG_UNIQUE_ID'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0]['type'] = COMPONENT_TYPE auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0]['version'] = config['PLUG_VERSION_INT'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0]['sandboxSafe'] = True auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0]['tags'] = [{}] if config['PLUG_TYPE'] == 1: auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0]['tags'][0] = "Synth" else: auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0]['tags'][0] = "Effects" plistlib.writePlist(auv3, plistpath) # AAX plistpath = projectpath + "/resources/" + config['BUNDLE_NAME'] + "-AAX-Info.plist" aax = plistlib.readPlist(plistpath) aax['CFBundleExecutable'] = config['BUNDLE_NAME'] aax['CFBundleGetInfoString'] = CFBundleGetInfoString aax['CFBundleIdentifier'] = config['BUNDLE_DOMAIN'] + "." + config['BUNDLE_MFR'] + ".aax." + config['BUNDLE_NAME'] + "" aax['CFBundleName'] = config['BUNDLE_NAME'] aax['CFBundleVersion'] = CFBundleVersion aax['CFBundleShortVersionString'] = CFBundleVersion aax['LSMinimumSystemVersion'] = LSMinimumSystemVersion aax['CSResourcesFileMapped'] = CSResourcesFileMapped plistlib.writePlist(aax, plistpath) # APP plistpath = projectpath + "/resources/" + config['BUNDLE_NAME'] + "-macOS-Info.plist" macOSapp = plistlib.readPlist(plistpath) macOSapp['CFBundleExecutable'] = config['BUNDLE_NAME'] macOSapp['CFBundleGetInfoString'] = CFBundleGetInfoString macOSapp['CFBundleIdentifier'] = config['BUNDLE_DOMAIN'] + "." + config['BUNDLE_MFR'] + ".app." + config['BUNDLE_NAME'] + "" macOSapp['CFBundleName'] = config['BUNDLE_NAME'] macOSapp['CFBundleVersion'] = CFBundleVersion macOSapp['CFBundleShortVersionString'] = CFBundleVersion macOSapp['LSMinimumSystemVersion'] = LSMinimumSystemVersion macOSapp['CFBundlePackageType'] = CFBundlePackageType macOSapp['CFBundleSignature'] = config['PLUG_UNIQUE_ID'] macOSapp['CSResourcesFileMapped'] = CSResourcesFileMapped macOSapp['NSPrincipalClass'] = "SWELLApplication" macOSapp['NSMainNibFile'] = config['BUNDLE_NAME'] + "-macOS-MainMenu" macOSapp['LSApplicationCategoryType'] = "public.app-category.music" macOSapp['CFBundleIconFile'] = config['BUNDLE_NAME'] + ".icns" macOSapp['NSMicrophoneUsageDescription'] = "This app needs mic access to process audio." plistlib.writePlist(macOSapp, plistpath)
def main(): config = parse_config(projectpath) xcconfig = parse_xcconfig( os.path.join(os.getcwd(), IPLUG2_ROOT + '/common-mac.xcconfig')) CFBundleGetInfoString = config['BUNDLE_NAME'] + " v" + config[ 'FULL_VER_STR'] + " " + config['PLUG_COPYRIGHT_STR'] CFBundleVersion = config['FULL_VER_STR'] CFBundlePackageType = "BNDL" CSResourcesFileMapped = True LSMinimumSystemVersion = xcconfig['DEPLOYMENT_TARGET'] print("Processing Info.plist files...") # VST3 plistpath = projectpath + "/resources/" + config[ 'BUNDLE_NAME'] + "-VST3-Info.plist" with open(plistpath, 'rb') as f: vst3 = plistlib.load(f) vst3['CFBundleExecutable'] = config['BUNDLE_NAME'] vst3['CFBundleGetInfoString'] = CFBundleGetInfoString vst3['CFBundleIdentifier'] = config['BUNDLE_DOMAIN'] + "." + config[ 'BUNDLE_MFR'] + ".vst3." + config['BUNDLE_NAME'] + "" vst3['CFBundleName'] = config['BUNDLE_NAME'] vst3['CFBundleVersion'] = CFBundleVersion vst3['CFBundleShortVersionString'] = CFBundleVersion vst3['LSMinimumSystemVersion'] = LSMinimumSystemVersion vst3['CFBundlePackageType'] = CFBundlePackageType vst3['CFBundleSignature'] = config['PLUG_UNIQUE_ID'] vst3['CSResourcesFileMapped'] = CSResourcesFileMapped with open(plistpath, 'wb') as f2: plistlib.dump(vst3, f2) # VST2 plistpath = projectpath + "/resources/" + config[ 'BUNDLE_NAME'] + "-VST2-Info.plist" with open(plistpath, 'rb') as f: vst2 = plistlib.load(f) vst2['CFBundleExecutable'] = config['BUNDLE_NAME'] vst2['CFBundleGetInfoString'] = CFBundleGetInfoString vst2['CFBundleIdentifier'] = config['BUNDLE_DOMAIN'] + "." + config[ 'BUNDLE_MFR'] + ".vst." + config['BUNDLE_NAME'] + "" vst2['CFBundleName'] = config['BUNDLE_NAME'] vst2['CFBundleVersion'] = CFBundleVersion vst2['CFBundleShortVersionString'] = CFBundleVersion vst2['LSMinimumSystemVersion'] = LSMinimumSystemVersion vst2['CFBundlePackageType'] = CFBundlePackageType vst2['CFBundleSignature'] = config['PLUG_UNIQUE_ID'] vst2['CSResourcesFileMapped'] = CSResourcesFileMapped with open(plistpath, 'wb') as f2: plistlib.dump(vst2, f2) # AUDIOUNIT v2 plistpath = projectpath + "/resources/" + config[ 'BUNDLE_NAME'] + "-AU-Info.plist" with open(plistpath, 'rb') as f: auv2 = plistlib.load(f) auv2['CFBundleExecutable'] = config['BUNDLE_NAME'] auv2['CFBundleGetInfoString'] = CFBundleGetInfoString auv2['CFBundleIdentifier'] = config['BUNDLE_DOMAIN'] + "." + config[ 'BUNDLE_MFR'] + ".audiounit." + config['BUNDLE_NAME'] + "" auv2['CFBundleName'] = config['BUNDLE_NAME'] auv2['CFBundleVersion'] = CFBundleVersion auv2['CFBundleShortVersionString'] = CFBundleVersion auv2['LSMinimumSystemVersion'] = LSMinimumSystemVersion auv2['CFBundlePackageType'] = CFBundlePackageType auv2['CFBundleSignature'] = config['PLUG_UNIQUE_ID'] auv2['CSResourcesFileMapped'] = CSResourcesFileMapped if config['PLUG_TYPE'] == 0: if config['PLUG_DOES_MIDI_IN']: COMPONENT_TYPE = kAudioUnitType_MusicEffect else: COMPONENT_TYPE = kAudioUnitType_Effect elif config['PLUG_TYPE'] == 1: COMPONENT_TYPE = kAudioUnitType_MusicDevice elif config['PLUG_TYPE'] == 2: COMPONENT_TYPE = kAudioUnitType_MIDIProcessor auv2['AudioUnit Version'] = config['PLUG_VERSION_HEX'] auv2['AudioComponents'] = [{}] auv2['AudioComponents'][0]['description'] = config['PLUG_NAME'] auv2['AudioComponents'][0]['factoryFunction'] = config['AUV2_FACTORY'] auv2['AudioComponents'][0]['manufacturer'] = config['PLUG_MFR_ID'] auv2['AudioComponents'][0][ 'name'] = config['PLUG_MFR'] + ": " + config['PLUG_NAME'] auv2['AudioComponents'][0]['subtype'] = config['PLUG_UNIQUE_ID'] auv2['AudioComponents'][0]['type'] = COMPONENT_TYPE auv2['AudioComponents'][0]['version'] = config['PLUG_VERSION_INT'] auv2['AudioComponents'][0]['sandboxSafe'] = True with open(plistpath, 'wb') as f2: plistlib.dump(auv2, f2) # AUDIOUNIT v3 if config['PLUG_HAS_UI']: NSEXTENSIONPOINTIDENTIFIER = "com.apple.AudioUnit-UI" else: NSEXTENSIONPOINTIDENTIFIER = "com.apple.AudioUnit" plistpath = projectpath + "/resources/" + config[ 'BUNDLE_NAME'] + "-macOS-AUv3-Info.plist" with open(plistpath, 'rb') as f: auv3 = plistlib.load(f) auv3['CFBundleExecutable'] = config['BUNDLE_NAME'] auv3['CFBundleGetInfoString'] = CFBundleGetInfoString auv3['CFBundleIdentifier'] = config['BUNDLE_DOMAIN'] + "." + config[ 'BUNDLE_MFR'] + ".app." + config['BUNDLE_NAME'] + ".AUv3" auv3['CFBundleName'] = config['BUNDLE_NAME'] auv3['CFBundleVersion'] = CFBundleVersion auv3['CFBundleShortVersionString'] = CFBundleVersion auv3['LSMinimumSystemVersion'] = "10.12.0" auv3['CFBundlePackageType'] = "XPC!" auv3['NSExtension'] = dict( NSExtensionAttributes=dict(AudioComponentBundle="com.GWS.app." + config['BUNDLE_NAME'] + ".AUv3Framework", AudioComponents=[{}]), # NSExtensionServiceRoleType = "NSExtensionServiceRoleTypeEditor", NSExtensionPointIdentifier=NSEXTENSIONPOINTIDENTIFIER, NSExtensionPrincipalClass="IPlugAUViewController") auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'] = [{}] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'description'] = config['PLUG_NAME'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'manufacturer'] = config['PLUG_MFR_ID'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'name'] = config['PLUG_MFR'] + ": " + config['PLUG_NAME'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'subtype'] = config['PLUG_UNIQUE_ID'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'type'] = COMPONENT_TYPE auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'version'] = config['PLUG_VERSION_INT'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'sandboxSafe'] = True auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'tags'] = [{}] if config['PLUG_TYPE'] == 1: auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'tags'][0] = "Synth" else: auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'tags'][0] = "Effects" with open(plistpath, 'wb') as f2: plistlib.dump(auv3, f2) # AAX plistpath = projectpath + "/resources/" + config[ 'BUNDLE_NAME'] + "-AAX-Info.plist" with open(plistpath, 'rb') as f: aax = plistlib.load(f) aax['CFBundleExecutable'] = config['BUNDLE_NAME'] aax['CFBundleGetInfoString'] = CFBundleGetInfoString aax['CFBundleIdentifier'] = config['BUNDLE_DOMAIN'] + "." + config[ 'BUNDLE_MFR'] + ".aax." + config['BUNDLE_NAME'] + "" aax['CFBundleName'] = config['BUNDLE_NAME'] aax['CFBundleVersion'] = CFBundleVersion aax['CFBundleShortVersionString'] = CFBundleVersion aax['LSMinimumSystemVersion'] = LSMinimumSystemVersion aax['CSResourcesFileMapped'] = CSResourcesFileMapped with open(plistpath, 'wb') as f2: plistlib.dump(aax, f2) # APP plistpath = projectpath + "/resources/" + config[ 'BUNDLE_NAME'] + "-macOS-Info.plist" with open(plistpath, 'rb') as f: macOSapp = plistlib.load(f) macOSapp['CFBundleExecutable'] = config['BUNDLE_NAME'] macOSapp['CFBundleGetInfoString'] = CFBundleGetInfoString macOSapp[ 'CFBundleIdentifier'] = config['BUNDLE_DOMAIN'] + "." + config[ 'BUNDLE_MFR'] + ".app." + config['BUNDLE_NAME'] + "" macOSapp['CFBundleName'] = config['BUNDLE_NAME'] macOSapp['CFBundleVersion'] = CFBundleVersion macOSapp['CFBundleShortVersionString'] = CFBundleVersion macOSapp['LSMinimumSystemVersion'] = LSMinimumSystemVersion macOSapp['CFBundlePackageType'] = CFBundlePackageType macOSapp['CFBundleSignature'] = config['PLUG_UNIQUE_ID'] macOSapp['CSResourcesFileMapped'] = CSResourcesFileMapped macOSapp['NSPrincipalClass'] = "SWELLApplication" macOSapp['NSMainNibFile'] = config['BUNDLE_NAME'] + "-macOS-MainMenu" macOSapp['LSApplicationCategoryType'] = "public.app-category.music" macOSapp['CFBundleIconFile'] = config['BUNDLE_NAME'] + ".icns" macOSapp[ 'NSMicrophoneUsageDescription'] = "This app needs mic access to process audio." with open(plistpath, 'wb') as f2: plistlib.dump(macOSapp, f2)
def main(): if (len(sys.argv) == 2): if (sys.argv[1] == "app"): print "Copying resources ..." dst = os.environ["TARGET_BUILD_DIR"] + "/" + os.environ[ "UNLOCALIZED_RESOURCES_FOLDER_PATH"] if os.path.exists(projectpath + "/resources/img/"): imgs = os.listdir(projectpath + "/resources/img/") for img in imgs: print "copying " + img + " to " + dst shutil.copy(projectpath + "/resources/img/" + img, dst) if os.path.exists(projectpath + "/resources/fonts/"): fonts = os.listdir(projectpath + "/resources/fonts/") for font in fonts: print "copying " + font + " to " + dst shutil.copy(projectpath + "/resources/fonts/" + font, dst) config = parse_config(projectpath) xcconfig = parse_xcconfig(projectpath + '/../../common-ios.xcconfig') CFBundleGetInfoString = config['BUNDLE_NAME'] + " v" + config[ 'FULL_VER_STR'] + " " + config['PLUG_COPYRIGHT_STR'] CFBundleVersion = config['FULL_VER_STR'] CFBundlePackageType = "BNDL" CSResourcesFileMapped = True LSMinimumSystemVersion = xcconfig['DEPLOYMENT_TARGET'] print "Processing Info.plist files..." # AUDIOUNIT v3 if config['PLUG_TYPE'] == 0: if config['PLUG_DOES_MIDI_IN']: COMPONENT_TYPE = kAudioUnitType_MusicEffect else: COMPONENT_TYPE = kAudioUnitType_Effect elif config['PLUG_TYPE'] == 1: COMPONENT_TYPE = kAudioUnitType_MusicDevice elif config['PLUG_TYPE'] == 2: COMPONENT_TYPE = kAudioUnitType_MIDIProcessor NSEXTENSIONPOINTIDENTIFIER = "com.apple.AudioUnit-UI" plistpath = projectpath + "/resources/" + config[ 'BUNDLE_NAME'] + "-iOS-AUv3-Info.plist" auv3 = plistlib.readPlist(plistpath) auv3['CFBundleExecutable'] = config['BUNDLE_NAME'] + "AppExtension" auv3['CFBundleIdentifier'] = config['BUNDLE_DOMAIN'] + "." + config[ 'BUNDLE_MFR'] + ".app." + config['BUNDLE_NAME'] + ".AUv3" auv3['CFBundleName'] = config['BUNDLE_NAME'] + "AppExtension" auv3['CFBundleDisplayName'] = config['BUNDLE_NAME'] + "AppExtension" auv3['CFBundleVersion'] = CFBundleVersion auv3['CFBundleShortVersionString'] = CFBundleVersion auv3['CFBundlePackageType'] = "XPC!" auv3['NSExtension'] = dict( NSExtensionAttributes=dict(AudioComponents=[{}]), NSExtensionMainStoryboard=config['BUNDLE_NAME'] + "-iOS-MainInterface", NSExtensionPointIdentifier=NSEXTENSIONPOINTIDENTIFIER) auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'] = [{}] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'description'] = config['PLUG_NAME'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'manufacturer'] = config['PLUG_MFR_ID'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'factoryFunction'] = config['BUNDLE_NAME'] + "ViewController" auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'name'] = config['PLUG_MFR'] + ": " + config['PLUG_NAME'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'subtype'] = config['PLUG_UNIQUE_ID'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'type'] = COMPONENT_TYPE auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'version'] = config['PLUG_VERSION_INT'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'sandboxSafe'] = True auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'tags'] = [{}] if config['PLUG_TYPE'] == 1: auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'tags'][0] = "Synth" else: auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'tags'][0] = "Effects" plistlib.writePlist(auv3, plistpath) # Standalone APP plistpath = projectpath + "/resources/" + config[ 'BUNDLE_NAME'] + "-iOS-Info.plist" iOSapp = plistlib.readPlist(plistpath) iOSapp['CFBundleExecutable'] = config['BUNDLE_NAME'] iOSapp['CFBundleIdentifier'] = config['BUNDLE_DOMAIN'] + "." + config[ 'BUNDLE_MFR'] + ".app." + config['BUNDLE_NAME'] iOSapp['CFBundleName'] = config['BUNDLE_NAME'] iOSapp['CFBundleVersion'] = CFBundleVersion iOSapp['CFBundleShortVersionString'] = CFBundleVersion iOSapp['CFBundlePackageType'] = "APPL" iOSapp['LSApplicationCategoryType'] = "public.app-category.music" plistlib.writePlist(iOSapp, plistpath)
def main(): config = parse_config(projectpath) xcconfig = parse_xcconfig( os.path.join(os.getcwd(), IPLUG2_ROOT + '/../common-ios.xcconfig')) CFBundleGetInfoString = config['BUNDLE_NAME'] + " v" + config[ 'FULL_VER_STR'] + " " + config['PLUG_COPYRIGHT_STR'] CFBundleVersion = config['FULL_VER_STR'] CFBundlePackageType = "BNDL" CSResourcesFileMapped = True LSMinimumSystemVersion = xcconfig['DEPLOYMENT_TARGET'] print("Processing Info.plist files...") # AUDIOUNIT v3 if config['PLUG_TYPE'] == 0: if config['PLUG_DOES_MIDI_IN']: COMPONENT_TYPE = kAudioUnitType_MusicEffect else: COMPONENT_TYPE = kAudioUnitType_Effect elif config['PLUG_TYPE'] == 1: COMPONENT_TYPE = kAudioUnitType_MusicDevice elif config['PLUG_TYPE'] == 2: COMPONENT_TYPE = kAudioUnitType_MIDIProcessor if config['PLUG_HAS_UI'] == 1: NSEXTENSIONPOINTIDENTIFIER = "com.apple.AudioUnit-UI" else: NSEXTENSIONPOINTIDENTIFIER = "com.apple.AudioUnit" plistpath = projectpath + "/resources/" + config[ 'BUNDLE_NAME'] + "-iOS-AUv3-Info.plist" with open(plistpath, 'rb') as f: auv3 = plistlib.load(f) auv3['CFBundleExecutable'] = config['BUNDLE_NAME'] + "AppExtension" auv3['CFBundleIdentifier'] = "$(PRODUCT_BUNDLE_IDENTIFIER)" auv3['CFBundleName'] = config['BUNDLE_NAME'] + "AppExtension" auv3['CFBundleDisplayName'] = config['BUNDLE_NAME'] + "AppExtension" auv3['CFBundleVersion'] = CFBundleVersion auv3['CFBundleShortVersionString'] = CFBundleVersion auv3['CFBundlePackageType'] = "XPC!" auv3['NSExtension'] = dict( NSExtensionAttributes=dict(AudioComponents=[{}]), NSExtensionPointIdentifier=NSEXTENSIONPOINTIDENTIFIER) auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'] = [{}] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'description'] = config['PLUG_NAME'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'manufacturer'] = config['PLUG_MFR_ID'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'name'] = config['PLUG_MFR'] + ": " + config['PLUG_NAME'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'subtype'] = config['PLUG_UNIQUE_ID'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'type'] = COMPONENT_TYPE auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'version'] = config['PLUG_VERSION_INT'] auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'sandboxSafe'] = True auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'tags'] = ["", ""] if config['PLUG_TYPE'] == 1: auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'tags'][0] = "Synth" else: auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'tags'][0] = "Effects" if config['PLUG_HAS_UI'] == 1: auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'tags'][1] = "size:{" + str(config['PLUG_WIDTH']) + "," + str( config['PLUG_HEIGHT']) + "}" auv3['NSExtension']['NSExtensionAttributes']['AudioComponents'][0][ 'factoryFunction'] = "IPlugAUViewController" auv3['NSExtension']['NSExtensionMainStoryboard'] = config[ 'BUNDLE_NAME'] + "-iOS-MainInterface" else: auv3['NSExtension'][ 'NSExtensionPrincipalClass'] = "IPlugAUViewController" with open(plistpath, 'wb') as f2: plistlib.dump(auv3, f2) # Standalone APP plistpath = projectpath + "/resources/" + config[ 'BUNDLE_NAME'] + "-iOS-Info.plist" with open(plistpath, 'rb') as f: iOSapp = plistlib.load(f) iOSapp['CFBundleExecutable'] = config['BUNDLE_NAME'] iOSapp['CFBundleIdentifier'] = "$(PRODUCT_BUNDLE_IDENTIFIER)" iOSapp['CFBundleName'] = config['BUNDLE_NAME'] iOSapp['CFBundleVersion'] = CFBundleVersion iOSapp['CFBundleShortVersionString'] = CFBundleVersion iOSapp['CFBundlePackageType'] = "APPL" iOSapp['LSApplicationCategoryType'] = "public.app-category.music" with open(plistpath, 'wb') as f2: plistlib.dump(iOSapp, f2)