ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / build / gulpfile.vscode.linux.ts 307 строк · изменён 14 нояб., 04:52
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
import { gulp, replace, rename } from './lib/gulp/facade.ts' ;
import es from 'event-stream' ;
import vfs from 'vinyl-fs' ;
import { rimraf } from './lib/util.ts' ;
import { getVersion } from './lib/getVersion.ts' ;
import * as task from './lib/gulp/task.ts' ;
import packageJson from '../package.json' with { type: 'json' } ;
import product from '../product.json' with { type
getDependencies
recommendedDeps debianRecommendedDependencies
recommendedDeps rpmRecommendedDependencies
path
cp
promisify
exec cp exec
root path meta dirname
commit root
linuxPackageRevision Math
arch
arch
arch
binaryDir arch
debArch arch
destination debArch product applicationName debArch
dependencies binaryDir product applicationName debArch
desktop gulp base
product applicationName
desktopUrlHandler gulp base
product applicationName
desktops es desktop desktopUrlHandler
product nameLong
product nameShort
product applicationName
product linuxIconName
product urlProtocol
appdata gulp base
product nameLong
product applicationName
product licenseName
product applicationName
workspaceMime gulp base
product nameLong
product applicationName
product applicationName
icon gulp base
product linuxIconName
bash_completion gulp
product applicationName
product applicationName
zsh_completion gulp
product applicationName
product applicationName
code gulp binaryDir base binaryDir
p p dirname product applicationName p dirname
size
control code es
f size f f contents length
that
gulp base
product applicationName
packageJson version linuxPackageRevision
debArch
dependencies
debianRecommendedDependencies
Math size
es f that f that
prerm gulp base
product applicationName
postrm gulp base
product applicationName
postinst gulp base
product applicationName
debArch
templates gulp base
product applicationName
all es control templates postinst postrm prerm desktops appdata workspaceMime icon bash_completion zsh_completion code
all vfs destination
arch
debArch arch
cwd
cwd
cwd
cwd
rpmArch
rpmArch
arch
arch
arch
binaryDir arch
rpmArch arch
stripBinary process env
dependencies binaryDir product applicationName rpmArch
desktop gulp base
product applicationName
desktopUrlHandler gulp base
product applicationName
desktops es desktop desktopUrlHandler
product nameLong
product nameShort
product applicationName
product linuxIconName
product urlProtocol
appdata gulp base
product nameLong
product applicationName
product licenseName
product applicationName
workspaceMime gulp base
product nameLong
product applicationName
product applicationName
icon gulp base
product linuxIconName
bash_completion gulp
product applicationName
product applicationName
zsh_completion gulp
product applicationName
product applicationName
code gulp binaryDir base binaryDir
p p dirname product applicationName p dirname
spec gulp base
product applicationName
product nameLong
product linuxIconName
packageJson version
linuxPackageRevision
rpmArch
product licenseName
product product quality quality
product product updateUrl updateUrl
dependencies
rpmRecommendedDependencies
stripBinary
product applicationName
specIcon gulp base
product applicationName
all es code desktops appdata workspaceMime icon bash_completion zsh_completion spec specIcon
all vfs rpmArch
arch
rpmArch arch
rpmBuildPath rpmArch
rpmOut
destination
arch
arch
binaryDir arch
destination arch
desktop gulp base
desktopUrlHandler gulp base
desktops es desktop desktopUrlHandler
product nameLong
product nameShort
product applicationName
product urlProtocol
icon gulp base
code gulp binaryDir base binaryDir
p p dirname
snapcraft gulp base
product applicationName
commit
arch arch
electronLaunch gulp base
all es desktops icon code snapcraft electronLaunch
all vfs destination
arch
cwd arch
cwd
arch
arch
arch
arch
debArch arch
prepareDebTask task task arch
task prepareDebTask
buildDebTask task arch
task buildDebTask
rpmArch arch
prepareRpmTask task task arch
task prepareRpmTask
buildRpmTask task arch
task buildRpmTask
prepareSnapTask task task arch
task prepareSnapTask
buildSnapTask task task prepareSnapTask arch
task buildSnapTask
:
'json'
}
;
import
{
}
from
'./linux/dependencies-generator.ts'
;
import
{
as
}
from
'./linux/debian/dep-lists.ts'
;
import
{
as
}
from
'./linux/rpm/dep-lists.ts'
;
import
*
as
from
'path'
;
import
*
as
from
'child_process'
;
import
{
}
from
'util'
;
const
=
promisify
(
.
)
;
const
=
.
dirname
(
import
.
.
)
;
const
=
getVersion
(
)
;
const
=
.
floor
(
new
Date
(
)
.
getTime
(
)
/
1000
)
;
function
getDebPackageArch
(
:
string
)
:
string
{
switch
(
)
{
case
'x64'
:
return
'amd64'
;
case
'armhf'
:
return
'armhf'
;
case
'arm64'
:
return
'arm64'
;
default
:
throw
new
Error
(
` Unknown arch: ${ arch} `
)
;
}
}
function
prepareDebPackage
(
:
string
)
{
const
=
'../VSCode-linux-'
+
;
const
=
getDebPackageArch
(
)
;
const
=
'.build/linux/deb/'
+
+
'/'
+
.
+
'-'
+
;
return
async
function
(
)
{
const
=
await
getDependencies
(
'deb'
,
,
.
,
)
;
const
=
.
src
(
'resources/linux/code.desktop'
,
{
:
'.'
}
)
.
pipe
(
rename
(
'usr/share/applications/'
+
.
+
'.desktop'
)
)
;
const
=
.
src
(
'resources/linux/code-url-handler.desktop'
,
{
:
'.'
}
)
.
pipe
(
rename
(
'usr/share/applications/'
+
.
+
'-url-handler.desktop'
)
)
;
const
=
.
merge
(
,
)
.
pipe
(
replace
(
'@@NAME_LONG@@'
,
.
)
)
.
pipe
(
replace
(
'@@NAME_SHORT@@'
,
.
)
)
.
pipe
(
replace
(
'@@NAME@@'
,
.
)
)
.
pipe
(
replace
(
'@@EXEC@@'
,
` /usr/share/ ${ product. applicationName} / ${ product. applicationName} `
)
)
.
pipe
(
replace
(
'@@ICON@@'
,
.
)
)
.
pipe
(
replace
(
'@@URLPROTOCOL@@'
,
.
)
)
;
const
=
.
src
(
'resources/linux/code.appdata.xml'
,
{
:
'.'
}
)
.
pipe
(
replace
(
'@@NAME_LONG@@'
,
.
)
)
.
pipe
(
replace
(
'@@NAME@@'
,
.
)
)
.
pipe
(
replace
(
'@@LICENSE@@'
,
.
)
)
.
pipe
(
rename
(
'usr/share/appdata/'
+
.
+
'.appdata.xml'
)
)
;
const
=
.
src
(
'resources/linux/code-workspace.xml'
,
{
:
'.'
}
)
.
pipe
(
replace
(
'@@NAME_LONG@@'
,
.
)
)
.
pipe
(
replace
(
'@@NAME@@'
,
.
)
)
.
pipe
(
rename
(
'usr/share/mime/packages/'
+
.
+
'-workspace.xml'
)
)
;
const
=
.
src
(
'resources/linux/code.png'
,
{
:
'.'
}
)
.
pipe
(
rename
(
'usr/share/pixmaps/'
+
.
+
'.png'
)
)
;
const
=
.
src
(
'resources/completions/bash/code'
)
.
pipe
(
replace
(
'@@APPNAME@@'
,
.
)
)
.
pipe
(
rename
(
'usr/share/bash-completion/completions/'
+
.
)
)
;
const
=
.
src
(
'resources/completions/zsh/_code'
)
.
pipe
(
replace
(
'@@APPNAME@@'
,
.
)
)
.
pipe
(
rename
(
'usr/share/zsh/vendor-completions/_'
+
.
)
)
;
const
=
.
src
(
+
'/**/*'
,
{
:
}
)
.
pipe
(
rename
(
function
(
)
{
.
=
'usr/share/'
+
.
+
'/'
+
.
;
}
)
)
;
let
=
0
;
const
=
.
pipe
(
.
through
(
function
(
)
{
+=
.
isDirectory
(
)
?
4096
:
.
.
;
}
,
function
(
)
{
const
=
this
;
.
src
(
'resources/linux/debian/control.template'
,
{
:
'.'
}
)
.
pipe
(
replace
(
'@@NAME@@'
,
.
)
)
.
pipe
(
replace
(
'@@VERSION@@'
,
.
+
'-'
+
)
)
.
pipe
(
replace
(
'@@ARCHITECTURE@@'
,
)
)
.
pipe
(
replace
(
'@@DEPENDS@@'
,
.
join
(
', '
)
)
)
.
pipe
(
replace
(
'@@RECOMMENDS@@'
,
.
join
(
', '
)
)
)
.
pipe
(
replace
(
'@@INSTALLEDSIZE@@'
,
.
ceil
(
/
1024
)
.
toString
(
)
)
)
.
pipe
(
rename
(
'DEBIAN/control'
)
)
.
pipe
(
.
through
(
function
(
)
{
.
emit
(
'data'
,
)
;
}
,
function
(
)
{
.
emit
(
'end'
)
;
}
)
)
;
}
)
)
;
const
=
.
src
(
'resources/linux/debian/prerm.template'
,
{
:
'.'
}
)
.
pipe
(
replace
(
'@@NAME@@'
,
.
)
)
.
pipe
(
rename
(
'DEBIAN/prerm'
)
)
;
const
=
.
src
(
'resources/linux/debian/postrm.template'
,
{
:
'.'
}
)
.
pipe
(
replace
(
'@@NAME@@'
,
.
)
)
.
pipe
(
rename
(
'DEBIAN/postrm'
)
)
;
const
=
.
src
(
'resources/linux/debian/postinst.template'
,
{
:
'.'
}
)
.
pipe
(
replace
(
'@@NAME@@'
,
.
)
)
.
pipe
(
replace
(
'@@ARCHITECTURE@@'
,
)
)
.
pipe
(
rename
(
'DEBIAN/postinst'
)
)
;
const
=
.
src
(
'resources/linux/debian/templates.template'
,
{
:
'.'
}
)
.
pipe
(
replace
(
'@@NAME@@'
,
.
)
)
.
pipe
(
rename
(
'DEBIAN/templates'
)
)
;
const
=
.
merge
(
,
,
,
,
,
,
,
,
,
,
,
)
;
return
.
pipe
(
.
dest
(
)
)
;
}
;
}
function
buildDebPackage
(
:
string
)
{
const
=
getDebPackageArch
(
)
;
const
=
` .build/linux/deb/ ${ debArch} `
;
return
async
(
)
=>
{
await
exec
(
` chmod 755 ${ product. applicationName} - ${ debArch} /DEBIAN/postinst ${ product. applicationName} - ${ debArch} /DEBIAN/prerm ${ product. applicationName} - ${ debArch} /DEBIAN/postrm `
,
{
}
)
;
await
exec
(
'mkdir -p deb'
,
{
}
)
;
await
exec
(
` fakeroot dpkg-deb -Zxz -b ${ product. applicationName} - ${ debArch} deb `
,
{
}
)
;
}
;
}
function
getRpmBuildPath
(
:
string
)
:
string
{
return
'.build/linux/rpm/'
+
+
'/rpmbuild'
;
}
function
getRpmPackageArch
(
:
string
)
:
string
{
switch
(
)
{
case
'x64'
:
return
'x86_64'
;
case
'armhf'
:
return
'armv7hl'
;
case
'arm64'
:
return
'aarch64'
;
default
:
throw
new
Error
(
` Unknown arch: ${ arch} `
)
;
}
}
function
prepareRpmPackage
(
:
string
)
{
const
=
'../VSCode-linux-'
+
;
const
=
getRpmPackageArch
(
)
;
const
=
.
[
'STRIP'
]
??
'/usr/bin/strip'
;
return
async
function
(
)
{
const
=
await
getDependencies
(
'rpm'
,
,
.
,
)
;
const
=
.
src
(
'resources/linux/code.desktop'
,
{
:
'.'
}
)
.
pipe
(
rename
(
'BUILD/usr/share/applications/'
+
.
+
'.desktop'
)
)
;
const
=
.
src
(
'resources/linux/code-url-handler.desktop'
,
{
:
'.'
}
)
.
pipe
(
rename
(
'BUILD/usr/share/applications/'
+
.
+
'-url-handler.desktop'
)
)
;
const
=
.
merge
(
,
)
.
pipe
(
replace
(
'@@NAME_LONG@@'
,
.
)
)
.
pipe
(
replace
(
'@@NAME_SHORT@@'
,
.
)
)
.
pipe
(
replace
(
'@@NAME@@'
,
.
)
)
.
pipe
(
replace
(
'@@EXEC@@'
,
` /usr/share/ ${ product. applicationName} / ${ product. applicationName} `
)
)
.
pipe
(
replace
(
'@@ICON@@'
,
.
)
)
.
pipe
(
replace
(
'@@URLPROTOCOL@@'
,
.
)
)
;
const
=
.
src
(
'resources/linux/code.appdata.xml'
,
{
:
'.'
}
)
.
pipe
(
replace
(
'@@NAME_LONG@@'
,
.
)
)
.
pipe
(
replace
(
'@@NAME@@'
,
.
)
)
.
pipe
(
replace
(
'@@LICENSE@@'
,
.
)
)
.
pipe
(
rename
(
'BUILD/usr/share/appdata/'
+
.
+
'.appdata.xml'
)
)
;
const
=
.
src
(
'resources/linux/code-workspace.xml'
,
{
:
'.'
}
)
.
pipe
(
replace
(
'@@NAME_LONG@@'
,
.
)
)
.
pipe
(
replace
(
'@@NAME@@'
,
.
)
)
.
pipe
(
rename
(
'BUILD/usr/share/mime/packages/'
+
.
+
'-workspace.xml'
)
)
;
const
=
.
src
(
'resources/linux/code.png'
,
{
:
'.'
}
)
.
pipe
(
rename
(
'BUILD/usr/share/pixmaps/'
+
.
+
'.png'
)
)
;
const
=
.
src
(
'resources/completions/bash/code'
)
.
pipe
(
replace
(
'@@APPNAME@@'
,
.
)
)
.
pipe
(
rename
(
'BUILD/usr/share/bash-completion/completions/'
+
.
)
)
;
const
=
.
src
(
'resources/completions/zsh/_code'
)
.
pipe
(
replace
(
'@@APPNAME@@'
,
.
)
)
.
pipe
(
rename
(
'BUILD/usr/share/zsh/site-functions/_'
+
.
)
)
;
const
=
.
src
(
+
'/**/*'
,
{
:
}
)
.
pipe
(
rename
(
function
(
)
{
.
=
'BUILD/usr/share/'
+
.
+
'/'
+
.
;
}
)
)
;
const
=
.
src
(
'resources/linux/rpm/code.spec.template'
,
{
:
'.'
}
)
.
pipe
(
replace
(
'@@NAME@@'
,
.
)
)
.
pipe
(
replace
(
'@@NAME_LONG@@'
,
.
)
)
.
pipe
(
replace
(
'@@ICON@@'
,
.
)
)
.
pipe
(
replace
(
'@@VERSION@@'
,
.
)
)
.
pipe
(
replace
(
'@@RELEASE@@'
,
.
toString
(
)
)
)
.
pipe
(
replace
(
'@@ARCHITECTURE@@'
,
)
)
.
pipe
(
replace
(
'@@LICENSE@@'
,
.
)
)
.
pipe
(
replace
(
'@@QUALITY@@'
,
(
as
typeof
&
{
?
:
string
}
)
.
||
'@@QUALITY@@'
)
)
.
pipe
(
replace
(
'@@UPDATEURL@@'
,
(
as
typeof
&
{
?
:
string
}
)
.
||
'@@UPDATEURL@@'
)
)
.
pipe
(
replace
(
'@@DEPENDENCIES@@'
,
.
join
(
', '
)
)
)
.
pipe
(
replace
(
'@@RECOMMENDS@@'
,
.
join
(
', '
)
)
)
.
pipe
(
replace
(
'@@STRIP@@'
,
)
)
.
pipe
(
rename
(
'SPECS/'
+
.
+
'.spec'
)
)
;
const
=
.
src
(
'resources/linux/rpm/code.xpm'
,
{
:
'.'
}
)
.
pipe
(
rename
(
'SOURCES/'
+
.
+
'.xpm'
)
)
;
const
=
.
merge
(
,
,
,
,
,
,
,
,
)
;
return
.
pipe
(
.
dest
(
getRpmBuildPath
(
)
)
)
;
}
;
}
function
buildRpmPackage
(
:
string
)
{
const
=
getRpmPackageArch
(
)
;
const
=
getRpmBuildPath
(
)
;
const
=
` ${ rpmBuildPath} /RPMS/ ${ rpmArch} `
;
const
=
` .build/linux/rpm/ ${ rpmArch} `
;
return
async
(
)
=>
{
await
exec
(
` mkdir -p ${ destination} `
)
;
await
exec
(
` HOME="$(pwd)/ ${ destination} " rpmbuild -bb ${ rpmBuildPath} /SPECS/ ${ product. applicationName} .spec --target= ${ rpmArch} `
)
;
await
exec
(
` cp " ${ rpmOut} /$(ls ${ rpmOut} )" ${ destination} / `
)
;
}
;
}
function
getSnapBuildPath
(
:
string
)
:
string
{
return
` .build/linux/snap/ ${ arch} / ${ product. applicationName} - ${ arch} `
;
}
function
prepareSnapPackage
(
:
string
)
{
const
=
'../VSCode-linux-'
+
;
const
=
getSnapBuildPath
(
)
;
return
function
(
)
{
const
=
.
src
(
'resources/linux/code.desktop'
,
{
:
'.'
}
)
.
pipe
(
rename
(
` snap/gui/ ${ product. applicationName} .desktop `
)
)
;
const
=
.
src
(
'resources/linux/code-url-handler.desktop'
,
{
:
'.'
}
)
.
pipe
(
rename
(
` snap/gui/ ${ product. applicationName} -url-handler.desktop `
)
)
;
const
=
.
merge
(
,
)
.
pipe
(
replace
(
'@@NAME_LONG@@'
,
.
)
)
.
pipe
(
replace
(
'@@NAME_SHORT@@'
,
.
)
)
.
pipe
(
replace
(
'@@NAME@@'
,
.
)
)
.
pipe
(
replace
(
'@@EXEC@@'
,
` ${ product. applicationName} --force-user-env `
)
)
.
pipe
(
replace
(
'@@ICON@@'
,
` \${SNAP}/meta/gui/ ${ product. linuxIconName} .png `
)
)
.
pipe
(
replace
(
'@@URLPROTOCOL@@'
,
.
)
)
;
const
=
.
src
(
'resources/linux/code.png'
,
{
:
'.'
}
)
.
pipe
(
rename
(
` snap/gui/ ${ product. linuxIconName} .png `
)
)
;
const
=
.
src
(
+
'/**/*'
,
{
:
}
)
.
pipe
(
rename
(
function
(
)
{
.
=
` usr/share/ ${ product. applicationName} / ${ p. dirname} `
;
}
)
)
;
const
=
.
src
(
'resources/linux/snap/snapcraft.yaml'
,
{
:
'.'
}
)
.
pipe
(
replace
(
'@@NAME@@'
,
.
)
)
.
pipe
(
replace
(
'@@VERSION@@'
,
!
.
substr
(
0
,
8
)
)
)
.
pipe
(
replace
(
'@@ARCHITECTURE@@'
,
===
'x64'
?
'amd64'
:
)
)
.
pipe
(
rename
(
'snap/snapcraft.yaml'
)
)
;
const
=
.
src
(
'resources/linux/snap/electron-launch'
,
{
:
'.'
}
)
.
pipe
(
rename
(
'electron-launch'
)
)
;
const
=
.
merge
(
,
,
,
,
)
;
return
.
pipe
(
.
dest
(
)
)
;
}
;
}
function
buildSnapPackage
(
:
string
)
{
const
=
getSnapBuildPath
(
)
;
return
(
)
=>
exec
(
'snapcraft'
,
{
}
)
;
}
const
BUILD_TARGETS
=
[
{
:
'x64'
}
,
{
:
'armhf'
}
,
{
:
'arm64'
}
,
]
;
BUILD_TARGETS
.
forEach
(
(
{
}
)
=>
{
const
=
getDebPackageArch
(
)
;
const
=
.
define
(
` vscode-linux- ${ arch} -prepare-deb `
,
.
series
(
rimraf
(
` .build/linux/deb/ ${ debArch} `
)
,
prepareDebPackage
(
)
)
)
;
.
task
(
)
;
const
=
.
define
(
` vscode-linux- ${ arch} -build-deb `
,
buildDebPackage
(
)
)
;
.
task
(
)
;
const
=
getRpmPackageArch
(
)
;
const
=
.
define
(
` vscode-linux- ${ arch} -prepare-rpm `
,
.
series
(
rimraf
(
` .build/linux/rpm/ ${ rpmArch} `
)
,
prepareRpmPackage
(
)
)
)
;
.
task
(
)
;
const
=
.
define
(
` vscode-linux- ${ arch} -build-rpm `
,
buildRpmPackage
(
)
)
;
.
task
(
)
;
const
=
.
define
(
` vscode-linux- ${ arch} -prepare-snap `
,
.
series
(
rimraf
(
` .build/linux/snap/ ${ arch} `
)
,
prepareSnapPackage
(
)
)
)
;
.
task
(
)
;
const
=
.
define
(
` vscode-linux- ${ arch} -build-snap `
,
.
series
(
,
buildSnapPackage
(
)
)
)
;
.
task
(
)
;
}
)
;