File tree Expand file tree Collapse file tree 4 files changed +25
-12
lines changed Expand file tree Collapse file tree 4 files changed +25
-12
lines changed Original file line number Diff line number Diff line change 11<Project >
22
3-   <UsingTask  TaskName =" Fsi "   AssemblyFile =" $(FSharpBuildAssemblyFile)"   />
3+   <UsingTask  TaskName =" FsiTestTask "   AssemblyFile =" $(FSharpBuildAssemblyFile)"   />
44
55    <Target 
66        Name =" RunFSharpScript" 
77        Returns =" " 
88        DependsOnTargets =" $(CoreCompileDependsOn)" 
99    >
10-         <Fsi   Condition ="  '%(_CoreCompileResourceInputs.WithCulture)' != 'true' " 
10+       <FsiTestTask 
11+               Condition ="  '%(_CoreCompileResourceInputs.WithCulture)' != 'true' " 
1112              CodePage =" $(CodePage)" 
1213              DefineConstants =" $(DefineConstants)" 
1314              DisabledWarnings =" $(NoWarn)" 
3435              WarningsAsErrors =" $(WarningsAsErrors)"  >
3536          <Output  TaskParameter =" CommandLineArgs"   ItemName =" FsiCommandLineArgs"   />
3637          <Output  TaskParameter =" TextOutput"   ItemName =" FsiTextOutput"   />
37-         </Fsi >
38+         </FsiTestTask >
3839
3940      <ItemGroup >
4041          <_CoreCompileResourceInputs  Remove =" @(_CoreCompileResourceInputs)"   />
Original file line number Diff line number Diff line change 3838    <Compile  Include =" FSharpCommandLineBuilder.fs"   />
3939    <Compile  Include =" Fsc.fs"   />
4040    <Compile  Include =" Fsi.fs"   />
41+     <Compile  Include =" FsiTestTask.fs"   />
4142    <Compile  Include =" FSharpEmbedResourceText.fs"   />
4243    <Compile  Include =" FSharpEmbedResXSource.fs"   />
4344    <Compile  Include =" WriteCodeFragment.fs"   />
Original file line number Diff line number Diff line change @@ -161,12 +161,6 @@ type public Fsi() as this =
161161
162162        builder
163163
164-     let  outputWriter  =  new  StringWriter() 
165- 
166-     override  _.LogEventsFromTextOutput ( line ,  msgImportance )  = 
167-         outputWriter.WriteLine( line) 
168-         base .LogEventsFromTextOutput( line,  msgImportance) 
169- 
170164    // --codepage <int>: Specify the codepage to use when opening source files 
171165    member  _.CodePage 
172166        with  get ()  =  codePage
@@ -289,9 +283,6 @@ type public Fsi() as this =
289283        with  get ()  =  List.toArray commandLineArgs
290284        and  set  value  =  commandLineArgs <-  List.ofArray value
291285
292-     [<Output>] 
293-     member  _.TextOutput  =  outputWriter.ToString() 
294- 
295286    // ToolTask methods 
296287    override  _.ToolName  =  " fsi.exe" 
297288
Original file line number Diff line number Diff line change 1+ // Copyright (c) Microsoft Corporation.  All Rights Reserved.  See License.txt in the project root for license information. 
2+ 
3+ namespace  FSharp.Build.Tests 
4+ 
5+ open  System.IO  
6+ open  Microsoft.Build .Framework  
7+ 
8+ /// MsBuild tool task for capturing stdout from test scripts. 
9+ type  FsiTestTask ()  = 
10+     inherit  FSharp.Build.Fsi() 
11+ 
12+     // Just to keep a reasonable amount of test scipt output. 
13+     let  outputWriter  =  new  StringWriter() 
14+ 
15+     override  _.LogEventsFromTextOutput ( line ,  msgImportance )  = 
16+         outputWriter.WriteLine( line) 
17+         base .LogEventsFromTextOutput( line,  msgImportance) 
18+ 
19+     [<Output>] 
20+     member  _.TextOutput  =  outputWriter.ToString() 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments