Skip to content

Commit

Permalink
add assembly redirects for cross version integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbednarski committed Sep 1, 2023
1 parent e29b4aa commit 08db20d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<packageSourceMapping>
<packageSource key="nuget">
<package pattern="*" />
<package pattern="WixToolset.*" allowedVersions="[,{GitBaseVersionMajor})" />
</packageSource>
<packageSource key="build">
<package pattern="WixToolset.*" />
Expand Down
19 changes: 19 additions & 0 deletions src/internal/SetBuildNumber/SetBuildNumber.proj
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,34 @@
SetGlobalJson;
SetDirectoryPackagesProps;
SetOverallWixVersions;
TransformWixAppConfig;
InstallSigningClient
</SetBuildNumbersDependsOn>

<GlobalJsonPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\..\..\global.json))</GlobalJsonPath>
<CentralPackageVersionsPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\..\..\Directory.Packages.props))</CentralPackageVersionsPath>
<OverallWixVersionsPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\..\..\build\wixver.props))</OverallWixVersionsPath>
<GitInfoThisAssemblyFile>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\..\..\build\ThisAssembly.WixVer.cs))</GitInfoThisAssemblyFile>
<WixAppConfigTransform>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\..\wix\wix\app.config))</WixAppConfigTransform>
</PropertyGroup>

<Target Name="TransformWixAppConfig"
Inputs="transform.wix.app.config"
Outputs="$(WixAppConfigTransform)">
<PropertyGroup>
<OverallWixAppConfigHeader></OverallWixAppConfigHeader>
<OverallWixAppConfigText>$([System.IO.File]::ReadAllText(transform.wix.app.config))</OverallWixAppConfigText>
<OverallWixAppConfigText>$(OverallWixAppConfigText.Replace('{GitBaseVersionMajor}', $(GitBaseVersionMajor)))</OverallWixAppConfigText>
</PropertyGroup>

<WriteLinesToFile File="$(WixAppConfigTransform)"
Lines="$(OverallWixAppConfigHeader);$(OverallWixAppConfigText)"
WriteOnlyWhenDifferent="true"
Overwrite="true" />

<Message Importance="high" Text="$(MSBuildProjectName) -&gt; $(WixAppConfigTransform)" />
</Target>

<Target Name="SetGlobalJson"
Inputs="global.json.pp"
Outputs="$(GlobalJsonPath)">
Expand Down
18 changes: 18 additions & 0 deletions src/internal/SetBuildNumber/transform.wix.app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
<configuration>
<runtime>
<loadFromRemoteSources enabled="true"/>
<AppContextSwitchOverrides value="Switch.System.IO.UseLegacyPathHandling=false;Switch.System.IO.BlockLongPaths=false" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="WixToolset.Extensibility" publicKeyToken="a7d136314861246c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-{GitBaseVersionMajor}.0.0.0" newVersion="{GitBaseVersionMajor}.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WixToolset.Data" publicKeyToken="a7d136314861246c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-{GitBaseVersionMajor}.0.0.0" newVersion="{GitBaseVersionMajor}.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
10 changes: 10 additions & 0 deletions src/wix/wix/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,15 @@
<runtime>
<loadFromRemoteSources enabled="true"/>
<AppContextSwitchOverrides value="Switch.System.IO.UseLegacyPathHandling=false;Switch.System.IO.BlockLongPaths=false" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="WixToolset.Extensibility" publicKeyToken="a7d136314861246c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WixToolset.Data" publicKeyToken="a7d136314861246c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

0 comments on commit 08db20d

Please sign in to comment.