diff --git a/ReactCommon/cxxreact/ReactNativeVersion.h b/ReactCommon/cxxreact/ReactNativeVersion.h new file mode 100644 index 00000000000000..d6cbbcd82a9c6d --- /dev/null +++ b/ReactCommon/cxxreact/ReactNativeVersion.h @@ -0,0 +1,24 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by scripts/bump-oss-version.js + */ + +#pragma once + +#include +#include + +namespace facebook::react { + +constexpr struct { + int32_t Major = 0; + int32_t Minor = 0; + int32_t Patch = 0; + std::string_view Prerelease = ""; +} ReactNativeVersion; + +} // namespace facebook::react diff --git a/scripts/bump-oss-version.js b/scripts/bump-oss-version.js index e6a394b05266dc..cf924e49ffe2f9 100755 --- a/scripts/bump-oss-version.js +++ b/scripts/bump-oss-version.js @@ -84,6 +84,19 @@ fs.writeFileSync( 'utf-8', ); +fs.writeFileSync( + 'ReactCommon/cxxreact/ReactNativeVersion.h', + cat('scripts/versiontemplates/ReactNativeVersion.h.template') + .replace('${major}', major) + .replace('${minor}', minor) + .replace('${patch}', patch) + .replace( + '${prerelease}', + prerelease !== undefined ? `"${prerelease}"` : '""', + ), + 'utf-8', +); + fs.writeFileSync( 'Libraries/Core/ReactNativeVersion.js', cat('scripts/versiontemplates/ReactNativeVersion.js.template') diff --git a/scripts/versiontemplates/ReactNativeVersion.h.template b/scripts/versiontemplates/ReactNativeVersion.h.template new file mode 100644 index 00000000000000..ed9d242c72a43d --- /dev/null +++ b/scripts/versiontemplates/ReactNativeVersion.h.template @@ -0,0 +1,24 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by scripts/bump-oss-version.js + */ + +#pragma once + +#include +#include + +namespace facebook::react { + +constexpr struct { + int32_t Major = ${major}; + int32_t Minor = ${minor}; + int32_t Patch = ${patch}; + std::string_view Prerelease = ${prerelease}; +} ReactNativeVersion; + +} // namespace facebook::react