stovmascript / react-native-version

:1234: Version your React Native or Expo app in a `npm version` fashion.
MIT License
576 stars 75 forks source link

Add support for ios MARKETING_VERSION build setting #186

Open archansel opened 4 years ago

archansel commented 4 years ago

Since XCode 11, CFBundleShortVersionString is managed using $(MARKETING_VERSION) from build setting, not a static value anymore

In react-native-version:4.0.0 it replace the value using static one

before
    <key>CFBundleShortVersionString</key>
    <string>$(MARKETING_VERSION)</string>
after
    <key>CFBundleShortVersionString</key>
    <string>0.1.0</string>

It will be better if it can handle build setting and change it accordingly in build setting file MyApp.xcodeproj > project.pbxproj both in debug and release

            buildSettings = {
                ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
                CURRENT_PROJECT_VERSION = 1;
                DEAD_CODE_STRIPPING = NO;
                INFOPLIST_FILE = BSQMobile/Info.plist;
                IPHONEOS_DEPLOYMENT_TARGET = 10.0;
                LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
                MARKETING_VERSION = 1.0.0; // CHANGE THIS INSTEAD
                OTHER_LDFLAGS = (
                    "$(inherited)",
                    "-ObjC",
                    "-lc++",
                );
                PRODUCT_BUNDLE_IDENTIFIER = binus.itdivision.mobilebsq;
                PRODUCT_NAME = BSQMobile;
                VERSIONING_SYSTEM = "apple-generic";
            };
archansel commented 4 years ago

Turns out that it use CURRENT_PROJECT_VERSION for build version too

Maybe you could use this approach https://stackoverflow.com/questions/58585239/how-to-change-build-setting-versioning-in-xcode-11-using-script

macdonaldr93 commented 2 years ago

+1 I had the same issue. Is there a PR or a fork to allow this?

ChaossAdept7 commented 2 years ago

+1 here, also having the same

coldSeattle commented 1 year ago

+1 here, also having the same

charneykaye commented 11 months ago

+1

krmao commented 10 months ago

+1

MARKETING_VERSION not change after npx react-native-version --never-amend --skip-tag --set-build 22

xcode version: Version 15.0.1 (15A507) "react-native-version": "^4.0.0", "react-native": "0.72.4",

macos : 14.0 (23A344)

zedtux commented 1 week ago

Actually this package should only update the project.pbxproj file for iOS and never touch the Info.plist file anymore.