Use dotnet pack to pack AspNetCore file

This commit is contained in:
Pranav K 2017-07-17 11:19:09 -07:00
parent afba2d05ae
commit 4d35489e85
3 changed files with 16 additions and 4 deletions

View File

@ -8,7 +8,6 @@
<ItemGroup>
<PackageReference Include="PackagePublisher" Version="2.0.0-*" />
<PackageReference Include="NuGet.CommandLine" Version="$(NuGetCommandLineVersion)" />
</ItemGroup>
<Target Name="_LocateMSBuildExe">
@ -35,11 +34,14 @@
<Target Name="PackageProjects">
<PropertyGroup>
<NuGetExePath>$([MSBuild]::EnsureTrailingSlash('$(NuGetPackageRoot)'))nuget.commandline\$(NuGetCommandLineVersion)\tools\nuget.exe</NuGetExePath>
<NuspecPath>$(RepositoryRoot)nuget\AspNetCore.nuspec</NuspecPath>
<PackageVersion>1.0.0-pre-$(BuildNumber)</PackageVersion>
<PackageOutputPath>$(ArtifactsDir)build\</PackageOutputPath>
</PropertyGroup>
<Exec Command="&quot;$(NuGetExePath)&quot; pack &quot;$(NuspecPath)&quot; -OutputDirectory &quot;$(ArtifactsDir)\build&quot; -prop Version=1.0.0-pre-$(BuildNumber)" />
<MSBuild
Projects="$(MSBuildThisFileDirectory)../nuget/AspNetCore.csproj"
Targets="Pack"
Properties="PackageVersion=$(PackageVersion);PackageOutputPath=$(PackageOutputPath)" />
</Target>
<Target Name="PublishPackage"

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="AspNetCore" value="https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json" />
<add key="AspNetCoreTools" value="https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json" />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />

9
nuget/AspNetCore.csproj Normal file
View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.0</TargetFramework>
<NuspecFile>$(MSBuildThisFileDirectory)AspNetCore.nuspec</NuspecFile>
<NuspecProperties>version=$(PackageVersion)</NuspecProperties>
</PropertyGroup>
</Project>