diff --git a/.ado/templates/android-build-office.yml b/.ado/templates/android-build-office.yml index 543d73c1ec6243..93463ef1bfca2f 100644 --- a/.ado/templates/android-build-office.yml +++ b/.ado/templates/android-build-office.yml @@ -43,12 +43,12 @@ steps: # ReactCommon/cxxreact/ReactNativeVersion.h # Libraries/Core/ReactNativeVersion.js # - # --nightly => version = `0.0.0-${currentCommit.slice(0, 9)}`; + # --nightly --autogenerateVersionNumber => version = `0.0.0-${currentCommit.slice(0, 9)}`; # When on main branch or non-stable branch. - task: CmdLine@2 displayName: Bump canary package version inputs: - script: node scripts/bump-oss-version.js --nightly + script: node scripts/bump-oss-version.js --nightly --autogenerateVersionNumber condition: or(eq(variables['Build.SourceBranchName'], 'main'), not(contains(variables['Build.SourceBranchName'], '-stable'))) # TODO: We don't seem to be running bump-oss-version.js for stable branches, hence we would end up publishing using the values in the repository. diff --git a/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp b/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp index 2b0f26ba8d8f8d..0be63fb8f4290b 100644 --- a/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +++ b/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp @@ -12,7 +12,7 @@ CatalystInstanceImpl::handleMemoryPressure), makeNativeMethod( "getRuntimeExecutor", CatalystInstanceImpl::getRuntimeExecutor), -+ makeNativeMethod("getPointerOfInstancePointer", CatalystInstanceImpl::getPointerOfInstancePointer) ++ makeNativeMethod("getPointerOfInstancePointer", CatalystInstanceImpl::getPointerOfInstancePointer), makeNativeMethod( "warnOnLegacyNativeModuleSystemUse", CatalystInstanceImpl::warnOnLegacyNativeModuleSystemUse), diff --git a/scripts/bump-oss-version.js b/scripts/bump-oss-version.js index 55ec034c8d5863..854b45cb83a8a5 100755 --- a/scripts/bump-oss-version.js +++ b/scripts/bump-oss-version.js @@ -36,6 +36,11 @@ type: 'boolean', default: false, }) + .option('a', { // TODO(macOS GH#774): See note below + alias: 'autogenerate-version-number', + type: 'boolean', + default: false, + }) .option('v', { alias: 'to-version', type: 'string', @@ -46,14 +51,23 @@ default: false, }).argv; + const autogenerateVersionNumber = argv.autogenerateVersionNumber; const nightlyBuild = argv.nightly; - const version = argv.toVersion; + let version = argv.toVersion; if (!version) { - echo( - 'You must specify a version using -v', - ); - exit(1); + // TODO(macOS GH#774): Some of our calls to bump-oss-version.js still depend on an automatically generated version number + if (nightlyBuild && autogenerateVersionNumber) { + const currentCommit = exec('git rev-parse HEAD', { + silent: true, + }).stdout.trim(); + version = `0.0.0-${currentCommit.slice(0, 9)}`; + } else { + echo( + 'You must specify a version using -v', + ); + exit(1); + } } let branch;