Convert DotNet.ReproducibleBuild.csproj to pack during build
This commit is contained in:
Родитель
4ce5530d5e
Коммит
6355e76842
|
@ -0,0 +1,5 @@
|
|||
<Project>
|
||||
<PropertyGroup Condition="'$(Build_ArtifactStagingDirectory)' != ''">
|
||||
<PackageOutputPath>$(Build_ArtifactStagingDirectory)packages\</PackageOutputPath>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -30,16 +30,11 @@ stages:
|
|||
|
||||
- task: NuGetToolInstaller@1
|
||||
|
||||
- pwsh: |
|
||||
mkdir $(Build.ArtifactStagingDirectory)\Packages
|
||||
$version = .\nbgv get-version -f json | ConvertFrom-Json
|
||||
|
||||
nuget pack $(System.DefaultWorkingDirectory)\src\DotNet.ReproducibleBuilds\DotNet.ReproducibleBuilds.nuspec `
|
||||
-outputdirectory $(Build.ArtifactStagingDirectory)\Packages `
|
||||
-basepath $(System.DefaultWorkingDirectory)\src\DotNet.ReproducibleBuilds `
|
||||
-NoPackageAnalysis `
|
||||
-Properties "version=$($version.NuGetPackageVersion);RepositoryCommit=$($version.GitCommitId)"
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
inputs:
|
||||
command: custom
|
||||
custom: pack
|
||||
arguments: src/DotNet.ReproducibleBuilds
|
||||
displayName: Create package
|
||||
|
||||
- publish: $(Build.ArtifactStagingDirectory)\Packages
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Project Sdk="Microsoft.Build.NoTargets">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard1.0</TargetFramework>
|
||||
<DevelopmentDependency>true</DevelopmentDependency>
|
||||
|
@ -12,14 +11,9 @@
|
|||
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
|
||||
<GenerateAssemblyVersionInfo>false</GenerateAssemblyVersionInfo>
|
||||
<NuspecFile>DotNet.ReproducibleBuilds.nuspec</NuspecFile>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<IntermediateAssembly Remove="@(IntermediateAssembly)"/>
|
||||
<IntermediateRefAssembly Remove="@(IntermediateRefAssembly)"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.194" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
|
@ -33,8 +27,17 @@
|
|||
<AssemblyVersion>$(BuildVersionSimple)</AssemblyVersion>
|
||||
|
||||
<NuspecProperties>version=$(NuGetPackageVersion);RepositoryType=git;RepositoryCommit=$(GitCommitId);RepositoryUrl=$(GitRepositoryUrl)</NuspecProperties>
|
||||
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="CustomPack" BeforeTargets="Pack">
|
||||
<!--
|
||||
Manually package the nuget.
|
||||
|
||||
There's no way to use the pack targets without it putting Exclude=Build,Analyzers, which we don't
|
||||
want. We also explicitly need the dependent reference's build targets to run (for soucelink). That's
|
||||
why we specify the nuspec directly.
|
||||
-->
|
||||
<Exec Command="nuget pack DotNet.ReproducibleBuilds.nuspec -outputdirectory $(PackageOutputPath) -basepath . -NoPackageAnalysis -Properties "$(NuspecProperties)"" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
Загрузка…
Ссылка в новой задаче