Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit a3c53a2

Browse files
committed
Fix fake framework overrides
1 parent f1ed409 commit a3c53a2

3 files changed

Lines changed: 52 additions & 51 deletions

File tree

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup>
4-
<DocumentationFile Condition="'$(DocumentationFile)' == ''">$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
5-
</PropertyGroup>
6-
7-
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" Condition="'$(IsPortable)' != 'true'" />
8-
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets"
3+
<PropertyGroup>
4+
<DocumentationFile Condition="'$(DocumentationFile)' == ''">$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
5+
</PropertyGroup>
6+
7+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" Condition="'$(IsPortable)' != 'true'" />
8+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets"
99
Condition="'$(IsPortable)' == 'true'" />
10-
11-
<Import Project="$(NuGetTargetsPath)\NuGet.Build.Packaging.targets" Condition="Exists('$(NuGetTargetsPath)\NuGet.Build.Packaging.targets')" />
1210

13-
<ItemGroup>
14-
<Compile Include="$(MSBuildThisFileDirectory)_._" />
15-
</ItemGroup>
16-
17-
<Target Name="Dump" DependsOnTargets="GetPackageContents">
18-
<Message Importance="high" Text="%(_PackageContent.Filename)%(_PackageContent.Extension)
11+
<Import Project="$(NuGetTargetsPath)\NuGet.Build.Packaging.targets" Condition="Exists('$(NuGetTargetsPath)\NuGet.Build.Packaging.targets')" />
12+
13+
<ItemGroup>
14+
<Compile Include="$(MSBuildThisFileDirectory)_._" />
15+
</ItemGroup>
16+
17+
<Target Name="Dump" DependsOnTargets="GetPackageContents">
18+
<Message Importance="high" Text="%(_PackageContent.Filename)%(_PackageContent.Extension)
1919
FullPath=%(_PackageContent.FullPath)
2020
Kind=%(_PackageContent.Kind)
2121
PackageId=%(_PackageContent.PackageId)
@@ -26,25 +26,25 @@
2626
TargetFramework=%(_PackageContent.TargetFramework)
2727
TargetFrameworkMoniker=%(_PackageContent.TargetFrameworkMoniker)"/>
2828

29-
<DumpItems Items="@(_PackageContent)" ItemName="_PackageContent" />
29+
<DumpItems Items="@(_PackageContent)" ItemName="_PackageContent" />
3030

31-
<!--
31+
<!--
3232
OriginalTargetFramework=%(_PackageContent.OriginalTargetFramework)
3333
OriginalTargetFrameworkMoniker=%(_PackageContent.OriginalTargetFrameworkMoniker)
3434
-->
35-
<!--<DumpItems Items="@(_ReferencedProjectDocumentationDependency)" ItemName="_ReferencedProjectDocumentationDependency" Condition="'%(Extension)' == '.xml'" />-->
36-
</Target>
35+
<!--<DumpItems Items="@(_ReferencedProjectDocumentationDependency)" ItemName="_ReferencedProjectDocumentationDependency" Condition="'%(Extension)' == '.xml'" />-->
36+
</Target>
3737

38-
<PropertyGroup>
39-
<CodeTaskAssembly Condition="'$(CodeTaskAssembly)' == '' And '$(MSBuildAssemblyVersion)' == '' And Exists('$(MSBuildBinPath)\Microsoft.Build.Tasks.v4.0.dll')">$(MSBuildBinPath)\Microsoft.Build.Tasks.v4.0.dll</CodeTaskAssembly>
40-
<CodeTaskAssembly Condition="'$(CodeTaskAssembly)' == '' And '$(MSBuildAssemblyVersion)' == '' And Exists('$(MSBuildBinPath)\Microsoft.Build.Tasks.v12.0.dll')">$(MSBuildBinPath)\Microsoft.Build.Tasks.v12.0.dll</CodeTaskAssembly>
41-
<!-- In VS2013, the assembly contains the VS version. -->
42-
<CodeTaskAssembly Condition="'$(CodeTaskAssembly)' == '' And '$(MSBuildAssemblyVersion)' == '12.0'">$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll</CodeTaskAssembly>
43-
<!-- In VS2015+, the assembly was renamed, hopefully this will be the last condition! -->
44-
<CodeTaskAssembly Condition="'$(CodeTaskAssembly)' == '' And '$(MSBuildAssemblyVersion)' != '' And '$(MSBuildAssemblyVersion)' &gt;= '14.0'">$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll</CodeTaskAssembly>
45-
</PropertyGroup>
38+
<PropertyGroup>
39+
<CodeTaskAssembly Condition="'$(CodeTaskAssembly)' == '' And '$(MSBuildAssemblyVersion)' == '' And Exists('$(MSBuildBinPath)\Microsoft.Build.Tasks.v4.0.dll')">$(MSBuildBinPath)\Microsoft.Build.Tasks.v4.0.dll</CodeTaskAssembly>
40+
<CodeTaskAssembly Condition="'$(CodeTaskAssembly)' == '' And '$(MSBuildAssemblyVersion)' == '' And Exists('$(MSBuildBinPath)\Microsoft.Build.Tasks.v12.0.dll')">$(MSBuildBinPath)\Microsoft.Build.Tasks.v12.0.dll</CodeTaskAssembly>
41+
<!-- In VS2013, the assembly contains the VS version. -->
42+
<CodeTaskAssembly Condition="'$(CodeTaskAssembly)' == '' And '$(MSBuildAssemblyVersion)' == '12.0'">$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll</CodeTaskAssembly>
43+
<!-- In VS2015+, the assembly was renamed, hopefully this will be the last condition! -->
44+
<CodeTaskAssembly Condition="'$(CodeTaskAssembly)' == '' And '$(MSBuildAssemblyVersion)' != '' And '$(MSBuildAssemblyVersion)' &gt;= '14.0'">$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll</CodeTaskAssembly>
45+
</PropertyGroup>
4646

