Skip to content

Commit 1c682d4

Browse files
committed
iOS: automate versioning
1 parent 86f6d39 commit 1c682d4

File tree

4 files changed

+51
-5
lines changed

4 files changed

+51
-5
lines changed

ios/Config.xcconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// Config.xcconfig
3+
// zeus
4+
//
5+
// Created by Satoshi on 11/1/24.
6+
// Copyright © 2024 Facebook. All rights reserved.
7+
//
8+
9+
// Configuration settings file format documentation can be found at:
10+
// https://help.apple.com/xcode/#/dev745c5c974
11+
12+
VERSION = 0.9.2
13+
BUILD_NUMBER = 20241101000000

ios/versioning.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
cd "$SRCROOT"
4+
5+
sed -i -e "/BUILD_NUMBER =/ s/= .*/= $(date +"%Y%m%d%H%M")/" Config.xcconfig
6+
7+
rm Config.xcconfig-e

ios/zeus.xcodeproj/project.pbxproj

+21-5
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@
8585
74B637832A5A350B00750202 /* StreamingCallback.mm in Sources */ = {isa = PBXBuildFile; fileRef = 74B6377A2A5A350A00750202 /* StreamingCallback.mm */; };
8686
74B637842A5A350B00750202 /* Callback.mm in Sources */ = {isa = PBXBuildFile; fileRef = 74B6377C2A5A350A00750202 /* Callback.mm */; };
8787
74B637872A5A35B600750202 /* Lndmobile.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 74B637862A5A35B600750202 /* Lndmobile.xcframework */; };
88+
74BFA2652CD5C658006BCE4B /* Config.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 74BFA2642CD5C658006BCE4B /* Config.xcconfig */; };
89+
74BFA2662CD5C658006BCE4B /* Config.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 74BFA2642CD5C658006BCE4B /* Config.xcconfig */; };
8890
74DE85FF2BB530E5001FEC15 /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 74A116702A55DEE600F7078C /* libresolv.tbd */; };
8991
74F9D7F22AF33324007D44BF /* ppneuemontreal-medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = 74F9D7EF2AF33324007D44BF /* ppneuemontreal-medium.otf */; };
9092
7598B75F1F64426CAF420155 /* UnifiedSvg.tsx in Resources */ = {isa = PBXBuildFile; fileRef = C7FBAA85E56C4D5D92F74F11 /* UnifiedSvg.tsx */; };
@@ -425,6 +427,7 @@
425427
74B6377E2A5A350A00750202 /* Callback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Callback.h; sourceTree = "<group>"; };
426428
74B6377F2A5A350A00750202 /* LncModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LncModule.h; sourceTree = "<group>"; };
427429
74B637862A5A35B600750202 /* Lndmobile.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Lndmobile.xcframework; path = LncMobile/Lndmobile.xcframework; sourceTree = "<group>"; };
430+
74BFA2642CD5C658006BCE4B /* Config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; };
428431
74DE86022BB530E5001FEC15 /* libresolv.9.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.9.tbd; path = usr/lib/libresolv.9.tbd; sourceTree = SDKROOT; };
429432
74F9D7EF2AF33324007D44BF /* ppneuemontreal-medium.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "ppneuemontreal-medium.otf"; path = "../assets/fonts/ppneuemontreal-medium.otf"; sourceTree = "<group>"; };
430433
77EC666A91C04742A050DEF4 /* Help Icon.svg */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Help Icon.svg"; path = "../assets/images/SVG/Help Icon.svg"; sourceTree = "<group>"; };
@@ -747,6 +750,7 @@
747750
83CBB9F61A601CBA00E9B192 = {
748751
isa = PBXGroup;
749752
children = (
753+
74BFA2642CD5C658006BCE4B /* Config.xcconfig */,
750754
13B07FAE1A68108700A75B9A /* zeus */,
751755
832341AE1AAA6A7D00B99B32 /* Libraries */,
752756
00E356EF1AD99517003FC87E /* zeusTests */,
@@ -1312,6 +1316,7 @@
13121316
97D6EBB726C487DC002ADC8C /* ioslauncher.png in Resources */,
13131317
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
13141318
74F9D7F22AF33324007D44BF /* ppneuemontreal-medium.otf in Resources */,
1319+
74BFA2662CD5C658006BCE4B /* Config.xcconfig in Resources */,
13151320
2F59AB02206B4761AB921130 /* Mempool.svg in Resources */,
13161321
5ECDD76F848B4802B0B5D3C1 /* Loading.gif in Resources */,
13171322
D939E2C93F2B4F279F9923FD /* 1.png in Resources */,
@@ -1422,6 +1427,7 @@
14221427
isa = PBXResourcesBuildPhase;
14231428
buildActionMask = 2147483647;
14241429
files = (
1430+
74BFA2652CD5C658006BCE4B /* Config.xcconfig in Resources */,
14251431
C26BE00A80C59796641EC9CD /* PrivacyInfo.xcprivacy in Resources */,
14261432
);
14271433
runOnlyForDeploymentPostprocessing = 0;
@@ -1818,11 +1824,12 @@
18181824
buildSettings = {
18191825
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
18201826
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1827+
BUILD_NUMBER = "${BUILD_NUMBER}";
18211828
CLANG_ENABLE_MODULES = YES;
18221829
CODE_SIGN_ENTITLEMENTS = zeus/zeus.entitlements;
18231830
CODE_SIGN_IDENTITY = "Apple Development";
18241831
CODE_SIGN_STYLE = Automatic;
1825-
CURRENT_PROJECT_VERSION = 4;
1832+
CURRENT_PROJECT_VERSION = "${BUILD_NUMBER}";
18261833
DEAD_CODE_STRIPPING = YES;
18271834
DEVELOPMENT_TEAM = 9TU7M3555F;
18281835
ENABLE_BITCODE = NO;
@@ -1837,7 +1844,7 @@
18371844
"$(inherited)",
18381845
"@executable_path/Frameworks",
18391846
);
1840-
MARKETING_VERSION = 0.9.2;
1847+
MARKETING_VERSION = "${VERSION}";
18411848
ONLY_ACTIVE_ARCH = YES;
18421849
OTHER_LDFLAGS = (
18431850
"-ObjC",
@@ -1854,21 +1861,23 @@
18541861
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
18551862
SWIFT_VERSION = 5.0;
18561863
TARGETED_DEVICE_FAMILY = "1,2";
1864+
VERSION = "${VERSION}";
18571865
VERSIONING_SYSTEM = "apple-generic";
18581866
};
18591867
name = Debug;
18601868
};
18611869
13B07F951A680F5B00A75B9A /* Release */ = {
18621870
isa = XCBuildConfiguration;
1863-
baseConfigurationReference = 04FCBC4A7845073E39FACA73 /* Pods-zeus.release.xcconfig */;
1871+
baseConfigurationReference = 0DB55EB3FF0F9245280FEA6C /* Pods-zeus-zeusTests.release.xcconfig */;
18641872
buildSettings = {
18651873
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
18661874
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1875+
BUILD_NUMBER = "${BUILD_NUMBER}";
18671876
CLANG_ENABLE_MODULES = YES;
18681877
CODE_SIGN_ENTITLEMENTS = zeus/zeusRelease.entitlements;
18691878
CODE_SIGN_IDENTITY = "Apple Development";
18701879
CODE_SIGN_STYLE = Automatic;
1871-
CURRENT_PROJECT_VERSION = 4;
1880+
CURRENT_PROJECT_VERSION = "${BUILD_NUMBER}";
18721881
DEAD_CODE_STRIPPING = YES;
18731882
DEVELOPMENT_TEAM = 9TU7M3555F;
18741883
ENABLE_BITCODE = NO;
@@ -1882,7 +1891,7 @@
18821891
"$(inherited)",
18831892
"@executable_path/Frameworks",
18841893
);
1885-
MARKETING_VERSION = 0.9.2;
1894+
MARKETING_VERSION = "${VERSION}";
18861895
ONLY_ACTIVE_ARCH = NO;
18871896
OTHER_LDFLAGS = (
18881897
"$(inherited)",
@@ -1903,6 +1912,7 @@
19031912
SWIFT_OBJC_BRIDGING_HEADER = "LndMobile/zeus-Bridging-Header.h";
19041913
SWIFT_VERSION = 5.0;
19051914
TARGETED_DEVICE_FAMILY = "1,2";
1915+
VERSION = "${VERSION}";
19061916
VERSIONING_SYSTEM = "apple-generic";
19071917
};
19081918
name = Release;
@@ -2042,6 +2052,7 @@
20422052
};
20432053
83CBBA201A601CBA00E9B192 /* Debug */ = {
20442054
isa = XCBuildConfiguration;
2055+
baseConfigurationReference = 74BFA2642CD5C658006BCE4B /* Config.xcconfig */;
20452056
buildSettings = {
20462057
ALWAYS_SEARCH_USER_PATHS = NO;
20472058
CC = "";
@@ -2071,6 +2082,7 @@
20712082
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
20722083
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
20732084
COPY_PHASE_STRIP = NO;
2085+
CURRENT_PROJECT_VERSION = "${BUILD_NUMBER}";
20742086
CXX = "";
20752087
ENABLE_STRICT_OBJC_MSGSEND = YES;
20762088
ENABLE_TESTABILITY = YES;
@@ -2094,6 +2106,7 @@
20942106
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
20952107
LD = "";
20962108
LDPLUSPLUS = "";
2109+
MARKETING_VERSION = "${VERSION}";
20972110
MTL_ENABLE_DEBUG_INFO = YES;
20982111
ONLY_ACTIVE_ARCH = YES;
20992112
OTHER_CFLAGS = "$(inherited)";
@@ -2107,6 +2120,7 @@
21072120
};
21082121
83CBBA211A601CBA00E9B192 /* Release */ = {
21092122
isa = XCBuildConfiguration;
2123+
baseConfigurationReference = 74BFA2642CD5C658006BCE4B /* Config.xcconfig */;
21102124
buildSettings = {
21112125
ALWAYS_SEARCH_USER_PATHS = NO;
21122126
CC = "";
@@ -2136,6 +2150,7 @@
21362150
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
21372151
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
21382152
COPY_PHASE_STRIP = YES;
2153+
CURRENT_PROJECT_VERSION = "${BUILD_NUMBER}";
21392154
CXX = "";
21402155
ENABLE_NS_ASSERTIONS = NO;
21412156
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -2155,6 +2170,7 @@
21552170
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
21562171
LD = "";
21572172
LDPLUSPLUS = "";
2173+
MARKETING_VERSION = "${VERSION}";
21582174
MTL_ENABLE_DEBUG_INFO = NO;
21592175
OTHER_CFLAGS = "$(inherited)";
21602176
OTHER_CPLUSPLUSFLAGS = "$(inherited)";

ios/zeus.xcodeproj/xcshareddata/xcschemes/zeus.xcscheme

+10
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,15 @@
107107
<ArchiveAction
108108
buildConfiguration = "Release"
109109
revealArchiveInOrganizer = "YES">
110+
<PreActions>
111+
<ExecutionAction
112+
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
113+
<ActionContent
114+
title = "Run Script"
115+
scriptText = "# Type a script or drag a script file from your workspace to insert its path.&#10;source $SRCROOT/versioning.sh&#10;"
116+
shellToInvoke = "/bin/sh">
117+
</ActionContent>
118+
</ExecutionAction>
119+
</PreActions>
110120
</ArchiveAction>
111121
</Scheme>

0 commit comments

Comments
 (0)