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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
using CommandLine;
using CommandLine.Text;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core;
using Tango.Web;
namespace Tango.PPC.Common.Publish
{
public class PublishOptions : ExtendedObject
{
public event EventHandler EnvironmentChanged;
public event EventHandler BuidConfigChanged;
public event EventHandler BasicInfoChanged;
public event EventHandler MachineVersionGuidChanged;
public event EventHandler TfpPathChanged;
public event EventHandler TagChanged;
private String basePath;
[Option("path", HelpText = "Specifies the application base path.", Required = false)]
public String BasePath
{
get { return basePath; }
set { basePath = value; RaisePropertyChangedAuto(); }
}
private String _buildConfig;
[Option("build", HelpText = "Specifies the build configuration.", Required = false, DefaultValue = "Release")]
public String BuildConfig
{
get { return _buildConfig; }
set { _buildConfig = value; RaisePropertyChangedAuto(); BuidConfigChanged?.Invoke(this, new EventArgs()); }
}
private String _email;
[Option("email", HelpText = "Email account used for login to the machine service.", Required = true)]
public String Email
{
get { return _email; }
set { _email = value; RaisePropertyChangedAuto(); BasicInfoChanged?.Invoke(this, new EventArgs()); }
}
private String _password;
[Option("pass", HelpText = "Password used for login to the machine service.", Required = true)]
public String Password
{
get { return _password; }
set { _password = value; RaisePropertyChangedAuto(); BasicInfoChanged?.Invoke(this, new EventArgs()); }
}
private String _comments;
[Option("comments", HelpText = "Optional comments that are attached to this release.", Required = false, DefaultValue = "No comments.")]
public String Comments
{
get { return _comments; }
set { _comments = value; RaisePropertyChangedAuto(); BasicInfoChanged?.Invoke(this, new EventArgs()); }
}
private String _tag;
public String Tag
{
get { return _tag.IsNotNullOrEmpty() ? _tag : null; }
set { _tag = value; RaisePropertyChangedAuto(); TagChanged?.Invoke(this, new EventArgs()); }
}
private DeploymentSlot _environment;
[Option("env", HelpText = "Specifies the target environment to publish.", Required = true)]
public DeploymentSlot Environment
{
get { return _environment; }
set { _environment = value; RaisePropertyChangedAuto(); EnvironmentChanged?.Invoke(this, new EventArgs()); }
}
private String _machineVersionGuid;
[Option("machine-version-guid", HelpText = "Specifies the machine version id for which to upload the PPC version.", Required = true)]
public String MachineVersionGuid
{
get { return _machineVersionGuid; }
set { _machineVersionGuid = value; RaisePropertyChangedAuto(); MachineVersionGuidChanged?.Invoke(this, new EventArgs()); }
}
private String _tfpPath;
[Option("tfp", HelpText = "Specifies Tango Firmware Package file path (.tfp).", Required = true)]
public String TfpPath
{
get { return _tfpPath; }
set { _tfpPath = value; RaisePropertyChangedAuto(); TfpPathChanged?.Invoke(this, new EventArgs()); }
}
private String _installerProject;
[Option("installer-project-file", HelpText = "Specifies the advanced installer project file to build and upload.", Required = false)]
public String InstallerProject
{
get { return _installerProject; }
set { _installerProject = value; RaisePropertyChangedAuto(); }
}
private String _installerOutputFolder;
[Option("installer-output-folder", HelpText = "Specifies where to save the installer application.", Required = false)]
public String InstallerOutputFolder
{
get { return _installerOutputFolder; }
set { _installerOutputFolder = value; RaisePropertyChangedAuto(); }
}
private SynchronizationOptions _synchronization;
public SynchronizationOptions Synchronization
{
get { return _synchronization; }
set { _synchronization = value; RaisePropertyChangedAuto(); }
}
private String _personalAccessToken;
public String PersonalAccessToken
{
get { return _personalAccessToken; }
set { _personalAccessToken = value; RaisePropertyChangedAuto(); }
}
private bool _createTag;
public bool CreateTag
{
get { return _createTag; }
set { _createTag = value; RaisePropertyChangedAuto(); }
}
private bool _autoCommitAndSync;
public bool AutoCommitAndPush
{
get { return _autoCommitAndSync; }
set { _autoCommitAndSync = value; RaisePropertyChangedAuto(); }
}
public PublishOptions()
{
BasePath = AppDomain.CurrentDomain.BaseDirectory + "..\\";
BuildConfig = "Release";
Synchronization = new SynchronizationOptions();
}
public String GetApplicationPath()
{
return Path.Combine(BasePath, BuildConfig);
}
}
}
|