- 
                Notifications
    You must be signed in to change notification settings 
- Fork 48
refactor: centralize version configuration #37
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -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 | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,70 @@ | ||||||||||||||||||||||||||||||||||||||||
| # 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 | ||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||
| ## ✅ Centralized Version Configuration | ||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||
| **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 */ | ||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||
| 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. | ||||||||||||||||||||||||||||||||||||||||
| 
      Comment on lines
    
      +27
     to 
      +43
    
   
     | ||||||||||||||||||||||||||||||||||||||||
| 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 */ | |
| ``` | |
| 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. | |
| To update versions, simply edit the values in the `Version.xcconfig` file at the root of the project: | |
MARKETING_VERSION = 1.1.2      // VERSION_NAME
CURRENT_PROJECT_VERSION = 29   // VERSION_CODE
All targets (Debug and Release) will automatically inherit these values from the xcconfig file. You do **not** need to update any values in `project.pbxproj`.
> **Note:** If you previously updated version numbers in `project.pbxproj`, you can now manage them exclusively in `Version.xcconfig` for consistency and simplicity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Version.xcconfig file defines version values but isn't being used in the project configuration. The project.pbxproj file contains hardcoded version values instead of referencing this configuration file. Either remove this file or update the project to actually use it by including it in the build configurations.