-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.vssbe
311 lines (311 loc) · 11.4 KB
/
.vssbe
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
{
"Header": {
"_": [
" This file for vsSolutionBuildEvent ",
" https://github.com/3F/vsSolutionBuildEvent "
],
"Compatibility": "0.12.4"
},
"PreBuild": [
{
"Enabled": true,
"Name": "Definitions",
"Caption": "Prepares data",
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[$(revDeltaBase = \"2016/11/05\")]",
"#[$(revDeltaMin = $([System.Math]::Pow(10, 3)))]",
"#[$(revDeltaMax = 65534)] #[\" limit of AssemblyVersion (2^16 - 2) - i.e. 65534 max allowed \"]",
"",
"#[\"",
" Prepares data - version, revBuild & information from git",
"\"]",
"",
"#[var tBase = $([System.DateTime]::Parse('$(revDeltaBase)').ToBinary())]",
"#[var tNow = $([System.DateTime]::UtcNow.Ticks)]",
"#[var revBuild = #[$(",
" [System.TimeSpan]::FromTicks('$(",
" [MSBuild]::Subtract($(tNow), $(tBase))",
" )')",
" .TotalMinutes.ToString('0')",
")]]",
" ",
"#[var revBuild = #[$(",
"",
" [MSBuild]::Add(",
" $(revDeltaMin), ",
" $([MSBuild]::Modulo(",
" $(revBuild), ",
" $([MSBuild]::Subtract(",
" $(revDeltaMax), $(revDeltaMin)",
" ))",
" ))",
" )",
" ",
")]]",
"",
"$(incModules = 'inc/modules/')",
"",
"#[var pDir = vsCommandEvent/]",
"#[var odir = $(SolutionDir)bin/Releases/$(Configuration)/]",
"",
"#[var vssbeConf = $(Configuration:vsCommandEvent)]",
"#[var cfgSDK = $(vssbeConf.Trim('RELDBGCI_SK'))]",
"",
"#[var numCE = #[File get(\".version\")]]",
"",
"#[IO delete.directory(\"$(odir)\", true)]",
"",
"#[var tplVersion = // This code was generated by a vsSolutionBuildEvent. ",
"// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.",
"namespace net.r_eg.vsCE%namespace%",
"{",
" internal struct Version",
" {",
" public static readonly System.Version number = new System.Version(S_NUM_REV);",
"",
" public const string S_NUM = \"%VersionString%\";",
" public const string S_REV = \"%VersionRev%\";",
"",
" public const string S_NUM_REV = S_NUM + \".\" + S_REV;",
"",
" public const string B_SHA1 = \"%bSha1%\";",
" public const string B_NAME = \"%bName%\";",
" public const string B_REVC = \"%bRevCount%\";",
"",
" internal const string S_INFO = S_NUM_REV + \"+\" + B_SHA1;",
" internal const string S_INFO_FULL = S_INFO;",
" }",
"}]",
""
]
}
},
{
"Enabled": true,
"Name": "ModulesAndPackages",
"Caption": "Submodules and dep packages",
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[$(_tprjs = 'MvsSln;E-MSBuild;LSender;SobaScript;SobaScript.Mapper;SobaScript.Z.Core;SobaScript.Z.Ext;SobaScript.Z.VS;Varhead')]",
"",
"#[$(loop = true)]",
"#[Box iterate(i = 0; $(loop); i += 1): #[try",
"{",
" #[$(_p = \"$(_tprjs.Split(';')[$(i)].Trim())\")]",
" #[try ",
" {",
" #[( $(_p) != \"\" ) ",
" {",
" #[( !(#[IO exists.file(\"$(_p)/$(_p).sln\")]) ) { #[File call(\"git\", \"submodule update --init $(_p)\", 1000)] }]",
" }]",
" }",
" catch(err, msg){ #[IO writeLine(STDERR): Cfg .props.user failed: #[$(msg)] ] }]",
"}",
"catch { $(loop = false) }] ]",
"",
"",
"",
"L-660 Your project does not reference \"...\" framework. Add a reference to ...",
"#[File scall(\"tools\\hmsbuild.bat\", \"-t:restore /v:q /nologo /p:Configuration=$(Configuration) /p:Platform=\\\"Any CPU\\\"\", 1000)]",
"",
"#[\" Packages \"]",
"",
"#[( !(#[IO exists.file(\"packages/__checked\")]) )",
"{",
" #[IO writeLine(STDOUT): Restoring packages. Please wait ...]",
" ",
" #[NuGet gnt.raw(\"/p:ngconfig=\\\"tools/packages.config\\\" /nologo /v:m /m:6\")]",
" ",
" #[IO copy.directory(\"\", \"packages/\", true)]",
" #[File write(\"packages/__checked\"): ]",
"}]"
]
}
},
{
"Enabled": true,
"Name": "Version",
"Caption": "Updating version",
"IgnoreIfBuildFailed": true,
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[\" ",
" Checking of the git to define sha1, branch name, etc.",
"\"]",
"#[var isGit = #[IO cmd(\"git rev-parse 2>&1\")]]",
"#[( $(isGit) == \"\" )",
"{",
" #[var bSha1 = #[File sout(\"git\", \"rev-parse --short HEAD\")]]",
" #[var bName = #[File sout(\"git\", \"rev-parse --abbrev-ref HEAD\")]]",
" #[var bRevCount = #[File sout(\"git\", \"rev-list HEAD --count\")]]",
" ",
" #[var csVersion = $(tplVersion.Replace(%bName%, \"$(bName)\").Replace(%bSha1%, \"$(bSha1)\").Replace(%bRevCount%, \"$(bRevCount)\"))]",
" ",
" #[($(bName) == \"HEAD\") {",
" #[var bName = $(APPVEYOR_REPO_BRANCH)]",
" }]",
"}",
"else {",
" #[var bSha1 =-] #[var bName =-] #[var bRevCount =-]",
" #[var csVersion = $(tplVersion.Replace(%bName%, \"-\").Replace(%bSha1%, \"-\").Replace(%bRevCount%, \"-\"))]",
"}]",
"",
"",
"#[\"",
" 'vsSolutionBuildEvent' project",
"\"]",
"",
"#[var cs = $(csVersion.Replace(\"%Version%\", \"$(numCE.Replace('.', ', ')), $(revBuild)\").Replace(\"%namespace%\", \"\"))]",
"#[var cs = $(cs.Replace(\"%VersionRev%\", \"$(revBuild)\").Replace(\"%VersionString%\", \"$(numCE)\"))]",
"#[File write(\"#[var pDir]Version.cs\"):#[var cs]]",
"",
"",
"#[\"",
" .vsixmanifest",
"\"]",
"",
"#[var vsixvnum = #[var numCE]]",
"",
"#[( $(IsRCI) ) {",
" #[var numCE = #[var numCE].#[var revBuild]]",
" $(fRCI = 'RCI/')",
"}",
"else{ $(fRCI = '') }]",
"",
"#[File replace.Regexp(\"#[var pDir]/sdk10.vsixmanifest\", \"<Version>[0-9.]+</Version>\", \"<Version>#[var vsixvnum]</Version>\")]",
"",
"#[File replace.Regexp(\"#[var pDir]/sdk15.vsixmanifest\", \"(<Identity.*?) Version=\\\"[0-9.]+\\\"\", \"$1 Version=\\\"#[var vsixvnum]\\\"\")]",
"",
"#[File replace.Regexp(\"#[var pDir]/sdk17.vsixmanifest\", \"(<Identity.*?) Version=\\\"[0-9.]+\\\"\", \"$1 Version=\\\"#[var vsixvnum]\\\"\")]",
""
]
}
},
{
"Enabled": true,
"Name": "IncProps",
"Caption": "`.props.user` properties for inc modules",
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"",
"#[\" TODO: migrate to .props \"]",
"",
"#[var tplProps =",
"<Project>",
" <PropertyGroup>",
" <Version>$v</Version>",
" </PropertyGroup>",
"</Project>",
"]",
"",
"#[$(_tprjs = 'E-MSBuild;LSender;SobaScript;SobaScript.Mapper;SobaScript.Z.Core;SobaScript.Z.Ext;SobaScript.Z.VS;Varhead')]",
"",
"#[$(loop = true)]",
"#[Box iterate(i = 0; $(loop); i += 1): #[try",
"{",
" #[$(_p = \"$(_tprjs.Split(';')[$(i)].Trim())\")]",
" #[try ",
" {",
" #[( $(_p) != \"\" ) ",
" {",
" #[File write(\"$(incModules)/$(_p)/.props.user\"): #[$(tplProps.Replace('$v', '#[File get(\"$(_p)/.version\")]'))]]",
" }]",
" }",
" catch(err, msg){ #[IO writeLine(STDERR): Cfg .props.user failed: #[$(msg)] ] }]",
"}",
"catch { $(loop = false) }] ]"
]
}
},
{
"Enabled": true,
"Name": "Fvsixmanifest",
"Caption": "source.extension.vsixmanifest",
"IgnoreIfBuildFailed": true,
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[IO copy.file(\"$(pDir)/sdk$(cfgSDK).vsixmanifest\", \"$(pDir)/source.extension.vsixmanifest\", true)]",
""
]
}
}
],
"PostBuild": [
{
"Enabled": true,
"Name": "Definitions",
"Caption": "Definitions for POST",
"IgnoreIfBuildFailed": true,
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[var cfg = #[( $(Configuration) ^= \"REL_\" || $(Configuration) ^= \"RCI_\" ){Release}else{Debug}]]",
"#[var cfgFull = $(Configuration)]",
"#[var vsixLib = $(SolutionDir)bin\\prj\\vsCommandEvent\\$(Configuration)\\]",
"",
"#[var netStamp = $(NetTargetVName:vsCommandEvent)]",
"#[var netVerString = $(TargetFrameworkVersion:vsCommandEvent)]",
"#[var msbuildver = v$(MSBuildToolsVersion)]",
"",
"",
"##[IO delete.directory(\"$(odir)\", true)]",
"#[IO copy.directory(\"\", \"$(odir)\", true)]"
]
}
},
{
"Enabled": true,
"Name": "ReleaseNotes",
"Caption": "Release notes",
"IgnoreIfBuildFailed": true,
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[File write(\"$(odir)\\build.SDK$(cfgSDK).txt\"):vsCommandEvent #[var numCE]+#[var bSha1]",
"",
"",
"Configuration: #[var fRCI]#[var cfgFull] ( #[var cfg] )",
"SDK base: #[var cfgSDK]",
"",
"Sha1: #[var bSha1]",
"",
"Build: #[var revBuild]",
"",
"",
":: generated by a vsSolutionBuildEvent #[$(vsSolutionBuildEvent)]",
"]",
""
]
}
},
{
"Enabled": true,
"Name": "PackVSCE",
"Caption": "Pack 'vsSCE'",
"IgnoreIfBuildFailed": true,
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[IO copy.file(",
" \"$(vsixLib)vsCommandEvent.vsix\", ",
" \"$(odir)vsCommandEvent.$(vsixvnum)+$(bSha1)-SDK$(cfgSDK).vsix\", ",
" true)]"
]
}
}
]
}