Skip to content

Commit 48f3137

Browse files
authored
Update versioning scheme to reflect targeted/tested RNW version (#134)
* Update versioning scheme * Just testing things now * Trying something else * Is this correct? * How about this? * This is not a good experience * Will this work any better? * bleh * oops * Such sadness * This is getting pretty absurd * Trying something out * When at first you don't succeed * Trailing .0 gets removed from package version. Starting at 1
1 parent b0f1634 commit 48f3137

4 files changed

Lines changed: 30 additions & 7 deletions

File tree

azure-pipelines.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ trigger:
1010
pool:
1111
vmImage: 'windows-2019'
1212

13+
# NOTE: The major/minor versions correspond to the React Native version we target/have tested against
14+
variables:
15+
product_major_version: 0
16+
product_minor_version: 63
17+
product_build: $[format('{0:yyyyMMdd}', pipeline.startTime)]
18+
product_build_qfe: $[counter(format('{0}.{1}.{2}', variables['product_major_version'], variables['product_minor_version'], variables['product_build']), 1)]
19+
20+
# NOTE: The first two digits are the targeted React Native version
21+
name: $(product_major_version).$(product_minor_version).$(product_build).$(product_build_qfe)
22+
1323
jobs:
1424
- job: Build
1525
steps:
@@ -29,6 +39,7 @@ jobs:
2939
vsVersion: 'latest'
3040
platform: 'x64'
3141
configuration: 'Release'
42+
msbuildArgs: '-p:RnWinRTMajorVersion=$(product_major_version);RnWinRTMinorVersion=$(product_minor_version);RnWinRTBuild=$(product_build);RnWinRTBuildQFE=$(product_build_qfe)'
3243

3344
- task: EsrpCodeSigning@1
3445
displayName: 'ESRP CodeSigning'

rnwinrt/rnwinrt/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace
3333

3434
void PrintUsage()
3535
{
36-
std::cout << R"(React Native WinRT )" << CPPWINRT_VERSION_STRING << std::endl;
36+
std::cout << R"(React Native WinRT )" << RNWINRT_VERSION_STRING << std::endl;
3737
std::cout << R"(Copyright (c) Microsoft Corporation. All rights reserved.)" << std::endl;
3838
std::cout << R"( rnwinrt.exe [options...])" << std::endl << std::endl;
3939
std::cout << R"(Options:)" << std::endl;

rnwinrt/rnwinrt/rnwinrt.vcxproj

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
<!-- TODO: This is to ensure that VS will re-run msbuild each time we "build". Otherwise changes to base.h/cpp might
1010
not get recompiled... This slows compilation down slightly, but is net goodness -->
1111
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
12+
<RnWinRTMajorVersion Condition="'$(RnWinRTMajorVersion)' == ''">0</RnWinRTMajorVersion>
13+
<RnWinRTMinorVersion Condition="'$(RnWinRTMinorVersion)' == ''">0</RnWinRTMinorVersion>
14+
<RnWinRTBuild Condition="'$(RnWinRTBuild)' == ''">0</RnWinRTBuild>
15+
<RnWinRTBuildQFE Condition="'$(RnWinRTBuildQFE)' == ''">1</RnWinRTBuildQFE>
16+
<RnWinRTBuildVersion>$(RnWinRTMajorVersion).$(RnWinRTMinorVersion).$(RnWinRTBuild).$(RnWinRTBuildQFE)</RnWinRTBuildVersion>
1217
</PropertyGroup>
1318
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
1419
<ItemGroup Label="ProjectConfigurations">
@@ -103,7 +108,7 @@
103108
<LanguageStandard>stdcpp17</LanguageStandard>
104109
<PrecompiledHeader>Use</PrecompiledHeader>
105110
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
106-
<PreprocessorDefinitions>CPPWINRT_VERSION_STRING="$(CppWinRTBuildVersion)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
111+
<PreprocessorDefinitions>RNWINRT_VERSION_STRING="$(RnWinRTBuildVersion)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
107112
<MultiProcessorCompilation>true</MultiProcessorCompilation>
108113
<AdditionalOptions>/await /bigobj</AdditionalOptions>
109114
<AdditionalOptions Condition="'$(Clang)'=='1'">-Wno-unused-command-line-argument -fno-delayed-template-parsing -Xclang -fcoroutines-ts -mcx16</AdditionalOptions>
@@ -113,7 +118,14 @@
113118
<SubSystem>Console</SubSystem>
114119
</Link>
115120
<ResourceCompile>
116-
<PreprocessorDefinitions>CPPWINRT_VERSION_STRING="$(CppWinRTBuildVersion)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
121+
<PreprocessorDefinitions>
122+
RNWINRT_MAJOR_VERSION=$(RnWinRTMajorVersion);
123+
RNWINRT_MINOR_VERSION=$(RnWinRTMinorVersion);
124+
RNWINRT_BUILD=$(RnWinRTBuild);
125+
RNWINRT_BUILD_QFE=$(RnWinRTBuildQFE);
126+
RNWINRT_VERSION_STRING="\"$(RnWinRTBuildVersion)\"";
127+
%(PreprocessorDefinitions)
128+
</PreprocessorDefinitions>
117129
</ResourceCompile>
118130
</ItemDefinitionGroup>
119131
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">

rnwinrt/rnwinrt/version.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#include "winres.h"
33

44
VS_VERSION_INFO VERSIONINFO
5-
FILEVERSION 0,0,0,1
6-
PRODUCTVERSION 0,0,0,1
5+
FILEVERSION RNWINRT_MAJOR_VERSION, RNWINRT_MINOR_VERSION, RNWINRT_BUILD, RNWINRT_BUILD_QFE
6+
PRODUCTVERSION RNWINRT_MAJOR_VERSION, RNWINRT_MINOR_VERSION, RNWINRT_BUILD, RNWINRT_BUILD_QFE
77
FILEFLAGSMASK 0x3fL
88
#ifdef _DEBUG
99
FILEFLAGS 0x1L
@@ -20,11 +20,11 @@ BEGIN
2020
BEGIN
2121
VALUE "CompanyName", "Microsoft Corporation"
2222
VALUE "FileDescription", "React Native WinRT"
23-
VALUE "FileVersion", "0.0.0.1"
23+
VALUE "FileVersion", RNWINRT_VERSION_STRING
2424
VALUE "LegalCopyright", "Microsoft Corporation. All rights reserved."
2525
VALUE "OriginalFilename", "rnwinrt.exe"
2626
VALUE "ProductName", "React Native WinRT"
27-
VALUE "ProductVersion", "0.0.0.1"
27+
VALUE "ProductVersion", RNWINRT_VERSION_STRING
2828
END
2929
END
3030
BLOCK "VarFileInfo"

0 commit comments

Comments
 (0)