@@ -6,35 +6,39 @@ Task("Artifacts-DotnetTool-Test")
66 . IsDependentOnWhen ( "Pack-Nuget" , singleStageRun )
77 . Does < BuildParameters > ( ( parameters ) =>
88{
9- var currentDir = MakeAbsolute ( Directory ( "." ) ) ;
10- var rootDir = parameters . IsDockerForWindows ? "c:/" : "/" ;
11- var settings = new DockerContainerRunSettings
12- {
13- Rm = true ,
14- Volume = new [ ]
15- {
16- $ "{ currentDir } :{ rootDir } repo",
17- $ "{ currentDir } /artifacts/v{ parameters . Version . SemVersion } /nuget:{ rootDir } nuget"
18- }
19- } ;
9+ var rootPrefix = parameters . DockerRootPrefix ;
10+ var version = parameters . Version . NugetVersion ;
2011
2112 foreach ( var dockerImage in parameters . Docker . Images )
2213 {
23- var ( os , distro , targetframework ) = dockerImage ;
24- var tag = $ "gittools/build-images:{ distro } -sdk-{ targetframework . Replace ( "netcoreapp" , "" ) } ";
25- Information ( "Docker tag: {0}" , tag ) ;
26-
27- var version = parameters . Version . NugetVersion ;
14+ var cmd = $ "dotnet tool install GitVersion.Tool --version { version } --tool-path { rootPrefix } /gitversion --add-source { rootPrefix } /nuget | out-null; ";
15+ cmd += $ "{ rootPrefix } /gitversion/dotnet-gitversion { rootPrefix } /repo /showvariable FullSemver;";
16+
17+ DockerTestArtifact ( dockerImage , parameters , cmd ) ;
18+ }
19+ } ) ;
2820
29- var cmd = $ "dotnet tool install GitVersion.Tool --version { version } --tool-path { rootDir } gitversion --add-source { rootDir } nuget | out-null; ";
30- cmd += $ "{ rootDir } gitversion/dotnet-gitversion { rootDir } repo /showvariable FullSemver;";
31- Information ( "Docker cmd: {0}" , cmd ) ;
21+ Task ( "Artifacts-MsBuild-Test" )
22+ . WithCriteria < BuildParameters > ( ( context , parameters ) => ! parameters . IsRunningOnMacOS , "Artifacts-MsBuild-Test can be tested only on Windows or Linux agents." )
23+ . WithCriteria < BuildParameters > ( ( context , parameters ) => parameters . IsRunningOnAzurePipeline , "Artifacts-MsBuild-Test works only on AzurePipeline." )
24+ . IsDependentOnWhen ( "Pack-Nuget" , singleStageRun )
25+ . Does < BuildParameters > ( ( parameters ) =>
26+ {
27+ var rootPrefix = parameters . DockerRootPrefix ;
28+ var version = parameters . Version . NugetVersion ;
3229
33- DockerTestRun ( settings , parameters , tag , "pwsh" , cmd ) ;
30+ foreach ( var dockerImage in parameters . Docker . Images )
31+ {
32+ var ( os , distro , targetframework ) = dockerImage ;
33+ var cmd = $ "dotnet build { rootPrefix } /repo/test --source { rootPrefix } /nuget --source https://api.nuget.org/v3/index.json -p:GitVersionTaskVersion={ version } -p:TargetFramework={ targetframework } | out-null; ";
34+ cmd += $ "dotnet { rootPrefix } /repo/test/build/corefx/{ targetframework } /TestRepo.dll;";
35+
36+ DockerTestArtifact ( dockerImage , parameters , cmd ) ;
3437 }
3538} ) ;
3639
3740Task ( "Artifacts-Test" )
3841 . WithCriteria < BuildParameters > ( ( context , parameters ) => ! parameters . IsRunningOnMacOS , "Artifacts-Test can be tested only on Windows or Linux agents." )
3942 . WithCriteria < BuildParameters > ( ( context , parameters ) => parameters . IsRunningOnAzurePipeline , "Artifacts-Test works only on AzurePipeline." )
40- . IsDependentOn ( "Artifacts-DotnetTool-Test" ) ;
43+ . IsDependentOn ( "Artifacts-DotnetTool-Test" )
44+ . IsDependentOn ( "Artifacts-MsBuild-Test" ) ;
0 commit comments