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 Oct 22, 2023
1 parent bb691bd commit 57b1171
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 4 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
27 changes: 23 additions & 4 deletions src/internal/SetBuildNumber/SetBuildNumber.proj
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,34 @@
GitThisAssembly;
SetGlobalJson;
SetDirectoryPackagesProps;
SetOverallWixVersions
SetOverallWixVersions;
TransformWixAppConfig
</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 All @@ -50,7 +69,7 @@

<WriteLinesToFile File="$(GlobalJsonPath)"
Lines="$(GlobaJsonTextHeader);$(GlobalJsonText)"
Overwrite="true"
Overwrite="true"
WriteOnlyWhenDifferent="true" />

<Message Importance="high" Text="$(MSBuildProjectName) -&gt; $(GlobalJsonPath)" />
Expand All @@ -74,7 +93,7 @@

<WriteLinesToFile File="$(CentralPackageVersionsPath)"
Lines="$(CentralPackageVersionsTextHeader);$(CentralPackageVersionsText)"
Overwrite="true"
Overwrite="true"
WriteOnlyWhenDifferent="true" />

<Message Importance="high" Text="$(MSBuildProjectName) -&gt; $(CentralPackageVersionsPath)" />
Expand All @@ -98,7 +117,7 @@

<WriteLinesToFile File="$(OverallWixVersionsPath)"
Lines="$(OverallWixVersionsTextHeader);$(OverallWixVersionsText)"
Overwrite="true"
Overwrite="true"
WriteOnlyWhenDifferent="true" />

<Message Importance="high" Text="$(MSBuildProjectName) -&gt; $(OverallWixVersionsPath)" />
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 57b1171

Please sign in to comment.