Skip to content
This repository was archived by the owner on Nov 8, 2018. It is now read-only.

Commit 2b9a4e0

Browse files
committed
Updated NuGet packaging process
* Rename Diagnostic.nuspec to AsyncUsageAnalyzers.nuspec * Updated information in AsyncUsageAnalyzers.nuspec * Use Tvl.NuGet.BuildTasks to generate the .nupkg during the build
1 parent 0c6dfc0 commit 2b9a4e0

File tree

4 files changed

+47
-33
lines changed

4 files changed

+47
-33
lines changed

AsyncUsageAnalyzers/AsyncUsageAnalyzers/AsyncUsageAnalyzers.csproj

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\..\packages\Tvl.NuGet.BuildTasks.1.0.0-alpha002\build\Tvl.NuGet.BuildTasks.props" Condition="Exists('..\..\packages\Tvl.NuGet.BuildTasks.1.0.0-alpha002\build\Tvl.NuGet.BuildTasks.props')" />
34
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
45
<PropertyGroup>
56
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
@@ -48,10 +49,11 @@
4849
</EmbeddedResource>
4950
</ItemGroup>
5051
<ItemGroup>
51-
<None Include="Diagnostic.nuspec">
52+
<NuGetManifest Include="AsyncUsageAnalyzers.nuspec">
5253
<SubType>Designer</SubType>
53-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
54-
</None>
54+
<Symbols>True</Symbols>
55+
<PackageAnalysis>False</PackageAnalysis>
56+
</NuGetManifest>
5557
<None Include="packages.config" />
5658
<None Include="tools\install.ps1">
5759
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -112,10 +114,14 @@
112114
</Reference>
113115
</ItemGroup>
114116
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\v4.5\Microsoft.Portable.CSharp.targets" />
115-
<PropertyGroup>
116-
<PostBuildEvent>"$(SolutionDir)\packages\NuGet.CommandLine.2.8.2\tools\NuGet.exe" pack Diagnostic.nuspec -NoPackageAnalysis -OutputDirectory .</PostBuildEvent>
117-
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
118-
</PropertyGroup>
117+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
118+
<PropertyGroup>
119+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
120+
</PropertyGroup>
121+
<Error Condition="!Exists('..\..\packages\Tvl.NuGet.BuildTasks.1.0.0-alpha002\build\Tvl.NuGet.BuildTasks.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Tvl.NuGet.BuildTasks.1.0.0-alpha002\build\Tvl.NuGet.BuildTasks.props'))" />
122+
<Error Condition="!Exists('..\..\packages\Tvl.NuGet.BuildTasks.1.0.0-alpha002\build\Tvl.NuGet.BuildTasks.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Tvl.NuGet.BuildTasks.1.0.0-alpha002\build\Tvl.NuGet.BuildTasks.targets'))" />
123+
</Target>
124+
<Import Project="..\..\packages\Tvl.NuGet.BuildTasks.1.0.0-alpha002\build\Tvl.NuGet.BuildTasks.targets" Condition="Exists('..\..\packages\Tvl.NuGet.BuildTasks.1.0.0-alpha002\build\Tvl.NuGet.BuildTasks.targets')" />
119125
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
120126
Other similar extension points exist, see Microsoft.Common.targets.
121127
<Target Name="BeforeBuild">
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
3+
<metadata minClientVersion="2.7">
4+
<id>AsyncUsageAnalyzers</id>
5+
<version>0.0.0</version>
6+
<title>AsyncUsageAnalyzers</title>
7+
<authors>Sam Harwell et. al.</authors>
8+
<owners>Sam Harwell</owners>
9+
<licenseUrl>https://raw.githubusercontent.com/DotNetAnalyzers/AsyncUsageAnalyzers/$version$/LICENSE</licenseUrl>
10+
<projectUrl>https://github.com/DotNetAnalyzers/AsyncUsageAnalyzers</projectUrl>
11+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
12+
<description>A collection of analyzers related to best practices for writing asynchronous code.</description>
13+
<releaseNotes>https://github.com/DotNetAnalyzers/AsyncUsageAnalyzers/releases/$version$</releaseNotes>
14+
<copyright>Copyright Sam Harwell 2015</copyright>
15+
<tags>Async DotNetAnalyzers Roslyn Diagnostic Analyzer</tags>
16+
<developmentDependency>true</developmentDependency>
17+
</metadata>
18+
<files>
19+
20+
<!-- Binaries and symbols -->
21+
<file src="bin\$Configuration$\AsyncUsageAnalyzers.dll" target="tools\analyzers\" />
22+
<file src="bin\$Configuration$\AsyncUsageAnalyzers.pdb" target="tools\analyzers\" />
23+
24+
<!-- Scripts -->
25+
<file src="tools\install.ps1" target="tools\" />
26+
<file src="tools\uninstall.ps1" target="tools\" />
27+
28+
<!-- Source code -->
29+
<file src="**\*.cs" exclude="obj\**\*.cs" target="src"/>
30+
31+
</files>
32+
</package>

AsyncUsageAnalyzers/AsyncUsageAnalyzers/Diagnostic.nuspec

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

AsyncUsageAnalyzers/AsyncUsageAnalyzers/packages.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
<package id="Microsoft.CodeAnalysis.CSharp.Workspaces" version="1.0.0-rc2" targetFramework="portable45-net45+win8" userInstalled="true" />
77
<package id="Microsoft.CodeAnalysis.Workspaces.Common" version="1.0.0-rc2" targetFramework="portable45-net45+win8" userInstalled="true" />
88
<package id="Microsoft.Composition" version="1.0.27" targetFramework="portable45-net45+win8" userInstalled="true" />
9-
<package id="NuGet.CommandLine" version="2.8.2" targetFramework="portable45-net45+win8" userInstalled="true" />
9+
<package id="NuGet.CommandLine" version="2.8.3" targetFramework="portable45-net45+win8" userInstalled="true" />
1010
<package id="System.Collections.Immutable" version="1.1.33-beta" targetFramework="portable45-net45+win8" userInstalled="true" />
1111
<package id="System.Reflection.Metadata" version="1.0.18-beta" targetFramework="portable45-net45+win8" userInstalled="true" />
12+
<package id="Tvl.NuGet.BuildTasks" version="1.0.0-alpha002" targetFramework="portable45-net45+win8" userInstalled="true" />
1213
</packages>

0 commit comments

Comments
 (0)