11using Cake . Common . Tools . DotNet . Pack ;
2- using Cake . Common . Tools . NuGet . Pack ;
32using Common . Utilities ;
43
54namespace Build . Tasks ;
@@ -14,7 +13,6 @@ public override void Run(BuildContext context)
1413 context . EnsureDirectoryExists ( Paths . Nuget ) ;
1514
1615 PackageWithCli ( context ) ;
17- PackageUsingNuspec ( context ) ;
1816 }
1917 private static void PackageWithCli ( BuildContext context )
2018 {
@@ -34,33 +32,4 @@ private static void PackageWithCli(BuildContext context)
3432 settings . ArgumentCustomization = arg => arg . Append ( "/p:IsPackaging=true" ) ;
3533 context . DotNetPack ( "./src/GitVersion.MsBuild" , settings ) ;
3634 }
37- private static void PackageUsingNuspec ( BuildContextBase context )
38- {
39- var cmdlineNuspecFile = Paths . Nuspec . CombineWithFilePath ( "GitVersion.CommandLine.nuspec" ) ;
40- if ( ! context . FileExists ( cmdlineNuspecFile ) )
41- return ;
42-
43- var artifactPath = context . MakeAbsolute ( Paths . ArtifactsBinCmdline ) . FullPath ;
44- var version = context . Version ;
45- var gitVersion = version ? . GitVersion ;
46- var nugetSettings = new NuGetPackSettings
47- {
48- // KeepTemporaryNuSpecFile = true,
49- Version = version ? . NugetVersion ,
50- NoPackageAnalysis = true ,
51- OutputDirectory = Paths . Nuget ,
52- Repository = new NuGetRepository
53- {
54- Branch = gitVersion ? . BranchName ,
55- Commit = gitVersion ? . Sha
56- } ,
57- Files = context . GetFiles ( artifactPath + "/**/*.*" )
58- . Select ( file => new NuSpecContent { Source = file . FullPath , Target = file . FullPath . Replace ( artifactPath , "" ) } )
59- . Concat ( context . GetFiles ( "docs/**/package_icon.png" ) . Select ( file => new NuSpecContent { Source = file . FullPath , Target = "package_icon.png" } ) )
60- . Concat ( context . GetFiles ( "build/nuspec/README.md" ) . Select ( file => new NuSpecContent { Source = file . FullPath , Target = "README.md" } ) )
61- . ToArray ( )
62- } ;
63-
64- context . NuGetPack ( cmdlineNuspecFile , nugetSettings ) ;
65- }
6635}
0 commit comments