-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
.vssbe
190 lines (190 loc) · 7.17 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
{
"Header": {
"_": [
"https://github.com/3F/vsSolutionBuildEvent"
],
"Compatibility": "0.9"
},
"PreBuild": [
{
"Enabled": true,
"Name": "ActDir",
"Caption": "To prepare directories",
"SupportMSBuild": true,
"SupportSBEScripts": true,
"IgnoreIfBuildFailed": false,
"BuildType": "Common",
"Confirmation": false,
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[$(dbin = \"bin/Release/\")]",
"",
"$(odir = \"$(dbin)raw/\")",
"",
"#[IO delete.directory(\"$(dbin)\", true)]",
"#[IO copy.directory(\"\", \"$(dbin)\", true)]",
"",
"#[$(dobj = \"obj/\")]",
"#[IO copy.directory(\"\", \"$(dobj)\", true)]"
]
}
},
{
"Enabled": true,
"Name": "ActBuild",
"Caption": "Build core",
"SupportMSBuild": true,
"SupportSBEScripts": true,
"BuildType": "Common",
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[$(revDeltaBase = \"2017/08/12\")]",
"#[$(revDeltaMin = $([System.Math]::Pow(10, 3)))]",
"#[$(revDeltaMax = 65534)] #[\" limit of AssemblyVersion (2^16 - 2) - i.e. 65534 max allowed \"]",
"",
"#[var pVer = #[File get(\".version\")]]",
"",
"#[\" ",
" Calculate revision",
"\"]",
"#[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)",
" ))",
" ))",
" )",
" )]",
"]",
"",
"#[$(pVerPrintFile = \"$(pVer).$(revBuild)\"))]",
"",
"#[\" ",
" Checking of the git folder +tool & define sha1, branch name, etc.",
"\"]",
"#[var isGit = #[IO cmd(\"git rev-parse 2>&1\")]]",
"#[( $(isGit) == \"\" )",
"{",
" #[var bSha1 = #[IO sout(\"git\", \"rev-parse --short HEAD\")]]",
" ",
" #[$(pVerPrintFile = \"$(pVerPrintFile)+$(bSha1)\")]",
"}",
"else {",
" #[$(bSha1 = '-')]",
"}]",
"",
"#[( $(reltype) == \"PublicRelease\" ) {",
" #[$(pVerPrintApp = \"$(pVer).$(revBuild)+$(bSha1)\")]",
"}",
"else {",
" #[$(pVerPrintApp = $(pVer))]",
"}]",
"",
"#[\" obj \"]",
"",
"#[IO copy.file(\"logic.targets\", \"$(dobj)core\", true)]",
"#[IO replace.Regex(\"$(dobj)core\", \"<GetNuTool>.*?</GetNuTool>\", \"<GetNuTool>$(pVerPrintApp)</GetNuTool>\")]",
"",
"#[IO writeLine(STDOUT):#[File sout(\"netmsb.bat\", \"minified/.compressor /p:core=\\\"../$(dobj)core\\\" /p:output=\\\"../$(dobj)gnt.min.core\\\" /nologo /v:m /m:4\", 400)]]",
"",
"#[IO writeLine(STDOUT):#[File sout(\"netmsb.bat\", \"embedded/.packer /p:core=\\\"../$(dobj)gnt.min.core\\\" /p:output=\\\"../$(dobj)gnt.bat\\\" /nologo /v:m /m:4\", 400)]]",
"",
"",
"#[\" ",
" .compressor for executable version (batch)",
"\"]",
"#[IO writeLine(STDOUT):#[File sout(\"netmsb.bat\", \"embedded/.compressor /p:core=\\\"../$(dobj)gnt.bat\\\" /p:output=\\\"../$(dobj)gnt.minified.bat\\\" /nologo /v:m /m:4\", 400)]]",
"#[IO copy.file(\"$(dobj)gnt.bat\", \"$(dobj)gnt.full.bat\", true)]",
"#[IO copy.file(\"$(dobj)gnt.minified.bat\", \"$(dobj)gnt.bat\", true)]",
"#[IO delete.files({\"$(dobj)gnt.minified.bat\"})]",
"",
"#[IO writeLine(STDOUT): Validating the generated version ...]",
"",
"#[IO copy.file(\"embedded/sha1*\", \"$(dobj)\", true)]",
"#[IO writeLine(STDOUT):#[File sout(\"$(dobj)sha1.cmd\", \"\", 400)]]"
]
}
}
],
"PostBuild": [
{
"Enabled": true,
"Name": "ActBin",
"Caption": "Binaries & tools ...",
"SupportMSBuild": true,
"SupportSBEScripts": true,
"IgnoreIfBuildFailed": true,
"BuildType": "Common",
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[IO copy.file(\"$(dobj)core\", \"$(odir)core/gnt.core\", true)]",
"#[IO copy.file(\"$(dobj)gnt.min.core\", \"$(odir)core-minified/gnt.core\", true)]",
"#[IO copy.file(\"$(dobj)gnt.bat\", \"$(odir)versions/01. executable/gnt.bat\", true)]",
"#[IO copy.file(\"$(dobj)gnt.bat.map\", \"$(odir)versions/01. executable/gnt.bat.map\", true)]",
"",
"#[IO copy.file({",
" \"$(odir)core-minified/gnt.core\", ",
" \"caller/gnt.bat\"",
" }, ",
" \"$(odir)versions/02. wrapper/\", true)]",
"",
"#[IO copy.file(\"README.md\", \"$(odir)doc/Readme.md\", true)]",
"",
"#[IO write(\"$(odir)msbuild.bat\"):@echo off",
"echo.",
"echo The MSBuild-helper from GetNuTool is obsolete and was replaced by hMSBuild project.",
"echo Please look here: https://github.com/3F/hMSBuild",
"echo.",
"pause",
"]",
"",
"#[IO copy.file(\"changelog.txt\", \"$(odir)doc/\", true)]",
"",
"##[IO copy.file({",
" \"msbuild.bat\",",
" \"LICENSE\"",
" },",
" \"$(odir)\", true)]",
"",
"#[IO copy.file(\"LICENSE\", \"$(odir)License.txt\", true)]"
]
}
},
{
"Enabled": true,
"Name": "ActZip",
"Caption": "Create Zip archive",
"SupportMSBuild": true,
"SupportSBEScripts": true,
"IgnoreIfBuildFailed": true,
"BuildType": "Common",
"Confirmation": false,
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[7z pack.directory(\"$(dbin)raw\", \"$(dbin)GetNuTool.$(pVerPrintFile).zip\")]",
"",
"#[IO copy.file(\"$(odir)versions/01. executable/gnt.bat\", \"$(dbin)gnt.bat\", true)]"
]
}
}
]
}