@@ -21,21 +21,50 @@ public override void Run(BuildContext context)
21
21
{
22
22
context . EnsureDirectoryExists ( Paths . Nuget ) ;
23
23
24
- var portableNuspecFile = Paths . Nuspec . CombineWithFilePath ( "GitVersion.Portable.nuspec" ) ;
25
- if ( ! context . FileExists ( portableNuspecFile ) )
26
- return ;
27
-
28
24
var artifactPath = context . MakeAbsolute ( Paths . ArtifactsBinPortable ) . FullPath ;
29
25
26
+ var portableSettings = GetChocolateyPackSettings ( context , "GitVersion.Portable" ) ;
27
+ portableSettings . Files = context . GetFiles ( artifactPath + "/**/*.*" )
28
+ . Select ( file => new ChocolateyNuSpecContent { Source = file . FullPath , Target = file . FullPath . Replace ( artifactPath , "" ) } )
29
+ . ToArray ( ) ;
30
+
31
+ context . ChocolateyPack ( portableSettings ) ;
32
+
33
+ var metaPackageSettings = GetChocolateyPackSettings ( context , "GitVersion" ) ;
34
+ metaPackageSettings . Files = context . GetFiles ( artifactPath + "/**/*.txt" )
35
+ . Select ( file => new ChocolateyNuSpecContent { Source = file . FullPath , Target = file . FullPath . Replace ( artifactPath , "" ) } )
36
+ . ToArray ( ) ;
37
+
38
+ metaPackageSettings . Dependencies = new [ ]
39
+ {
40
+ new ChocolateyNuSpecDependency { Id = "GitVersion.Portable" , Version = context . Version ? . ChocolateyVersion }
41
+ } ;
42
+
43
+ context . ChocolateyPack ( metaPackageSettings ) ;
44
+ }
45
+
46
+ private static ChocolateyPackSettings GetChocolateyPackSettings ( BuildContextBase context , string id )
47
+ {
30
48
var chocolateySettings = new ChocolateyPackSettings
31
49
{
32
- LimitOutput = true ,
50
+ Id = id ,
33
51
Version = context . Version ? . ChocolateyVersion ,
52
+ Title = "GitVersion" ,
53
+ Description = "Derives SemVer information from a repository following GitFlow or GitHubFlow." ,
54
+ Authors = new [ ] { "GitTools and Contributors" } ,
55
+ Owners = new [ ] { "GitTools and Contributors" } ,
56
+ Copyright = $ "Copyright GitTools { DateTime . Now . Year } ",
57
+ DocsUrl = new Uri ( "https://gitversion.net/docs/" ) ,
58
+ LicenseUrl = new Uri ( "https://opensource.org/license/mit/" ) ,
59
+ ProjectUrl = new Uri ( "https://github.com/GitTools/GitVersion" ) ,
60
+ ProjectSourceUrl = new Uri ( "https://github.com/GitTools/GitVersion" ) ,
61
+ IconUrl = new Uri ( "https://raw.githubusercontent.com/GitTools/graphics/master/GitVersion/Color/icon_100x100.png" ) ,
62
+ RequireLicenseAcceptance = false ,
63
+ Tags = new [ ] { "Git" , "Versioning" , "GitVersion" , "GitFlowVersion" , "GitFlow" , "GitHubFlow" , "SemVer" } ,
64
+ ReleaseNotes = new [ ] { $ "https://github.com/GitTools/GitVersion/releases/tag/{ context . Version ? . ChocolateyVersion } " } ,
34
65
OutputDirectory = Paths . Nuget ,
35
- Files = context . GetFiles ( artifactPath + "/**/*.*" )
36
- . Select ( file => new ChocolateyNuSpecContent { Source = file . FullPath , Target = file . FullPath . Replace ( artifactPath , "" ) } )
37
- . ToArray ( )
66
+ LimitOutput = true ,
38
67
} ;
39
- context . ChocolateyPack ( portableNuspecFile , chocolateySettings ) ;
68
+ return chocolateySettings ;
40
69
}
41
70
}
0 commit comments