@@ -23,16 +23,19 @@ public class CsProjClassicNetToolchain : Toolchain
23
23
[ PublicAPI ] public static readonly IToolchain Net48 = new CsProjClassicNetToolchain ( "net48" , ".NET Framework 4.8" ) ;
24
24
[ PublicAPI ] public static readonly IToolchain Net481 = new CsProjClassicNetToolchain ( "net481" , ".NET Framework 4.8.1" ) ;
25
25
26
- private CsProjClassicNetToolchain ( string targetFrameworkMoniker , string name , string packagesPath = null )
26
+ internal string CustomDotNetCliPath { get ; }
27
+
28
+ private CsProjClassicNetToolchain ( string targetFrameworkMoniker , string name , string packagesPath = null , string customDotNetCliPath = null )
27
29
: base ( name ,
28
- new CsProjGenerator ( targetFrameworkMoniker , cliPath : null , packagesPath : packagesPath , runtimeFrameworkVersion : null , isNetCore : false ) ,
29
- new DotNetCliBuilder ( targetFrameworkMoniker , customDotNetCliPath : null ) ,
30
+ new CsProjGenerator ( targetFrameworkMoniker , customDotNetCliPath , packagesPath , runtimeFrameworkVersion : null , isNetCore : false ) ,
31
+ new DotNetCliBuilder ( targetFrameworkMoniker , customDotNetCliPath ) ,
30
32
new Executor ( ) )
31
33
{
34
+ CustomDotNetCliPath = customDotNetCliPath ;
32
35
}
33
36
34
- public static IToolchain From ( string targetFrameworkMoniker , string packagesPath = null )
35
- => new CsProjClassicNetToolchain ( targetFrameworkMoniker , targetFrameworkMoniker , packagesPath ) ;
37
+ public static IToolchain From ( string targetFrameworkMoniker , string packagesPath = null , string customDotNetCliPath = null )
38
+ => new CsProjClassicNetToolchain ( targetFrameworkMoniker , targetFrameworkMoniker , packagesPath , customDotNetCliPath ) ;
36
39
37
40
public override IEnumerable < ValidationError > Validate ( BenchmarkCase benchmarkCase , IResolver resolver )
38
41
{
@@ -47,7 +50,7 @@ public override IEnumerable<ValidationError> Validate(BenchmarkCase benchmarkCas
47
50
$ "Classic .NET toolchain is supported only for Windows, benchmark '{ benchmarkCase . DisplayInfo } ' will not be executed",
48
51
benchmarkCase ) ;
49
52
}
50
- else if ( IsCliPathInvalid ( customDotNetCliPath : null , benchmarkCase , out var invalidCliError ) )
53
+ else if ( IsCliPathInvalid ( CustomDotNetCliPath , benchmarkCase , out var invalidCliError ) )
51
54
{
52
55
yield return invalidCliError ;
53
56
}
0 commit comments