# -*- coding: utf-8 -*- import re import os import plistlib import getopt import sys def walk_dir(rootDir, dir_list): for lists in os.listdir(rootDir): path = os.path.join(rootDir, lists) if os.path.isdir(path): global FLAG pos = path.rfind( FLAG ) tmp = path tmp = tmp.lower() pos2 = tmp.find( r'.dsym' ) if pos >= 0 and pos2 < 0: dir_list.append( path ) continue walk_dir(path, dir_list) if os.path.isfile(path): pass def getpath( debug_falg, release_falg, dir ): debug = [] release = [] for i in dir: if i.find( debug_falg ) >=0: debug.append( i ) if i.find( release_falg ) >= 0: release.append( i ) return debug,release def getcombincommand( dir, is_debug ): command = "lipo -create " s = r"" for i in dir: t = i + "/" + flagshort + " " if s: s = s + t else: s = t; command = command + s if is_debug == True: command = command + "-output " + "./" + flagshort + "_debug" else: command = command + "-output " + "./" + flagshort #print command return command # python framework.py 工程名 if __name__ == "__main__": opts, args = getopt.getopt(sys.argv[1:], "t:d", ["help", "grammar="]) # project name flagshort = args #r"ALSLog" homedir = os.path.split(os.path.realpath(__file__))[0] global FLAG FLAG = "/" + flagshort + ".framework" dir = [] walk_dir( homedir, dir ) debug_flag = r"Debug-iphone" release_flag = "Release-iphone" debug,release = getpath( debug_flag, release_flag, dir ) print debug print "--" print release print "--" combin_debug = getcombincommand( debug, True ) combin_release = getcombincommand( release, False ) print combin_debug print combin_release os.system( combin_debug ) os.system( combin_release )
ios framework 合并叫脚本
最新推荐文章于 2022-03-11 15:11:41 发布