@@ -29,6 +29,54 @@ Task("Artifacts-DotnetTool-Test")
29
29
}
30
30
} ) ;
31
31
32
+ Task ( "Artifacts-Commandline-Test" )
33
+ . WithCriteria < BuildParameters > ( ( context , parameters ) => parameters . IsRunningOnWindows , "Artifacts-Commandline-Test can be tested only on Windows agents." )
34
+ . WithCriteria < BuildParameters > ( ( context , parameters ) => parameters . IsReleasingCI , "Artifacts-Commandline-Test works only on Releasing CI." )
35
+ . IsDependentOnWhen ( "Pack-Nuget" , singleStageRun )
36
+ . Does < BuildParameters > ( ( parameters ) =>
37
+ {
38
+ NuGetInstall ( "GitVersion.Commandline" , new NuGetInstallSettings {
39
+ Source = new string [ ] { MakeAbsolute ( parameters . Paths . Directories . NugetRoot ) . FullPath } ,
40
+ ExcludeVersion = true ,
41
+ Prerelease = true ,
42
+ OutputDirectory = parameters . Paths . Directories . ArtifactsRoot
43
+ } ) ;
44
+
45
+ var settings = new GitVersionSettings
46
+ {
47
+ OutputType = GitVersionOutput . Json ,
48
+ ToolPath = parameters . Paths . Directories . ArtifactsRoot . Combine ( "GitVersion.Commandline/tools" ) . CombineWithFilePath ( "gitversion.exe" ) . FullPath
49
+ } ;
50
+ var gitVersion = GitVersion ( settings ) ;
51
+
52
+ Assert . Equal ( parameters . Version . GitVersion . FullSemVer , gitVersion . FullSemVer ) ;
53
+ } ) ;
54
+
55
+ Task ( "Artifacts-Portable-Test" )
56
+ . WithCriteria < BuildParameters > ( ( context , parameters ) => parameters . IsRunningOnWindows , "Artifacts-Portable-Test can be tested only on Windows agents." )
57
+ . WithCriteria < BuildParameters > ( ( context , parameters ) => parameters . IsReleasingCI , "Artifacts-Portable-Test works only on Releasing CI." )
58
+ . IsDependentOnWhen ( "Pack-Chocolatey" , singleStageRun )
59
+ . Does < BuildParameters > ( ( parameters ) =>
60
+ {
61
+ if ( parameters . IsMainBranch && ! parameters . IsPullRequest ) {
62
+ NuGetInstall ( "GitVersion.Portable" , new NuGetInstallSettings {
63
+ Source = new string [ ] { MakeAbsolute ( parameters . Paths . Directories . NugetRoot ) . FullPath } ,
64
+ ExcludeVersion = true ,
65
+ Prerelease = true ,
66
+ OutputDirectory = parameters . Paths . Directories . ArtifactsRoot
67
+ } ) ;
68
+
69
+ var settings = new GitVersionSettings
70
+ {
71
+ OutputType = GitVersionOutput . Json ,
72
+ ToolPath = parameters . Paths . Directories . ArtifactsRoot . Combine ( "GitVersion.Portable/tools" ) . CombineWithFilePath ( "gitversion.exe" ) . FullPath
73
+ } ;
74
+ var gitVersion = GitVersion ( settings ) ;
75
+
76
+ Assert . Equal ( parameters . Version . GitVersion . FullSemVer , gitVersion . FullSemVer ) ;
77
+ }
78
+ } ) ;
79
+
32
80
Task ( "Artifacts-Native-Test" )
33
81
. WithCriteria < BuildParameters > ( ( context , parameters ) => parameters . IsRunningOnLinux , "Artifacts-Native-Test can be tested only on Linux agents." )
34
82
. WithCriteria < BuildParameters > ( ( context , parameters ) => parameters . IsReleasingCI , "Artifacts-Native-Test works only on Releasing CI." )
0 commit comments