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

Rename folder containing localization dlls in MSTest.TestAdapter NuGet package #1398

Merged
merged 1 commit into from
Nov 18, 2022
Merged
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
9 changes: 5 additions & 4 deletions src/Adapter/Build/Desktop/MSTest.TestAdapter.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
</ItemGroup>

<ItemGroup>
<!-- Including `@(TestAdapterContent)` in the `None` ItemGroup to get the `CopyToOutputDirectory`
behavior be default, package consumers can opt-out of this behavior
by removing `@(TestAdapterContent)` from the `None` ItemGroup
i.e. `<None Remove="@(TestAdapterContent)" />` -->
<!--
Including `@(TestAdapterContent)` in the `None` ItemGroup to get the `CopyToOutputDirectory` behavior be default,
package consumers can opt-out of this behavior by removing `@(TestAdapterContent)` from the `None` ItemGroup
(i.e. `<None Remove="@(TestAdapterContent)" />`)
-->
<None Include="@(TestAdapterContent)" />
</ItemGroup>
</Project>
12 changes: 8 additions & 4 deletions src/Adapter/Build/Desktop/MSTest.TestAdapter.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
</PropertyGroup>

<Target Name="GetMSTestV2CultureHierarchy">
<!-- Only traversing 5 levels in the culture hierarchy. This is the maximum length for all cultures and should be sufficient to get to a culture name that maps to a resource folder we package.
The root culture name for all cultures is invariant whose name is ''(empty) and the parent for invariant culture is invariant itself.(https://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.parent(v=vs.110).aspx.)
So the below code should not break build in any case. -->
<!--
Only traversing 5 levels in the culture hierarchy. This is the maximum length for all cultures and should be sufficient
to get to a culture name that maps to a resource folder we package.
The root culture name for all cultures is invariant whose name is '' (empty) and the parent for invariant culture is
invariant itself. (https://msdn.microsoft.com/library/system.globalization.cultureinfo.parent.aspx)
So the below code should not break build in any case.
-->
<ItemGroup>
<CurrentUICultureHierarchy Include="$([System.Globalization.CultureInfo]::CurrentUICulture.Name)" />
<CurrentUICultureHierarchy Include="$([System.Globalization.CultureInfo]::CurrentUICulture.Parent.Name)" Condition=" '$([System.Globalization.CultureInfo]::CurrentUICulture.Parent.Name)' != '' "/>
Expand All @@ -20,7 +24,7 @@
<!-- Copy resources over to $(TargetDir) if this is a localized build. -->
<Target Name="CopyMSTestV2Resources" BeforeTargets="PrepareForBuild" Condition=" '$(EnableMSTestV2CopyResources)' == 'true' " DependsOnTargets="GetMSTestV2CultureHierarchy">
<ItemGroup>
<MSTestV2ResourceFiles Include="$(MSBuildThisFileDirectory)..\_common\%(CurrentUICultureHierarchy.Identity)\*resources.dll">
<MSTestV2ResourceFiles Include="$(MSBuildThisFileDirectory)..\_localization\%(CurrentUICultureHierarchy.Identity)\*resources.dll">
<CultureString>%(CurrentUICultureHierarchy.Identity)</CultureString>
</MSTestV2ResourceFiles>

Expand Down
4 changes: 2 additions & 2 deletions src/Adapter/Build/Net6/MSTest.TestAdapter.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<!--
Directives here are moved to MSTest.TestAdapter.targets file to make sure they are
included after WinUI properties are specified.
Directives here are moved to MSTest.TestAdapter.targets file to make sure they are included after WinUI
properties are specified.
-->
</Project>
21 changes: 13 additions & 8 deletions src/Adapter/Build/Net6/MSTest.TestAdapter.targets
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,22 @@
</ItemGroup>

<ItemGroup>
<!-- Including `@(TestAdapterContent)` in the `None` ItemGroup to get the `CopyToOutputDirectory`
behavior be default, package consumers can opt-out of this behavior
by removing `@(TestAdapterContent)` from the `None` ItemGroup
i.e. `<None Remove="@(TestAdapterContent)" />` -->
<!--
Including `@(TestAdapterContent)` in the `None` ItemGroup to get the `CopyToOutputDirectory` behavior be default,
package consumers can opt-out of this behavior by removing `@(TestAdapterContent)` from the `None` ItemGroup
(i.e. `<None Remove="@(TestAdapterContent)" />`)
-->
<None Include="@(TestAdapterContent)" />
</ItemGroup>

<Target Name="GetMSTestV2CultureHierarchy">
<!-- Only traversing 5 levels in the culture hierarchy. This is the maximum length for all cultures and should be sufficient to get to a culture name that maps to a resource folder we package.
The root culture name for all cultures is invariant whose name is ''(empty) and the parent for invariant culture is invariant itself.(https://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.parent(v=vs.110).aspx.)
So the below code should not break build in any case. -->
<!--
Only traversing 5 levels in the culture hierarchy. This is the maximum length for all cultures and should be sufficient
to get to a culture name that maps to a resource folder we package.
The root culture name for all cultures is invariant whose name is '' (empty) and the parent for invariant culture is
invariant itself. (https://msdn.microsoft.com/library/system.globalization.cultureinfo.parent.aspx)
So the below code should not break build in any case.
-->
<ItemGroup>
<CurrentUICultureHierarchy Include="$([System.Globalization.CultureInfo]::CurrentUICulture.Name)" />
<CurrentUICultureHierarchy Include="$([System.Globalization.CultureInfo]::CurrentUICulture.Parent.Name)" Condition=" '$([System.Globalization.CultureInfo]::CurrentUICulture.Parent.Name)' != '' "/>
Expand All @@ -56,7 +61,7 @@
</PropertyGroup>

<ItemGroup>
<MSTestV2Files Include="$(MSBuildThisFileDirectory)..\_common\*.dll" />
<MSTestV2Files Include="$(MSBuildThisFileDirectory)..\_localization\*.dll" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 5 additions & 4 deletions src/Adapter/Build/NetCore/MSTest.TestAdapter.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
</ItemGroup>

<ItemGroup>
<!-- Including `@(TestAdapterContent)` in the `None` ItemGroup to get the `CopyToOutputDirectory`
behavior be default, package consumers can opt-out of this behavior
by removing `@(TestAdapterContent)` from the `None` ItemGroup
i.e. `<None Remove="@(TestAdapterContent)" />` -->
<!--
Including `@(TestAdapterContent)` in the `None` ItemGroup to get the `CopyToOutputDirectory` behavior be default,
package consumers can opt-out of this behavior by removing `@(TestAdapterContent)` from the `None` ItemGroup
(i.e. `<None Remove="@(TestAdapterContent)" />`)
-->
<None Include="@(TestAdapterContent)" />
</ItemGroup>
</Project>
9 changes: 5 additions & 4 deletions src/Adapter/Build/Universal/MSTest.TestAdapter.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
</ItemGroup>

<ItemGroup>
<!-- Including `@(TestAdapterContent)` in the `None` ItemGroup to get the `CopyToOutputDirectory`
behavior be default, package consumers can opt-out of this behavior
by removing `@(TestAdapterContent)` from the `None` ItemGroup
i.e. `<None Remove="@(TestAdapterContent)" />` -->
<!--
Including `@(TestAdapterContent)` in the `None` ItemGroup to get the `CopyToOutputDirectory` behavior be default,
package consumers can opt-out of this behavior by removing `@(TestAdapterContent)` from the `None` ItemGroup
(i.e. `<None Remove="@(TestAdapterContent)" />`)
-->
<None Include="@(TestAdapterContent)" />
</ItemGroup>
</Project>
12 changes: 8 additions & 4 deletions src/Adapter/Build/Universal/MSTest.TestAdapter.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
</PropertyGroup>

<Target Name="GetMSTestV2CultureHierarchy">
<!-- Only traversing 5 levels in the culture hierarchy. This is the maximum length for all cultures and should be sufficient to get to a culture name that maps to a resource folder we package.
The root culture name for all cultures is invariant whose name is ''(empty) and the parent for invariant culture is invariant itself.(https://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.parent(v=vs.110).aspx.)
So the below code should not break build in any case. -->
<!--
Only traversing 5 levels in the culture hierarchy. This is the maximum length for all cultures and should be sufficient
to get to a culture name that maps to a resource folder we package.
The root culture name for all cultures is invariant whose name is '' (empty) and the parent for invariant culture is
invariant itself. (https://msdn.microsoft.com/library/system.globalization.cultureinfo.parent.aspx)
So the below code should not break build in any case.
-->
<ItemGroup>
<CurrentUICultureHierarchy Include="$([System.Globalization.CultureInfo]::CurrentUICulture.Name)" />
<CurrentUICultureHierarchy Include="$([System.Globalization.CultureInfo]::CurrentUICulture.Parent.Name)" Condition=" '$([System.Globalization.CultureInfo]::CurrentUICulture.Parent.Name)' != '' "/>
Expand All @@ -25,7 +29,7 @@
</PropertyGroup>

<ItemGroup>
<MSTestV2Files Include="$(MSBuildThisFileDirectory)../_common/Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll" />
<MSTestV2Files Include="$(MSBuildThisFileDirectory)../_localization/Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll" />
<MSTestV2Files Include="$(MSBuildThisFileDirectory)*.dll" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Package/MSTest.TestAdapter.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

<!-- Localization -->
<!-- All TFMs share the same resx + TestAdapter depends on PlatformServices + TestFramework so all resources are available -->
<file src="MSTest.TestAdapter\net462\**\*.resources.dll" target="\build\_common\" />
<file src="MSTest.TestAdapter\net462\**\*.resources.dll" target="\build\_localization\" />

<!-- Icon -->
<file src="Icon.png" target="" />
Expand Down
2 changes: 1 addition & 1 deletion src/Package/MSTest.TestAdapter.symbols.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

<!-- Localization -->
<!-- All TFMs share the same resx + TestAdapter depends on PlatformServices + TestFramework so all resources are available -->
<file src="MSTest.TestAdapter\net462\**\*.resources.dll" target="\build\_common\" />
<file src="MSTest.TestAdapter\net462\**\*.resources.dll" target="\build\_localization\" />

<!-- Source code -->
<file src="$srcroot$\**\*.cs" target="src" />
Expand Down