Skip to content

Version code support#24

Open
revopushbot wants to merge 7 commits intomainfrom
version_code
Open

Version code support#24
revopushbot wants to merge 7 commits intomainfrom
version_code

Conversation

@revopushbot
Copy link
Copy Markdown
Contributor

Summary

Extends the release-react command to detect and pass the native build number alongside appVersion. Previously only the semantic version was
auto-detected and forwarded to the server; the build number (iOS CFBundleVersion / Android versionCode) was ignored.

Changes

getReactNativeProjectVersionInfo (renamed from getReactNativeProjectAppVersion)

  • Returns ProjectVersionInfo { appVersion?: string; buildNumber?: string } instead of a plain version string
  • Made pure — no longer reads command.appStoreVersion internally; CLI overrides are applied at the call site
  • iOS (plist path): reads both CFBundleShortVersionString and CFBundleVersion
  • iOS (Xcode project path): reads both MARKETING_VERSION and CURRENT_PROJECT_VERSION
  • Android: reads both versionName and versionCode from build.gradle, including resolution of Gradle property references (e.g. project.VERSION_NAME,
    project.VERSION_CODE) from gradle.properties

Android property resolution refactor

  • Unified two separate property-lookup loops into one: previously the isValidVersion branch had its own inner loop for versionCode while the
    property-reference branch had a separate loop — both are now handled in a single pass
  • Fixed a bug where the loop broke as soon as appVersion was found, potentially missing versionCode if it resided in a different properties file — the
    loop now continues until both are resolved
  • versionCode = 0 is handled correctly (!== null check instead of truthiness)
  • Extracted parsePropertiesFile helper to eliminate repeated file-read/parse/error-handle pattern

Call sites (both releaseReact variants)

  • Detection is skipped only when both --targetBinaryVersion and --buildNumber are provided; if only one is given, detection still runs and the CLI value
    overrides the detected one
  • Logs now show "Detected … from " for the raw file values, then "Using …" after CLI overrides are applied, so the effective values are always
    visible

throwForInvalidSemverRange

  • Parameter type widened from string to string | undefined; throws a clear message when appVersion could not be determined, directing the user to
    --targetBinaryVersion

@revopushbot revopushbot requested a review from kit2o April 11, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant