fix(apple): set new project version on each build (#9072)

When developing the macOS app, we always build the exact same version
and build code for each build. ~~This _may_ be one reason why we
constantly have to deactivate the extension before the new one will
launch.~~ Edit: Just tested, and I can verify that this does fix the
issue on dev builds, so no more having to uninstall the sysex between
builds.

Even if that's not the reason, this is a cleaner approach than building
it in our prod-only scripts.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
This commit is contained in:
Jamil
2025-05-11 17:55:14 -07:00
committed by GitHub
parent 091b52ef07
commit 4e61ba9582
6 changed files with 24 additions and 7 deletions

View File

@@ -4,3 +4,4 @@ build/
DerivedData/
xcuserdata/
**/*.xcuserstate
Firezone/xcconfig/dynamic_build_number.xcconfig

View File

@@ -303,6 +303,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 8DCC024328D512AE007E12D2 /* Build configuration list for PBXNativeTarget "Firezone" */;
buildPhases = (
8D40C0B72DD1335C00ACF8D7 /* Generate build number */,
8DCC021528D512AC007E12D2 /* Sources */,
8D70FAE62D4971E900216473 /* SwiftLint */,
8DCC021628D512AC007E12D2 /* Frameworks */,
@@ -400,6 +401,25 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
8D40C0B72DD1335C00ACF8D7 /* Generate build number */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Generate build number";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Set the project (build) version to the current epoch so that it monotonically increases\nseconds_since_epoch=$(date +%s)\necho \"CURRENT_PROJECT_VERSION = $seconds_since_epoch\" > Firezone/xcconfig/dynamic_build_number.xcconfig\n";
};
8D70FAE62D4971E900216473 /* SwiftLint */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;

View File

@@ -6,4 +6,6 @@ APP_GROUP_ID_PRE_1_4_0[sdk=macosx*] = 47R2M6779T.group.dev.firezone.firezone
APP_GROUP_ID[sdk=iphoneos*] = group.dev.firezone.firezone
APP_GROUP_ID_PRE_1_4_0[sdk=iphoneos*] = group.dev.firezone.firezone
CODE_SIGN_STYLE = Automatic
CURRENT_PROJECT_VERSION = 0
// Include the dynamic build number created during the build phase
#include? "dynamic_build_number.xcconfig"