Make gradle.properties optional

This commit is contained in:
topjohnwu 2023-10-19 15:44:34 -07:00
parent bb39a524d0
commit 4e4ec73d94

View File

@ -187,15 +187,17 @@ def load_config(args):
# Default values # Default values
config["version"] = commit_hash config["version"] = commit_hash
config["versionCode"] = 1000000
config["outdir"] = "out" config["outdir"] = "out"
# Load prop files # Load prop files
if op.exists(args.config): if op.exists(args.config):
config.update(parse_props(args.config)) config.update(parse_props(args.config))
for key, value in parse_props("gradle.properties").items(): if op.exists("gradle.properties"):
if key.startswith("magisk."): for key, value in parse_props("gradle.properties").items():
config[key[7:]] = value if key.startswith("magisk."):
config[key[7:]] = value
try: try:
config["versionCode"] = int(config["versionCode"]) config["versionCode"] = int(config["versionCode"])