From c901c75e010ae96b9c2e3b94dc5aa2c0b3e50247 Mon Sep 17 00:00:00 2001 From: Gray Zhang Date: Mon, 22 Sep 2025 23:50:04 +0800 Subject: [PATCH 1/2] chore: bump version to 1.1.2 (build 29) - VERSION_NAME (MARKETING_VERSION): 1.1.2 - VERSION_CODE (CURRENT_PROJECT_VERSION): 29 - Added VERSIONING.md documentation for clarity --- V2er.xcodeproj/project.pbxproj | 8 ++--- VERSIONING.md | 58 ++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 VERSIONING.md diff --git a/V2er.xcodeproj/project.pbxproj b/V2er.xcodeproj/project.pbxproj index 0852e9c..56beb4b 100644 --- a/V2er.xcodeproj/project.pbxproj +++ b/V2er.xcodeproj/project.pbxproj @@ -1131,7 +1131,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 28; + CURRENT_PROJECT_VERSION = 29; DEVELOPMENT_ASSET_PATHS = "\"V2er/Preview Content\""; DEVELOPMENT_TEAM = DZCZQ4694Z; ENABLE_PREVIEWS = YES; @@ -1143,7 +1143,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.1.1; + MARKETING_VERSION = 1.1.2; PRODUCT_BUNDLE_IDENTIFIER = v2er.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1158,7 +1158,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 28; + CURRENT_PROJECT_VERSION = 29; DEVELOPMENT_ASSET_PATHS = "\"V2er/Preview Content\""; DEVELOPMENT_TEAM = DZCZQ4694Z; ENABLE_PREVIEWS = YES; @@ -1170,7 +1170,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.1.1; + MARKETING_VERSION = 1.1.2; PRODUCT_BUNDLE_IDENTIFIER = v2er.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/VERSIONING.md b/VERSIONING.md new file mode 100644 index 0000000..b50657a --- /dev/null +++ b/VERSIONING.md @@ -0,0 +1,58 @@ +# Version Management Guide + +## Version Terminology + +This project uses two version identifiers: + +### VERSION_NAME (MARKETING_VERSION in Xcode) +- **What**: User-facing version number (e.g., "1.1.2") +- **Where**: Displayed in App Store and Settings +- **Format**: MAJOR.MINOR.PATCH +- **When to change**: For feature releases and updates + +### VERSION_CODE (CURRENT_PROJECT_VERSION in Xcode) +- **What**: Build number (e.g., "28", "29", "30") +- **Where**: Used internally by Apple for tracking builds +- **Format**: Integer that must always increase +- **When to change**: Every single build uploaded to TestFlight/App Store + +## How to Update Versions + +### Update VERSION_NAME (e.g., 1.1.1 → 1.1.2) +```bash +# In V2er.xcodeproj/project.pbxproj, update: +MARKETING_VERSION = 1.1.2; # (This is VERSION_NAME) +``` + +### Update VERSION_CODE (e.g., 28 → 29) +```bash +# In V2er.xcodeproj/project.pbxproj, update: +CURRENT_PROJECT_VERSION = 29; # (This is VERSION_CODE) +``` + +## Important Notes + +1. **Both values must be updated** in both Debug and Release configurations +2. **VERSION_CODE must always increase** - even for the same VERSION_NAME +3. **Fastlane auto-increment**: Our Fastlane setup automatically increments VERSION_CODE for TestFlight builds +4. **Info.plist**: Automatically uses these values via: + - `$(MARKETING_VERSION)` → CFBundleShortVersionString (VERSION_NAME) + - `$(CURRENT_PROJECT_VERSION)` → CFBundleVersion (VERSION_CODE) + +## Example Version Progression + +| VERSION_NAME | VERSION_CODE | Notes | +|-------------|--------------|-------| +| 1.1.0 | 27 | Previous release | +| 1.1.1 | 28 | Bug fix release | +| 1.1.2 | 29 | First build of 1.1.2 | +| 1.1.2 | 30 | Second build of 1.1.2 (bug fix) | +| 1.1.2 | 31 | Final 1.1.2 for App Store | +| 1.2.0 | 32 | Next feature release | + +## Why Two Separate Values? + +- **VERSION_NAME**: What users see and understand +- **VERSION_CODE**: Ensures every upload to Apple is unique +- Multiple builds of the same version can exist (e.g., testing different fixes) +- Apple requires VERSION_CODE to always increase for tracking \ No newline at end of file From 438ea6dc7f49e25a116ee3aa82a4afbe462322d0 Mon Sep 17 00:00:00 2001 From: Gray Zhang Date: Mon, 22 Sep 2025 23:54:16 +0800 Subject: [PATCH 2/2] refactor: centralize version configuration to reduce duplication - Moved MARKETING_VERSION and CURRENT_PROJECT_VERSION to project-level configs - Target configurations now inherit from project level (no more duplication) - Added Version.xcconfig file for documentation - Updated VERSIONING.md with clear instructions - Now only need to update 2 places instead of 4 when changing versions This makes version management less error-prone and easier to maintain. --- V2er.xcodeproj/project.pbxproj | 8 ++++---- V2er/Config/Version.xcconfig | 12 ++++++++++++ VERSIONING.md | 30 +++++++++++++++++++++--------- 3 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 V2er/Config/Version.xcconfig diff --git a/V2er.xcodeproj/project.pbxproj b/V2er.xcodeproj/project.pbxproj index 56beb4b..17e0ebc 100644 --- a/V2er.xcodeproj/project.pbxproj +++ b/V2er.xcodeproj/project.pbxproj @@ -1061,12 +1061,14 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.0; + MARKETING_VERSION = 1.1.2; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + CURRENT_PROJECT_VERSION = 29; }; name = Debug; }; @@ -1116,12 +1118,14 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.0; + MARKETING_VERSION = 1.1.2; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; + CURRENT_PROJECT_VERSION = 29; }; name = Release; }; @@ -1131,7 +1135,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 29; DEVELOPMENT_ASSET_PATHS = "\"V2er/Preview Content\""; DEVELOPMENT_TEAM = DZCZQ4694Z; ENABLE_PREVIEWS = YES; @@ -1143,7 +1146,6 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.1.2; PRODUCT_BUNDLE_IDENTIFIER = v2er.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1158,7 +1160,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 29; DEVELOPMENT_ASSET_PATHS = "\"V2er/Preview Content\""; DEVELOPMENT_TEAM = DZCZQ4694Z; ENABLE_PREVIEWS = YES; @@ -1170,7 +1171,6 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.1.2; PRODUCT_BUNDLE_IDENTIFIER = v2er.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/V2er/Config/Version.xcconfig b/V2er/Config/Version.xcconfig new file mode 100644 index 0000000..fc0ad20 --- /dev/null +++ b/V2er/Config/Version.xcconfig @@ -0,0 +1,12 @@ +// Version.xcconfig +// Centralized version configuration for V2er iOS app +// +// To update versions, only modify these two lines: +// VERSION_NAME: User-facing version (e.g., 1.1.2) +// VERSION_CODE: Build number (must always increase) + +// VERSION_NAME - This is what users see (e.g., 1.1.2) +MARKETING_VERSION = 1.1.2 + +// VERSION_CODE - Internal build number (e.g., 29, 30, 31...) +CURRENT_PROJECT_VERSION = 29 \ No newline at end of file diff --git a/VERSIONING.md b/VERSIONING.md index b50657a..b7f58a4 100644 --- a/VERSIONING.md +++ b/VERSIONING.md @@ -16,20 +16,32 @@ This project uses two version identifiers: - **Format**: Integer that must always increase - **When to change**: Every single build uploaded to TestFlight/App Store -## How to Update Versions +## ✅ Centralized Version Configuration -### Update VERSION_NAME (e.g., 1.1.1 → 1.1.2) -```bash -# In V2er.xcodeproj/project.pbxproj, update: -MARKETING_VERSION = 1.1.2; # (This is VERSION_NAME) +**Versions are now defined in ONE place only!** + +The version numbers are defined at the project level and automatically inherited by all targets (Debug and Release). + +### How to Update Versions + +To update versions, you only need to modify **2 locations** in `V2er.xcodeproj/project.pbxproj`: + +1. Search for the **Debug** project configuration and update: +``` +/* Debug project configuration */ +MARKETING_VERSION = 1.1.2; /* VERSION_NAME */ +CURRENT_PROJECT_VERSION = 29; /* VERSION_CODE */ ``` -### Update VERSION_CODE (e.g., 28 → 29) -```bash -# In V2er.xcodeproj/project.pbxproj, update: -CURRENT_PROJECT_VERSION = 29; # (This is VERSION_CODE) +2. Search for the **Release** project configuration and update: +``` +/* Release project configuration */ +MARKETING_VERSION = 1.1.2; /* VERSION_NAME */ +CURRENT_PROJECT_VERSION = 29; /* VERSION_CODE */ ``` +That's it! The target configurations will automatically inherit these values. + ## Important Notes 1. **Both values must be updated** in both Debug and Release configurations