Skip to content

Commit 3b59e7a

Browse files
Merge pull request #967 from lukepistrol/chore/xcode-configurations
[chore]: Xcode Configurations
2 parents 9826487 + 7b07257 commit 3b59e7a

10 files changed

Lines changed: 484 additions & 9 deletions

File tree

.github/workflows/pre-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Build CodeEdit
4949
env:
5050
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
51-
run: xcodebuild -scheme CodeEdit -configuration Release -derivedDataPath "$RUNNER_TEMP/DerivedData" -archivePath "$RUNNER_TEMP/CodeEdit.xcarchive" -skipPackagePluginValidation DEVELOPMENT_TEAM=$APPLE_TEAM_ID archive
51+
run: xcodebuild -scheme CodeEdit -configuration Alpha -derivedDataPath "$RUNNER_TEMP/DerivedData" -archivePath "$RUNNER_TEMP/CodeEdit.xcarchive" -skipPackagePluginValidation DEVELOPMENT_TEAM=$APPLE_TEAM_ID archive
5252

5353
############################
5454
# Sign

CodeEdit.xcodeproj/project.pbxproj

Lines changed: 408 additions & 2 deletions
Large diffs are not rendered by default.

CodeEdit/Features/About/Views/AboutView.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ public struct AboutView: View {
2020
Bundle.buildString ?? "No Build"
2121
}
2222

23+
private var appVersionPostfix: String {
24+
Bundle.versionPostfix ?? ""
25+
}
26+
2327
public var body: some View {
2428
HStack(spacing: 0) {
2529
logo
@@ -45,7 +49,7 @@ public struct AboutView: View {
4549
private var topMetaData: some View {
4650
VStack(alignment: .leading, spacing: 5) {
4751
Text("CodeEdit").font(.system(size: 38, weight: .regular))
48-
Text("Version \(appVersion) (\(appBuild))")
52+
Text("Version \(appVersion)\(appVersionPostfix) (\(appBuild))")
4953
.textSelection(.enabled)
5054
.foregroundColor(.secondary)
5155
.font(.system(size: 13, weight: .light))
@@ -54,7 +58,9 @@ public struct AboutView: View {
5458

5559
private var bottomMetaData: some View {
5660
VStack(alignment: .leading, spacing: 5) {
57-
Text("Copyright © 2022 CodeEdit")
61+
if let copyright = Bundle.copyrightString {
62+
Text(copyright)
63+
}
5864
Text("MIT License")
5965
}
6066
.foregroundColor(.secondary)

CodeEdit/Features/Welcome/Views/WelcomeView.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ struct WelcomeView: View {
5656
Bundle.buildString ?? ""
5757
}
5858

59+
private var appVersionPostfix: String {
60+
Bundle.versionPostfix ?? ""
61+
}
62+
5963
/// Get the macOS version & build
6064
private var macOSVersion: String {
6165
let url = URL(fileURLWithPath: "/System/Library/CoreServices/SystemVersion.plist")
@@ -87,7 +91,7 @@ struct WelcomeView: View {
8791

8892
/// Get program and operating system information
8993
private func copyInformation() {
90-
var copyString = "CodeEdit: \(appVersion) (\(appBuild))\n"
94+
var copyString = "CodeEdit: \(appVersion)\(appVersionPostfix) (\(appBuild))\n"
9195

9296
copyString.append("macOS: \(macOSVersion)\n")
9397

@@ -111,8 +115,9 @@ struct WelcomeView: View {
111115
.font(.system(size: 38))
112116
Text(
113117
String(
114-
format: NSLocalizedString("Version %@ (%@)", comment: ""),
118+
format: NSLocalizedString("Version %@%@ (%@)", comment: ""),
115119
appVersion,
120+
appVersionPostfix,
116121
appBuild
117122
)
118123
)

CodeEdit/Info.plist

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>CE_VERSION_POSTFIX</key>
6+
<string>${CE_VERSION_POSTFIX}</string>
57
<key>CFBundleDocumentTypes</key>
68
<array>
79
<dict>
@@ -1264,7 +1266,7 @@
12641266
<string>https://github.com/CodeEditApp/CodeEdit/releases/download/latest/appcast.xml</string>
12651267
<key>SUPublicEDKey</key>
12661268
<string>/vAnxnK9wj4IqnUt6wS9EN3Ug69zHb+S/Pb9CyZuwa0=</string>
1267-
<key>CFBundleShortVersionString</key>
1268-
<string>0.0.1</string>
1269+
<key>CFBundleShortVersionString</key>
1270+
<string>0.0.1</string>
12691271
</dict>
12701272
</plist>

CodeEdit/Utils/Extensions/Bundle/Bundle+Info.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import Foundation
99

1010
extension Bundle {
1111

12+
static var copyrightString: String? {
13+
Bundle.main.object(forInfoDictionaryKey: "NSHumanReadableCopyright") as? String
14+
}
15+
1216
/// Returns the main bundle's version string if available (e.g. 1.0.0)
1317
static var versionString: String? {
1418
Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String
@@ -18,4 +22,8 @@ extension Bundle {
1822
static var buildString: String? {
1923
Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String
2024
}
25+
26+
static var versionPostfix: String? {
27+
Bundle.main.object(forInfoDictionaryKey: "CE_VERSION_POSTFIX") as? String
28+
}
2129
}

Configs/Alpha.xcconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// Alpha.xcconfig
3+
// CodeEdit
4+
//
5+
// Created by Lukas Pistrol on 14.01.23.
6+
//
7+
8+
// Configuration settings file format documentation can be found at:
9+
// https://help.apple.com/xcode/#/dev745c5c974
10+
11+
CE_APPICON_NAME = AppIconAlpha
12+
CE_VERSION_POSTFIX = -alpha

Configs/Beta.xcconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// Beta.xcconfig
3+
// CodeEdit
4+
//
5+
// Created by Lukas Pistrol on 14.01.23.
6+
//
7+
8+
// Configuration settings file format documentation can be found at:
9+
// https://help.apple.com/xcode/#/dev745c5c974
10+
11+
CE_APPICON_NAME = AppIconBeta
12+
CE_VERSION_POSTFIX = -beta

Configs/Debug.xcconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// Debug.xcconfig
3+
// CodeEdit
4+
//
5+
// Created by Lukas Pistrol on 14.01.23.
6+
//
7+
8+
// Configuration settings file format documentation can be found at:
9+
// https://help.apple.com/xcode/#/dev745c5c974
10+
11+
CE_APPICON_NAME = AppIconDev
12+
CE_VERSION_POSTFIX = -dev

Configs/Release.xcconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// Release.xcconfig
3+
// CodeEdit
4+
//
5+
// Created by Lukas Pistrol on 14.01.23.
6+
//
7+
8+
// Configuration settings file format documentation can be found at:
9+
// https://help.apple.com/xcode/#/dev745c5c974
10+
11+
CE_APPICON_NAME = AppIcon
12+
// CE_VERSION_POSTFIX = // this is a placeholder since we don't want a postfix in final release

0 commit comments

Comments
 (0)