From 9a146c238e3d09cb0cbf25877a69e61d072e301c Mon Sep 17 00:00:00 2001 From: Theodore Dubois Date: Wed, 19 Aug 2020 11:14:44 -0700 Subject: [PATCH] Auto-generate the CFBundleIcons crap This was much harder than it should have been. But now all you need to do to add an icon is add it to the project and edit Icons.plist. https://medium.com/twitch-news/ios-versioning-89e02f0a5146 --- app/Icons/Icons.plist | 46 +++++----- app/Info.plist | 77 +---------------- iSH.xcodeproj/project.pbxproj | 84 +++++++++++++++++++ .../xcshareddata/WorkspaceSettings.xcsettings | 8 ++ 4 files changed, 117 insertions(+), 98 deletions(-) create mode 100644 iSH.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/app/Icons/Icons.plist b/app/Icons/Icons.plist index fe834f8598..c93a4539bf 100644 --- a/app/Icons/Icons.plist +++ b/app/Icons/Icons.plist @@ -4,48 +4,48 @@ - description - Default - author - @tbodt link https://twitter.com/tblodt - - ihash1 - - description - i# author - @01010101lzy - link - https://github.com/tbodt/ish/issues/578#issuecomment-562960935 + @tbodt + description + Default uninspired - description - uninspired + link + https://github.com/ish-app/ish/issues/578#issuecomment-562906800 author @saagarjha + description + uninspired + + ihash1 + link - https://github.com/tbodt/ish/issues/578#issuecomment-562906800 + https://github.com/ish-app/ish/issues/578#issuecomment-562960935 + author + @01010101lzy + description + i# pydann2 - description - >| Light + link + https://github.com/ish-app/ish/issues/578#issuecomment-562897067 author @PyDann - link - https://github.com/tbodt/ish/issues/578#issuecomment-562897067 + description + >| Light pydann1 - description - >| Dark + link + https://github.com/ish-app/ish/issues/578#issuecomment-562897067 author @PyDann - link - https://github.com/tbodt/ish/issues/578#issuecomment-562897067 + description + >| Dark diff --git a/app/Info.plist b/app/Info.plist index 1a798bc83d..04c34fe8eb 100644 --- a/app/Info.plist +++ b/app/Info.plist @@ -2,85 +2,12 @@ + fuc + ICON_STUFF CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable $(EXECUTABLE_NAME) - CFBundleIcons - - CFBundleAlternateIcons - - ihash1 - - CFBundleIconFiles - - ihash1 - - - pydann1 - - CFBundleIconFiles - - pydann1 - - - pydann2 - - CFBundleIconFiles - - pydann2 - - - uninspired - - CFBundleIconFiles - - uninspired - - - - CFBundlePrimaryIcon - - CFBundleIconFiles - - icon - - - - CFBundleIcons~ipad - - CFBundleAlternateIcons - - ihash1 - - CFBundleIconFiles - - ihash1 - - - pydann1 - - CFBundleIconFiles - - pydann1 - - - pydann2 - - CFBundleIconFiles - - pydann2 - - - uninspired - - CFBundleIconFiles - - uninspired - - - - CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion diff --git a/iSH.xcodeproj/project.pbxproj b/iSH.xcodeproj/project.pbxproj index 01b3ae35f2..210fe28323 100644 --- a/iSH.xcodeproj/project.pbxproj +++ b/iSH.xcodeproj/project.pbxproj @@ -6,6 +6,20 @@ objectVersion = 47; objects = { +/* Begin PBXAggregateTarget section */ + BB4A922324ED9402002F5A96 /* iSH pre */ = { + isa = PBXAggregateTarget; + buildConfigurationList = BB4A922424ED9402002F5A96 /* Build configuration list for PBXAggregateTarget "iSH pre" */; + buildPhases = ( + BB4A922A24ED9421002F5A96 /* Add icons to Info.plist */, + ); + dependencies = ( + ); + name = "iSH pre"; + productName = "iSH pre"; + }; +/* End PBXAggregateTarget section */ + /* Begin PBXBuildFile section */ 408A263A236440F8008A4E81 /* iOSFS.m in Sources */ = {isa = PBXBuildFile; fileRef = 408A2639236440F8008A4E81 /* iOSFS.m */; }; 650B337422EA235C00B4C03E /* PasteboardDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 650B337322EA235C00B4C03E /* PasteboardDevice.m */; }; @@ -104,6 +118,13 @@ remoteGlobalIDString = BB13F7D0200ACCA2003D1C4D; remoteInfo = Ninja; }; + BB4A922724ED940C002F5A96 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BB792B461F96D8E000FFB7A4 /* Project object */; + proxyType = 1; + remoteGlobalIDString = BB4A922324ED9402002F5A96; + remoteInfo = "iSH pre"; + }; BB88F49D2154760800A341FD /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BB792B461F96D8E000FFB7A4 /* Project object */; @@ -888,6 +909,7 @@ buildRules = ( ); dependencies = ( + BB4A922824ED940C002F5A96 /* PBXTargetDependency */, BB10E5CB248DBAB7009C7A74 /* PBXTargetDependency */, BB13F7E7200AD874003D1C4D /* PBXTargetDependency */, BB88F49E2154760800A341FD /* PBXTargetDependency */, @@ -938,6 +960,11 @@ DevelopmentTeam = CK5SXRTBR7; ProvisioningStyle = Automatic; }; + BB4A922324ED9402002F5A96 = { + CreatedOnToolsVersion = 11.5; + DevelopmentTeam = CK5SXRTBR7; + ProvisioningStyle = Automatic; + }; BB792B4F1F96D90D00FFB7A4 = { CreatedOnToolsVersion = 9.0; DevelopmentTeam = CK5SXRTBR7; @@ -984,6 +1011,7 @@ BB13F7CA200ACC31003D1C4D /* Meson */, BB13F7D0200ACCA2003D1C4D /* Ninja */, BB13F7DB200AD81D003D1C4D /* libish */, + BB4A922324ED9402002F5A96 /* iSH pre */, ); }; /* End PBXProject section */ @@ -1063,6 +1091,26 @@ shellScript = "cd $SRCROOT/deps/libapps\n./hterm/bin/mkdist\n"; showEnvVarsInLog = 0; }; + BB4A922A24ED9421002F5A96 /* Add icons to Info.plist */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "$(SRCROOT)/app/Icons/Icons.plist", + ); + name = "Add icons to Info.plist"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(BUILT_PRODUCTS_DIR)/infoplisticons.h", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "python3 - \"${SRCROOT}/app/Icons/Icons.plist\" \"${BUILT_PRODUCTS_DIR}/infoplisticons.h\" <CFBundleAlternateIcons'\nfor icon in icons.keys():\n if icon == '': continue\n alt_icons += '''{0}\n\nCFBundleIconFiles\n{0}\n'''.format(icon)\nalt_icons += ''\nicon_stuff = '''\nCFBundleIcons{0}\nCFBundleIcons~ipad{0}\nkxcode'''.format(alt_icons)\nicon_define = '#define ICON_STUFF ' + icon_stuff.replace('\\n', '')\nwith open(sys.argv[2], 'w') as output:\n output.write(icon_define)\nEND\ntouch \"${SRCROOT}/app/Info.plist\"\n"; + }; BBF1248B1FA7BF530088FB50 /* Download Alpine */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -1152,6 +1200,11 @@ target = BB13F7D0200ACCA2003D1C4D /* Ninja */; targetProxy = BB13F7E8200AD967003D1C4D /* PBXContainerItemProxy */; }; + BB4A922824ED940C002F5A96 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = BB4A922324ED9402002F5A96 /* iSH pre */; + targetProxy = BB4A922724ED940C002F5A96 /* PBXContainerItemProxy */; + }; BB88F49E2154760800A341FD /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = BB88F48F2154760800A341FD /* iSHFileProvider */; @@ -1385,6 +1438,24 @@ }; name = Release; }; + BB4A922524ED9402002F5A96 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = CK5SXRTBR7; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + BB4A922624ED9402002F5A96 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = CK5SXRTBR7; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; BB792B4A1F96D8E000FFB7A4 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = BB9C7B88240A343400F5D4F0 /* iSH.xcconfig */; @@ -1526,6 +1597,8 @@ "$(SRCROOT)/deps/libarchive/libarchive", ); INFOPLIST_FILE = app/Info.plist; + INFOPLIST_PREFIX_HEADER = "$(BUILT_PRODUCTS_DIR)/infoplisticons.h"; + INFOPLIST_PREPROCESS = YES; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; @@ -1589,6 +1662,8 @@ "$(SRCROOT)/deps/libarchive/libarchive", ); INFOPLIST_FILE = app/Info.plist; + INFOPLIST_PREFIX_HEADER = "$(BUILT_PRODUCTS_DIR)/infoplisticons.h"; + INFOPLIST_PREPROCESS = YES; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)"; @@ -1711,6 +1786,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + BB4A922424ED9402002F5A96 /* Build configuration list for PBXAggregateTarget "iSH pre" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BB4A922524ED9402002F5A96 /* Debug */, + BB4A922624ED9402002F5A96 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; BB792B491F96D8E000FFB7A4 /* Build configuration list for PBXProject "iSH" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/iSH.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/iSH.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000000..08de0be8d3 --- /dev/null +++ b/iSH.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + +