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

Commit 9974c65

Browse files
committed
Remove unnecessary Fody, add MSBuild nuget, fix unit tests
1 parent 3fe3c28 commit 9974c65

23 files changed

Lines changed: 90 additions & 137 deletions

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ nuget:
4040
disable_publish_on_pr: false
4141

4242
artifacts:
43-
- path: 'bin\Release\*.nupkg'
43+
- path: 'out\*.nupkg'
4444
name: Package
45-
- path: 'bin\Release\*.vsix'
45+
- path: 'out\*.vsix'
4646
name: Extension

build.proj

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
<PropertyGroup>
1414
<NuGetUrl Condition=" '$(NuGetUrl)' == '' ">https://dist.nuget.org/win-x86-commandline/v3.4.4/NuGet.exe</NuGetUrl>
15+
<RestorePackages>false</RestorePackages>
1516
<Out Condition=" '$(Out)' == '' ">$(MSBuildThisFileDirectory)out</Out>
1617
<RunCodeAnalysis Condition=" '$(RunCodeAnalysis)' == ''">false</RunCodeAnalysis>
1718
<IntermediateOutputPath>.nuget\</IntermediateOutputPath>
@@ -67,15 +68,24 @@
6768
</ItemGroup>
6869
<MakeDir Directories="$(Out)" Condition="!Exists('$(Out)')" />
6970

70-
<xunit Assemblies="@(TestAssembly)"
71-
Html="$(Out)\test.html"
72-
Xml="$(Out)\test.xml"
73-
Reporter="appveyor" />
71+
<PropertyGroup>
72+
<XunitConsole>"$(PackagesPath)\xunit.runner.console\tools\xunit.console.exe"</XunitConsole>
73+
<XunitOptions>$(XunitOptions) -html $(Out)\test.html -xml $(Out)\test.xml -parallel all -noshadow</XunitOptions>
74+
</PropertyGroup>
75+
76+
<Exec Command="$(XunitConsole) @(TestAssembly, ' ') $(XunitOptions)" ConsoleToMSBuild="true" />
7477
</Target>
7578

7679
<Target Name="Restore">
77-
<Exec Command='"$(NuGet)" Restore "%(Solution.FullPath)" -Verbosity quiet -Config src\NuGet.Config' />
78-
<Exec Command='"$(NuGet)" Restore "src\VisualStudio\NuGet.Packaging.VisualStudio.sln" -Verbosity quiet -Config src\NuGet.Config' />
80+
81+
<Exec Command='"$(NuGet)" Restore "external\ApiIntersect\ApiIntersect.sln" -Verbosity quiet' />
82+
<Exec Command='"$(NuGet)" Restore "src\Build\NuGet.Build.Packaging.sln" -Verbosity quiet -Config src\NuGet.Config' />
83+
<Exec Command='"$(NuGet)" Restore "src\Build\NuGet.Build.Packaging.Tests\Scenarios\given_a_library_with_non_nugetized_reference\b.sln"' />
84+
<Exec Command='"$(NuGet)" Restore "src\Build\NuGet.Build.Packaging.Tests\Scenarios\given_a_multi_platform_solution\forms.sln"' />
85+
<Exec Command='"$(NuGet)" Restore "src\Build\NuGet.Build.Packaging.Tests\Scenarios\given_library_with_json_dependencies\project.json"' />
86+
87+
<!-- Ignore error code here since NuGet will detect an incompatibility between VS2017 ProjectSystem NuGet on MSBuild 15+, and the tasks' MSBuild 14, which is intentional -->
88+
<Exec Command='"$(NuGet)" Restore "src\VisualStudio\NuGet.Packaging.VisualStudio.sln" -Verbosity quiet -Config src\NuGet.Config' IgnoreExitCode='true' />
7989
</Target>
8090

8191
<Target Name="Coverage" DependsOnTargets="Build">
@@ -89,7 +99,7 @@
8999
<MakeDir Directories="$(Out)" Condition="!Exists('$(Out)')" />
90100

91101
<PropertyGroup>
92-
<XunitOptions>$(XunitOptions) -html $(Out)\test.html -xml $(Out)\test.xml -parallel none -noshadow</XunitOptions>
102+
<XunitOptions>$(XunitOptions) -html $(Out)\test.html -xml $(Out)\test.xml -parallel none -noshadow </XunitOptions>
93103

94104
<CoverageConsole>$(PackagesPath)\OpenCover\tools\OpenCover.Console.exe</CoverageConsole>
95105
<CoverageOptions>$(CoverageOptions) -output:$(Out)\coverage.xml -returntargetcode -register:user -filter:"+[NuGet.Build.Packaging*]* -[NuGet.Packaging.Core*]* -[NuGet.Packaging.VisualStudio*]* -[Clide*]* -[xunit*]* -[*Tests]* -[*]*ThisAssembly*" -excludebyattribute:*ExcludeFromCodeCoverage*;*CompilerGenerated* -skipautoprops -showunvisited -mergebyhash</CoverageOptions>
@@ -126,7 +136,13 @@
126136
<PendingRestore Condition=" !Exists('$(GitInfoTargets)') Or !Exists('$(XunitConsole)') Or !Exists('$(XunitProps)') ">true</PendingRestore>
127137
</PropertyGroup>
128138
<Import Project="$(XunitProps)" Condition="Exists('$(XunitProps)')"/>
129-
<Target Name="GitVersion" />
139+
<Target Name="GitVersion">
140+
<PropertyGroup>
141+
<GitSemVerMajor>1</GitSemVerMajor>
142+
<GitSemVerMinor>0</GitSemVerMinor>
143+
<GitSemVerPatch>0</GitSemVerPatch>
144+
</PropertyGroup>
145+
</Target>
130146
<Import Project="$(GitInfoTargets)" Condition="Exists('$(GitInfoTargets)')"/>
131147
<Import Project="src\PackageVersion.targets" />
132148

