Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix handling of Info.plist #366

Merged
merged 3 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions buildscripts/create_infoplist_preprocessor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash -euo pipefail

sha="$(git log -n 1 '--pretty=format:%h')"
if [[ $(git status -s | wc -c) -ne 0 ]]; then
sha="${sha}.dirty"
fi

preprocess_dir=infoplist-preprocess
compiled_headers="$preprocess_dir/compiled.h"

cat "$preprocess_dir/fixed/"*.h > "$compiled_headers"

printf '#define FULL_BUILD_VERSION %s\n' "$(/bin/date -u '+%Y.%m%d.%H%M%S')" >> "$compiled_headers"
1 change: 1 addition & 0 deletions buildscripts/infoplist-preprocess/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
compiled.h
2 changes: 2 additions & 0 deletions buildscripts/infoplist-preprocess/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- fixed.h is checked in
- compiled.h is generated from `fixed/*.h plus other stuff by `buildscripts/create_infoplist_preprocessor.sh`
1 change: 1 addition & 0 deletions buildscripts/infoplist-preprocess/fixed/sparkle.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define SPARKLE_FEED_URL "https://whatdid.yuvalshavit.com/appcast/appcast.xml"
28 changes: 0 additions & 28 deletions buildscripts/set_plist_build.sh

This file was deleted.

120 changes: 93 additions & 27 deletions whatdid.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@
objectVersion = 54;
objects = {

/* Begin PBXAggregateTarget section */
60D5F41C2C0286430017D139 /* infoplist-preprocess-generator */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 60D5F41D2C0286430017D139 /* Build configuration list for PBXAggregateTarget "infoplist-preprocess-generator" */;
buildPhases = (
60D5F4212C02865D0017D139 /* ShellScript */,
);
dependencies = (
);
name = "infoplist-preprocess-generator";
productName = "infoplist-preprocess-generator";
};
/* End PBXAggregateTarget section */

/* Begin PBXBuildFile section */
6E01204F389CB80FC8CD75ED /* EditEntriesDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E012F97EBB4C11F269A1939 /* EditEntriesDataSource.swift */; };
6E012216A8475ABF72DEBC69 /* EntriesTreeControllerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E012ED45DEC1A299BFA43AB /* EntriesTreeControllerTest.swift */; };
Expand Down Expand Up @@ -291,6 +305,20 @@
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
60D5F4222C02868C0017D139 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 7E8C04D223714F0700A0C3A6 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 60D5F41C2C0286430017D139;
remoteInfo = "infoplist-preprocess-generator";
};
60D5F4242C0286D20017D139 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 7E8C04D223714F0700A0C3A6 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 60D5F41C2C0286430017D139;
remoteInfo = "infoplist-preprocess-generator";
};
7E8C04EB23714F0800A0C3A6 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 7E8C04D223714F0700A0C3A6 /* Project object */;
Expand Down Expand Up @@ -1010,12 +1038,12 @@
7E8C04D623714F0700A0C3A6 /* Sources */,
7E8C04D723714F0700A0C3A6 /* Frameworks */,
7E8C04D823714F0700A0C3A6 /* Resources */,
7E1C2F4F24CE33780070D8CD /* Set gitsha in Info.plist */,
7E6FF1C2252D73EA0071E58C /* CopyFiles */,
);
buildRules = (
);
dependencies = (
60D5F4232C02868C0017D139 /* PBXTargetDependency */,
);
name = whatdid;
packageProductDependencies = (
Expand Down Expand Up @@ -1069,12 +1097,12 @@
7EF30DD42AC2B4920097FA24 /* Sources */,
7EF30E2F2AC2B4920097FA24 /* Frameworks */,
7EF30E332AC2B4920097FA24 /* Resources */,
7EF30E3F2AC2B4920097FA24 /* Set gitsha in Info.plist */,
7EF30E402AC2B4920097FA24 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
60D5F4252C0286D20017D139 /* PBXTargetDependency */,
);
name = "whatdid-app-store";
packageProductDependencies = (
Expand All @@ -1094,6 +1122,9 @@
LastUpgradeCheck = 1320;
ORGANIZATIONNAME = "Yuval Shavit";
TargetAttributes = {
60D5F41C2C0286430017D139 = {
CreatedOnToolsVersion = 15.4;
};
7E6FF19B252D71060071E58C = {
CreatedOnToolsVersion = 12.0.1;
};
Expand Down Expand Up @@ -1132,6 +1163,7 @@
7E8C04E923714F0800A0C3A6 /* whatdidTests */,
7E8C04F423714F0800A0C3A6 /* whatdidUITests */,
7E6FF19B252D71060071E58C /* WhatdidLauncher */,
60D5F41C2C0286430017D139 /* infoplist-preprocess-generator */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -1203,7 +1235,7 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
7E1C2F4F24CE33780070D8CD /* Set gitsha in Info.plist */ = {
60D5F4212C02865D0017D139 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
Expand All @@ -1213,33 +1245,14 @@
);
inputPaths = (
);
name = "Set gitsha in Info.plist";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n$SRCROOT/buildscripts/set_plist_build.sh\n";
};
7EF30E3F2AC2B4920097FA24 /* Set gitsha in Info.plist */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 12;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Set gitsha in Info.plist";
outputFileListPaths = (
);
outputPaths = (
"$(SRCROOT)/buildscripts/infoplist-preprocess/compiled.h",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -euo pipefail\n$SRCROOT/buildscripts/set_plist_build.sh\n";
shellScript = "set -euo pipefail\ncd \"$SRCROOT/buildscripts/\"\n./create_infoplist_preprocessor.sh\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down Expand Up @@ -1528,6 +1541,16 @@
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
60D5F4232C02868C0017D139 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 60D5F41C2C0286430017D139 /* infoplist-preprocess-generator */;
targetProxy = 60D5F4222C02868C0017D139 /* PBXContainerItemProxy */;
};
60D5F4252C0286D20017D139 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 60D5F41C2C0286430017D139 /* infoplist-preprocess-generator */;
targetProxy = 60D5F4242C0286D20017D139 /* PBXContainerItemProxy */;
};
7E8C04EC23714F0800A0C3A6 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 7E8C04D923714F0700A0C3A6 /* whatdid */;
Expand All @@ -1552,6 +1575,33 @@
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
60D5F41E2C0286430017D139 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = CUJYAXXM6G;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
60D5F41F2C0286430017D139 /* UI Test */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = CUJYAXXM6G;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = "UI Test";
};
60D5F4202C0286430017D139 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = CUJYAXXM6G;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
7E6FF1A7252D71080071E58C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
Expand Down Expand Up @@ -2004,12 +2054,14 @@
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = whatdid/Info.plist;
INFOPLIST_PREFIX_HEADER = "$(PROJECT_DIR)/buildscripts/infoplist-preprocess/compiled.h";
INFOPLIST_PREPROCESS = YES;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.2.1;
MARKETING_VERSION = 0.2.2;
PRODUCT_BUNDLE_IDENTIFIER = com.yuvalshavit.whatdid;
PRODUCT_NAME = Whatdid;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -2027,12 +2079,14 @@
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = whatdid/Info.plist;
INFOPLIST_PREFIX_HEADER = "$(PROJECT_DIR)/buildscripts/infoplist-preprocess/compiled.h";
INFOPLIST_PREPROCESS = YES;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.2.1;
MARKETING_VERSION = 0.2.2;
PRODUCT_BUNDLE_IDENTIFIER = com.yuvalshavit.whatdid;
PRODUCT_NAME = Whatdid;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -2051,12 +2105,14 @@
DEVELOPMENT_TEAM = CUJYAXXM6G;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = whatdid/Info.plist;
INFOPLIST_PREFIX_HEADER = "$(PROJECT_DIR)/buildscripts/infoplist-preprocess/compiled.h";
INFOPLIST_PREPROCESS = YES;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.2.1;
MARKETING_VERSION = 0.2.2;
PRODUCT_BUNDLE_IDENTIFIER = com.yuvalshavit.whatdid;
PRODUCT_NAME = Whatdid;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -2067,6 +2123,16 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
60D5F41D2C0286430017D139 /* Build configuration list for PBXAggregateTarget "infoplist-preprocess-generator" */ = {
isa = XCConfigurationList;
buildConfigurations = (
60D5F41E2C0286430017D139 /* Debug */,
60D5F41F2C0286430017D139 /* UI Test */,
60D5F4202C0286430017D139 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
7E6FF1AA252D71080071E58C /* Build configuration list for PBXNativeTarget "WhatdidLauncher" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down
4 changes: 2 additions & 2 deletions whatdid/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>FULL_BUILD_VERSION</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>
Expand All @@ -41,7 +41,7 @@
<key>SUEnableInstallerLauncherService</key>
<true/>
<key>SUFeedURL</key>
<string>https://whatdid.yuvalshavit.com/appcast/appcast.xml</string>
<string>SPARKLE_FEED_URL</string>
<key>SUPublicEDKey</key>
<string>+c3D0qE8WwVHoLX6rl2fTqniphIs/5s4UPW4D7w+KxQ=</string>
</dict>
Expand Down
Loading