Skip to content

Commit 91e40e2

Browse files
marabooyxuzhg
authored andcommitted
Switch to dotnet pack fron nuget pack.
1 parent 063023c commit 91e40e2

File tree

4 files changed

+48
-11
lines changed

4 files changed

+48
-11
lines changed

pipelines/azure_pipelines_nightly.yml

+28-9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ resources:
99
type: git
1010
ref: master
1111

12+
variables:
13+
BuildPlatformDirName: 'AnyCpu'
14+
buildConfiguration: 'Release'
15+
rootDir: '$(Build.SourcesDirectory)'
16+
productBinPath: '$(rootDir)\bin\$(BuildPlatformDirName)\$(buildConfiguration)'
17+
RELEASE_SEMANTICS: '$(ReleaseSemantics)'
18+
SourcesRoot: '$(rootDir)'
1219
stages:
1320
- stage: Build
1421
jobs:
@@ -77,22 +84,34 @@ stages:
7784
projects: $(Build.SourcesDirectory)\test\Microsoft.AspNetCore.OData.E2E.Tests\Microsoft.AspNetCore.OData.E2E.Tests.csproj
7885
arguments: --configuration $(BuildConfiguration) --no-build -l "console;verbosity=detailed" --framework netcoreapp3.1
7986
- task: DotNetCoreCLI@2
80-
displayName: build Product(Microsoft.AspNetCore.OData.NewtonsoftJson)
81-
enabled: False
87+
displayName: Build Microsoft.AspNetCore.OData.NewtonsoftJson
8288
inputs:
8389
projects: $(Build.SourcesDirectory)\src\Microsoft.AspNetCore.OData.NewtonsoftJson\Microsoft.AspNetCore.OData.NewtonsoftJson.csproj
8490
arguments: --configuration $(BuildConfiguration) --no-incremental
85-
- task: NuGetCommand@2
86-
displayName: NuGet - pack Microsoft.AspNetCore.OData.NewtonsoftJson
91+
92+
- task: DotNetCoreCLI@2
8793
inputs:
8894
command: custom
89-
arguments: pack $(Build.SourcesDirectory)\src\Microsoft.AspNetCore.OData.NewtonsoftJson.$(RELEASE_SEMANTICS).nuspec -NonInteractive -OutputDirectory $(Build.ArtifactStagingDirectory)\Packages -Properties Configuration=$(BuildConfiguration);ProductRoot=$(ProductBinPath);SourcesRoot=$(Build.SourcesDirectory);VersionFullSemantic=$(VersionFullSemantic);NightlyBuildVersion=$(VersionNugetNightlyBuild);VersionNuGetSemantic=$(VersionNuGetSemantic) -Verbosity Detailed -Symbols -SymbolPackageFormat snupkg
90-
91-
- task: NuGetCommand@2
92-
displayName: NuGet - pack Microsoft.AspNetCore.OData
95+
custom: pack
96+
arguments: >
97+
$(rootDir)\src\Microsoft.AspNetCore.OData\Microsoft.AspNetCore.OData.csproj
98+
/p:NuspecFile=$(rootDir)\src\Microsoft.AspNetCore.OData.$(RELEASE_SEMANTICS).nuspec
99+
--configuration=$(buildConfiguration)
100+
--output=$(Build.ArtifactStagingDirectory)\Packages
101+
-p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
102+
displayName: Packing ASP.NET Core OData
103+
104+
- task: DotNetCoreCLI@2
93105
inputs:
94106
command: custom
95-
arguments: pack $(Build.SourcesDirectory)\src\Microsoft.AspNetCore.OData.$(RELEASE_SEMANTICS).nuspec -NonInteractive -OutputDirectory $(Build.ArtifactStagingDirectory)\Packages -Properties Configuration=$(BuildConfiguration);ProductRoot=$(ProductBinPath);SourcesRoot=$(Build.SourcesDirectory);VersionFullSemantic=$(VersionFullSemantic);NightlyBuildVersion=$(VersionNugetNightlyBuild);VersionNuGetSemantic=$(VersionNuGetSemantic);ODataModelBuilderPackageDependency="$(ODataModelBuilderPackageDependency)";ODataLibPackageDependency="$(ODataLibPackageDependency)" -Verbosity Detailed -Symbols -SymbolPackageFormat snupkg
107+
custom: pack
108+
arguments: >
109+
$(rootDir)\src\Microsoft.AspNetCore.OData.NewtonsoftJson\Microsoft.AspNetCore.OData.NewtonsoftJson.csproj
110+
/p:NuspecFile=$(rootDir)\src\Microsoft.AspNetCore.OData.NewtonsoftJson.$(RELEASE_SEMANTICS).nuspec
111+
--configuration=$(buildConfiguration)
112+
--output=$(Build.ArtifactStagingDirectory)\Packages
113+
-p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
114+
displayName: Packing NewtonsoftJson
96115

