Skip to content

Commit

Permalink
Switch to dotnet pack fron nuget pack.
Browse files Browse the repository at this point in the history
  • Loading branch information
marabooy authored and xuzhg committed Jul 3, 2021
1 parent 063023c commit 91e40e2
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 11 deletions.
37 changes: 28 additions & 9 deletions pipelines/azure_pipelines_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ resources:
type: git
ref: master

variables:
BuildPlatformDirName: 'AnyCpu'
buildConfiguration: 'Release'
rootDir: '$(Build.SourcesDirectory)'
productBinPath: '$(rootDir)\bin\$(BuildPlatformDirName)\$(buildConfiguration)'
RELEASE_SEMANTICS: '$(ReleaseSemantics)'
SourcesRoot: '$(rootDir)'
stages:
- stage: Build
jobs:
Expand Down Expand Up @@ -77,22 +84,34 @@ stages:
projects: $(Build.SourcesDirectory)\test\Microsoft.AspNetCore.OData.E2E.Tests\Microsoft.AspNetCore.OData.E2E.Tests.csproj
arguments: --configuration $(BuildConfiguration) --no-build -l "console;verbosity=detailed" --framework netcoreapp3.1
- task: DotNetCoreCLI@2
displayName: build Product(Microsoft.AspNetCore.OData.NewtonsoftJson)
enabled: False
displayName: Build Microsoft.AspNetCore.OData.NewtonsoftJson
inputs:
projects: $(Build.SourcesDirectory)\src\Microsoft.AspNetCore.OData.NewtonsoftJson\Microsoft.AspNetCore.OData.NewtonsoftJson.csproj
arguments: --configuration $(BuildConfiguration) --no-incremental
- task: NuGetCommand@2
displayName: NuGet - pack Microsoft.AspNetCore.OData.NewtonsoftJson

- task: DotNetCoreCLI@2
inputs:
command: custom
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

- task: NuGetCommand@2
displayName: NuGet - pack Microsoft.AspNetCore.OData
custom: pack
arguments: >
$(rootDir)\src\Microsoft.AspNetCore.OData\Microsoft.AspNetCore.OData.csproj
/p:NuspecFile=$(rootDir)\src\Microsoft.AspNetCore.OData.$(RELEASE_SEMANTICS).nuspec
--configuration=$(buildConfiguration)
--output=$(Build.ArtifactStagingDirectory)\Packages
-p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
displayName: Packing ASP.NET Core OData

- task: DotNetCoreCLI@2
inputs:
command: custom
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
custom: pack
arguments: >
$(rootDir)\src\Microsoft.AspNetCore.OData.NewtonsoftJson\Microsoft.AspNetCore.OData.NewtonsoftJson.csproj
/p:NuspecFile=$(rootDir)\src\Microsoft.AspNetCore.OData.NewtonsoftJson.$(RELEASE_SEMANTICS).nuspec
--configuration=$(buildConfiguration)
--output=$(Build.ArtifactStagingDirectory)\Packages
-p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
displayName: Packing NewtonsoftJson

- publish: $(Build.ArtifactStagingDirectory)\Packages
displayName: Publish Build Artifacts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,12 @@
<CustomToolNamespace>Microsoft.AspNetCore.OData.NewtonsoftJson</CustomToolNamespace>
</EmbeddedResource>
</ItemGroup>

<Target Name="SetNuspecProperties" BeforeTargets="GenerateNuspec">
<PropertyGroup>
<NuspecProperties>ProductRoot=$(productBinPath);VersionNuGetSemantic=$(VersionNuGetSemantic)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);NightlyBuildVersion=$(NightlyBuildVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SourcesRoot=$(SourcesRoot)</NuspecProperties>
</PropertyGroup>
</Target>
</Project>
2 changes: 1 addition & 1 deletion src/Microsoft.AspNetCore.OData.Nightly.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<version>$VersionFullSemantic$-Nightly$NightlyBuildVersion$</version>
<authors>Microsoft</authors>
<copyright>&#169; Microsoft Corporation. All rights reserved.</copyright>
<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>
<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>
<summary>This package contains everything you need to create OData v4.0 endpoints using ASP.NET Core.</summary>
<language>en-US</language>
<projectUrl>http://github.com/OData/AspNetCoreOData</projectUrl>
Expand Down
12 changes: 11 additions & 1 deletion src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<RootNamespace>Microsoft.AspNetCore.OData</RootNamespace>
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>

<!-- Let's generate our own assembly info -->
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<OutputType>Library</OutputType>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<IsPackable>true</IsPackable>
</PropertyGroup>

<Import Project="..\..\tool\build.props" />
Expand Down Expand Up @@ -67,4 +67,14 @@
</Content>
</ItemGroup>

<Target Name="SetNuspecProperties" BeforeTargets="GenerateNuspec">
<PropertyGroup>
<NuspecProperties>ProductRoot=$(productBinPath);VersionNuGetSemantic=$(VersionNuGetSemantic)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);ODataModelBuilderPackageDependency=$(ODataModelBuilderPackageDependency)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);ODataLibPackageDependency=$(ODataLibPackageDependency)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);NightlyBuildVersion=$(NightlyBuildVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SourcesRoot=$(SourcesRoot)</NuspecProperties>
</PropertyGroup>
</Target>

</Project>

0 comments on commit 91e40e2

Please sign in to comment.