src/Build/Before.NuGet.Build.Packaging.sln.targets

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/Build/NuGet.Build.Packaging.Tasks.Shared.targets

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,6 @@
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), NuGet.Build.Packaging.Shared.targets))\NuGet.Build.Packaging.Shared.targets" />
44

5-
<Target Name="AddMSBuildReferences" BeforeTargets="ResolveAssemblyReferences">
6-
<ItemGroup>
7-
<!-- TODO: to replace with the MSBuild nugets once they are more generally available -->
8-
<Reference Include="Microsoft.Build">
9-
<HintPath>$(MSBuildBinPath)\Microsoft.Build.dll</HintPath>
10-
</Reference>
11-
<Reference Include="Microsoft.Build.Framework">
12-
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Framework.dll</HintPath>
13-
</Reference>
14-
<Reference Include="Microsoft.Build.Tasks.Core">
15-
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Tasks.Core.dll</HintPath>
16-
</Reference>
17-
<Reference Include="Microsoft.Build.Utilities.Core">
18-
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Utilities.Core.dll</HintPath>
19-
</Reference>
20-
</ItemGroup>
21-
</Target>
22-
235
<PropertyGroup>
246
<!-- We'll include the PackageFiles ourselves -->
257
<IncludeOutputs>false</IncludeOutputs>

src/Build/NuGet.Build.Packaging.Tasks/GenerateReferenceAssembly.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
<WarningLevel>4</WarningLevel>
2525
</PropertyGroup>
2626
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
27-
2827
<PropertyGroup>
2928
<PrepareResourcesDependsOn>
3029
_CollectCompileFiles;

src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Tasks.csproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<PropertyGroup>
66
<ProjectGuid>{A3D231D7-31E4-4A70-8CD1-7246C7D069F6}</ProjectGuid>
77
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
8-
<TargetFrameworkProfile />
98
</PropertyGroup>
109
<ItemGroup>
1110
<Reference Include="System" />
@@ -29,10 +28,6 @@
2928
<Content Include="NuGet.Build.Packaging.Authoring.targets">
3029
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
3130
</Content>
32-
<None Include="..\..\..\external\ApiIntersect\ApiIntersect\app.config">
33-
<Link>ApiIntersect.exe.config</Link>
34-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
35-
</None>
3631
<None Include="NuGet.Build.Packaging.Version.props">
3732
<SubType>Designer</SubType>
3833
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Tasks.targets

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -117,25 +117,7 @@ namespace $(RootNamespace)
117117
<FileWrites Include="$(PackageItemKindFile)" />
118118
</ItemGroup>
119119
</Target>
120-
121-
<Target Name="AddMSBuildReferences" BeforeTargets="ResolveAssemblyReferences">
122-
<ItemGroup>
123-
<!-- TODO: to replace with the MSBuild nugets once they are more generally available -->
124-
<Reference Include="Microsoft.Build">
125-
<HintPath>$(MSBuildBinPath)\Microsoft.Build.dll</HintPath>
126-
</Reference>
127-
<Reference Include="Microsoft.Build.Framework">
128-
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Framework.dll</HintPath>
129-
</Reference>
130-
<Reference Include="Microsoft.Build.Tasks.Core">
131-
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Tasks.Core.dll</HintPath>
132-
</Reference>
133-
<Reference Include="Microsoft.Build.Utilities.Core">
134-
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Utilities.Core.dll</HintPath>
135-
</Reference>
136-
</ItemGroup>
137-
</Target>
138-
120+
139121
<PropertyGroup>
140122
<ILMerge>$(NuGetPackageRoot)ILRepack\2.0.12\tools\ILRepack.exe</ILMerge>
141123
</PropertyGroup>

src/Build/NuGet.Build.Packaging.Tasks/project.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"dependencies": {
33
"GitInfo": "1.1.32",
44
"ILRepack": "2.0.12",
5+
"Microsoft.Build": "14.3.0",
6+
"Microsoft.Build.Tasks.Core": "14.3.0",
57
"MSBuilder.ThisAssembly.Project": "0.3.1",
68
"netfx-System.StringResources": "3.0.14",
79
"Newtonsoft.Json": "6.0.4",

src/Build/NuGet.Build.Packaging.Tests/AssignPackagePathTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using NuGet.Build.Packaging.Tasks;
1010
using static NuGet.Build.Packaging.Properties.Strings;
1111
using Metadata = System.Collections.Generic.Dictionary<string, string>;
12+
using System;
1213

1314
namespace NuGet.Build.Packaging
1415
{
@@ -20,7 +21,7 @@ public class AssignPackagePathTests
2021

2122
static AssignPackagePathTests()
2223
{
23-
kinds = new Project(Path.Combine(ModuleInitializer.BaseDirectory, "NuGet.Build.Packaging.props"), null, null, new ProjectCollection())
24+
kinds = new Project(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "NuGet.Build.Packaging.props"), null, null, new ProjectCollection())
2425
.GetItems("PackageItemKind")
2526
.Select(item => new TaskItem(item.UnevaluatedInclude, item.Metadata.ToDictionary(meta => meta.Name, meta => meta.UnevaluatedValue)))
2627
.ToArray();

0 commit comments

Comments
 (0)