Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pipelines/OneBranch.Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ variables:
parameters:
debug: ${{ parameters.debug }}

name: 2.0.$(date:yyMMdd)$(rev:.r)
name: 3.0.$(date:yyMMdd)$(rev:.r)

trigger: none

Expand Down
2 changes: 1 addition & 1 deletion .pipelines/OneBranch.PullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ variables:
parameters:
debug: ${{ parameters.debug }}

name: PullRequest_2.0.$(date:yyMMdd)$(rev:.r)
name: PullRequest_3.0.$(date:yyMMdd)$(rev:.r)

trigger: none

Expand Down
2 changes: 1 addition & 1 deletion .pipelines/variables/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
default: false

variables:
MajorVersion: "2"
MajorVersion: "3"
MinorVersion: "0"
VersionDate: $[format('{0:yyMMdd}', pipeline.startTime)]
VersionCounter: $[counter(variables['VersionDate'], 1)]
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ project(cppwinrt LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

set(CPPWINRT_BUILD_VERSION "2.3.4.5" CACHE STRING "The version string used for cppwinrt.")
if(CPPWINRT_BUILD_VERSION STREQUAL "2.3.4.5" OR CPPWINRT_BUILD_VERSION STREQUAL "0.0.0.0")
set(CPPWINRT_BUILD_VERSION "3.3.4.5" CACHE STRING "The version string used for cppwinrt.")
if(CPPWINRT_BUILD_VERSION STREQUAL "3.3.4.5" OR CPPWINRT_BUILD_VERSION STREQUAL "0.0.0.0")
message(WARNING "CPPWINRT_BUILD_VERSION has been set to a dummy version string. Do not use in production!")
endif()
message(STATUS "Using version string: ${CPPWINRT_BUILD_VERSION}")
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.Props
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</PropertyGroup>

<PropertyGroup>
<CppWinRTBuildVersion Condition="'$(CppWinRTBuildVersion)'==''">2.3.4.5</CppWinRTBuildVersion>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.9.9.9 for local builds?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're at it, maybe even 3.99.99.99, or 3.255.255.255? Now that we're going to break out of the fossilized "2.0" version, it doesn't seem far-fetched to have more than 9 minor releases...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, either sounds good to me.

<CppWinRTBuildVersion Condition="'$(CppWinRTBuildVersion)'==''">3.3.4.5</CppWinRTBuildVersion>
<CppWinRTPlatform>$(Platform)</CppWinRTPlatform>
<CppWinRTPlatform Condition="'$(Platform)'=='Win32'">x86</CppWinRTPlatform>
<OutDir>$(SolutionDir)_build\$(CppWinRTPlatform)\$(Configuration)\</OutDir>
Expand Down
18 changes: 14 additions & 4 deletions prebuild/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,19 @@ namespace cppwinrt::strings {

writer version_rc;

// Extract major.minor substrings from CPPWINRT_VERSION_STRING (e.g. "3.0.250316.1")
std::string_view const full_version{ CPPWINRT_VERSION_STRING };
auto const first_dot = full_version.find('.');
auto const second_dot = full_version.find('.', first_dot + 1);
auto const ver_major = full_version.substr(0, first_dot);
auto const ver_minor = full_version.substr(first_dot + 1, second_dot - first_dot - 1);

version_rc.write(R"(
#include "winres.h"

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,0,0,0
PRODUCTVERSION 2,0,0,0
FILEVERSION %,%,0,0
PRODUCTVERSION %,%,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -99,7 +106,7 @@ BEGIN
BEGIN
VALUE "CompanyName", "Microsoft Corporation"
VALUE "FileDescription", "C++/WinRT"
VALUE "FileVersion", "2.0.0.0"
VALUE "FileVersion", "%.%.0.0"
VALUE "LegalCopyright", "Microsoft Corporation. All rights reserved."
VALUE "OriginalFilename", "cppwinrt.exe"
VALUE "ProductName", "C++/WinRT"
Expand All @@ -112,7 +119,10 @@ BEGIN
END
END
)",
CPPWINRT_VERSION_STRING);
ver_major, ver_minor, // FILEVERSION
ver_major, ver_minor, // PRODUCTVERSION
ver_major, ver_minor, // FileVersion string
CPPWINRT_VERSION_STRING); // ProductVersion string

std::filesystem::create_directories(argv[2]);
auto const output = std::filesystem::canonical(argv[2]);
Expand Down