1
- using System . IO ;
2
- using System . Text ;
1
+ using System . Text ;
3
2
4
3
public class ArgumentBuilder
5
4
{
@@ -8,53 +7,86 @@ public ArgumentBuilder(string workingDirectory)
8
7
this . workingDirectory = workingDirectory ;
9
8
}
10
9
11
- public string WorkingDirectory
10
+
11
+ public ArgumentBuilder ( string workingDirectory , string exec , string execArgs , string projectFile , string projectArgs , string logFile , bool isTeamCity )
12
12
{
13
- get { return workingDirectory ; }
13
+ this . workingDirectory = workingDirectory ;
14
+ this . exec = exec ;
15
+ this . execArgs = execArgs ;
16
+ this . projectFile = projectFile ;
17
+ this . projectArgs = projectArgs ;
18
+ this . logFile = logFile ;
19
+ this . isTeamCity = isTeamCity ;
14
20
}
15
21
16
- public string Exec { get ; set ; }
22
+ public ArgumentBuilder ( string workingDirectory , string additionalArguments , bool isTeamCity )
23
+ {
24
+ this . workingDirectory = workingDirectory ;
25
+ this . isTeamCity = isTeamCity ;
26
+ this . additionalArguments = additionalArguments ;
27
+ }
17
28
18
- public string ExecArgs { get ; set ; }
19
29
20
- public string ProjectFile { get ; set ; }
30
+ public string WorkingDirectory
31
+ {
32
+ get { return workingDirectory ; }
33
+ }
21
34
22
- public string ProjectArgs { get ; set ; }
23
35
24
- public string LogFile { get ; set ; }
36
+ public string LogFile
37
+ {
38
+ get { return logFile ; }
39
+ }
25
40
26
- public bool IsTeamCity { get ; set ; }
41
+ public bool IsTeamCity
42
+ {
43
+ get { return isTeamCity ; }
44
+ }
27
45
28
- public string AdditionalArguments { get ; set ; }
29
46
30
47
public override string ToString ( )
31
48
{
32
49
var arguments = new StringBuilder ( ) ;
33
50
34
- arguments . AppendFormat ( "\" {0}\" " , WorkingDirectory ) ;
51
+ arguments . AppendFormat ( "\" {0}\" " , workingDirectory ) ;
35
52
36
- if ( ! string . IsNullOrWhiteSpace ( Exec ) )
37
- arguments . AppendFormat ( " /exec \" {0}\" " , Exec ) ;
53
+ if ( ! string . IsNullOrWhiteSpace ( exec ) )
54
+ {
55
+ arguments . AppendFormat ( " /exec \" {0}\" " , exec ) ;
56
+ }
38
57
39
- if ( ! string . IsNullOrWhiteSpace ( ExecArgs ) )
40
- arguments . AppendFormat ( " /execArgs \" {0}\" " , ExecArgs ) ;
58
+ if ( ! string . IsNullOrWhiteSpace ( execArgs ) )
59
+ {
60
+ arguments . AppendFormat ( " /execArgs \" {0}\" " , execArgs ) ;
61
+ }
41
62
42
- if ( ! string . IsNullOrWhiteSpace ( ProjectFile ) )
43
- arguments . AppendFormat ( " /proj \" {0}\" " , ProjectFile ) ;
63
+ if ( ! string . IsNullOrWhiteSpace ( projectFile ) )
64
+ {
65
+ arguments . AppendFormat ( " /proj \" {0}\" " , projectFile ) ;
66
+ }
44
67
45
- if ( ! string . IsNullOrWhiteSpace ( ProjectArgs ) )
46
- arguments . AppendFormat ( " /projargs \" {0}\" " , ProjectArgs ) ;
68
+ if ( ! string . IsNullOrWhiteSpace ( projectArgs ) )
69
+ {
70
+ arguments . AppendFormat ( " /projargs \" {0}\" " , projectArgs ) ;
71
+ }
47
72
48
- arguments . Append ( AdditionalArguments ) ;
73
+ arguments . Append ( additionalArguments ) ;
49
74
50
- if ( ! string . IsNullOrWhiteSpace ( LogFile ) )
75
+ if ( ! string . IsNullOrWhiteSpace ( logFile ) )
51
76
{
52
- arguments . AppendFormat ( " /l \" {0}\" " , LogFile ) ;
77
+ arguments . AppendFormat ( " /l \" {0}\" " , logFile ) ;
53
78
}
54
79
55
80
return arguments . ToString ( ) ;
56
81
}
57
82
58
83
84
+ readonly string additionalArguments ;
85
+ readonly string exec ;
86
+ readonly string execArgs ;
87
+ readonly bool isTeamCity ;
88
+ readonly string logFile ;
89
+ readonly string projectArgs ;
90
+ readonly string projectFile ;
59
91
readonly string workingDirectory ;
60
92
}
0 commit comments