浏览代码

stash changes (still buggy)

/zxw-fix_build_script
Xingwei Zhu 3 年前
当前提交
01aff6c9
共有 2 个文件被更改,包括 21 次插入19 次删除
  1. 38
      engine/Scripts/lib_build.py
  2. 2
      engine/Scripts/patches/find_sdk.patch

38
engine/Scripts/lib_build.py


flutter_root_path=""
visual_studio_path=""
architecture=""
gclientSyncCmd=""
def get_opts():
# get intput agrs

def set_env_verb():
global platform
global flutter_root_path
flutter_root_path = os.getenv('FLUTTER_ROOT_PATH', 'null')
if flutter_root_path == 'null':
os.environ["FLUTTER_ROOT_PATH"] = os.path.join(engine_path, "engine","src")
flutter_root_path = os.getenv('FLUTTER_ROOT_PATH')
else:
print("This environment variable has been set, skip")
env_path = os.getenv('PATH')
path_strings = re.split("[;:]", env_path)
for path in path_strings:
if path.endswith("depot_tools"):
print("This environment variable has been set, skip")
return
if platform == "windows":
os.environ["PATH"] = engine_path + "/depot_tools;" + os.environ["PATH"]
#if the user provides us an valid engine path, use it
if not engine_path == "":
flutter_root_path = os.path.join(engine_path, "engine","src")
#if the engine path is not set, we try to fetch it from the environment variables
os.environ["PATH"] = engine_path + "/depot_tools:" + os.environ["PATH"]
flutter_root_path = os.getenv('FLUTTER_ROOT_PATH', 'null')
if flutter_root_path == 'null':
assert False, "flutter root path is invalid. Please use -r to specify a root path for the third party flutter repos"
global gclientSyncCmd
print("\nGetting Depot Tools...")
if not os.path.exists(engine_path):
assert False,"Flutter engine path is not exist, please set the path by using \"-r\" param to set a engine path."

os.chdir(engine_path)
os.system("git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git")
os.system("gclient sync")
# we use the absolute path to execute gthe client command
gclientSyncCmd = engine_path + "depot_tools/gclient sync"
def get_flutter_engine():
global engine_path

f.write(content)
f.close()
os.chdir(Path(engine_path + "/engine"))
os.system("gclient sync")
os.system(gclientSyncCmd)
if not os.path.exists(Path(flutter_root_path + "/flutter")):
os.makedirs(Path(flutter_root_path + "/flutter"))
os.system("gclient sync -D")
os.system(gclientSyncCmd + " -D")
def compile_engine():
global flutter_root_path

f = open(Path(flutter_root_path + "/out/" + output_path + "/args.gn"), 'a')
f.write("icu_use_data_file = false")
f.close()
#the contents in the include path below may conflict with those in MacSDK 12.0, so we'd better remove them as a work-around
os.system("rm -rf " + flutter_root_path + "/buildtools/mac-x64/clang/include")
os.system("ninja " + ninja_params)
elif platform == "ios":
old_str = "bitcode_marker = true"

2
engine/Scripts/patches/find_sdk.patch


else:
sdk_dir = os.path.join(out.rstrip(), 'SDKs')
- sdks = [re.findall('^MacOSX(10\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]
+ sdks = [re.findall('^MacOSX(1[0-1]\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]
+ sdks = [re.findall('^MacOSX(1[0-2]\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]
sdks = [s[0] for s in sdks if s] # [['10.5'], ['10.6']] => ['10.5', '10.6']
sdks = [s for s in sdks # ['10.5', '10.6'] => ['10.6']
if parse_version(s) >= parse_version(min_sdk_version)]
正在加载...
取消
保存