diff --git a/src/dragon/config/rules.yml b/src/dragon/config/rules.yml index d3b1994ac..da5efce07 100644 --- a/src/dragon/config/rules.yml +++ b/src/dragon/config/rules.yml @@ -65,10 +65,6 @@ bundle: name: "Bundle Resources" desc: "Copying Bundle Resources" cmd: "mkdir -p $dragon_data_dir/_$location/ && cp -R $resource_dir/ $dragon_data_dir/_$location" -plist: - name: "plutil compilation" - desc: "Compiling $in" - cmd: "$plutil -convert binary1 $in -o $out" debug: name: "DsymUtil" desc: "Generating Debug Symbols for $name" diff --git a/src/dragon/shscripts/building b/src/dragon/shscripts/building index 2da1945c6..ed663e1e9 100644 --- a/src/dragon/shscripts/building +++ b/src/dragon/shscripts/building @@ -77,6 +77,35 @@ build() true else cp -R $DRAGON_DIR/_ "$DRAGON_DATA_DIR" 2>/dev/null + + if [[ $release -eq 1 ]]; then + if command -v plutil &> /dev/null; then + cmd=plutil + elif command -v ply &> /dev/null; then + cmd=ply + elif command -v plistutill &> /dev/null; then + cmd=plistutil + fi + + if ! [[ -z $cmd ]]; then + prefix_print "Converting plist/xml resources to binary" + find "$DRAGON_DATA_DIR" \( -name \*.plist -o -name \*.strings \) | while read i; do + head="$(od -c "$i" | head)" + clean_head="${head//[^[:alpha:]]/}" + magic_bytes="${clean_head:0:6}" + + if ! [[ $magic_bytes == bplist ]]; then + if [[ $cmd == plutil ]]; then + plutil -convert binary1 "$i" + elif [[ $cmd == ply ]]; then + ply -c binary "$i" + else + plistutil -i "$i" -f bin -o "$i" + fi + fi + done + fi + fi fi cd "$projroot" || drexit diff --git a/src/dragongen/generation.py b/src/dragongen/generation.py index 8d8fc1bac..0ae6dc4ba 100644 --- a/src/dragongen/generation.py +++ b/src/dragongen/generation.py @@ -213,8 +213,6 @@ def generate_vars(self, module_variables: dict, target: str) -> dict: project_dict['lipo'] = toolchain.lipo if 'dsym' not in project_dict: project_dict['dsym'] = toolchain.dsym - if 'plutil' not in project_dict: - project_dict['plutil'] = toolchain.plutil if 'ld' not in project_dict: project_dict['ld'] = toolchain.ld if 'codesign' not in project_dict: @@ -410,7 +408,6 @@ def generate_ninja_outline(self) -> list: Var('lipo'), Var('logos'), Var('optool'), - Var('plutil'), Var('swift'), ___, Var('targetvers'), diff --git a/src/dragongen/toolchain.py b/src/dragongen/toolchain.py index 558b30e9b..43f50cb4b 100644 --- a/src/dragongen/toolchain.py +++ b/src/dragongen/toolchain.py @@ -21,7 +21,6 @@ def __init__(self): self.ld = "" self.codesign = "" self.dsym = "" - self.plutil = "" self.lipo = "" self.tapi = "" @@ -50,7 +49,6 @@ def locate_macos_toolchain(cls, use_objcs: bool): tc.ld = tc_dir + 'clang++' tc.codesign = 'ldid' tc.dsym = tc_dir + 'dsymutil' - tc.plutil = 'plutil' # FIXME: hardcoded while I wait on a real distribution of llvm-objcs if use_objcs: tc.lipo = '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo' @@ -79,7 +77,6 @@ def locate_linux_toolchain(cls, use_objcs: bool): tc.ld = tc_dir + 'clang++' tc.codesign = tc_dir + 'ldid' tc.dsym = tc_dir + 'dsymutil' - tc.plutil = 'plutil' # TODO: fixme tc.lipo = tc_dir + 'lipo' tc.tapi = tc_dir + 'tapi'