47-
<!--
47+
<!--
4848
============================================================
4949
DumpItems Task
5050
@@ -62,22 +62,22 @@
6262
6363
============================================================
6464
-->
65-
<UsingTask TaskName="DumpItems" TaskFactory="CodeTaskFactory" AssemblyFile="$(CodeTaskAssembly)">
66-
<ParameterGroup>
67-
<Items ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
68-
<ItemName />
69-
</ParameterGroup>
70-
<Task>
71-
<Reference Include="Microsoft.Build" />
72-
<Reference Include="Microsoft.CSharp" />
73-
<Reference Include="System" />
74-
<Reference Include="System.Core" />
75-
<Using Namespace="Microsoft.Build.Framework" />
76-
<Using Namespace="Microsoft.Build.Utilities" />
77-
<Using Namespace="System" />
78-
<Using Namespace="System.Linq" />
79-
<Code Type="Fragment" Language="cs">
80-
<![CDATA[
65+
<UsingTask TaskName="DumpItems" TaskFactory="CodeTaskFactory" AssemblyFile="$(CodeTaskAssembly)">
66+
<ParameterGroup>
67+
<Items ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
68+
<ItemName />
69+
</ParameterGroup>
70+
<Task>
71+
<Reference Include="Microsoft.Build" />
72+
<Reference Include="Microsoft.CSharp" />
73+
<Reference Include="System" />
74+
<Reference Include="System.Core" />
75+
<Using Namespace="Microsoft.Build.Framework" />
76+
<Using Namespace="Microsoft.Build.Utilities" />
77+
<Using Namespace="System" />
78+
<Using Namespace="System.Linq" />
79+
<Code Type="Fragment" Language="cs">
80+
<![CDATA[
8181
var itemName = ItemName ?? "Item";
8282
if (Items.Length == 0)
8383
Log.LogMessage(MessageImportance.High, "No {0} items received to dump.", ItemName ?? "");
@@ -99,8 +99,8 @@
9999
}
100100
}
101101
]]>
102-
</Code>
103-
</Task>
104-
</UsingTask>
102+
</Code>
103+
</Task>
104+
</UsingTask>
105105

106106
</Project>

src/Build/NuGet.Build.Packaging.Tests/Scenarios/fakeframework.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<!-- Allows fake frameworks to compile without errors -->
44
<PropertyGroup>
55
<ResolveAssemblyReferencesDependsOn />
6-
<_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories>
7-
<_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>
8-
</PropertyGroup>
6+
<TargetFrameworkRootPath>$(ProgramFiles)\Reference Assemblies\Microsoft\Framework\</TargetFrameworkRootPath>
7+
<FrameworkPathOverride>$(TargetFrameworkRootPath).NETFramework\v4.6</FrameworkPathOverride>
8+
</PropertyGroup>
99
<Target Name="CleanReferences" AfterTargets="ResolveAssemblyReferences">
1010
<ItemGroup>
1111
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" />

src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_content/library_with_content.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<PropertyGroup>
55
<AssemblyName>library</AssemblyName>
66
<TargetFrameworkMoniker>MonoAndroid,Version=v5.1</TargetFrameworkMoniker>
7-
</PropertyGroup>
7+
</PropertyGroup>
88
<ItemGroup>
99
<Content Include="Resources\**\*.*">
1010
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -27,5 +27,6 @@
2727
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2828
</Content>
2929
</ItemGroup>
30-
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Scenario.targets))\Scenario.targets" />
30+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), fakeframework.targets))\fakeframework.targets" />
31+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Scenario.targets))\Scenario.targets" />
3132
</Project>

0 commit comments

Comments
 (0)