Skip to content

Commit 5ddd120

Browse files
committed
renaming back to system in the Xake.SystemTasks
1 parent e6ff0a3 commit 5ddd120

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

build.fsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ if not (System.IO.File.Exists file) then
1414

1515
open Xake
1616

17+
let TestsAssembly = "bin/XakeLibTests.dll"
18+
1719
let systemClr cmd args =
1820
let cmd',args' = if Xake.Env.isUnix then "mono", cmd::args else cmd,args
1921
in system cmd' args'
@@ -27,7 +29,7 @@ do xake {ExecOptions.Default with Vars = ["NETFX-TARGET", "4.5"]; FileLog = "bui
2729
do! need ["test"]
2830
}
2931

30-
"build" <== ["bin/XakeLibTests.dll"; "bin/Xake.Core.dll"]
32+
"build" <== [TestsAssembly; "bin/Xake.Core.dll"]
3133
"clean" => action {
3234
do! rm ["bin/*.*"]
3335
}
@@ -41,8 +43,8 @@ do xake {ExecOptions.Default with Vars = ["NETFX-TARGET", "4.5"]; FileLog = "bui
4143
}
4244

4345
"test" => action {
44-
45-
let! exit_code = systemClr "packages/NUnit.Runners/tools/nunit-console.exe" ["./bin/XakeLibTests.dll"]
46+
do! need[TestsAssembly]
47+
let! exit_code = systemClr "packages/NUnit.Runners/tools/nunit-console.exe" [TestsAssembly]
4648
if exit_code <> 0 then
4749
failwith "Failed to test"
4850
}
@@ -101,7 +103,7 @@ do xake {ExecOptions.Default with Vars = ["NETFX-TARGET", "4.5"]; FileLog = "bui
101103

102104
}
103105

104-
"bin/XakeLibTests.dll" *> fun file -> action {
106+
TestsAssembly *> fun file -> action {
105107

106108
// TODO --doc:..\bin\Xake.Core.XML --- multitarget rule!
107109

core/DotnetTasks.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ module DotnetTasks =
327327
do! trace Debug "Command line: '%s %s'" fwkInfo.CscTool (args |> Seq.map Impl.escapeArgument |> String.concat "\r\n\t")
328328

329329
let options = {
330-
SystemTasks.Options.Default with
330+
SystemTasks.SysOptions.Default with
331331
LogPrefix = "[CSC] "
332332
StdOutLevel = fun _ -> Level.Verbose
333333
ErrOutLevel = Impl.levelFromString Level.Verbose
@@ -477,7 +477,7 @@ module DotnetTasks =
477477
do! trace Debug "Command line: '%s'" args
478478

479479
let options = {
480-
SystemTasks.Options.Default with
480+
SystemTasks.SysOptions.Default with
481481
LogPrefix = pfx
482482
StdOutLevel = fun _ -> Level.Info
483483
ErrOutLevel = Impl.levelFromString Level.Verbose
@@ -595,7 +595,7 @@ module DotnetTasks =
595595
do! trace Debug "Command line: '%s %s'" fsc (args |> Seq.map Impl.escapeArgument |> String.concat "\r\n\t")
596596

597597
let options = {
598-
SystemTasks.Options.Default with
598+
SystemTasks.SysOptions.Default with
599599
LogPrefix = "[FSC] "
600600
StdOutLevel = fun _ -> Level.Verbose
601601
ErrOutLevel = Impl.levelFromString Level.Verbose

core/SystemTasks.fs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module SystemTasks =
4040
return proc.ExitCode
4141
}
4242

43-
type Options = {
43+
type SysOptions = {
4444
LogPrefix:string;
4545
StdOutLevel: string -> Level; ErrOutLevel: string -> Level;
4646
EnvVars: (string * string) list
@@ -85,25 +85,25 @@ module SystemTasks =
8585
return errorlevel
8686
}
8787

88-
type OptionsFn = Options -> Options
88+
type ExecOptionsFn = SysOptions -> SysOptions
8989

9090
/// <summary>
9191
/// Executes external process and waits until it completes
9292
/// </summary>
9393
/// <param name="opts">Options setters</param>
9494
/// <param name="cmd">Command or executable name.</param>
9595
/// <param name="args">Command arguments.</param>
96-
let system (opts: OptionsFn) (cmd: string) (args: string seq) =
96+
let system (opts: ExecOptionsFn) (cmd: string) (args: string seq) =
9797
action {
9898
do! trace Info "[shell.run] starting '%s'" cmd
99-
let! exitCode = _system (opts Options.Default) cmd (args |> String.concat " ")
99+
let! exitCode = _system (opts SysOptions.Default) cmd (args |> String.concat " ")
100100
do! trace Info "[shell.run] completed '%s' exitcode: %d" cmd exitCode
101101

102102
return exitCode
103103
}
104104

105-
let useClr: OptionsFn = fun o -> {o with UseClr = true}
106-
let checkErrorLevel: OptionsFn = fun o -> {o with FailOnErrorLevel = true}
105+
let useClr: ExecOptionsFn = fun o -> {o with UseClr = true}
106+
let checkErrorLevel: ExecOptionsFn = fun o -> {o with FailOnErrorLevel = true}
107107

108108
[<AutoOpen>]
109109
module CommonTasks =
@@ -112,5 +112,5 @@ module CommonTasks =
112112
/// </summary>
113113
/// <param name="cmd">Command or executable name.</param>
114114
/// <param name="args">Command arguments.</param>
115-
[<System.Obsolete("Use shell id... instead")>]
115+
[<System.Obsolete("Use Xake.SystemTasks.system id cmd... instead")>]
116116
let system cmd args = SystemTasks.system id cmd args

core/Xake.Core.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<Compile Include="WorkerPool.fs" />
7575
<Compile Include="Progress.fs" />
7676
<Compile Include="XakeScript.fs" />
77-
<Compile Include="CommonTasks.fs" />
77+
<Compile Include="SystemTasks.fs" />
7878
<Compile Include="FileTasks.fs" />
7979
<Compile Include="ResourceFileset.fs" />
8080
<Compile Include="DotNetFwk.fs" />

0 commit comments

Comments
 (0)