@@ -46,11 +46,6 @@ bool IBuildActions.FileExists(string file)
46
46
47
47
public IList < string > RunProcessIn { get ; } = new List < string > ( ) ;
48
48
public IDictionary < string , int > RunProcess { get ; } = new Dictionary < string , int > ( ) ;
49
-
50
- /// <summary>
51
- /// (process-exit code) pairs for commands that are executed during the assembly of the autobuild script.
52
- /// </summary>
53
- public IDictionary < string , int > RunProcessExecuteDuring { get ; } = new Dictionary < string , int > ( ) ;
54
49
public IDictionary < string , string > RunProcessOut { get ; } = new Dictionary < string , string > ( ) ;
55
50
public IDictionary < string , string > RunProcessWorkingDirectory { get ; } = new Dictionary < string , string > ( ) ;
56
51
public HashSet < string > CreateDirectories { get ; } = new HashSet < string > ( ) ;
@@ -71,7 +66,7 @@ int IBuildActions.RunProcess(string cmd, string args, string? workingDirectory,
71
66
if ( wd != workingDirectory )
72
67
throw new ArgumentException ( $ "Unexpected RunProcessWorkingDirectory, got { wd ?? "null" } expected { workingDirectory ?? "null" } in { pattern } ") ;
73
68
74
- if ( ! RunProcess . TryGetValue ( pattern , out var ret ) && ! RunProcessExecuteDuring . TryGetValue ( pattern , out ret ) )
69
+ if ( ! RunProcess . TryGetValue ( pattern , out var ret ) )
75
70
throw new ArgumentException ( "Missing RunProcess " + pattern ) ;
76
71
77
72
return ret ;
@@ -86,7 +81,7 @@ int IBuildActions.RunProcess(string cmd, string args, string? workingDirectory,
86
81
if ( wd != workingDirectory )
87
82
throw new ArgumentException ( $ "Unexpected RunProcessWorkingDirectory, got { wd ?? "null" } expected { workingDirectory ?? "null" } in { pattern } ") ;
88
83
89
- if ( ! RunProcess . TryGetValue ( pattern , out var ret ) && ! RunProcessExecuteDuring . TryGetValue ( pattern , out ret ) )
84
+ if ( ! RunProcess . TryGetValue ( pattern , out var ret ) )
90
85
throw new ArgumentException ( "Missing RunProcess " + pattern ) ;
91
86
92
87
return ret ;
@@ -167,6 +162,10 @@ IEnumerable<string> IBuildActions.EnumerateDirectories(string dir)
167
162
168
163
bool IBuildActions . IsRunningOnAppleSilicon ( ) => IsRunningOnAppleSilicon ;
169
164
165
+ public bool IsMonoInstalled { get ; set ; }
166
+
167
+ bool IBuildActions . IsMonoInstalled ( ) => IsMonoInstalled ;
168
+
170
169
public string PathCombine ( params string [ ] parts )
171
170
{
172
171
return string . Join ( IsWindows ? '\\ ' : '/' , parts . Where ( p => ! string . IsNullOrWhiteSpace ( p ) ) ) ;
@@ -804,7 +803,7 @@ public void TestDirsProjWindows()
804
803
[ Fact ]
805
804
public void TestDirsProjLinux_WithMono ( )
806
805
{
807
- actions . RunProcessExecuteDuring [ @"mono --version" ] = 0 ;
806
+ actions . IsMonoInstalled = true ;
808
807
809
808
actions . RunProcess [ @"nuget restore C:\Project/dirs.proj -DisableParallelProcessing" ] = 1 ;
810
809
actions . RunProcess [ @"mono scratch/.nuget/nuget.exe restore C:\Project/dirs.proj -DisableParallelProcessing" ] = 0 ;
@@ -817,7 +816,7 @@ public void TestDirsProjLinux_WithMono()
817
816
[ Fact ]
818
817
public void TestDirsProjLinux_WithoutMono ( )
819
818
{
820
- actions . RunProcessExecuteDuring [ @"mono --version" ] = 1 ;
819
+ actions . IsMonoInstalled = false ;
821
820
822
821
actions . RunProcess [ @"dotnet msbuild /t:restore C:\Project/dirs.proj" ] = 0 ;
823
822
actions . RunProcess [ @"dotnet msbuild C:\Project/dirs.proj /t:rebuild" ] = 0 ;
0 commit comments