File: FsSrGen.fs

package info (click to toggle)
fsharp 3.1.1.26%2Bdfsg2-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 59,244 kB
  • ctags: 4,190
  • sloc: cs: 13,398; ml: 1,098; sh: 399; makefile: 293; xml: 82
file content (46 lines) | stat: -rwxr-xr-x 1,349 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

namespace Microsoft.FSharp.Build

open System
open Microsoft.Build.Framework
open Microsoft.Build.Utilities

type FsSrGen() =
    inherit ToolTask()
    let mutable inputFile  : string = null
    let mutable toolPath : string = null
    let mutable outputFsFile : string = null
    let mutable outputResxFile : string = null
    [<Required>]
    member this.InputFile
        with get ()  = inputFile
        and  set (s) = inputFile <- s
    [<Required>]
    [<Output>]
    member this.OutputFsFile
        with get ()  = outputFsFile
        and  set (s) = outputFsFile <- s
    [<Required>]
    [<Output>]
    member this.OutputResxFile
        with get ()  = outputResxFile
        and  set (s) = outputResxFile <- s

    // For targeting other versions
    member this.ToolPath
        with get ()  = toolPath
        and  set (s) = toolPath <- s
        
    // ToolTask methods
    override this.ToolName = "fssrgen.exe"

    override this.GenerateFullPathToTool() =
        System.IO.Path.Combine(toolPath, this.ToolExe)

    override this.GenerateCommandLineCommands() =
        let builder = new CommandLineBuilder()
        builder.AppendSwitchIfNotNull(" ", inputFile)
        builder.AppendSwitchIfNotNull(" ", outputFsFile)
        builder.AppendSwitchIfNotNull(" ", outputResxFile)
        let args = builder.ToString()
        args