Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add assembly redirects for cross version integration tests #451

Closed
wants to merge 1 commit into from
Closed
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
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>