97116
- publish: $(Build.ArtifactStagingDirectory)\Packages
98117
displayName: Publish Build Artifacts

src/Microsoft.AspNetCore.OData.NewtonsoftJson/Microsoft.AspNetCore.OData.NewtonsoftJson.csproj

+8
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,12 @@
5454
<CustomToolNamespace>Microsoft.AspNetCore.OData.NewtonsoftJson</CustomToolNamespace>
5555
</EmbeddedResource>
5656
</ItemGroup>
57+
58+
<Target Name="SetNuspecProperties" BeforeTargets="GenerateNuspec">
59+
<PropertyGroup>
60+
<NuspecProperties>ProductRoot=$(productBinPath);VersionNuGetSemantic=$(VersionNuGetSemantic)</NuspecProperties>
61+
<NuspecProperties>$(NuspecProperties);NightlyBuildVersion=$(NightlyBuildVersion)</NuspecProperties>
62+
<NuspecProperties>$(NuspecProperties);SourcesRoot=$(SourcesRoot)</NuspecProperties>
63+
</PropertyGroup>
64+
</Target>
5765
</Project>

src/Microsoft.AspNetCore.OData.Nightly.nuspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<version>$VersionFullSemantic$-Nightly$NightlyBuildVersion$</version>
77
<authors>Microsoft</authors>
88
<copyright>&#169; Microsoft Corporation. All rights reserved.</copyright>
9-
<description>This package contains everything you need to create OData v4.0 endpoints using ASP.NET Core 3.x and 5.x to support OData query syntax for your Web APIs.</description>
9+
<description>This package contains everything you need to create OData v4.0 endpoints using ASP.NET Core MVC Core 3.x and 5.x to support OData query syntax for your Web APIs.</description>
1010
<summary>This package contains everything you need to create OData v4.0 endpoints using ASP.NET Core.</summary>
1111
<language>en-US</language>
1212
<projectUrl>http://github.com/OData/AspNetCoreOData</projectUrl>

src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.csproj

+11-1
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
<RootNamespace>Microsoft.AspNetCore.OData</RootNamespace>
66
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
77
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
8-
98
<!-- Let's generate our own assembly info -->
109
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
1110
<OutputType>Library</OutputType>
1211
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
1312
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
1413
<PackageLicenseExpression>MIT</PackageLicenseExpression>
14+
<IsPackable>true</IsPackable>
1515
</PropertyGroup>
1616

1717
<Import Project="..\..\tool\build.props" />
@@ -67,4 +67,14 @@
6767
</Content>
6868
</ItemGroup>
6969

70+
<Target Name="SetNuspecProperties" BeforeTargets="GenerateNuspec">
71+
<PropertyGroup>
72+
<NuspecProperties>ProductRoot=$(productBinPath);VersionNuGetSemantic=$(VersionNuGetSemantic)</NuspecProperties>
73+
<NuspecProperties>$(NuspecProperties);ODataModelBuilderPackageDependency=$(ODataModelBuilderPackageDependency)</NuspecProperties>
74+
<NuspecProperties>$(NuspecProperties);ODataLibPackageDependency=$(ODataLibPackageDependency)</NuspecProperties>
75+
<NuspecProperties>$(NuspecProperties);NightlyBuildVersion=$(NightlyBuildVersion)</NuspecProperties>
76+
<NuspecProperties>$(NuspecProperties);SourcesRoot=$(SourcesRoot)</NuspecProperties>
77+
</PropertyGroup>
78+
</Target>
79+
7080
</Project>

0 commit comments

Comments
 (0)