Skip to content

Migrated nuspec to csproj and improved packaging #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ PublishScripts/

# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
Expand Down
28 changes: 19 additions & 9 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,6 @@ jobs:
contents: '**/*.jar'
targetFolder: $(Build.SourcesDirectory)/src/scala

- task: NuGetToolInstaller@0
inputs:
versionSpec: '4.9.2'

- task: MicroBuildSigningPlugin@2
displayName: Install MicroBuild plugin
inputs:
Expand All @@ -204,7 +200,7 @@ jobs:
displayName: 'Sign .NET binaries'
inputs:
solution: eng/Sign.proj
msbuildArguments: /t:SignBinaries
msbuildArguments: /t:SignBinaries
/p:SignSparkBinaries=true
/p:SignAssetsDir=$(Build.SourcesDirectory)\src\csharp\Microsoft.Spark\bin\$(buildConfiguration)\
/p:SignType=$(_SignType)
Expand All @@ -230,10 +226,12 @@ jobs:
/p:SignType=$(_SignType)
msbuildVersion: 15.0

- task: NuGetCommand@2
- task: DotNetCoreCLI@2
displayName: 'Create NuGet packages'
inputs:
command: pack
packagesToPack: '$(Build.SourcesDirectory)\src\csharp\Microsoft.Spark.nuspec'
projects: '$(solution)'
arguments: '--no-build --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'

- task: MSBuild@1
displayName: 'Sign nuget packages'
Expand All @@ -251,13 +249,25 @@ jobs:
sourceFolder: $(Build.ArtifactStagingDirectory)
contents: 'Microsoft.Spark*.nupkg'
targetFolder: $(Build.ArtifactStagingDirectory)/Packages


- task: CopyFiles@2
displayName: Copy snupkg to publish
inputs:
sourceFolder: $(Build.ArtifactStagingDirectory)
contents: 'Microsoft.Spark*.snupkg'
targetFolder: $(Build.ArtifactStagingDirectory)/SymbolPackages

- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/Microsoft.Spark.Binaries'
artifactName: Microsoft.Spark.Binaries

- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/Packages'
artifactName: Microsoft.Spark.Binaries

- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/SymbolPackages'
artifactName: Microsoft.Spark.Binaries
2 changes: 1 addition & 1 deletion eng/Sign.proj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</ItemGroup>

<ItemGroup Condition="'$(SignNugetPackages)' == 'true'">
<FilesToSign Include="$(OutDir)*.nupkg" Exclude="$(OutDir)*.symbols.nupkg">
<FilesToSign Include="$(OutDir)*.nupkg">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also sign snupkg, right? Since the plan is for it to go into nuget? @eerhardt what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opps we merged right at the same moment I commented on this, but @imback82 I think we want to solve this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it depends on what we plan on doing with them... if we just use it to publish the symbols to the Microsoft Symbol Server during the build, they probably don't need to be signed.
But if we do plan on uploading them to nuget.org, then maybe they need to be signed?

@dagood @mikem8361 - for thoughts/recommendations on what should be done with .snupkg files.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tmat knows the most about snupkgs, I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snupkgs should be published to NuGet.org and the PDBs to Microsoft Symbol servers.

<Authenticode>NuGet</Authenticode>
</FilesToSign>
</ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions examples/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="ExcludeRestorePackageImports">
<Import Project="..\src\csharp\Directory.Build.props" />

<PropertyGroup>
<IsPackable>False</IsPackable>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
12 changes: 12 additions & 0 deletions src/csharp/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
<Product>.NET for Apache Spark</Product>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>

<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RequireLicenseAcceptance>true</RequireLicenseAcceptance>
<PackageProjectUrl>https://github.com/dotnet/spark</PackageProjectUrl>

<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>

<EngDir>$(MSBuildThisFileDirectory)..\..\eng\</EngDir>
<IsTestProject Condition="$(MSBuildProjectName.EndsWith('Test'))">true</IsTestProject>

Expand All @@ -24,4 +32,8 @@
<DelaySign>false</DelaySign>
<PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
</PropertyGroup>

<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)..\..\THIRD-PARTY-NOTICES.TXT" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net461;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netcoreapp2.1</TargetFrameworks>
<RootNamespace>Microsoft.Spark.Worker</RootNamespace>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(MSBuildProjectName).xml</DocumentationFile>
<IsPackable>False</IsPackable>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'netcoreapp2.1' ">
Expand Down
28 changes: 0 additions & 28 deletions src/csharp/Microsoft.Spark.nuspec

This file was deleted.

18 changes: 17 additions & 1 deletion src/csharp/Microsoft.Spark/Microsoft.Spark.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>Microsoft.Spark</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(MSBuildProjectName).xml</DocumentationFile>

<Description>.NET for Apache Spark</Description>
<PackageReleaseNotes>Initial release</PackageReleaseNotes>
<PackageTags>spark;dotnet;csharp</PackageTags>
</PropertyGroup>

<ItemGroup>
Expand All @@ -15,4 +19,16 @@
<PackageReference Include="System.Memory" Version="4.5.2" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
<Content Include="..\..\scala\microsoft-spark-*\target\microsoft-spark-*.jar"
Link="jars\%(Filename)%(Extension)"
Pack="true"
PackagePath="jars\%(Filename)%(Extension)" />
<Content Include="build\**" Pack="true" PackagePath="build" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)../jars/microsoft-spark*.jar">
<None Include="$(MSBuildThisFileDirectory)../../jars/microsoft-spark*.jar">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
Expand Down