mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-18 18:46:47 -05:00
Compare commits
486 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96e2145931 | ||
|
|
5845135366 | ||
|
|
4b05fa9075 | ||
|
|
bd1f133ca5 | ||
|
|
944a8f9c72 | ||
|
|
441b57f3ca | ||
|
|
803b02be81 | ||
|
|
d76bba1458 | ||
|
|
9b40838ea3 | ||
|
|
6c98603979 | ||
|
|
0e2d1e515e | ||
|
|
bfb03d160e | ||
|
|
ff21a93e00 | ||
|
|
763080aea0 | ||
|
|
fb713e0762 | ||
|
|
a8d41a6717 | ||
|
|
34bc0efc1c | ||
|
|
23e4a30cd1 | ||
|
|
ba58b0f429 | ||
|
|
89e6e062ab | ||
|
|
33ff8ec5a3 | ||
|
|
9f4053d051 | ||
|
|
1bb9d142f1 | ||
|
|
b10bd70d67 | ||
|
|
dc2ff2295e | ||
|
|
f231d6945f | ||
|
|
8786caf630 | ||
|
|
5c520bc82e | ||
|
|
1ccf408654 | ||
|
|
76ebfe38a1 | ||
|
|
364206010b | ||
|
|
559c675164 | ||
|
|
1773dede25 | ||
|
|
fa52478ffa | ||
|
|
ae0603c041 | ||
|
|
a364af5c4c | ||
|
|
6b76611c93 | ||
|
|
d7df71c8ba | ||
|
|
ea464abaaf | ||
|
|
a026b682c4 | ||
|
|
8e3fa660fd | ||
|
|
c9257822ec | ||
|
|
783bb8bd92 | ||
|
|
bf19ab6ad9 | ||
|
|
c4e59027fc | ||
|
|
f9b7bc26c0 | ||
|
|
a197cd6158 | ||
|
|
ae5b506848 | ||
|
|
f8ab5fef78 | ||
|
|
0893ba33fc | ||
|
|
75ce8d6c20 | ||
|
|
6d56701b5b | ||
|
|
ea8aa92dd5 | ||
|
|
9fc634dfe0 | ||
|
|
4b1088edbc | ||
|
|
8e355a14e9 | ||
|
|
ef2b6f91f1 | ||
|
|
9cae7a0a49 | ||
|
|
9a55ca3021 | ||
|
|
e8b20c86c1 | ||
|
|
dc78a4af88 | ||
|
|
34273907f7 | ||
|
|
ca1c5899a1 | ||
|
|
0064f17ad4 | ||
|
|
f8ccafd2af | ||
|
|
d386311e54 | ||
|
|
0e2475aa72 | ||
|
|
b4cce9f147 | ||
|
|
3e8f25d864 | ||
|
|
4c68580e82 | ||
|
|
3bc82c10b1 | ||
|
|
c7d94055a4 | ||
|
|
34316b0ffd | ||
|
|
3d494dcd73 | ||
|
|
85b2c4de4a | ||
|
|
d0ce6bb066 | ||
|
|
38c6495fd8 | ||
|
|
bcc449b524 | ||
|
|
361ada4963 | ||
|
|
2e8d62d0ca | ||
|
|
fb97bf6041 | ||
|
|
6d9c95720d | ||
|
|
db5a0a892a | ||
|
|
7b01a6ca61 | ||
|
|
fbbf767700 | ||
|
|
776e2cf6e7 | ||
|
|
34ca0e8671 | ||
|
|
0d37047c37 | ||
|
|
25c8f60e6e | ||
|
|
aae1480e4f | ||
|
|
5e8a52bcc0 | ||
|
|
cf8f8907ee | ||
|
|
ca36f20c6b | ||
|
|
bdae02e51e | ||
|
|
2d7eb0dcb5 | ||
|
|
2e0756ad8d | ||
|
|
ef2bbce34b | ||
|
|
65e59dc57d | ||
|
|
2ca39b571a | ||
|
|
48a6157efb | ||
|
|
ab3a64604a | ||
|
|
e9ddf43c6c | ||
|
|
2549d91ddf | ||
|
|
81ae86ff79 | ||
|
|
7670104e4d | ||
|
|
3fc2ad5bc9 | ||
|
|
c84367e2ee | ||
|
|
77413ad25c | ||
|
|
c1f73255b5 | ||
|
|
fe7ec76cd5 | ||
|
|
0bc9849ad8 | ||
|
|
c9a4f8f664 | ||
|
|
1315b8e42a | ||
|
|
7a03da42ec | ||
|
|
8b9bb2a8fc | ||
|
|
162dfbaab0 | ||
|
|
71b6e35231 | ||
|
|
9268513128 | ||
|
|
5d44b6a6a7 | ||
|
|
586fe10525 | ||
|
|
a59d1d3c05 | ||
|
|
1fce604a11 | ||
|
|
8ea831c845 | ||
|
|
94061fa634 | ||
|
|
fe17955fa1 | ||
|
|
3158e9f63a | ||
|
|
fcb2b53bf8 | ||
|
|
5470702c16 | ||
|
|
8c05c6e122 | ||
|
|
cc397a012f | ||
|
|
e12827de3f | ||
|
|
02a646c7ea | ||
|
|
86986efb15 | ||
|
|
a718fb3cae | ||
|
|
48ba9ce175 | ||
|
|
be60ad6766 | ||
|
|
b1b58f2550 | ||
|
|
99d00e2057 | ||
|
|
7da0dddaa9 | ||
|
|
3ea45e4ef5 | ||
|
|
dbac187b44 | ||
|
|
43293b98c0 | ||
|
|
34eef8e97d | ||
|
|
5a48fd80cd | ||
|
|
5260afc15d | ||
|
|
66b4e08026 | ||
|
|
2b8e0cc6c4 | ||
|
|
a501214bfa | ||
|
|
2b9a8b9136 | ||
|
|
1cc3cb5408 | ||
|
|
7df793f208 | ||
|
|
ca2b7cc4bc | ||
|
|
9e0a74da3d | ||
|
|
da5076a4dc | ||
|
|
005808f003 | ||
|
|
1dd1919200 | ||
|
|
0a9db55dc4 | ||
|
|
4551ba5b7c | ||
|
|
0f25ad5676 | ||
|
|
c6564c0d84 | ||
|
|
a7e94d433f | ||
|
|
64480a35ac | ||
|
|
4f96d5caf2 | ||
|
|
7cca1b9f48 | ||
|
|
56ebbedbfd | ||
|
|
4e5b8ce875 | ||
|
|
5c5ee50983 | ||
|
|
0a67488447 | ||
|
|
022761aa4b | ||
|
|
b9d985b663 | ||
|
|
08ed9d285e | ||
|
|
ab0cd71d10 | ||
|
|
df7645e4e5 | ||
|
|
39f9c72390 | ||
|
|
0023714884 | ||
|
|
ec9fdc517f | ||
|
|
db387eb770 | ||
|
|
354ed22706 | ||
|
|
a69f194d8b | ||
|
|
f5d13319a2 | ||
|
|
9a0e691635 | ||
|
|
6c7cb185a1 | ||
|
|
ab22b93ce0 | ||
|
|
c7f5278430 | ||
|
|
56ad0dbaf2 | ||
|
|
74c92cd460 | ||
|
|
16ebb4322a | ||
|
|
fccd026812 | ||
|
|
b6e49f2bc0 | ||
|
|
188ccf849d | ||
|
|
1bfdce9642 | ||
|
|
495254b0be | ||
|
|
d209ff7b9a | ||
|
|
98eeb50060 | ||
|
|
8a68f0aaf9 | ||
|
|
039859213c | ||
|
|
a3c022aebf | ||
|
|
3a9b32b6e8 | ||
|
|
c1cb9000a9 | ||
|
|
104b99ffa0 | ||
|
|
a89d7f327a | ||
|
|
91bc4bde3c | ||
|
|
80da7ad496 | ||
|
|
64bf211a45 | ||
|
|
2558a66a48 | ||
|
|
df22eab4ec | ||
|
|
c2678cf818 | ||
|
|
f9af34b103 | ||
|
|
97cab22e00 | ||
|
|
64416e05c1 | ||
|
|
b21125ff2d | ||
|
|
e72d0d03ed | ||
|
|
0f12d15020 | ||
|
|
44a2d009c0 | ||
|
|
48682bacde | ||
|
|
f70369c2a6 | ||
|
|
f7fc94520a | ||
|
|
77c6f5c9a2 | ||
|
|
dffa47301b | ||
|
|
08f47e7e14 | ||
|
|
56342af140 | ||
|
|
aacc0eca67 | ||
|
|
02916aeffa | ||
|
|
e42bfada9d | ||
|
|
72fb114dec | ||
|
|
9ba1561386 | ||
|
|
39772c2dbe | ||
|
|
cbf3ca726f | ||
|
|
f1e21ebe9d | ||
|
|
49c36cc040 | ||
|
|
9b90400abd | ||
|
|
8cda364210 | ||
|
|
ca98ef879d | ||
|
|
bb9c85cd8f | ||
|
|
91b946bf3d | ||
|
|
64377000c6 | ||
|
|
23f4931a1d | ||
|
|
3625834028 | ||
|
|
705e7b30bc | ||
|
|
6528c0817d | ||
|
|
f3d7392af3 | ||
|
|
5d5f44ba11 | ||
|
|
34457880c7 | ||
|
|
d63f07d29a | ||
|
|
5c2cbc9d29 | ||
|
|
8dbfa10646 | ||
|
|
9e804089e0 | ||
|
|
51145903aa | ||
|
|
036c49f398 | ||
|
|
46b85ebc6b | ||
|
|
07bc5e2de9 | ||
|
|
e822091907 | ||
|
|
7d46e77922 | ||
|
|
ad528ad3d5 | ||
|
|
e8b4c03770 | ||
|
|
33aacc1798 | ||
|
|
58959ef35e | ||
|
|
c66b349cec | ||
|
|
5c90df092b | ||
|
|
32374f264f | ||
|
|
5e62229f25 | ||
|
|
1b24dff738 | ||
|
|
161135cd90 | ||
|
|
5fb583da06 | ||
|
|
8b40d20eab | ||
|
|
432034d2cb | ||
|
|
0e168e36fc | ||
|
|
f248260584 | ||
|
|
880e3e10da | ||
|
|
f33b95ee82 | ||
|
|
4a71eb9b90 | ||
|
|
3372a5ad4b | ||
|
|
8326f05f66 | ||
|
|
7ce921d449 | ||
|
|
31f7364f08 | ||
|
|
5119d28b9d | ||
|
|
a2a5fe3bee | ||
|
|
6222d8c977 | ||
|
|
d3699a261a | ||
|
|
9c0e56d640 | ||
|
|
ddd89fc52a | ||
|
|
b852f032d3 | ||
|
|
1fec26c6b3 | ||
|
|
d3483afaed | ||
|
|
910e4815fa | ||
|
|
ef118e3351 | ||
|
|
2beedb10d4 | ||
|
|
41bf10d989 | ||
|
|
ac3b6aef27 | ||
|
|
8956b591f7 | ||
|
|
2f8519cb6b | ||
|
|
15a19c044d | ||
|
|
ec47ff7479 | ||
|
|
82f707ee89 | ||
|
|
dfcab8db6a | ||
|
|
5c10127758 | ||
|
|
b376f36733 | ||
|
|
96c0f62cf5 | ||
|
|
a96f996b59 | ||
|
|
b75d0b6cb5 | ||
|
|
a5bc65fbfb | ||
|
|
dcdbc95ae7 | ||
|
|
72e7e5e025 | ||
|
|
57242a2e13 | ||
|
|
6dbf757385 | ||
|
|
c5a32d8373 | ||
|
|
34288435ec | ||
|
|
177b48c3f2 | ||
|
|
642f5d4405 | ||
|
|
92b1c59e48 | ||
|
|
cb1682542b | ||
|
|
9e56187c16 | ||
|
|
51851efda5 | ||
|
|
11e4b743e0 | ||
|
|
3349151d4c | ||
|
|
c8f6937166 | ||
|
|
ad36c1df3d | ||
|
|
a5b8924e2d | ||
|
|
bc898cc2c2 | ||
|
|
1247b6e8eb | ||
|
|
2111c3de1a | ||
|
|
bcea1b66be | ||
|
|
4f8d14ed3e | ||
|
|
442adfbbc3 | ||
|
|
fe12233954 | ||
|
|
c725f6f572 | ||
|
|
1870d83081 | ||
|
|
8315dacda4 | ||
|
|
18c54f41bd | ||
|
|
293f9c22c4 | ||
|
|
a74510544f | ||
|
|
9b053c50c2 | ||
|
|
88712f46bf | ||
|
|
d6df20b0e8 | ||
|
|
5dc37f7557 | ||
|
|
445d306586 | ||
|
|
d332ae1132 | ||
|
|
37f45b10a3 | ||
|
|
d9b6ec0654 | ||
|
|
f98428aea5 | ||
|
|
b3be1d79cd | ||
|
|
ea8f885f05 | ||
|
|
2de47c2a50 | ||
|
|
30b8e105f9 | ||
|
|
2a44fab8ba | ||
|
|
6a06a99e46 | ||
|
|
3670dfbebd | ||
|
|
daf929ecc7 | ||
|
|
f96a17c930 | ||
|
|
2fb06e7f4f | ||
|
|
4ece9b0085 | ||
|
|
a4bd31e96a | ||
|
|
8bdcc3267a | ||
|
|
9e9164c4ee | ||
|
|
5dc6a39652 | ||
|
|
ada0966832 | ||
|
|
e6faef27ab | ||
|
|
acc27d0829 | ||
|
|
ab54f7bb45 | ||
|
|
88161cc37d | ||
|
|
0975e6834e | ||
|
|
22ec1d5f0a | ||
|
|
01784dd186 | ||
|
|
02cf91c158 | ||
|
|
0532346f4f | ||
|
|
657adafb7d | ||
|
|
818c0789ea | ||
|
|
cb5bcf2248 | ||
|
|
9bd7e30d18 | ||
|
|
572010ded1 | ||
|
|
1f22326e78 | ||
|
|
504d5c91bc | ||
|
|
a34692b6f2 | ||
|
|
73b5d23210 | ||
|
|
e31de8b137 | ||
|
|
cef5bbb2be | ||
|
|
80a8e1a4da | ||
|
|
fcb8fe50fe | ||
|
|
5235c8aad6 | ||
|
|
5b67525211 | ||
|
|
fb697729c0 | ||
|
|
76fe0fef49 | ||
|
|
6295d03801 | ||
|
|
07166fb3cd | ||
|
|
219dfe66d0 | ||
|
|
22c62fb524 | ||
|
|
f8706abebe | ||
|
|
e83a6f9c2e | ||
|
|
63485c8c78 | ||
|
|
72ef024678 | ||
|
|
414c736655 | ||
|
|
fdbfbb9238 | ||
|
|
a766e5d334 | ||
|
|
2faf01eb9d | ||
|
|
a4c2463b2f | ||
|
|
ddbd8033f9 | ||
|
|
6da66cf367 | ||
|
|
c7bc37d010 | ||
|
|
e0ec3c5035 | ||
|
|
d4f287298f | ||
|
|
e70d5838a8 | ||
|
|
b04ca0fdbd | ||
|
|
a064da642d | ||
|
|
37ce37979a | ||
|
|
cb3cbd0d78 | ||
|
|
1415aa1c03 | ||
|
|
7eb17f6abc | ||
|
|
fdb471d506 | ||
|
|
e6785ffe95 | ||
|
|
cc2951265e | ||
|
|
ee413f3b24 | ||
|
|
fc664a850d | ||
|
|
55efe76b2e | ||
|
|
dd8922ce4d | ||
|
|
102b48c302 | ||
|
|
a360bebd9d | ||
|
|
37ab493b78 | ||
|
|
46b7afe558 | ||
|
|
eac3420583 | ||
|
|
e1e9c08242 | ||
|
|
5ac6cf3b74 | ||
|
|
d6a58136da | ||
|
|
819b7b93d1 | ||
|
|
bceeda1cfd | ||
|
|
0d8ef9583b | ||
|
|
b1393ae615 | ||
|
|
464109313b | ||
|
|
83c8baf8e3 | ||
|
|
1bac929ab3 | ||
|
|
b27417da41 | ||
|
|
ef1f72f69b | ||
|
|
784fd57410 | ||
|
|
1dd0afcf80 | ||
|
|
ddce7731b9 | ||
|
|
d00c3780a6 | ||
|
|
4a87a24235 | ||
|
|
f5c9174c2f | ||
|
|
8d5f676039 | ||
|
|
71db7e10b6 | ||
|
|
756f77063a | ||
|
|
5f637036bc | ||
|
|
24b5f41065 | ||
|
|
b00352570b | ||
|
|
0b44b7d384 | ||
|
|
82da64d66d | ||
|
|
ee5a76bb0c | ||
|
|
b65ee5b42e | ||
|
|
8298db7d13 | ||
|
|
5b0e86b179 | ||
|
|
ed2641ea02 | ||
|
|
66939636dc | ||
|
|
2c331d929a | ||
|
|
4472764f3a | ||
|
|
6cb7153bdd | ||
|
|
5142f69655 | ||
|
|
dfe23f7bfe | ||
|
|
6873353cd4 | ||
|
|
025c97673f | ||
|
|
c814b92557 | ||
|
|
87765e8673 | ||
|
|
833d197412 | ||
|
|
5e72cd12d1 | ||
|
|
330fb6dff5 | ||
|
|
6d7d485a38 | ||
|
|
0160901060 | ||
|
|
9313140c59 | ||
|
|
25b1d4b673 | ||
|
|
b9d0602f55 | ||
|
|
ec0a3bbc95 | ||
|
|
50f63a2f72 | ||
|
|
cb47cb7dbf | ||
|
|
c9ac49c758 | ||
|
|
c4e8aba1c9 | ||
|
|
ba6b8b1f69 | ||
|
|
09af2fc2cb | ||
|
|
5caf0b02f0 | ||
|
|
86bac90001 | ||
|
|
7d31575149 | ||
|
|
7223b28829 | ||
|
|
4014c1d0ab | ||
|
|
0bf0e795ca | ||
|
|
0bc3716f74 | ||
|
|
ca23ea0f69 | ||
|
|
efaa2c0e3f | ||
|
|
d91f4d5748 | ||
|
|
6f1a03587a |
@@ -1,4 +1,4 @@
|
|||||||
# EditorConfig is awesome: http://EditorConfig.org
|
# EditorConfig is awesome: https://EditorConfig.org
|
||||||
|
|
||||||
# top-most EditorConfig file
|
# top-most EditorConfig file
|
||||||
root = true
|
root = true
|
||||||
@@ -6,7 +6,6 @@ root = true
|
|||||||
# Tab indentation
|
# Tab indentation
|
||||||
[*]
|
[*]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
indent_size = 4
|
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
# The indent size used in the `package.json` file cannot be changed
|
# The indent size used in the `package.json` file cannot be changed
|
||||||
|
|||||||
3
.gitattributes
vendored
3
.gitattributes
vendored
@@ -6,4 +6,5 @@ ThirdPartyNotices.txt eol=crlf
|
|||||||
*.bat eol=crlf
|
*.bat eol=crlf
|
||||||
*.cmd eol=crlf
|
*.cmd eol=crlf
|
||||||
*.ps1 eol=lf
|
*.ps1 eol=lf
|
||||||
*.sh eol=lf
|
*.sh eol=lf
|
||||||
|
*.rtf -text
|
||||||
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -2,7 +2,7 @@
|
|||||||
name: Bug report
|
name: Bug report
|
||||||
about: Create a report to help us improve
|
about: Create a report to help us improve
|
||||||
title: ''
|
title: ''
|
||||||
labels: ''
|
labels: Bug
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -2,7 +2,7 @@
|
|||||||
name: Feature request
|
name: Feature request
|
||||||
about: Suggest an idea for this project
|
about: Suggest an idea for this project
|
||||||
title: ''
|
title: ''
|
||||||
labels: feature request
|
labels: Enhancement
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
2
.github/classifier.yml
vendored
2
.github/classifier.yml
vendored
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
perform: true,
|
perform: false,
|
||||||
alwaysRequireAssignee: false,
|
alwaysRequireAssignee: false,
|
||||||
labelsRequiringAssignee: [],
|
labelsRequiringAssignee: [],
|
||||||
autoAssignees: {
|
autoAssignees: {
|
||||||
|
|||||||
6
.github/needs_more_info.yml
vendored
6
.github/needs_more_info.yml
vendored
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
daysUntilClose: 7,
|
daysUntilClose: 7,
|
||||||
needsMoreInfoLabel: 'more info',
|
needsMoreInfoLabel: 'needs more info',
|
||||||
perform: false,
|
perform: true,
|
||||||
closeComment: "This issue has been closed automatically because it needs more information and has not had recent activity. See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!"
|
closeComment: "This issue has been closed automatically because it needs more information and has not had recent activity in the last 7 days. If you have more info to help resolve the issue, leave a comment"
|
||||||
}
|
}
|
||||||
|
|||||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
|
.cache
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
node_modules/
|
node_modules/
|
||||||
@@ -14,7 +15,10 @@ out-editor-min/
|
|||||||
out-monaco-editor-core/
|
out-monaco-editor-core/
|
||||||
out-vscode/
|
out-vscode/
|
||||||
out-vscode-min/
|
out-vscode-min/
|
||||||
build/node_modules
|
out-vscode-reh/
|
||||||
|
out-vscode-reh-min/
|
||||||
|
out-vscode-reh-pkg/
|
||||||
|
**/node_modules
|
||||||
coverage/
|
coverage/
|
||||||
test_data/
|
test_data/
|
||||||
test-results/
|
test-results/
|
||||||
|
|||||||
57
.vscode/launch.json
vendored
57
.vscode/launch.json
vendored
@@ -66,23 +66,39 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "Launch azuredatastudio",
|
"name": "Launch azuredatastudio",
|
||||||
"windows": {
|
"windows": {
|
||||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.bat"
|
"runtimeExecutable": "${workspaceFolder}/scripts/sql.bat",
|
||||||
|
"timeout": 20000
|
||||||
},
|
},
|
||||||
"osx": {
|
"osx": {
|
||||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh"
|
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh",
|
||||||
|
"timeout": 20000
|
||||||
},
|
},
|
||||||
"linux": {
|
"linux": {
|
||||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh"
|
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh",
|
||||||
|
"timeout": 20000
|
||||||
},
|
},
|
||||||
|
"env": {
|
||||||
|
"VSCODE_EXTHOST_WILL_SEND_SOCKET": null
|
||||||
|
},
|
||||||
|
"breakOnLoad": false,
|
||||||
"urlFilter": "*workbench.html*",
|
"urlFilter": "*workbench.html*",
|
||||||
"runtimeArgs": [
|
"runtimeArgs": [
|
||||||
"--inspect=5875", "--no-cached-data"
|
"--inspect=5875",
|
||||||
|
"--no-cached-data"
|
||||||
],
|
],
|
||||||
"skipFiles": [
|
"webRoot": "${workspaceFolder}"
|
||||||
"**/winjs*.js"
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Launch ADS (Main Process)",
|
||||||
|
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"--no-cached-data"
|
||||||
],
|
],
|
||||||
"webRoot": "${workspaceFolder}",
|
"outFiles": [
|
||||||
"timeout": 45000
|
"${workspaceFolder}/out/**/*.js"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "chrome",
|
"type": "chrome",
|
||||||
@@ -147,7 +163,23 @@
|
|||||||
"outFiles": [
|
"outFiles": [
|
||||||
"${workspaceFolder}/out/**/*.js"
|
"${workspaceFolder}/out/**/*.js"
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"type": "chrome",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Run Extension Unit Tests",
|
||||||
|
"windows": {
|
||||||
|
"runtimeExecutable": "${workspaceFolder}/scripts/test-extensions-unit.bat"
|
||||||
|
},
|
||||||
|
"osx": {
|
||||||
|
"runtimeExecutable": "${workspaceFolder}/scripts/test-extensions-unit.sh"
|
||||||
|
},
|
||||||
|
"linux": {
|
||||||
|
"runtimeExecutable": "${workspaceFolder}/scripts/test-extensions-unit.sh"
|
||||||
|
},
|
||||||
|
"webRoot": "${workspaceFolder}",
|
||||||
|
"timeout": 45000
|
||||||
|
},
|
||||||
],
|
],
|
||||||
"compounds": [
|
"compounds": [
|
||||||
{
|
{
|
||||||
@@ -157,6 +189,13 @@
|
|||||||
"Run Unit Tests"
|
"Run Unit Tests"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "Debug Extension Unit Tests",
|
||||||
|
"configurations": [
|
||||||
|
"Attach to Extension Host",
|
||||||
|
"Run Extension Unit Tests"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Debug azuredatastudio Main and Renderer",
|
"name": "Debug azuredatastudio Main and Renderer",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
|
|||||||
24
.vscode/settings.json
vendored
24
.vscode/settings.json
vendored
@@ -44,11 +44,19 @@
|
|||||||
"emmet.excludeLanguages": [],
|
"emmet.excludeLanguages": [],
|
||||||
"typescript.preferences.importModuleSpecifier": "non-relative",
|
"typescript.preferences.importModuleSpecifier": "non-relative",
|
||||||
"typescript.preferences.quoteStyle": "single",
|
"typescript.preferences.quoteStyle": "single",
|
||||||
"json.schemas": [{
|
"json.schemas": [
|
||||||
"fileMatch": [ "cgmanifest.json" ],
|
{
|
||||||
"url": "./.vscode/cgmanifest.schema.json"
|
"fileMatch": [
|
||||||
}, {
|
"cgmanifest.json"
|
||||||
"fileMatch": [ "cglicenses.json" ],
|
],
|
||||||
"url": "./.vscode/cglicenses.schema.json"
|
"url": "./.vscode/cgmanifest.schema.json"
|
||||||
}]
|
},
|
||||||
}
|
{
|
||||||
|
"fileMatch": [
|
||||||
|
"cglicenses.json"
|
||||||
|
],
|
||||||
|
"url": "./.vscode/cglicenses.schema.json"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"git.ignoreLimitWarning": true
|
||||||
|
}
|
||||||
2
.vscode/shared.code-snippets
vendored
2
.vscode/shared.code-snippets
vendored
@@ -23,11 +23,13 @@
|
|||||||
"description": "Insert Copyright Statement"
|
"description": "Insert Copyright Statement"
|
||||||
},
|
},
|
||||||
"TS -> Inject Service": {
|
"TS -> Inject Service": {
|
||||||
|
"scope": "typescript",
|
||||||
"description": "Constructor Injection Pattern",
|
"description": "Constructor Injection Pattern",
|
||||||
"prefix": "@inject",
|
"prefix": "@inject",
|
||||||
"body": "@$1 private readonly _$2: ${1},$0"
|
"body": "@$1 private readonly _$2: ${1},$0"
|
||||||
},
|
},
|
||||||
"TS -> Event & Emitter": {
|
"TS -> Event & Emitter": {
|
||||||
|
"scope": "typescript",
|
||||||
"prefix": "emitter",
|
"prefix": "emitter",
|
||||||
"description": "Add emitter and event properties",
|
"description": "Add emitter and event properties",
|
||||||
"body": [
|
"body": [
|
||||||
|
|||||||
11
.vscode/tasks.json
vendored
11
.vscode/tasks.json
vendored
@@ -30,19 +30,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "npm",
|
"type": "npm",
|
||||||
"script": "strict-null-check-watch",
|
"script": "strict-initialization-watch",
|
||||||
"label": "TS - Strict Null Checks",
|
"label": "TS - Strict Initialization",
|
||||||
"isBackground": true,
|
"isBackground": true,
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"reveal": "never"
|
"reveal": "never"
|
||||||
},
|
},
|
||||||
"problemMatcher": {
|
"problemMatcher": {
|
||||||
"base": "$tsc-watch",
|
"base": "$tsc-watch",
|
||||||
"owner": "typescript-strict-null",
|
"owner": "typescript-strict-initialization",
|
||||||
"applyTo": "allDocuments"
|
"applyTo": "allDocuments"
|
||||||
},
|
|
||||||
"runOptions": {
|
|
||||||
"runOn": "folderOpen"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -86,4 +83,4 @@
|
|||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
2
.yarnrc
2
.yarnrc
@@ -1,3 +1,3 @@
|
|||||||
disturl "https://atom.io/download/electron"
|
disturl "https://atom.io/download/electron"
|
||||||
target "2.0.12"
|
target "3.1.8"
|
||||||
runtime "electron"
|
runtime "electron"
|
||||||
|
|||||||
41
CHANGELOG.md
41
CHANGELOG.md
@@ -1,5 +1,46 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## Version 1.7.0
|
||||||
|
* Release date: May 8, 2019
|
||||||
|
* Release status: General Availability
|
||||||
|
|
||||||
|
## What's new in this version
|
||||||
|
* Announcing Schema Compare *Preview* extension
|
||||||
|
* Tasks Panel UX improvement
|
||||||
|
* Announcing new Welcome page
|
||||||
|
* Resolved [bugs and issues](https://github.com/microsoft/azuredatastudio/milestone/31?closed=1).
|
||||||
|
|
||||||
|
## Contributions and "thank you"
|
||||||
|
We would like to thank all our users who raised issues.
|
||||||
|
|
||||||
|
## Version 1.6.0
|
||||||
|
* Release date: April 18, 2019
|
||||||
|
* Release status: General Availability
|
||||||
|
|
||||||
|
## What's new in this version
|
||||||
|
* Align with latest VS Code editor platform (currently 1.33.1)
|
||||||
|
* Resolved [bugs and issues](https://github.com/Microsoft/azuredatastudio/milestone/26?closed=1).
|
||||||
|
|
||||||
|
## Contributions and "thank you"
|
||||||
|
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||||
|
|
||||||
|
* yamatoya for `fix the format (#4899)`
|
||||||
|
|
||||||
|
## Version 1.5.1
|
||||||
|
* Release date: March 18, 2019
|
||||||
|
* Release status: General Availability
|
||||||
|
|
||||||
|
## What's new in this version
|
||||||
|
* Announcing T-SQL Notebooks
|
||||||
|
* Announcing PostgreSQL extension
|
||||||
|
* Announcing SQL Server Dacpac extension
|
||||||
|
* Resolved [bugs and issues](https://github.com/Microsoft/azuredatastudio/milestone/25?closed=1).
|
||||||
|
|
||||||
|
## Contributions and "thank you"
|
||||||
|
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||||
|
|
||||||
|
* GeoffYoung for `Fix sqlDropColumn description #4422`
|
||||||
|
|
||||||
## Version 1.4.5
|
## Version 1.4.5
|
||||||
* Release date: February 13, 2019
|
* Release date: February 13, 2019
|
||||||
* Release status: General Availability
|
* Release status: General Availability
|
||||||
|
|||||||
@@ -24,7 +24,9 @@ The built-in tool for reporting an issue, which you can access by using `Report
|
|||||||
|
|
||||||
Please include the following with each issue.
|
Please include the following with each issue.
|
||||||
|
|
||||||
* Version of Azure Data Studio (formerly SQL Operations Studio).
|
* Version of Azure Data Studio (formerly SQL Operations Studio)
|
||||||
|
|
||||||
|
* Your operating system
|
||||||
|
|
||||||
> **Tip:** You can easily create an issue using `Report Issues` from Azure Data Studio Help menu.
|
> **Tip:** You can easily create an issue using `Report Issues` from Azure Data Studio Help menu.
|
||||||
|
|
||||||
|
|||||||
16
README.md
16
README.md
@@ -9,13 +9,13 @@ Azure Data Studio is a data management tool that enables you to work with SQL Se
|
|||||||
|
|
||||||
Platform | Link
|
Platform | Link
|
||||||
-- | --
|
-- | --
|
||||||
Windows User Installer | https://go.microsoft.com/fwlink/?linkid=2072725
|
Windows User Installer | https://go.microsoft.com/fwlink/?linkid=2091882
|
||||||
Windows System Installer | https://go.microsoft.com/fwlink/?linkid=2072728
|
Windows System Installer | https://go.microsoft.com/fwlink/?linkid=2091491
|
||||||
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2072354
|
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2091490
|
||||||
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2072737
|
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2091489
|
||||||
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2072360
|
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2091488
|
||||||
Linux RPM | https://go.microsoft.com/fwlink/?linkid=2072741
|
Linux RPM | https://go.microsoft.com/fwlink/?linkid=2091487
|
||||||
Linux DEB | https://go.microsoft.com/fwlink/?linkid=2072744
|
Linux DEB | https://go.microsoft.com/fwlink/?linkid=2092022
|
||||||
|
|
||||||
Go to our [download page](https://aka.ms/azuredatastudio) for more specific instructions.
|
Go to our [download page](https://aka.ms/azuredatastudio) for more specific instructions.
|
||||||
|
|
||||||
@@ -68,6 +68,8 @@ The [Microsoft Enterprise and Developer Privacy Statement](https://privacy.micro
|
|||||||
## Contributions and "Thank You"
|
## Contributions and "Thank You"
|
||||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||||
|
|
||||||
|
* yamatoya for `fix the format (#4899)`
|
||||||
|
* GeoffYoung for `Fix sqlDropColumn description #4422`
|
||||||
* AlexFsmn for `Added context menu for DBs in explorer view to backup & restore db. #2277`
|
* AlexFsmn for `Added context menu for DBs in explorer view to backup & restore db. #2277`
|
||||||
* sadedil for `Missing feature request: Save as XML #3729`
|
* sadedil for `Missing feature request: Save as XML #3729`
|
||||||
* gbritton1 for `Removed reference to object explorer #3463`
|
* gbritton1 for `Removed reference to object explorer #3463`
|
||||||
|
|||||||
@@ -343,32 +343,6 @@ END OF emmet NOTICES AND INFORMATION
|
|||||||
=========================================
|
=========================================
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2015 JD Ballard
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
=========================================
|
|
||||||
END OF error-ex NOTICES AND INFORMATION
|
|
||||||
|
|
||||||
%% escape-string-regexp NOTICES AND INFORMATION BEGIN HERE
|
|
||||||
=========================================
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
@@ -2440,7 +2414,6 @@ General Public License.
|
|||||||
|
|
||||||
-------------------------------START OF THIRD-PARTY NOTICES-------------------------------------------
|
-------------------------------START OF THIRD-PARTY NOTICES-------------------------------------------
|
||||||
|
|
||||||
===================================ExcelDataReader (BEGIN)
|
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2014 ExcelDataReader
|
Copyright (c) 2014 ExcelDataReader
|
||||||
@@ -2466,4 +2439,4 @@ SOFTWARE.
|
|||||||
|
|
||||||
-------------------------------END OF THIRD-PARTY NOTICES-------------------------------------------
|
-------------------------------END OF THIRD-PARTY NOTICES-------------------------------------------
|
||||||
=========================================
|
=========================================
|
||||||
END OF Microsoft.ProgramSynthesis.Detection NOTICES AND INFORMATION
|
END OF Microsoft.ProgramSynthesis.Detection NOTICES AND INFORMATION
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: '8.x'
|
versionSpec: '10.15.1'
|
||||||
displayName: 'Install Node.js'
|
displayName: 'Install Node.js'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
git submodule update --init --recursive
|
|
||||||
nvm install 8.9.1
|
|
||||||
nvm use 8.9.1
|
|
||||||
npm i -g yarn
|
npm i -g yarn
|
||||||
displayName: 'preinstall'
|
displayName: 'preinstall'
|
||||||
|
|
||||||
@@ -24,23 +21,46 @@ steps:
|
|||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
yarn
|
yarn
|
||||||
displayName: 'Install'
|
displayName: 'Install'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
node_modules/.bin/gulp electron
|
yarn gulp electron-x64
|
||||||
node_modules/.bin/gulp compile --max_old_space_size=4096
|
displayName: Download Electron
|
||||||
node_modules/.bin/gulp optimize-vscode --max_old_space_size=4096
|
|
||||||
displayName: 'Scripts'
|
- script: |
|
||||||
|
yarn gulp hygiene
|
||||||
|
displayName: Run Hygiene Checks
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
yarn tslint
|
||||||
|
displayName: 'Run TSLint'
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
yarn strict-null-check
|
||||||
|
displayName: 'Run Strict Null Check'
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
yarn compile
|
||||||
|
displayName: 'Compile'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
DISPLAY=:10 ./scripts/test.sh --reporter mocha-junit-reporter
|
DISPLAY=:10 ./scripts/test.sh --reporter mocha-junit-reporter
|
||||||
displayName: 'Tests'
|
displayName: 'Tests'
|
||||||
|
condition: eq(variables['Agent.OS'], 'Linux')
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
DISPLAY=:10 ./scripts/test.sh --reporter mocha-junit-reporter --coverage
|
||||||
|
displayName: 'Tests'
|
||||||
|
condition: ne(variables['Agent.OS'], 'Linux')
|
||||||
|
|
||||||
- task: PublishTestResults@2
|
- task: PublishTestResults@2
|
||||||
inputs:
|
inputs:
|
||||||
testResultsFiles: '**/test-results.xml'
|
testResultsFiles: '**/test-results.xml'
|
||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
|
|
||||||
- script: |
|
- task: PublishCodeCoverageResults@1
|
||||||
yarn run tslint
|
inputs:
|
||||||
displayName: 'Run TSLint'
|
codeCoverageTool: 'cobertura'
|
||||||
|
summaryFileLocation: $(System.DefaultWorkingDirectory)/.build/coverage/cobertura-coverage.xml
|
||||||
|
reportDirectory: $(System.DefaultWorkingDirectory)/.build/coverage/lcov-reports
|
||||||
|
condition: ne(variables['Agent.OS'], 'Linux')
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: '8.9'
|
versionSpec: '10.15.1'
|
||||||
displayName: 'Install Node.js'
|
displayName: 'Install Node.js'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
@@ -9,15 +9,27 @@ steps:
|
|||||||
displayName: 'Yarn Install'
|
displayName: 'Yarn Install'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
.\node_modules\.bin\gulp electron
|
yarn gulp electron-x64
|
||||||
displayName: 'Electron'
|
displayName: 'Electron'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
npm run compile
|
yarn gulp hygiene
|
||||||
|
displayName: Run Hygiene Checks
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
yarn tslint
|
||||||
|
displayName: 'Run TSLint'
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
yarn strict-null-check
|
||||||
|
displayName: 'Run Strict Null Check'
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
yarn compile
|
||||||
displayName: 'Compile'
|
displayName: 'Compile'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
.\scripts\test.bat --reporter mocha-junit-reporter
|
.\scripts\test.bat --reporter mocha-junit-reporter --coverage
|
||||||
displayName: 'Test'
|
displayName: 'Test'
|
||||||
|
|
||||||
- task: PublishTestResults@2
|
- task: PublishTestResults@2
|
||||||
@@ -25,6 +37,8 @@ steps:
|
|||||||
testResultsFiles: 'test-results.xml'
|
testResultsFiles: 'test-results.xml'
|
||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
|
|
||||||
- script: |
|
- task: PublishCodeCoverageResults@1
|
||||||
yarn run tslint
|
inputs:
|
||||||
displayName: 'Run TSLint'
|
codeCoverageTool: 'cobertura'
|
||||||
|
summaryFileLocation: $(System.DefaultWorkingDirectory)\.build\coverage\cobertura-coverage.xml
|
||||||
|
reportDirectory: $(System.DefaultWorkingDirectory)\.build\coverage\lcov-report
|
||||||
|
|||||||
126
build/.nativeignore
Normal file
126
build/.nativeignore
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
# cleanup rules for native node modules, .gitignore style
|
||||||
|
|
||||||
|
fsevents/binding.gyp
|
||||||
|
fsevents/fsevents.cc
|
||||||
|
fsevents/build/**
|
||||||
|
fsevents/src/**
|
||||||
|
fsevents/test/**
|
||||||
|
!fsevents/**/*.node
|
||||||
|
|
||||||
|
vscode-sqlite3/binding.gyp
|
||||||
|
vscode-sqlite3/benchmark/**
|
||||||
|
vscode-sqlite3/cloudformation/**
|
||||||
|
vscode-sqlite3/deps/**
|
||||||
|
vscode-sqlite3/test/**
|
||||||
|
vscode-sqlite3/build/**
|
||||||
|
vscode-sqlite3/src/**
|
||||||
|
!vscode-sqlite3/build/Release/*.node
|
||||||
|
|
||||||
|
oniguruma/binding.gyp
|
||||||
|
oniguruma/build/**
|
||||||
|
oniguruma/src/**
|
||||||
|
oniguruma/deps/**
|
||||||
|
!oniguruma/build/Release/*.node
|
||||||
|
!oniguruma/src/*.js
|
||||||
|
|
||||||
|
windows-mutex/binding.gyp
|
||||||
|
windows-mutex/build/**
|
||||||
|
windows-mutex/src/**
|
||||||
|
!windows-mutex/**/*.node
|
||||||
|
|
||||||
|
native-keymap/binding.gyp
|
||||||
|
native-keymap/build/**
|
||||||
|
native-keymap/src/**
|
||||||
|
native-keymap/deps/**
|
||||||
|
!native-keymap/build/Release/*.node
|
||||||
|
|
||||||
|
native-is-elevated/binding.gyp
|
||||||
|
native-is-elevated/build/**
|
||||||
|
native-is-elevated/src/**
|
||||||
|
native-is-elevated/deps/**
|
||||||
|
!native-is-elevated/build/Release/*.node
|
||||||
|
|
||||||
|
native-watchdog/binding.gyp
|
||||||
|
native-watchdog/build/**
|
||||||
|
native-watchdog/src/**
|
||||||
|
!native-watchdog/build/Release/*.node
|
||||||
|
|
||||||
|
spdlog/binding.gyp
|
||||||
|
spdlog/build/**
|
||||||
|
spdlog/deps/**
|
||||||
|
spdlog/src/**
|
||||||
|
spdlog/test/**
|
||||||
|
!spdlog/build/Release/*.node
|
||||||
|
|
||||||
|
jschardet/dist/**
|
||||||
|
|
||||||
|
windows-foreground-love/binding.gyp
|
||||||
|
windows-foreground-love/build/**
|
||||||
|
windows-foreground-love/src/**
|
||||||
|
!windows-foreground-love/**/*.node
|
||||||
|
|
||||||
|
windows-process-tree/binding.gyp
|
||||||
|
windows-process-tree/build/**
|
||||||
|
windows-process-tree/src/**
|
||||||
|
!windows-process-tree/**/*.node
|
||||||
|
|
||||||
|
gc-signals/binding.gyp
|
||||||
|
gc-signals/build/**
|
||||||
|
gc-signals/src/**
|
||||||
|
gc-signals/deps/**
|
||||||
|
|
||||||
|
!gc-signals/build/Release/*.node
|
||||||
|
!gc-signals/src/index.js
|
||||||
|
|
||||||
|
keytar/binding.gyp
|
||||||
|
keytar/build/**
|
||||||
|
keytar/src/**
|
||||||
|
keytar/script/**
|
||||||
|
keytar/node_modules/**
|
||||||
|
!keytar/**/*.node
|
||||||
|
|
||||||
|
node-pty/binding.gyp
|
||||||
|
node-pty/build/**
|
||||||
|
node-pty/src/**
|
||||||
|
node-pty/tools/**
|
||||||
|
!node-pty/build/Release/*.exe
|
||||||
|
!node-pty/build/Release/*.dll
|
||||||
|
!node-pty/build/Release/*.node
|
||||||
|
|
||||||
|
chart.js/node_modules/**
|
||||||
|
|
||||||
|
emmet/node_modules/**
|
||||||
|
|
||||||
|
pty.js/build/**
|
||||||
|
!pty.js/build/Release/**
|
||||||
|
|
||||||
|
jquery-ui/external/**
|
||||||
|
jquery-ui/demos/**
|
||||||
|
|
||||||
|
core-js/**/**
|
||||||
|
|
||||||
|
slickgrid/node_modules/**
|
||||||
|
slickgrid/examples/**
|
||||||
|
|
||||||
|
vscode-nsfw/binding.gyp
|
||||||
|
vscode-nsfw/build/**
|
||||||
|
vscode-nsfw/src/**
|
||||||
|
vscode-nsfw/openpa/**
|
||||||
|
vscode-nsfw/includes/**
|
||||||
|
!vscode-nsfw/build/Release/*.node
|
||||||
|
!vscode-nsfw/**/*.a
|
||||||
|
|
||||||
|
vsda/binding.gyp
|
||||||
|
vsda/README.md
|
||||||
|
vsda/build/**
|
||||||
|
vsda/*.bat
|
||||||
|
vsda/*.sh
|
||||||
|
vsda/*.cpp
|
||||||
|
vsda/*.h
|
||||||
|
!vsda/build/Release/vsda.node
|
||||||
|
|
||||||
|
vscode-windows-ca-certs/**/*
|
||||||
|
!vscode-windows-ca-certs/package.json
|
||||||
|
!vscode-windows-ca-certs/**/*.node
|
||||||
|
|
||||||
|
node-addon-api/**/*
|
||||||
@@ -3,10 +3,12 @@
|
|||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import * as cp from 'child_process';
|
import * as cp from 'child_process';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
function yarnInstall(packageName: string): void {
|
function yarnInstall(packageName: string): void {
|
||||||
cp.execSync(`yarn add --no-lockfile ${packageName}`);
|
cp.execSync(`yarn add --no-lockfile ${packageName}`);
|
||||||
|
cp.execSync(`yarn add --no-lockfile ${packageName}`, { cwd: path.join( process.cwd(), 'remote') });
|
||||||
}
|
}
|
||||||
|
|
||||||
const product = require('../../../product.json');
|
const product = require('../../../product.json');
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import { execSync } from 'child_process';
|
|
||||||
import { Readable } from 'stream';
|
import { Readable } from 'stream';
|
||||||
import * as crypto from 'crypto';
|
import * as crypto from 'crypto';
|
||||||
import * as azure from 'azure-storage';
|
import * as azure from 'azure-storage';
|
||||||
@@ -66,8 +65,7 @@ interface Asset {
|
|||||||
platform: string;
|
platform: string;
|
||||||
type: string;
|
type: string;
|
||||||
url: string;
|
url: string;
|
||||||
// {{SQL CARBON EDIT}}
|
mooncakeUrl?: string;
|
||||||
mooncakeUrl: string | undefined;
|
|
||||||
hash: string;
|
hash: string;
|
||||||
sha256hash: string;
|
sha256hash: string;
|
||||||
size: number;
|
size: number;
|
||||||
@@ -154,9 +152,13 @@ async function publish(commit: string, quality: string, platform: string, type:
|
|||||||
|
|
||||||
const queuedBy = process.env['BUILD_QUEUEDBY']!;
|
const queuedBy = process.env['BUILD_QUEUEDBY']!;
|
||||||
const sourceBranch = process.env['BUILD_SOURCEBRANCH']!;
|
const sourceBranch = process.env['BUILD_SOURCEBRANCH']!;
|
||||||
const isReleased = quality === 'insider'
|
const isReleased = (
|
||||||
&& /^master$|^refs\/heads\/master$/.test(sourceBranch)
|
// Insiders: nightly build from master
|
||||||
&& /Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/.test(queuedBy);
|
(quality === 'insider' && /^master$|^refs\/heads\/master$/.test(sourceBranch) && /Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/.test(queuedBy)) ||
|
||||||
|
|
||||||
|
// Exploration: any build from electron-4.0.x branch
|
||||||
|
(quality === 'exploration' && /^electron-4.0.x$|^refs\/heads\/electron-4.0.x$/.test(sourceBranch))
|
||||||
|
);
|
||||||
|
|
||||||
console.log('Publishing...');
|
console.log('Publishing...');
|
||||||
console.log('Quality:', quality);
|
console.log('Quality:', quality);
|
||||||
@@ -186,56 +188,18 @@ async function publish(commit: string, quality: string, platform: string, type:
|
|||||||
const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']!)
|
const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']!)
|
||||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
|
||||||
await assertContainer(blobService, quality);
|
await assertContainer(blobService, quality);
|
||||||
|
|
||||||
const blobExists = await doesAssetExist(blobService, quality, blobName);
|
const blobExists = await doesAssetExist(blobService, quality, blobName);
|
||||||
|
|
||||||
const promises = [];
|
if (blobExists) {
|
||||||
|
|
||||||
if (!blobExists) {
|
|
||||||
promises.push(uploadBlob(blobService, quality, blobName, file));
|
|
||||||
}
|
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
|
||||||
if (process.env['MOONCAKE_STORAGE_ACCESS_KEY']) {
|
|
||||||
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY']!, `${storageAccount}.blob.core.chinacloudapi.cn`)
|
|
||||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
|
||||||
|
|
||||||
// mooncake is fussy and far away, this is needed!
|
|
||||||
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
|
||||||
|
|
||||||
await Promise.all([
|
|
||||||
assertContainer(blobService, quality),
|
|
||||||
assertContainer(mooncakeBlobService, quality)
|
|
||||||
]);
|
|
||||||
|
|
||||||
const [blobExists, moooncakeBlobExists] = await Promise.all([
|
|
||||||
doesAssetExist(blobService, quality, blobName),
|
|
||||||
doesAssetExist(mooncakeBlobService, quality, blobName)
|
|
||||||
]);
|
|
||||||
|
|
||||||
const promises: Array<Promise<void>> = [];
|
|
||||||
|
|
||||||
if (!blobExists) {
|
|
||||||
promises.push(uploadBlob(blobService, quality, blobName, file));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!moooncakeBlobExists) {
|
|
||||||
promises.push(uploadBlob(mooncakeBlobService, quality, blobName, file));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
console.log('Skipping Mooncake publishing.');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (promises.length === 0) {
|
|
||||||
console.log(`Blob ${quality}, ${blobName} already exists, not publishing again.`);
|
console.log(`Blob ${quality}, ${blobName} already exists, not publishing again.`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Uploading blobs to Azure storage...');
|
console.log('Uploading blobs to Azure storage...');
|
||||||
|
|
||||||
await Promise.all(promises);
|
await uploadBlob(blobService, quality, blobName, file);
|
||||||
|
|
||||||
console.log('Blobs successfully uploaded.');
|
console.log('Blobs successfully uploaded.');
|
||||||
|
|
||||||
@@ -247,8 +211,6 @@ async function publish(commit: string, quality: string, platform: string, type:
|
|||||||
platform: platform,
|
platform: platform,
|
||||||
type: type,
|
type: type,
|
||||||
url: `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`,
|
url: `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`,
|
||||||
// {{SQL CARBON EDIT}}
|
|
||||||
mooncakeUrl: process.env['MOONCAKE_CDN_URL'] ? `${process.env['MOONCAKE_CDN_URL']}/${quality}/${blobName}` : undefined,
|
|
||||||
hash: sha1hash,
|
hash: sha1hash,
|
||||||
sha256hash,
|
sha256hash,
|
||||||
size
|
size
|
||||||
@@ -289,15 +251,18 @@ function main(): void {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const commit = process.env['BUILD_SOURCEVERSION'];
|
||||||
|
|
||||||
|
if (!commit) {
|
||||||
|
console.warn('Skipping publish due to missing BUILD_SOURCEVERSION');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const opts = minimist<PublishOptions>(process.argv.slice(2), {
|
const opts = minimist<PublishOptions>(process.argv.slice(2), {
|
||||||
boolean: ['upload-only']
|
boolean: ['upload-only']
|
||||||
});
|
});
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
const [quality, platform, type, name, version, _isUpdate, file] = opts._;
|
||||||
let [quality, platform, type, name, version, _isUpdate, file, commit] = opts._;
|
|
||||||
if (!commit) {
|
|
||||||
commit = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
publish(commit, quality, platform, type, name, version, _isUpdate, file, opts).catch(err => {
|
publish(commit, quality, platform, type, name, version, _isUpdate, file, opts).catch(err => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|||||||
176
build/azure-pipelines/common/sync-mooncake.ts
Normal file
176
build/azure-pipelines/common/sync-mooncake.ts
Normal file
@@ -0,0 +1,176 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as url from 'url';
|
||||||
|
import * as azure from 'azure-storage';
|
||||||
|
import * as mime from 'mime';
|
||||||
|
import { DocumentClient, RetrievedDocument } from 'documentdb';
|
||||||
|
|
||||||
|
function log(...args: any[]) {
|
||||||
|
console.log(...[`[${new Date().toISOString()}]`, ...args]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function error(...args: any[]) {
|
||||||
|
console.error(...[`[${new Date().toISOString()}]`, ...args]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.argv.length < 3) {
|
||||||
|
error('Usage: node sync-mooncake.js <quality>');
|
||||||
|
process.exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Build extends RetrievedDocument {
|
||||||
|
assets: Asset[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Asset {
|
||||||
|
platform: string;
|
||||||
|
type: string;
|
||||||
|
url: string;
|
||||||
|
mooncakeUrl: string;
|
||||||
|
hash: string;
|
||||||
|
sha256hash: string;
|
||||||
|
size: number;
|
||||||
|
supportsFastUpdate?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateBuild(commit: string, quality: string, platform: string, type: string, asset: Asset): Promise<void> {
|
||||||
|
const client = new DocumentClient(process.env['AZURE_DOCUMENTDB_ENDPOINT']!, { masterKey: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||||
|
const collection = 'dbs/builds/colls/' + quality;
|
||||||
|
const updateQuery = {
|
||||||
|
query: 'SELECT TOP 1 * FROM c WHERE c.id = @id',
|
||||||
|
parameters: [{ name: '@id', value: commit }]
|
||||||
|
};
|
||||||
|
|
||||||
|
let updateTries = 0;
|
||||||
|
|
||||||
|
function _update(): Promise<void> {
|
||||||
|
updateTries++;
|
||||||
|
|
||||||
|
return new Promise<void>((c, e) => {
|
||||||
|
client.queryDocuments(collection, updateQuery).toArray((err, results) => {
|
||||||
|
if (err) { return e(err); }
|
||||||
|
if (results.length !== 1) { return e(new Error('No documents')); }
|
||||||
|
|
||||||
|
const release = results[0];
|
||||||
|
|
||||||
|
release.assets = [
|
||||||
|
...release.assets.filter((a: any) => !(a.platform === platform && a.type === type)),
|
||||||
|
asset
|
||||||
|
];
|
||||||
|
|
||||||
|
client.replaceDocument(release._self, release, err => {
|
||||||
|
if (err && err.code === 409 && updateTries < 5) { return c(_update()); }
|
||||||
|
if (err) { return e(err); }
|
||||||
|
|
||||||
|
log('Build successfully updated.');
|
||||||
|
c();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return _update();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function sync(commit: string, quality: string): Promise<void> {
|
||||||
|
log(`Synchronizing Mooncake assets for ${quality}, ${commit}...`);
|
||||||
|
|
||||||
|
const cosmosdb = new DocumentClient(process.env['AZURE_DOCUMENTDB_ENDPOINT']!, { masterKey: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||||
|
const collection = `dbs/builds/colls/${quality}`;
|
||||||
|
const query = {
|
||||||
|
query: 'SELECT TOP 1 * FROM c WHERE c.id = @id',
|
||||||
|
parameters: [{ name: '@id', value: commit }]
|
||||||
|
};
|
||||||
|
|
||||||
|
const build = await new Promise<Build>((c, e) => {
|
||||||
|
cosmosdb.queryDocuments(collection, query).toArray((err, results) => {
|
||||||
|
if (err) { return e(err); }
|
||||||
|
if (results.length !== 1) { return e(new Error('No documents')); }
|
||||||
|
c(results[0] as Build);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
log(`Found build for ${commit}, with ${build.assets.length} assets`);
|
||||||
|
|
||||||
|
const storageAccount = process.env['AZURE_STORAGE_ACCOUNT_2']!;
|
||||||
|
|
||||||
|
const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']!)
|
||||||
|
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||||
|
|
||||||
|
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY']!, `${storageAccount}.blob.core.chinacloudapi.cn`)
|
||||||
|
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||||
|
|
||||||
|
// mooncake is fussy and far away, this is needed!
|
||||||
|
blobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||||
|
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||||
|
|
||||||
|
for (const asset of build.assets) {
|
||||||
|
try {
|
||||||
|
const blobPath = url.parse(asset.url).path;
|
||||||
|
|
||||||
|
if (!blobPath) {
|
||||||
|
throw new Error(`Failed to parse URL: ${asset.url}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const blobName = blobPath.replace(/^\/\w+\//, '');
|
||||||
|
|
||||||
|
log(`Found ${blobName}`);
|
||||||
|
|
||||||
|
if (asset.mooncakeUrl) {
|
||||||
|
log(` Already in Mooncake ✔️`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const readStream = blobService.createReadStream(quality, blobName, undefined!);
|
||||||
|
const blobOptions: azure.BlobService.CreateBlockBlobRequestOptions = {
|
||||||
|
contentSettings: {
|
||||||
|
contentType: mime.lookup(blobPath),
|
||||||
|
cacheControl: 'max-age=31536000, public'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const writeStream = mooncakeBlobService.createWriteStreamToBlockBlob(quality, blobName, blobOptions, undefined);
|
||||||
|
|
||||||
|
log(` Uploading to Mooncake...`);
|
||||||
|
await new Promise((c, e) => readStream.pipe(writeStream).on('finish', c).on('error', e));
|
||||||
|
|
||||||
|
log(` Updating build in DB...`);
|
||||||
|
asset.mooncakeUrl = `${process.env['MOONCAKE_CDN_URL']}${blobPath}`;
|
||||||
|
await updateBuild(commit, quality, asset.platform, asset.type, asset);
|
||||||
|
|
||||||
|
log(` Done ✔️`);
|
||||||
|
} catch (err) {
|
||||||
|
error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log(`All done ✔️`);
|
||||||
|
}
|
||||||
|
|
||||||
|
function main(): void {
|
||||||
|
if (process.env['VSCODE_BUILD_SKIP_PUBLISH']) {
|
||||||
|
error('Skipping publish due to VSCODE_BUILD_SKIP_PUBLISH');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const commit = process.env['BUILD_SOURCEVERSION'];
|
||||||
|
|
||||||
|
if (!commit) {
|
||||||
|
error('Skipping publish due to missing BUILD_SOURCEVERSION');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const quality = process.argv[2];
|
||||||
|
|
||||||
|
sync(commit, quality).catch(err => {
|
||||||
|
error(err);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
||||||
5
build/azure-pipelines/darwin/build.sh
Executable file
5
build/azure-pipelines/darwin/build.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
yarn gulp vscode-darwin-min
|
||||||
|
yarn gulp vscode-reh-darwin-min
|
||||||
|
yarn gulp upload-vscode-sourcemaps
|
||||||
@@ -1,13 +1,26 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "1.10.1"
|
versionSpec: "1.10.1"
|
||||||
|
# - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||||
|
# inputs:
|
||||||
|
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
# vstsFeed: '$(ArtifactFeed)'
|
||||||
|
# condition: eq(variables['System.PullRequest.PullRequestId'], '')
|
||||||
- script: |
|
- script: |
|
||||||
yarn
|
yarn
|
||||||
displayName: Install Dependencies
|
displayName: Install Dependencies
|
||||||
|
# condition: or(ne(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||||
|
# - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||||
|
# inputs:
|
||||||
|
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
# vstsFeed: '$(ArtifactFeed)'
|
||||||
|
# condition: and(succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||||
- script: |
|
- script: |
|
||||||
yarn gulp electron-x64
|
yarn gulp electron-x64
|
||||||
displayName: Download Electron
|
displayName: Download Electron
|
||||||
@@ -17,9 +30,6 @@ steps:
|
|||||||
- script: |
|
- script: |
|
||||||
yarn monaco-compile-check
|
yarn monaco-compile-check
|
||||||
displayName: Run Monaco Editor Checks
|
displayName: Run Monaco Editor Checks
|
||||||
- script: |
|
|
||||||
yarn strict-null-check
|
|
||||||
displayName: Run Strict Null Checks
|
|
||||||
- script: |
|
- script: |
|
||||||
yarn compile
|
yarn compile
|
||||||
displayName: Compile Sources
|
displayName: Compile Sources
|
||||||
@@ -37,4 +47,4 @@ steps:
|
|||||||
inputs:
|
inputs:
|
||||||
testResultsFiles: '*-results.xml'
|
testResultsFiles: '*-results.xml'
|
||||||
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
|
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
|
||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
|
|||||||
@@ -1,29 +1,48 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "1.10.1"
|
versionSpec: "1.10.1"
|
||||||
|
|
||||||
|
- task: AzureKeyVault@1
|
||||||
|
displayName: 'Azure Key Vault: Get Secrets'
|
||||||
|
inputs:
|
||||||
|
azureSubscription: 'vscode-builds-subscription'
|
||||||
|
KeyVaultName: vscode
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
echo "machine monacotools.visualstudio.com password $(VSO_PAT)" > ~/.netrc
|
|
||||||
|
cat << EOF > ~/.netrc
|
||||||
|
machine monacotools.visualstudio.com
|
||||||
|
password $(devops-pat)
|
||||||
|
machine github.com
|
||||||
|
login vscode
|
||||||
|
password $(github-distro-mixin-password)
|
||||||
|
EOF
|
||||||
|
|
||||||
|
git config user.email "vscode@microsoft.com"
|
||||||
|
git config user.name "VSCode"
|
||||||
|
git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git"
|
||||||
|
git fetch distro
|
||||||
|
git merge $(node -p "require('./package.json').distro")
|
||||||
|
|
||||||
yarn
|
yarn
|
||||||
yarn gulp -- hygiene
|
yarn gulp mixin
|
||||||
|
yarn gulp hygiene
|
||||||
yarn monaco-compile-check
|
yarn monaco-compile-check
|
||||||
yarn strict-null-check
|
|
||||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" yarn gulp -- mixin
|
|
||||||
node build/azure-pipelines/common/installDistro.js
|
node build/azure-pipelines/common/installDistro.js
|
||||||
node build/lib/builtInExtensions.js
|
node build/lib/builtInExtensions.js
|
||||||
displayName: Prepare build
|
displayName: Prepare build
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||||
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
AZURE_STORAGE_ACCESS_KEY="$(ticino-storage-key)" \
|
||||||
yarn gulp -- vscode-darwin-min upload-vscode-sourcemaps
|
./build/azure-pipelines/darwin/build.sh
|
||||||
displayName: Build
|
displayName: Build
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
@@ -33,6 +52,11 @@ steps:
|
|||||||
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-darwin/$APP_NAME"
|
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-darwin/$APP_NAME"
|
||||||
displayName: Run unit tests
|
displayName: Run unit tests
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
./scripts/test-integration.sh --build --tfs "Integration Tests"
|
||||||
|
displayName: Run integration tests
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd
|
pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd
|
||||||
@@ -59,31 +83,12 @@ steps:
|
|||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
|
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||||
# remove pkg from archive
|
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||||
zip -d ../VSCode-darwin.zip "*.pkg"
|
AZURE_STORAGE_ACCESS_KEY="$(ticino-storage-key)" \
|
||||||
|
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||||
# publish the build
|
VSCODE_HOCKEYAPP_TOKEN="$(vscode-hockeyapp-token)" \
|
||||||
PACKAGEJSON=`ls ../VSCode-darwin/*.app/Contents/Resources/app/package.json`
|
./build/azure-pipelines/darwin/publish.sh
|
||||||
VERSION=`node -p "require(\"$PACKAGEJSON\").version"`
|
|
||||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
|
||||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
|
||||||
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
|
||||||
node build/azure-pipelines/common/publish.js \
|
|
||||||
"$(VSCODE_QUALITY)" \
|
|
||||||
darwin \
|
|
||||||
archive \
|
|
||||||
"VSCode-darwin-$(VSCODE_QUALITY).zip" \
|
|
||||||
$VERSION \
|
|
||||||
true \
|
|
||||||
../VSCode-darwin.zip
|
|
||||||
|
|
||||||
# publish hockeyapp symbols
|
|
||||||
node build/azure-pipelines/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" "$(VSCODE_HOCKEYAPP_ID_MACOS)"
|
|
||||||
|
|
||||||
# upload configuration
|
|
||||||
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
|
||||||
yarn gulp -- upload-vscode-configuration
|
|
||||||
displayName: Publish
|
displayName: Publish
|
||||||
|
|
||||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||||
|
|||||||
36
build/azure-pipelines/darwin/publish.sh
Executable file
36
build/azure-pipelines/darwin/publish.sh
Executable file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# remove pkg from archive
|
||||||
|
zip -d ../VSCode-darwin.zip "*.pkg"
|
||||||
|
|
||||||
|
# publish the build
|
||||||
|
PACKAGEJSON=`ls ../VSCode-darwin/*.app/Contents/Resources/app/package.json`
|
||||||
|
VERSION=`node -p "require(\"$PACKAGEJSON\").version"`
|
||||||
|
node build/azure-pipelines/common/publish.js \
|
||||||
|
"$VSCODE_QUALITY" \
|
||||||
|
darwin \
|
||||||
|
archive \
|
||||||
|
"VSCode-darwin-$VSCODE_QUALITY.zip" \
|
||||||
|
$VERSION \
|
||||||
|
true \
|
||||||
|
../VSCode-darwin.zip
|
||||||
|
|
||||||
|
# package Remote Extension Host
|
||||||
|
pushd .. && mv vscode-reh-darwin vscode-server-darwin && zip -Xry vscode-server-darwin.zip vscode-server-darwin && popd
|
||||||
|
|
||||||
|
# publish Remote Extension Host
|
||||||
|
node build/azure-pipelines/common/publish.js \
|
||||||
|
"$VSCODE_QUALITY" \
|
||||||
|
server-darwin \
|
||||||
|
archive-unsigned \
|
||||||
|
"vscode-server-darwin.zip" \
|
||||||
|
$VERSION \
|
||||||
|
true \
|
||||||
|
../vscode-server-darwin.zip
|
||||||
|
|
||||||
|
# publish hockeyapp symbols
|
||||||
|
node build/azure-pipelines/common/symbols.js "$VSCODE_MIXIN_PASSWORD" "$VSCODE_HOCKEYAPP_TOKEN" "$VSCODE_ARCH" "$VSCODE_HOCKEYAPP_ID_MACOS"
|
||||||
|
|
||||||
|
# upload configuration
|
||||||
|
yarn gulp upload-vscode-configuration
|
||||||
36
build/azure-pipelines/distro-build.yml
Normal file
36
build/azure-pipelines/distro-build.yml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
trigger:
|
||||||
|
branches:
|
||||||
|
include: ['master', 'release/*']
|
||||||
|
pr:
|
||||||
|
branches:
|
||||||
|
include: ['master', 'release/*']
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
|
- task: AzureKeyVault@1
|
||||||
|
displayName: 'Azure Key Vault: Get Secrets'
|
||||||
|
inputs:
|
||||||
|
azureSubscription: 'vscode-builds-subscription'
|
||||||
|
KeyVaultName: vscode
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cat << EOF > ~/.netrc
|
||||||
|
machine github.com
|
||||||
|
login vscode
|
||||||
|
password $(github-distro-mixin-password)
|
||||||
|
EOF
|
||||||
|
|
||||||
|
git config user.email "vscode@microsoft.com"
|
||||||
|
git config user.name "VSCode"
|
||||||
|
|
||||||
|
git remote add distro "https://github.com/$VSCODE_MIXIN_REPO.git"
|
||||||
|
git fetch distro
|
||||||
|
git push distro origin/master:refs/heads/master
|
||||||
|
git merge $(node -p "require('./package.json').distro")
|
||||||
|
|
||||||
|
displayName: Sync & Merge Distro
|
||||||
7
build/azure-pipelines/linux/build.sh
Executable file
7
build/azure-pipelines/linux/build.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
yarn gulp "vscode-linux-$VSCODE_ARCH-min"
|
||||||
|
|
||||||
|
if [[ "$VSCODE_ARCH" != "ia32" ]]; then
|
||||||
|
yarn gulp vscode-reh-linux-$VSCODE_ARCH-min
|
||||||
|
fi
|
||||||
@@ -2,20 +2,33 @@ steps:
|
|||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 libgconf-2-4 dbus xvfb libgtk-3-0
|
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0
|
||||||
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
|
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
|
||||||
sudo chmod +x /etc/init.d/xvfb
|
sudo chmod +x /etc/init.d/xvfb
|
||||||
sudo update-rc.d xvfb defaults
|
sudo update-rc.d xvfb defaults
|
||||||
sudo service xvfb start
|
sudo service xvfb start
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "1.10.1"
|
versionSpec: "1.10.1"
|
||||||
|
# - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||||
|
# inputs:
|
||||||
|
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
# vstsFeed: '$(ArtifactFeed)'
|
||||||
|
# condition: eq(variables['System.PullRequest.PullRequestId'], '')
|
||||||
- script: |
|
- script: |
|
||||||
yarn
|
yarn
|
||||||
displayName: Install Dependencies
|
displayName: Install Dependencies
|
||||||
|
# condition: or(ne(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||||
|
# - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||||
|
# inputs:
|
||||||
|
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
# vstsFeed: '$(ArtifactFeed)'
|
||||||
|
# condition: and(succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||||
- script: |
|
- script: |
|
||||||
yarn gulp electron-x64
|
yarn gulp electron-x64
|
||||||
displayName: Download Electron
|
displayName: Download Electron
|
||||||
@@ -25,9 +38,6 @@ steps:
|
|||||||
- script: |
|
- script: |
|
||||||
yarn monaco-compile-check
|
yarn monaco-compile-check
|
||||||
displayName: Run Monaco Editor Checks
|
displayName: Run Monaco Editor Checks
|
||||||
- script: |
|
|
||||||
yarn strict-null-check
|
|
||||||
displayName: Run Strict Null Checks
|
|
||||||
- script: |
|
- script: |
|
||||||
yarn compile
|
yarn compile
|
||||||
displayName: Compile Sources
|
displayName: Compile Sources
|
||||||
@@ -42,4 +52,4 @@ steps:
|
|||||||
inputs:
|
inputs:
|
||||||
testResultsFiles: '*-results.xml'
|
testResultsFiles: '*-results.xml'
|
||||||
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
|
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
|
||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "1.10.1"
|
versionSpec: "1.10.1"
|
||||||
|
|
||||||
|
- task: AzureKeyVault@1
|
||||||
|
displayName: 'Azure Key Vault: Get Secrets'
|
||||||
|
inputs:
|
||||||
|
azureSubscription: 'vscode-builds-subscription'
|
||||||
|
KeyVaultName: vscode
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
export npm_config_arch="$(VSCODE_ARCH)"
|
export npm_config_arch="$(VSCODE_ARCH)"
|
||||||
@@ -14,92 +20,53 @@ steps:
|
|||||||
export PKG_CONFIG_PATH="/usr/lib/i386-linux-gnu/pkgconfig"
|
export PKG_CONFIG_PATH="/usr/lib/i386-linux-gnu/pkgconfig"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "machine monacotools.visualstudio.com password $(VSO_PAT)" > ~/.netrc
|
cat << EOF > ~/.netrc
|
||||||
|
machine monacotools.visualstudio.com
|
||||||
|
password $(devops-pat)
|
||||||
|
machine github.com
|
||||||
|
login vscode
|
||||||
|
password $(github-distro-mixin-password)
|
||||||
|
EOF
|
||||||
|
|
||||||
|
git config user.email "vscode@microsoft.com"
|
||||||
|
git config user.name "VSCode"
|
||||||
|
git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git"
|
||||||
|
git fetch distro
|
||||||
|
git merge $(node -p "require('./package.json').distro")
|
||||||
|
|
||||||
CHILD_CONCURRENCY=1 yarn
|
CHILD_CONCURRENCY=1 yarn
|
||||||
npm run gulp -- hygiene
|
yarn gulp mixin
|
||||||
npm run monaco-compile-check
|
yarn gulp hygiene
|
||||||
npm run strict-null-check
|
yarn monaco-compile-check
|
||||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- mixin
|
|
||||||
node build/azure-pipelines/common/installDistro.js
|
node build/azure-pipelines/common/installDistro.js
|
||||||
node build/lib/builtInExtensions.js
|
node build/lib/builtInExtensions.js
|
||||||
|
displayName: Prepare build
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- vscode-linux-$(VSCODE_ARCH)-min
|
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||||
name: build
|
./build/azure-pipelines/linux/build.sh
|
||||||
|
displayName: Build
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
npm run gulp -- "electron-$(VSCODE_ARCH)"
|
yarn gulp "electron-$(VSCODE_ARCH)"
|
||||||
|
|
||||||
# xvfb seems to be crashing often, let's make sure it's always up
|
# xvfb seems to be crashing often, let's make sure it's always up
|
||||||
service xvfb start
|
service xvfb start
|
||||||
|
|
||||||
DISPLAY=:10 ./scripts/test.sh --build --tfs "Unit Tests"
|
DISPLAY=:10 ./scripts/test.sh --build --tfs "Unit Tests"
|
||||||
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)"
|
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)"
|
||||||
name: test
|
displayName: Run unit tests
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
REPO="$(pwd)"
|
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||||
ROOT="$REPO/.."
|
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||||
ARCH="$(VSCODE_ARCH)"
|
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||||
|
VSCODE_HOCKEYAPP_TOKEN="$(vscode-hockeyapp-token)" \
|
||||||
# Publish tarball
|
./build/azure-pipelines/linux/publish.sh
|
||||||
PLATFORM_LINUX="linux-$(VSCODE_ARCH)"
|
displayName: Publish
|
||||||
[[ "$ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
|
|
||||||
[[ "$ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
|
|
||||||
BUILDNAME="VSCode-$PLATFORM_LINUX"
|
|
||||||
BUILD="$ROOT/$BUILDNAME"
|
|
||||||
BUILD_VERSION="$(date +%s)"
|
|
||||||
[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$BUILD_VERSION.tar.gz"
|
|
||||||
TARBALL_PATH="$ROOT/$TARBALL_FILENAME"
|
|
||||||
PACKAGEJSON="$BUILD/resources/app/package.json"
|
|
||||||
VERSION=$(node -p "require(\"$PACKAGEJSON\").version")
|
|
||||||
|
|
||||||
rm -rf $ROOT/code-*.tar.*
|
|
||||||
(cd $ROOT && tar -czf $TARBALL_PATH $BUILDNAME)
|
|
||||||
|
|
||||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
|
||||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
|
||||||
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
|
||||||
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_LINUX" archive-unsigned "$TARBALL_FILENAME" "$VERSION" true "$TARBALL_PATH"
|
|
||||||
|
|
||||||
# Publish hockeyapp symbols
|
|
||||||
node build/azure-pipelines/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" "$(VSCODE_HOCKEYAPP_ID_LINUX64)"
|
|
||||||
|
|
||||||
# Publish DEB
|
|
||||||
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-deb"
|
|
||||||
PLATFORM_DEB="linux-deb-$ARCH"
|
|
||||||
[[ "$ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
|
|
||||||
DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)"
|
|
||||||
DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME"
|
|
||||||
|
|
||||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
|
||||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
|
||||||
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
|
||||||
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_DEB" package "$DEB_FILENAME" "$VERSION" true "$DEB_PATH"
|
|
||||||
|
|
||||||
# Publish RPM
|
|
||||||
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-rpm"
|
|
||||||
PLATFORM_RPM="linux-rpm-$ARCH"
|
|
||||||
[[ "$ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
|
|
||||||
RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)"
|
|
||||||
RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME"
|
|
||||||
|
|
||||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
|
||||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
|
||||||
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
|
||||||
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_RPM" package "$RPM_FILENAME" "$VERSION" true "$RPM_PATH"
|
|
||||||
|
|
||||||
# Publish Snap
|
|
||||||
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-prepare-snap"
|
|
||||||
|
|
||||||
# Pack snap tarball artifact, in order to preserve file perms
|
|
||||||
mkdir -p $REPO/.build/linux/snap-tarball
|
|
||||||
SNAP_TARBALL_PATH="$REPO/.build/linux/snap-tarball/snap-$(VSCODE_ARCH).tar.gz"
|
|
||||||
rm -rf $SNAP_TARBALL_PATH
|
|
||||||
(cd .build/linux && tar -czf $SNAP_TARBALL_PATH snap)
|
|
||||||
|
|
||||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||||
displayName: 'Component Detection'
|
displayName: 'Component Detection'
|
||||||
|
|||||||
64
build/azure-pipelines/linux/publish.sh
Executable file
64
build/azure-pipelines/linux/publish.sh
Executable file
@@ -0,0 +1,64 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
REPO="$(pwd)"
|
||||||
|
ROOT="$REPO/.."
|
||||||
|
|
||||||
|
# Publish tarball
|
||||||
|
PLATFORM_LINUX="linux-$VSCODE_ARCH"
|
||||||
|
[[ "$VSCODE_ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
|
||||||
|
[[ "$VSCODE_ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
|
||||||
|
BUILDNAME="VSCode-$PLATFORM_LINUX"
|
||||||
|
BUILD="$ROOT/$BUILDNAME"
|
||||||
|
BUILD_VERSION="$(date +%s)"
|
||||||
|
[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$BUILD_VERSION.tar.gz"
|
||||||
|
TARBALL_PATH="$ROOT/$TARBALL_FILENAME"
|
||||||
|
PACKAGEJSON="$BUILD/resources/app/package.json"
|
||||||
|
VERSION=$(node -p "require(\"$PACKAGEJSON\").version")
|
||||||
|
|
||||||
|
rm -rf $ROOT/code-*.tar.*
|
||||||
|
(cd $ROOT && tar -czf $TARBALL_PATH $BUILDNAME)
|
||||||
|
|
||||||
|
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_LINUX" archive-unsigned "$TARBALL_FILENAME" "$VERSION" true "$TARBALL_PATH"
|
||||||
|
|
||||||
|
# Publish Remote Extension Host
|
||||||
|
if [[ "$VSCODE_ARCH" != "ia32" ]]; then
|
||||||
|
LEGACY_SERVER_BUILD_NAME="vscode-reh-$PLATFORM_LINUX"
|
||||||
|
SERVER_BUILD_NAME="vscode-server-$PLATFORM_LINUX"
|
||||||
|
SERVER_TARBALL_FILENAME="vscode-server-$PLATFORM_LINUX.tar.gz"
|
||||||
|
SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"
|
||||||
|
|
||||||
|
rm -rf $ROOT/vscode-server-*.tar.*
|
||||||
|
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
|
||||||
|
|
||||||
|
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "server-$PLATFORM_LINUX" archive-unsigned "$SERVER_TARBALL_FILENAME" "$VERSION" true "$SERVER_TARBALL_PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Publish hockeyapp symbols
|
||||||
|
node build/azure-pipelines/common/symbols.js "$VSCODE_MIXIN_PASSWORD" "$VSCODE_HOCKEYAPP_TOKEN" "$VSCODE_ARCH" "$VSCODE_HOCKEYAPP_ID_LINUX64"
|
||||||
|
|
||||||
|
# Publish DEB
|
||||||
|
yarn gulp "vscode-linux-$VSCODE_ARCH-build-deb"
|
||||||
|
PLATFORM_DEB="linux-deb-$VSCODE_ARCH"
|
||||||
|
[[ "$VSCODE_ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
|
||||||
|
DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)"
|
||||||
|
DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME"
|
||||||
|
|
||||||
|
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_DEB" package "$DEB_FILENAME" "$VERSION" true "$DEB_PATH"
|
||||||
|
|
||||||
|
# Publish RPM
|
||||||
|
yarn gulp "vscode-linux-$VSCODE_ARCH-build-rpm"
|
||||||
|
PLATFORM_RPM="linux-rpm-$VSCODE_ARCH"
|
||||||
|
[[ "$VSCODE_ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
|
||||||
|
RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)"
|
||||||
|
RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME"
|
||||||
|
|
||||||
|
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_RPM" package "$RPM_FILENAME" "$VERSION" true "$RPM_PATH"
|
||||||
|
|
||||||
|
# Publish Snap
|
||||||
|
yarn gulp "vscode-linux-$VSCODE_ARCH-prepare-snap"
|
||||||
|
|
||||||
|
# Pack snap tarball artifact, in order to preserve file perms
|
||||||
|
mkdir -p $REPO/.build/linux/snap-tarball
|
||||||
|
SNAP_TARBALL_PATH="$REPO/.build/linux/snap-tarball/snap-$VSCODE_ARCH.tar.gz"
|
||||||
|
rm -rf $SNAP_TARBALL_PATH
|
||||||
|
(cd .build/linux && tar -czf $SNAP_TARBALL_PATH snap)
|
||||||
@@ -1,12 +1,18 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "1.10.1"
|
versionSpec: "1.10.1"
|
||||||
|
|
||||||
|
- task: AzureKeyVault@1
|
||||||
|
displayName: 'Azure Key Vault: Get Secrets'
|
||||||
|
inputs:
|
||||||
|
azureSubscription: 'vscode-builds-subscription'
|
||||||
|
KeyVaultName: vscode
|
||||||
|
|
||||||
- task: DownloadPipelineArtifact@0
|
- task: DownloadPipelineArtifact@0
|
||||||
displayName: 'Download Pipeline Artifact'
|
displayName: 'Download Pipeline Artifact'
|
||||||
inputs:
|
inputs:
|
||||||
@@ -16,6 +22,14 @@ steps:
|
|||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# Get snapcraft version
|
||||||
|
snapcraft --version
|
||||||
|
|
||||||
|
# Make sure we get latest packages
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get upgrade -y
|
||||||
|
|
||||||
|
# Define variables
|
||||||
REPO="$(pwd)"
|
REPO="$(pwd)"
|
||||||
ARCH="$(VSCODE_ARCH)"
|
ARCH="$(VSCODE_ARCH)"
|
||||||
SNAP_ROOT="$REPO/.build/linux/snap/$ARCH"
|
SNAP_ROOT="$REPO/.build/linux/snap/$ARCH"
|
||||||
@@ -33,10 +47,9 @@ steps:
|
|||||||
PACKAGEJSON="$(ls $SNAP_ROOT/code*/usr/share/code*/resources/app/package.json)"
|
PACKAGEJSON="$(ls $SNAP_ROOT/code*/usr/share/code*/resources/app/package.json)"
|
||||||
VERSION=$(node -p "require(\"$PACKAGEJSON\").version")
|
VERSION=$(node -p "require(\"$PACKAGEJSON\").version")
|
||||||
SNAP_PATH="$SNAP_ROOT/$SNAP_FILENAME"
|
SNAP_PATH="$SNAP_ROOT/$SNAP_FILENAME"
|
||||||
(cd $SNAP_ROOT/code-* && snapcraft snap --output "$SNAP_PATH")
|
(cd $SNAP_ROOT/code-* && sudo snapcraft snap --output "$SNAP_PATH")
|
||||||
|
|
||||||
# Publish snap package
|
# Publish snap package
|
||||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||||
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
|
||||||
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "linux-snap-$ARCH" package "$SNAP_FILENAME" "$VERSION" true "$SNAP_PATH"
|
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "linux-snap-$ARCH" package "$SNAP_FILENAME" "$VERSION" true "$SNAP_PATH"
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
resources:
|
resources:
|
||||||
containers:
|
containers:
|
||||||
- container: vscode-x64
|
- container: vscode-x64
|
||||||
image: joaomoreno/vscode-linux-build-agent:x64
|
endpoint: VSCodeHub
|
||||||
|
image: vscodehub.azurecr.io/vscode-linux-build-agent:x64
|
||||||
- container: vscode-ia32
|
- container: vscode-ia32
|
||||||
image: joaomoreno/vscode-linux-build-agent:ia32
|
endpoint: VSCodeHub
|
||||||
|
image: vscodehub.azurecr.io/vscode-linux-build-agent:ia32
|
||||||
- container: snapcraft
|
- container: snapcraft
|
||||||
image: snapcore/snapcraft
|
image: snapcore/snapcraft
|
||||||
|
|
||||||
@@ -62,4 +64,18 @@ jobs:
|
|||||||
pool:
|
pool:
|
||||||
vmImage: macOS 10.13
|
vmImage: macOS 10.13
|
||||||
steps:
|
steps:
|
||||||
- template: darwin/product-build-darwin.yml
|
- template: darwin/product-build-darwin.yml
|
||||||
|
|
||||||
|
- job: Mooncake
|
||||||
|
pool:
|
||||||
|
vmImage: 'Ubuntu-16.04'
|
||||||
|
condition: true
|
||||||
|
dependsOn:
|
||||||
|
- Windows
|
||||||
|
- Windows32
|
||||||
|
- Linux
|
||||||
|
- LinuxSnap
|
||||||
|
- Linux32
|
||||||
|
- macOS
|
||||||
|
steps:
|
||||||
|
- template: sync-mooncake.yml
|
||||||
2
build/azure-pipelines/publish-types/.gitignore
vendored
Normal file
2
build/azure-pipelines/publish-types/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
*.js
|
||||||
36
build/azure-pipelines/publish-types/check-version.js
Normal file
36
build/azure-pipelines/publish-types/check-version.js
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
'use strict';
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const cp = require("child_process");
|
||||||
|
let tag = '';
|
||||||
|
try {
|
||||||
|
tag = cp
|
||||||
|
.execSync('git describe --tags `git rev-list --tags --max-count=1`')
|
||||||
|
.toString()
|
||||||
|
.trim();
|
||||||
|
if (!isValidTag(tag)) {
|
||||||
|
throw Error(`Invalid tag ${tag}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
console.error('Failed to update types');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
function isValidTag(t) {
|
||||||
|
if (t.split('.').length !== 3) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const [major, minor, bug] = t.split('.');
|
||||||
|
// Only release for tags like 1.34.0
|
||||||
|
if (bug !== '0') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (parseInt(major, 10) === NaN || parseInt(minor, 10) === NaN) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
43
build/azure-pipelines/publish-types/check-version.ts
Normal file
43
build/azure-pipelines/publish-types/check-version.ts
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as cp from 'child_process';
|
||||||
|
|
||||||
|
let tag = '';
|
||||||
|
try {
|
||||||
|
tag = cp
|
||||||
|
.execSync('git describe --tags `git rev-list --tags --max-count=1`')
|
||||||
|
.toString()
|
||||||
|
.trim();
|
||||||
|
|
||||||
|
if (!isValidTag(tag)) {
|
||||||
|
throw Error(`Invalid tag ${tag}`);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
console.error('Failed to update types');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isValidTag(t: string) {
|
||||||
|
if (t.split('.').length !== 3) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const [major, minor, bug] = t.split('.');
|
||||||
|
|
||||||
|
// Only release for tags like 1.34.0
|
||||||
|
if (bug !== '0') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parseInt(major, 10) === NaN || parseInt(minor, 10) === NaN) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
67
build/azure-pipelines/publish-types/publish-types.yml
Normal file
67
build/azure-pipelines/publish-types/publish-types.yml
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
# Publish @types/vscode for each release
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branches:
|
||||||
|
include: ['refs/tags/*']
|
||||||
|
|
||||||
|
pr: none
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
|
inputs:
|
||||||
|
versionSpec: "1.10.1"
|
||||||
|
|
||||||
|
- bash: |
|
||||||
|
# Install build dependencies
|
||||||
|
(cd build && yarn)
|
||||||
|
node build/azure-pipelines/publish-types/check-version.js
|
||||||
|
displayName: Check version
|
||||||
|
|
||||||
|
- bash: |
|
||||||
|
git config --global user.email "vscode@microsoft.com"
|
||||||
|
git config --global user.name "VSCode"
|
||||||
|
|
||||||
|
git clone https://$(GITHUB_TOKEN)@github.com/DefinitelyTyped/DefinitelyTyped.git --depth=1
|
||||||
|
node build/azure-pipelines/publish-types/update-types.js
|
||||||
|
|
||||||
|
TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
|
||||||
|
|
||||||
|
cd DefinitelyTyped
|
||||||
|
|
||||||
|
git diff --color | cat
|
||||||
|
git add -A
|
||||||
|
git status
|
||||||
|
git checkout -b "vscode-types-$TAG_VERSION"
|
||||||
|
git commit -m "VS Code $TAG_VERSION Extension API"
|
||||||
|
git push origin "vscode-types-$TAG_VERSION"
|
||||||
|
|
||||||
|
displayName: Push update to DefinitelyTyped
|
||||||
|
|
||||||
|
- bash: |
|
||||||
|
TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
|
||||||
|
CHANNEL="G1C14HJ2F"
|
||||||
|
|
||||||
|
MESSAGE="DefinitelyTyped/DefinitelyTyped#vscode-types-$TAG_VERSION created. Endgame master, please open this link, examine changes and create a PR:"
|
||||||
|
LINK="https://github.com/DefinitelyTyped/DefinitelyTyped/compare/vscode-types-$TAG_VERSION?quick_pull=1&body=Updating%20VS%20Code%20Extension%20API.%20See%20https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fvscode%2Fissues%2F70175%20for%20details."
|
||||||
|
MESSAGE2="[@octref, @jrieken, @kmaetzel, @egamma]. Please review and merge PR to publish @types/vscode."
|
||||||
|
|
||||||
|
curl -X POST -H "Authorization: Bearer $(SLACK_TOKEN)" \
|
||||||
|
-H 'Content-type: application/json; charset=utf-8' \
|
||||||
|
--data '{"channel":"'"$CHANNEL"'", "link_names": true, "text":"'"$MESSAGE"'"}' \
|
||||||
|
https://slack.com/api/chat.postMessage
|
||||||
|
|
||||||
|
curl -X POST -H "Authorization: Bearer $(SLACK_TOKEN)" \
|
||||||
|
-H 'Content-type: application/json; charset=utf-8' \
|
||||||
|
--data '{"channel":"'"$CHANNEL"'", "link_names": true, "text":"'"$LINK"'"}' \
|
||||||
|
https://slack.com/api/chat.postMessage
|
||||||
|
|
||||||
|
curl -X POST -H "Authorization: Bearer $(SLACK_TOKEN)" \
|
||||||
|
-H 'Content-type: application/json; charset=utf-8' \
|
||||||
|
--data '{"channel":"'"$CHANNEL"'", "link_names": true, "text":"'"$MESSAGE2"'"}' \
|
||||||
|
https://slack.com/api/chat.postMessage
|
||||||
|
|
||||||
|
displayName: Send message on Slack
|
||||||
62
build/azure-pipelines/publish-types/update-types.js
Normal file
62
build/azure-pipelines/publish-types/update-types.js
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
'use strict';
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const fs = require("fs");
|
||||||
|
const cp = require("child_process");
|
||||||
|
const path = require("path");
|
||||||
|
let tag = '';
|
||||||
|
try {
|
||||||
|
tag = cp
|
||||||
|
.execSync('git describe --tags `git rev-list --tags --max-count=1`')
|
||||||
|
.toString()
|
||||||
|
.trim();
|
||||||
|
const dtsUri = `https://raw.githubusercontent.com/microsoft/vscode/${tag}/src/vs/vscode.d.ts`;
|
||||||
|
const outPath = path.resolve(process.cwd(), 'DefinitelyTyped/types/vscode/index.d.ts');
|
||||||
|
cp.execSync(`curl ${dtsUri} --output ${outPath}`);
|
||||||
|
updateDTSFile(outPath, tag);
|
||||||
|
console.log(`Done updating vscode.d.ts at ${outPath}`);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
console.error('Failed to update types');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
function updateDTSFile(outPath, tag) {
|
||||||
|
const oldContent = fs.readFileSync(outPath, 'utf-8');
|
||||||
|
const newContent = getNewFileContent(oldContent, tag);
|
||||||
|
fs.writeFileSync(outPath, newContent);
|
||||||
|
}
|
||||||
|
function getNewFileContent(content, tag) {
|
||||||
|
const oldheader = [
|
||||||
|
`/*---------------------------------------------------------------------------------------------`,
|
||||||
|
` * Copyright (c) Microsoft Corporation. All rights reserved.`,
|
||||||
|
` * Licensed under the Source EULA. See License.txt in the project root for license information.`,
|
||||||
|
` *--------------------------------------------------------------------------------------------*/`
|
||||||
|
].join('\n');
|
||||||
|
return getNewFileHeader(tag) + content.slice(oldheader.length);
|
||||||
|
}
|
||||||
|
function getNewFileHeader(tag) {
|
||||||
|
const [major, minor] = tag.split('.');
|
||||||
|
const shorttag = `${major}.${minor}`;
|
||||||
|
const header = [
|
||||||
|
`// Type definitions for Visual Studio Code ${shorttag}`,
|
||||||
|
`// Project: https://github.com/microsoft/vscode`,
|
||||||
|
`// Definitions by: Visual Studio Code Team, Microsoft <https://github.com/Microsoft>`,
|
||||||
|
`// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`,
|
||||||
|
``,
|
||||||
|
`/*---------------------------------------------------------------------------------------------`,
|
||||||
|
` * Copyright (c) Microsoft Corporation. All rights reserved.`,
|
||||||
|
` * Licensed under the Source EULA.`,
|
||||||
|
` * See https://github.com/Microsoft/vscode/blob/master/LICENSE.txt for license information.`,
|
||||||
|
` *--------------------------------------------------------------------------------------------*/`,
|
||||||
|
``,
|
||||||
|
`/**`,
|
||||||
|
` * Type Definition for Visual Studio Code ${shorttag} Extension API`,
|
||||||
|
` * See https://code.visualstudio.com/api for more information`,
|
||||||
|
` */`
|
||||||
|
].join('\n');
|
||||||
|
return header;
|
||||||
|
}
|
||||||
73
build/azure-pipelines/publish-types/update-types.ts
Normal file
73
build/azure-pipelines/publish-types/update-types.ts
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as fs from 'fs';
|
||||||
|
import * as cp from 'child_process';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
let tag = '';
|
||||||
|
try {
|
||||||
|
tag = cp
|
||||||
|
.execSync('git describe --tags `git rev-list --tags --max-count=1`')
|
||||||
|
.toString()
|
||||||
|
.trim();
|
||||||
|
|
||||||
|
const dtsUri = `https://raw.githubusercontent.com/microsoft/vscode/${tag}/src/vs/vscode.d.ts`;
|
||||||
|
const outPath = path.resolve(process.cwd(), 'DefinitelyTyped/types/vscode/index.d.ts');
|
||||||
|
cp.execSync(`curl ${dtsUri} --output ${outPath}`);
|
||||||
|
|
||||||
|
updateDTSFile(outPath, tag);
|
||||||
|
|
||||||
|
console.log(`Done updating vscode.d.ts at ${outPath}`);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
console.error('Failed to update types');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateDTSFile(outPath: string, tag: string) {
|
||||||
|
const oldContent = fs.readFileSync(outPath, 'utf-8');
|
||||||
|
const newContent = getNewFileContent(oldContent, tag);
|
||||||
|
|
||||||
|
fs.writeFileSync(outPath, newContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNewFileContent(content: string, tag: string) {
|
||||||
|
const oldheader = [
|
||||||
|
`/*---------------------------------------------------------------------------------------------`,
|
||||||
|
` * Copyright (c) Microsoft Corporation. All rights reserved.`,
|
||||||
|
` * Licensed under the Source EULA. See License.txt in the project root for license information.`,
|
||||||
|
` *--------------------------------------------------------------------------------------------*/`
|
||||||
|
].join('\n');
|
||||||
|
|
||||||
|
return getNewFileHeader(tag) + content.slice(oldheader.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNewFileHeader(tag: string) {
|
||||||
|
const [major, minor] = tag.split('.');
|
||||||
|
const shorttag = `${major}.${minor}`;
|
||||||
|
|
||||||
|
const header = [
|
||||||
|
`// Type definitions for Visual Studio Code ${shorttag}`,
|
||||||
|
`// Project: https://github.com/microsoft/vscode`,
|
||||||
|
`// Definitions by: Visual Studio Code Team, Microsoft <https://github.com/Microsoft>`,
|
||||||
|
`// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`,
|
||||||
|
``,
|
||||||
|
`/*---------------------------------------------------------------------------------------------`,
|
||||||
|
` * Copyright (c) Microsoft Corporation. All rights reserved.`,
|
||||||
|
` * Licensed under the Source EULA.`,
|
||||||
|
` * See https://github.com/Microsoft/vscode/blob/master/LICENSE.txt for license information.`,
|
||||||
|
` *--------------------------------------------------------------------------------------------*/`,
|
||||||
|
``,
|
||||||
|
`/**`,
|
||||||
|
` * Type Definition for Visual Studio Code ${shorttag} Extension API`,
|
||||||
|
` * See https://code.visualstudio.com/api for more information`,
|
||||||
|
` */`
|
||||||
|
].join('\n');
|
||||||
|
|
||||||
|
return header;
|
||||||
|
}
|
||||||
24
build/azure-pipelines/sync-mooncake.yml
Normal file
24
build/azure-pipelines/sync-mooncake.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
steps:
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
|
inputs:
|
||||||
|
versionSpec: "1.10.1"
|
||||||
|
|
||||||
|
- task: AzureKeyVault@1
|
||||||
|
displayName: 'Azure Key Vault: Get Secrets'
|
||||||
|
inputs:
|
||||||
|
azureSubscription: 'vscode-builds-subscription'
|
||||||
|
KeyVaultName: vscode
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
|
||||||
|
(cd build ; yarn)
|
||||||
|
|
||||||
|
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||||
|
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||||
|
MOONCAKE_STORAGE_ACCESS_KEY="$(vscode-mooncake-storage-key)" \
|
||||||
|
node build/azure-pipelines/common/sync-mooncake.js "$VSCODE_QUALITY"
|
||||||
5
build/azure-pipelines/win32/build.ps1
Normal file
5
build/azure-pipelines/win32/build.ps1
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
exec { yarn gulp "vscode-win32-$env:VSCODE_ARCH-min" }
|
||||||
|
exec { yarn gulp "vscode-reh-win32-$env:VSCODE_ARCH-min" }
|
||||||
|
exec { yarn gulp "vscode-win32-$env:VSCODE_ARCH-inno-updater" }
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "1.10.1"
|
versionSpec: "1.10.1"
|
||||||
@@ -9,9 +9,22 @@ steps:
|
|||||||
inputs:
|
inputs:
|
||||||
versionSpec: '2.x'
|
versionSpec: '2.x'
|
||||||
addToPath: true
|
addToPath: true
|
||||||
|
# - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||||
|
# inputs:
|
||||||
|
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
# vstsFeed: '$(ArtifactFeed)'
|
||||||
|
# condition: eq(variables['System.PullRequest.PullRequestId'], '')
|
||||||
- powershell: |
|
- powershell: |
|
||||||
yarn
|
yarn
|
||||||
displayName: Install Dependencies
|
displayName: Install Dependencies
|
||||||
|
# condition: or(ne(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||||
|
# - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||||
|
# inputs:
|
||||||
|
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
# vstsFeed: '$(ArtifactFeed)'
|
||||||
|
# condition: and(succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||||
- powershell: |
|
- powershell: |
|
||||||
yarn gulp electron
|
yarn gulp electron
|
||||||
displayName: Download Electron
|
displayName: Download Electron
|
||||||
@@ -21,9 +34,6 @@ steps:
|
|||||||
- powershell: |
|
- powershell: |
|
||||||
yarn monaco-compile-check
|
yarn monaco-compile-check
|
||||||
displayName: Run Monaco Editor Checks
|
displayName: Run Monaco Editor Checks
|
||||||
- script: |
|
|
||||||
yarn strict-null-check
|
|
||||||
displayName: Run Strict Null Checks
|
|
||||||
- powershell: |
|
- powershell: |
|
||||||
yarn compile
|
yarn compile
|
||||||
displayName: Compile Sources
|
displayName: Compile Sources
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
@@ -12,41 +12,59 @@ steps:
|
|||||||
versionSpec: '2.x'
|
versionSpec: '2.x'
|
||||||
addToPath: true
|
addToPath: true
|
||||||
|
|
||||||
|
- task: AzureKeyVault@1
|
||||||
|
displayName: 'Azure Key Vault: Get Secrets'
|
||||||
|
inputs:
|
||||||
|
azureSubscription: 'vscode-builds-subscription'
|
||||||
|
KeyVaultName: vscode
|
||||||
|
|
||||||
- powershell: |
|
- powershell: |
|
||||||
. build/azure-pipelines/win32/exec.ps1
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
"machine monacotools.visualstudio.com password $(VSO_PAT)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII
|
"machine monacotools.visualstudio.com`npassword $(devops-pat)`nmachine github.com`nlogin vscode`npassword $(github-distro-mixin-password)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII
|
||||||
$env:npm_config_arch="$(VSCODE_ARCH)"
|
$env:npm_config_arch="$(VSCODE_ARCH)"
|
||||||
$env:CHILD_CONCURRENCY="1"
|
$env:CHILD_CONCURRENCY="1"
|
||||||
$env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
|
|
||||||
|
exec { git config user.email "vscode@microsoft.com" }
|
||||||
|
exec { git config user.name "VSCode" }
|
||||||
|
exec { git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git" }
|
||||||
|
exec { git fetch distro }
|
||||||
|
exec { git merge $(node -p "require('./package.json').distro") }
|
||||||
|
|
||||||
exec { yarn }
|
exec { yarn }
|
||||||
exec { npm run gulp -- hygiene }
|
exec { yarn gulp mixin }
|
||||||
exec { npm run monaco-compile-check }
|
exec { yarn gulp hygiene }
|
||||||
exec { npm run strict-null-check }
|
exec { yarn monaco-compile-check }
|
||||||
exec { npm run gulp -- mixin }
|
|
||||||
exec { node build/azure-pipelines/common/installDistro.js }
|
exec { node build/azure-pipelines/common/installDistro.js }
|
||||||
exec { node build/lib/builtInExtensions.js }
|
exec { node build/lib/builtInExtensions.js }
|
||||||
|
displayName: Prepare build
|
||||||
|
|
||||||
- powershell: |
|
- powershell: |
|
||||||
. build/azure-pipelines/win32/exec.ps1
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
$env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
|
$env:VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)"
|
||||||
exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-min" }
|
.\build\azure-pipelines\win32\build.ps1
|
||||||
exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-inno-updater" }
|
displayName: Build
|
||||||
name: build
|
|
||||||
|
|
||||||
- powershell: |
|
- powershell: |
|
||||||
. build/azure-pipelines/win32/exec.ps1
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
exec { npm run gulp -- "electron-$(VSCODE_ARCH)" }
|
exec { yarn gulp "electron-$(VSCODE_ARCH)" }
|
||||||
exec { .\scripts\test.bat --build --tfs "Unit Tests" }
|
exec { .\scripts\test.bat --build --tfs "Unit Tests" }
|
||||||
# yarn smoketest -- --build "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
|
# yarn smoketest -- --build "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
|
||||||
name: test
|
displayName: Run unit tests
|
||||||
|
|
||||||
|
- powershell: |
|
||||||
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
exec { yarn gulp "electron-$(VSCODE_ARCH)" }
|
||||||
|
exec { .\scripts\test-integration.bat --build --tfs "Integration Tests" }
|
||||||
|
displayName: Run integration tests
|
||||||
|
|
||||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||||
inputs:
|
inputs:
|
||||||
ConnectedServiceName: 'ESRP CodeSign'
|
ConnectedServiceName: 'ESRP CodeSign'
|
||||||
FolderPath: '$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH)'
|
FolderPath: '$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH),$(agent.builddirectory)/vscode-reh-win32-$(VSCODE_ARCH)'
|
||||||
Pattern: '*.dll,*.exe,*.node'
|
Pattern: '*.dll,*.exe,*.node'
|
||||||
signConfigType: inlineSignParams
|
signConfigType: inlineSignParams
|
||||||
inlineOperation: |
|
inlineOperation: |
|
||||||
@@ -114,38 +132,17 @@ steps:
|
|||||||
|
|
||||||
- powershell: |
|
- powershell: |
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
.\build\azure-pipelines\win32\import-esrp-auth-cert.ps1 -AuthCertificateBase64 $(ESRP_AUTH_CERTIFICATE) -AuthCertificateKey $(ESRP_AUTH_CERTIFICATE_KEY)
|
.\build\azure-pipelines\win32\import-esrp-auth-cert.ps1 -AuthCertificateBase64 $(esrp-auth-certificate) -AuthCertificateKey $(esrp-auth-certificate-key)
|
||||||
displayName: Import ESRP Auth Certificate
|
displayName: Import ESRP Auth Certificate
|
||||||
|
|
||||||
- powershell: |
|
- powershell: |
|
||||||
. build/azure-pipelines/win32/exec.ps1
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-archive" "vscode-win32-$(VSCODE_ARCH)-system-setup" "vscode-win32-$(VSCODE_ARCH)-user-setup" --sign }
|
$env:AZURE_STORAGE_ACCESS_KEY_2 = "$(vscode-storage-key)"
|
||||||
|
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(builds-docdb-key-readwrite)"
|
||||||
$Repo = "$(pwd)"
|
$env:VSCODE_HOCKEYAPP_TOKEN = "$(vscode-hockeyapp-token)"
|
||||||
$Root = "$Repo\.."
|
.\build\azure-pipelines\win32\publish.ps1
|
||||||
$SystemExe = "$Repo\.build\win32-$(VSCODE_ARCH)\system-setup\VSCodeSetup.exe"
|
displayName: Publish
|
||||||
$UserExe = "$Repo\.build\win32-$(VSCODE_ARCH)\user-setup\VSCodeSetup.exe"
|
|
||||||
$Zip = "$Repo\.build\win32-$(VSCODE_ARCH)\archive\VSCode-win32-$(VSCODE_ARCH).zip"
|
|
||||||
$Build = "$Root\VSCode-win32-$(VSCODE_ARCH)"
|
|
||||||
|
|
||||||
# get version
|
|
||||||
$PackageJson = Get-Content -Raw -Path "$Build\resources\app\package.json" | ConvertFrom-Json
|
|
||||||
$Version = $PackageJson.version
|
|
||||||
$Quality = "$env:VSCODE_QUALITY"
|
|
||||||
$env:AZURE_STORAGE_ACCESS_KEY_2 = "$(AZURE_STORAGE_ACCESS_KEY_2)"
|
|
||||||
$env:MOONCAKE_STORAGE_ACCESS_KEY = "$(MOONCAKE_STORAGE_ACCESS_KEY)"
|
|
||||||
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(AZURE_DOCUMENTDB_MASTERKEY)"
|
|
||||||
|
|
||||||
$assetPlatform = if ("$(VSCODE_ARCH)" -eq "ia32") { "win32" } else { "win32-x64" }
|
|
||||||
|
|
||||||
exec { node build/azure-pipelines/common/publish.js $Quality "$global:assetPlatform-archive" archive "VSCode-win32-$(VSCODE_ARCH)-$Version.zip" $Version true $Zip }
|
|
||||||
exec { node build/azure-pipelines/common/publish.js $Quality "$global:assetPlatform" setup "VSCodeSetup-$(VSCODE_ARCH)-$Version.exe" $Version true $SystemExe }
|
|
||||||
exec { node build/azure-pipelines/common/publish.js $Quality "$global:assetPlatform-user" setup "VSCodeUserSetup-$(VSCODE_ARCH)-$Version.exe" $Version true $UserExe }
|
|
||||||
|
|
||||||
# publish hockeyapp symbols
|
|
||||||
$hockeyAppId = if ("$(VSCODE_ARCH)" -eq "ia32") { "$(VSCODE_HOCKEYAPP_ID_WIN32)" } else { "$(VSCODE_HOCKEYAPP_ID_WIN64)" }
|
|
||||||
exec { node build/azure-pipelines/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" $hockeyAppId }
|
|
||||||
|
|
||||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||||
displayName: 'Component Detection'
|
displayName: 'Component Detection'
|
||||||
|
|||||||
37
build/azure-pipelines/win32/publish.ps1
Normal file
37
build/azure-pipelines/win32/publish.ps1
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
$Arch = "$env:VSCODE_ARCH"
|
||||||
|
|
||||||
|
exec { yarn gulp "vscode-win32-$Arch-archive" "vscode-win32-$Arch-system-setup" "vscode-win32-$Arch-user-setup" --sign }
|
||||||
|
|
||||||
|
$Repo = "$(pwd)"
|
||||||
|
$Root = "$Repo\.."
|
||||||
|
$SystemExe = "$Repo\.build\win32-$Arch\system-setup\VSCodeSetup.exe"
|
||||||
|
$UserExe = "$Repo\.build\win32-$Arch\user-setup\VSCodeSetup.exe"
|
||||||
|
$Zip = "$Repo\.build\win32-$Arch\archive\VSCode-win32-$Arch.zip"
|
||||||
|
$LegacyServer = "$Root\vscode-reh-win32-$Arch"
|
||||||
|
$ServerName = "vscode-server-win32-$Arch"
|
||||||
|
$Server = "$Root\$ServerName"
|
||||||
|
$ServerZip = "$Repo\.build\vscode-server-win32-$Arch.zip"
|
||||||
|
$Build = "$Root\VSCode-win32-$Arch"
|
||||||
|
|
||||||
|
# Create server archive
|
||||||
|
exec { Rename-Item -Path $LegacyServer -NewName $ServerName }
|
||||||
|
exec { .\node_modules\7zip\7zip-lite\7z.exe a -tzip $ServerZip $Server -r }
|
||||||
|
|
||||||
|
# get version
|
||||||
|
$PackageJson = Get-Content -Raw -Path "$Build\resources\app\package.json" | ConvertFrom-Json
|
||||||
|
$Version = $PackageJson.version
|
||||||
|
$Quality = "$env:VSCODE_QUALITY"
|
||||||
|
|
||||||
|
$AssetPlatform = if ("$Arch" -eq "ia32") { "win32" } else { "win32-x64" }
|
||||||
|
|
||||||
|
exec { node build/azure-pipelines/common/publish.js $Quality "$AssetPlatform-archive" archive "VSCode-win32-$Arch-$Version.zip" $Version true $Zip }
|
||||||
|
exec { node build/azure-pipelines/common/publish.js $Quality "$AssetPlatform" setup "VSCodeSetup-$Arch-$Version.exe" $Version true $SystemExe }
|
||||||
|
exec { node build/azure-pipelines/common/publish.js $Quality "$AssetPlatform-user" setup "VSCodeUserSetup-$Arch-$Version.exe" $Version true $UserExe }
|
||||||
|
exec { node build/azure-pipelines/common/publish.js $Quality "server-$AssetPlatform" archive "vscode-server-win32-$Arch.zip" $Version true $ServerZip }
|
||||||
|
|
||||||
|
# publish hockeyapp symbols
|
||||||
|
$hockeyAppId = if ("$Arch" -eq "ia32") { "$env:VSCODE_HOCKEYAPP_ID_WIN32" } else { "$env:VSCODE_HOCKEYAPP_ID_WIN64" }
|
||||||
|
exec { node build/azure-pipelines/common/symbols.js "$env:VSCODE_MIXIN_PASSWORD" "$env:VSCODE_HOCKEYAPP_TOKEN" "$Arch" $hockeyAppId }
|
||||||
91
build/download/download.js
Normal file
91
build/download/download.js
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
"use strict";
|
||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const https = require("https");
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
const cp = require("child_process");
|
||||||
|
function ensureDir(filepath) {
|
||||||
|
if (!fs.existsSync(filepath)) {
|
||||||
|
ensureDir(path.dirname(filepath));
|
||||||
|
fs.mkdirSync(filepath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function download(options, destination) {
|
||||||
|
ensureDir(path.dirname(destination));
|
||||||
|
return new Promise((c, e) => {
|
||||||
|
const fd = fs.openSync(destination, 'w');
|
||||||
|
const req = https.get(options, (res) => {
|
||||||
|
res.on('data', (chunk) => {
|
||||||
|
fs.writeSync(fd, chunk);
|
||||||
|
});
|
||||||
|
res.on('end', () => {
|
||||||
|
fs.closeSync(fd);
|
||||||
|
c();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
req.on('error', (reqErr) => {
|
||||||
|
console.error(`request to ${options.host}${options.path} failed.`);
|
||||||
|
console.error(reqErr);
|
||||||
|
e(reqErr);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const MARKER_ARGUMENT = `_download_fork_`;
|
||||||
|
function base64encode(str) {
|
||||||
|
return Buffer.from(str, 'utf8').toString('base64');
|
||||||
|
}
|
||||||
|
function base64decode(str) {
|
||||||
|
return Buffer.from(str, 'base64').toString('utf8');
|
||||||
|
}
|
||||||
|
function downloadInExternalProcess(options) {
|
||||||
|
const url = `https://${options.requestOptions.host}${options.requestOptions.path}`;
|
||||||
|
console.log(`Downloading ${url}...`);
|
||||||
|
return new Promise((c, e) => {
|
||||||
|
const child = cp.fork(__filename, [MARKER_ARGUMENT, base64encode(JSON.stringify(options))], {
|
||||||
|
stdio: ['pipe', 'pipe', 'pipe', 'ipc']
|
||||||
|
});
|
||||||
|
let stderr = [];
|
||||||
|
child.stderr.on('data', (chunk) => {
|
||||||
|
stderr.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk);
|
||||||
|
});
|
||||||
|
child.on('exit', (code) => {
|
||||||
|
if (code === 0) {
|
||||||
|
// normal termination
|
||||||
|
console.log(`Finished downloading ${url}.`);
|
||||||
|
c();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// abnormal termination
|
||||||
|
console.error(Buffer.concat(stderr).toString());
|
||||||
|
e(new Error(`Download of ${url} failed.`));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.downloadInExternalProcess = downloadInExternalProcess;
|
||||||
|
function _downloadInExternalProcess() {
|
||||||
|
let options;
|
||||||
|
try {
|
||||||
|
options = JSON.parse(base64decode(process.argv[3]));
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(`Cannot read arguments`);
|
||||||
|
console.error(err);
|
||||||
|
process.exit(-1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
download(options.requestOptions, options.destinationPath).then(() => {
|
||||||
|
process.exit(0);
|
||||||
|
}, (err) => {
|
||||||
|
console.error(err);
|
||||||
|
process.exit(-2);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (process.argv.length >= 4 && process.argv[2] === MARKER_ARGUMENT) {
|
||||||
|
// running as forked download script
|
||||||
|
_downloadInExternalProcess();
|
||||||
|
}
|
||||||
111
build/download/download.ts
Normal file
111
build/download/download.ts
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
import * as https from 'https';
|
||||||
|
import * as fs from 'fs';
|
||||||
|
import * as path from 'path';
|
||||||
|
import * as cp from 'child_process';
|
||||||
|
|
||||||
|
function ensureDir(filepath: string) {
|
||||||
|
if (!fs.existsSync(filepath)) {
|
||||||
|
ensureDir(path.dirname(filepath));
|
||||||
|
fs.mkdirSync(filepath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function download(options: https.RequestOptions, destination: string): Promise<void> {
|
||||||
|
ensureDir(path.dirname(destination));
|
||||||
|
|
||||||
|
return new Promise<void>((c, e) => {
|
||||||
|
const fd = fs.openSync(destination, 'w');
|
||||||
|
const req = https.get(options, (res) => {
|
||||||
|
res.on('data', (chunk) => {
|
||||||
|
fs.writeSync(fd, chunk);
|
||||||
|
});
|
||||||
|
res.on('end', () => {
|
||||||
|
fs.closeSync(fd);
|
||||||
|
c();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
req.on('error', (reqErr) => {
|
||||||
|
console.error(`request to ${options.host}${options.path} failed.`);
|
||||||
|
console.error(reqErr);
|
||||||
|
e(reqErr);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const MARKER_ARGUMENT = `_download_fork_`;
|
||||||
|
|
||||||
|
function base64encode(str: string): string {
|
||||||
|
return Buffer.from(str, 'utf8').toString('base64');
|
||||||
|
}
|
||||||
|
|
||||||
|
function base64decode(str: string): string {
|
||||||
|
return Buffer.from(str, 'base64').toString('utf8');
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IDownloadRequestOptions {
|
||||||
|
host: string;
|
||||||
|
path: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IDownloadOptions {
|
||||||
|
requestOptions: IDownloadRequestOptions;
|
||||||
|
destinationPath: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function downloadInExternalProcess(options: IDownloadOptions): Promise<void> {
|
||||||
|
const url = `https://${options.requestOptions.host}${options.requestOptions.path}`;
|
||||||
|
console.log(`Downloading ${url}...`);
|
||||||
|
return new Promise<void>((c, e) => {
|
||||||
|
const child = cp.fork(
|
||||||
|
__filename,
|
||||||
|
[MARKER_ARGUMENT, base64encode(JSON.stringify(options))],
|
||||||
|
{
|
||||||
|
stdio: ['pipe', 'pipe', 'pipe', 'ipc']
|
||||||
|
}
|
||||||
|
);
|
||||||
|
let stderr: Buffer[] = [];
|
||||||
|
child.stderr.on('data', (chunk) => {
|
||||||
|
stderr.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk);
|
||||||
|
});
|
||||||
|
child.on('exit', (code) => {
|
||||||
|
if (code === 0) {
|
||||||
|
// normal termination
|
||||||
|
console.log(`Finished downloading ${url}.`);
|
||||||
|
c();
|
||||||
|
} else {
|
||||||
|
// abnormal termination
|
||||||
|
console.error(Buffer.concat(stderr).toString());
|
||||||
|
e(new Error(`Download of ${url} failed.`));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function _downloadInExternalProcess() {
|
||||||
|
let options: IDownloadOptions;
|
||||||
|
try {
|
||||||
|
options = JSON.parse(base64decode(process.argv[3]));
|
||||||
|
} catch (err) {
|
||||||
|
console.error(`Cannot read arguments`);
|
||||||
|
console.error(err);
|
||||||
|
process.exit(-1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
download(options.requestOptions, options.destinationPath).then(() => {
|
||||||
|
process.exit(0);
|
||||||
|
}, (err) => {
|
||||||
|
console.error(err);
|
||||||
|
process.exit(-2);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.argv.length >= 4 && process.argv[2] === MARKER_ARGUMENT) {
|
||||||
|
// running as forked download script
|
||||||
|
_downloadInExternalProcess();
|
||||||
|
}
|
||||||
18
build/gulpfile.compile.js
Normal file
18
build/gulpfile.compile.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const util = require('./lib/util');
|
||||||
|
const task = require('./lib/task');
|
||||||
|
const compilation = require('./lib/compilation');
|
||||||
|
const { compileExtensionsBuildTask } = require('./gulpfile.extensions');
|
||||||
|
|
||||||
|
// Full compile, including nls and inline sources in sourcemaps, for build
|
||||||
|
const compileClientBuildTask = task.define('compile-client-build', task.series(util.rimraf('out-build'), compilation.compileTask('src', 'out-build', true)));
|
||||||
|
|
||||||
|
// All Build
|
||||||
|
const compileBuildTask = task.define('compile-build', task.parallel(compileClientBuildTask, compileExtensionsBuildTask));
|
||||||
|
exports.compileBuildTask = compileBuildTask;
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
const gulp = require('gulp');
|
const gulp = require('gulp');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const util = require('./lib/util');
|
const util = require('./lib/util');
|
||||||
|
const task = require('./lib/task');
|
||||||
const common = require('./lib/optimize');
|
const common = require('./lib/optimize');
|
||||||
const es = require('event-stream');
|
const es = require('event-stream');
|
||||||
const File = require('vinyl');
|
const File = require('vinyl');
|
||||||
@@ -48,9 +49,6 @@ var editorResources = [
|
|||||||
'!**/test/**'
|
'!**/test/**'
|
||||||
];
|
];
|
||||||
|
|
||||||
var editorOtherSources = [
|
|
||||||
];
|
|
||||||
|
|
||||||
var BUNDLED_FILE_HEADER = [
|
var BUNDLED_FILE_HEADER = [
|
||||||
'/*!-----------------------------------------------------------',
|
'/*!-----------------------------------------------------------',
|
||||||
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
||||||
@@ -63,8 +61,7 @@ var BUNDLED_FILE_HEADER = [
|
|||||||
|
|
||||||
const languages = i18n.defaultLanguages.concat([]); // i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []);
|
const languages = i18n.defaultLanguages.concat([]); // i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []);
|
||||||
|
|
||||||
gulp.task('clean-editor-src', util.rimraf('out-editor-src'));
|
const extractEditorSrcTask = task.define('extract-editor-src', () => {
|
||||||
gulp.task('extract-editor-src', ['clean-editor-src'], function () {
|
|
||||||
console.log(`If the build fails, consider tweaking shakeLevel below to a lower value.`);
|
console.log(`If the build fails, consider tweaking shakeLevel below to a lower value.`);
|
||||||
const apiusages = monacoapi.execute().usageContent;
|
const apiusages = monacoapi.execute().usageContent;
|
||||||
const extrausages = fs.readFileSync(path.join(root, 'build', 'monaco', 'monaco.usage.recipe')).toString();
|
const extrausages = fs.readFileSync(path.join(root, 'build', 'monaco', 'monaco.usage.recipe')).toString();
|
||||||
@@ -84,6 +81,7 @@ gulp.task('extract-editor-src', ['clean-editor-src'], function () {
|
|||||||
'typings/thenable.d.ts',
|
'typings/thenable.d.ts',
|
||||||
'typings/es6-promise.d.ts',
|
'typings/es6-promise.d.ts',
|
||||||
'typings/require-monaco.d.ts',
|
'typings/require-monaco.d.ts',
|
||||||
|
"typings/lib.es2018.promise.d.ts",
|
||||||
'vs/monaco.d.ts'
|
'vs/monaco.d.ts'
|
||||||
],
|
],
|
||||||
libs: [
|
libs: [
|
||||||
@@ -95,20 +93,16 @@ gulp.task('extract-editor-src', ['clean-editor-src'], function () {
|
|||||||
'vs/base/browser/ui/octiconLabel/octiconLabel': 'vs/base/browser/ui/octiconLabel/octiconLabel.mock',
|
'vs/base/browser/ui/octiconLabel/octiconLabel': 'vs/base/browser/ui/octiconLabel/octiconLabel.mock',
|
||||||
},
|
},
|
||||||
shakeLevel: 2, // 0-Files, 1-InnerFile, 2-ClassMembers
|
shakeLevel: 2, // 0-Files, 1-InnerFile, 2-ClassMembers
|
||||||
importIgnorePattern: /^vs\/css!/,
|
importIgnorePattern: /(^vs\/css!)|(promise-polyfill\/polyfill)/,
|
||||||
destRoot: path.join(root, 'out-editor-src')
|
destRoot: path.join(root, 'out-editor-src')
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Full compile, including nls and inline sources in sourcemaps, for build
|
const compileEditorAMDTask = task.define('compile-editor-amd', compilation.compileTask('out-editor-src', 'out-editor-build', true));
|
||||||
gulp.task('clean-editor-build', util.rimraf('out-editor-build'));
|
|
||||||
gulp.task('compile-editor-build', ['clean-editor-build', 'extract-editor-src'], compilation.compileTask('out-editor-src', 'out-editor-build', true));
|
|
||||||
|
|
||||||
gulp.task('clean-optimized-editor', util.rimraf('out-editor'));
|
const optimizeEditorAMDTask = task.define('optimize-editor-amd', common.optimizeTask({
|
||||||
gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-editor-build'], common.optimizeTask({
|
|
||||||
src: 'out-editor-build',
|
src: 'out-editor-build',
|
||||||
entryPoints: editorEntryPoints,
|
entryPoints: editorEntryPoints,
|
||||||
otherSources: editorOtherSources,
|
|
||||||
resources: editorResources,
|
resources: editorResources,
|
||||||
loaderConfig: {
|
loaderConfig: {
|
||||||
paths: {
|
paths: {
|
||||||
@@ -125,11 +119,9 @@ gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-editor-build'],
|
|||||||
languages: languages
|
languages: languages
|
||||||
}));
|
}));
|
||||||
|
|
||||||
gulp.task('clean-minified-editor', util.rimraf('out-editor-min'));
|
const minifyEditorAMDTask = task.define('minify-editor-amd', common.minifyTask('out-editor'));
|
||||||
gulp.task('minify-editor', ['clean-minified-editor', 'optimize-editor'], common.minifyTask('out-editor'));
|
|
||||||
|
|
||||||
gulp.task('clean-editor-esm', util.rimraf('out-editor-esm'));
|
const createESMSourcesAndResourcesTask = task.define('extract-editor-esm', () => {
|
||||||
gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro', 'extract-editor-src'], function () {
|
|
||||||
standalone.createESMSourcesAndResources2({
|
standalone.createESMSourcesAndResources2({
|
||||||
srcFolder: './out-editor-src',
|
srcFolder: './out-editor-src',
|
||||||
outFolder: './out-editor-esm',
|
outFolder: './out-editor-esm',
|
||||||
@@ -151,7 +143,8 @@ gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro', 'ext
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
gulp.task('compile-editor-esm', ['extract-editor-esm', 'clean-editor-distro'], function () {
|
|
||||||
|
const compileEditorESMTask = task.define('compile-editor-esm', () => {
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
const result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, {
|
const result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, {
|
||||||
cwd: path.join(__dirname, '../out-editor-esm')
|
cwd: path.join(__dirname, '../out-editor-esm')
|
||||||
@@ -202,8 +195,16 @@ function toExternalDTS(contents) {
|
|||||||
return lines.join('\n');
|
return lines.join('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('clean-editor-distro', util.rimraf('out-monaco-editor-core'));
|
function filterStream(testFunc) {
|
||||||
gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify-editor', 'optimize-editor'], function () {
|
return es.through(function (data) {
|
||||||
|
if (!testFunc(data.relative)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.emit('data', data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const finalEditorResourcesTask = task.define('final-editor-resources', () => {
|
||||||
return es.merge(
|
return es.merge(
|
||||||
// other assets
|
// other assets
|
||||||
es.merge(
|
es.merge(
|
||||||
@@ -233,6 +234,14 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify
|
|||||||
}))
|
}))
|
||||||
.pipe(gulp.dest('out-monaco-editor-core')),
|
.pipe(gulp.dest('out-monaco-editor-core')),
|
||||||
|
|
||||||
|
// version.txt
|
||||||
|
gulp.src('build/monaco/version.txt')
|
||||||
|
.pipe(es.through(function (data) {
|
||||||
|
data.contents = Buffer.from(`monaco-editor-core: https://github.com/Microsoft/vscode/tree/${sha1}`);
|
||||||
|
this.emit('data', data);
|
||||||
|
}))
|
||||||
|
.pipe(gulp.dest('out-monaco-editor-core')),
|
||||||
|
|
||||||
// README.md
|
// README.md
|
||||||
gulp.src('build/monaco/README-npm.md')
|
gulp.src('build/monaco/README-npm.md')
|
||||||
.pipe(es.through(function (data) {
|
.pipe(es.through(function (data) {
|
||||||
@@ -266,7 +275,7 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify
|
|||||||
|
|
||||||
var strContents = data.contents.toString();
|
var strContents = data.contents.toString();
|
||||||
var newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/');
|
var newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/');
|
||||||
strContents = strContents.replace(/\/\/\# sourceMappingURL=[^ ]+$/, newStr);
|
strContents = strContents.replace(/\/\/# sourceMappingURL=[^ ]+$/, newStr);
|
||||||
|
|
||||||
data.contents = Buffer.from(strContents);
|
data.contents = Buffer.from(strContents);
|
||||||
this.emit('data', data);
|
this.emit('data', data);
|
||||||
@@ -282,59 +291,31 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('analyze-editor-distro', function () {
|
gulp.task('editor-distro',
|
||||||
// @ts-ignore
|
task.series(
|
||||||
var bundleInfo = require('../out-editor/bundleInfo.json');
|
task.parallel(
|
||||||
var graph = bundleInfo.graph;
|
util.rimraf('out-editor-src'),
|
||||||
var bundles = bundleInfo.bundles;
|
util.rimraf('out-editor-build'),
|
||||||
|
util.rimraf('out-editor-esm'),
|
||||||
var inverseGraph = {};
|
util.rimraf('out-monaco-editor-core'),
|
||||||
Object.keys(graph).forEach(function (module) {
|
util.rimraf('out-editor'),
|
||||||
var dependencies = graph[module];
|
util.rimraf('out-editor-min')
|
||||||
dependencies.forEach(function (dep) {
|
),
|
||||||
inverseGraph[dep] = inverseGraph[dep] || [];
|
extractEditorSrcTask,
|
||||||
inverseGraph[dep].push(module);
|
task.parallel(
|
||||||
});
|
task.series(
|
||||||
});
|
compileEditorAMDTask,
|
||||||
|
optimizeEditorAMDTask,
|
||||||
var detailed = {};
|
minifyEditorAMDTask
|
||||||
Object.keys(bundles).forEach(function (entryPoint) {
|
),
|
||||||
var included = bundles[entryPoint];
|
task.series(
|
||||||
var includedMap = {};
|
createESMSourcesAndResourcesTask,
|
||||||
included.forEach(function (included) {
|
compileEditorESMTask
|
||||||
includedMap[included] = true;
|
)
|
||||||
});
|
),
|
||||||
|
finalEditorResourcesTask
|
||||||
var explanation = [];
|
)
|
||||||
included.map(function (included) {
|
);
|
||||||
if (included.indexOf('!') >= 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var reason = (inverseGraph[included] || []).filter(function (mod) {
|
|
||||||
return !!includedMap[mod];
|
|
||||||
});
|
|
||||||
explanation.push({
|
|
||||||
module: included,
|
|
||||||
reason: reason
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
detailed[entryPoint] = explanation;
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(JSON.stringify(detailed, null, '\t'));
|
|
||||||
});
|
|
||||||
|
|
||||||
function filterStream(testFunc) {
|
|
||||||
return es.through(function (data) {
|
|
||||||
if (!testFunc(data.relative)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.emit('data', data);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//#region monaco type checking
|
//#region monaco type checking
|
||||||
|
|
||||||
@@ -354,6 +335,7 @@ function createTscCompileTask(watch) {
|
|||||||
let errors = [];
|
let errors = [];
|
||||||
let reporter = createReporter();
|
let reporter = createReporter();
|
||||||
let report;
|
let report;
|
||||||
|
// eslint-disable-next-line no-control-regex
|
||||||
let magic = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; // https://stackoverflow.com/questions/25245716/remove-all-ansi-colors-styles-from-strings
|
let magic = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; // https://stackoverflow.com/questions/25245716/remove-all-ansi-colors-styles-from-strings
|
||||||
|
|
||||||
child.stdout.on('data', data => {
|
child.stdout.on('data', data => {
|
||||||
@@ -387,7 +369,10 @@ function createTscCompileTask(watch) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('monaco-typecheck-watch', createTscCompileTask(true));
|
const monacoTypecheckWatchTask = task.define('monaco-typecheck-watch', createTscCompileTask(true));
|
||||||
gulp.task('monaco-typecheck', createTscCompileTask(false));
|
exports.monacoTypecheckWatchTask = monacoTypecheckWatchTask;
|
||||||
|
|
||||||
|
const monacoTypecheckTask = task.define('monaco-typecheck', createTscCompileTask(false));
|
||||||
|
exports.monacoTypecheckTask = monacoTypecheckTask;
|
||||||
|
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ const path = require('path');
|
|||||||
const tsb = require('gulp-tsb');
|
const tsb = require('gulp-tsb');
|
||||||
const es = require('event-stream');
|
const es = require('event-stream');
|
||||||
const filter = require('gulp-filter');
|
const filter = require('gulp-filter');
|
||||||
const rimraf = require('rimraf');
|
|
||||||
const util = require('./lib/util');
|
const util = require('./lib/util');
|
||||||
|
const task = require('./lib/task');
|
||||||
const watcher = require('./lib/watch');
|
const watcher = require('./lib/watch');
|
||||||
const createReporter = require('./lib/reporter').createReporter;
|
const createReporter = require('./lib/reporter').createReporter;
|
||||||
const glob = require('glob');
|
const glob = require('glob');
|
||||||
@@ -43,16 +43,6 @@ const tasks = compilations.map(function (tsconfigFile) {
|
|||||||
|
|
||||||
const name = relativeDirname.replace(/\//g, '-');
|
const name = relativeDirname.replace(/\//g, '-');
|
||||||
|
|
||||||
// Tasks
|
|
||||||
const clean = 'clean-extension:' + name;
|
|
||||||
const compile = 'compile-extension:' + name;
|
|
||||||
const watch = 'watch-extension:' + name;
|
|
||||||
|
|
||||||
// Build Tasks
|
|
||||||
const cleanBuild = 'clean-extension-build:' + name;
|
|
||||||
const compileBuild = 'compile-extension-build:' + name;
|
|
||||||
const watchBuild = 'watch-extension-build:' + name;
|
|
||||||
|
|
||||||
const root = path.join('extensions', relativeDirname);
|
const root = path.join('extensions', relativeDirname);
|
||||||
const srcBase = path.join(root, 'src');
|
const srcBase = path.join(root, 'src');
|
||||||
const src = path.join(srcBase, '**');
|
const src = path.join(srcBase, '**');
|
||||||
@@ -111,18 +101,18 @@ const tasks = compilations.map(function (tsconfigFile) {
|
|||||||
|
|
||||||
const srcOpts = { cwd: path.dirname(__dirname), base: srcBase };
|
const srcOpts = { cwd: path.dirname(__dirname), base: srcBase };
|
||||||
|
|
||||||
gulp.task(clean, cb => rimraf(out, cb));
|
const cleanTask = task.define(`clean-extension-${name}`, util.rimraf(out));
|
||||||
|
|
||||||
gulp.task(compile, [clean], () => {
|
const compileTask = task.define(`compile-extension:${name}`, task.series(cleanTask, () => {
|
||||||
const pipeline = createPipeline(false, true);
|
const pipeline = createPipeline(false, true);
|
||||||
const input = gulp.src(src, srcOpts);
|
const input = gulp.src(src, srcOpts);
|
||||||
|
|
||||||
return input
|
return input
|
||||||
.pipe(pipeline())
|
.pipe(pipeline())
|
||||||
.pipe(gulp.dest(out));
|
.pipe(gulp.dest(out));
|
||||||
});
|
}));
|
||||||
|
|
||||||
gulp.task(watch, [clean], () => {
|
const watchTask = task.define(`watch-extension:${name}`, task.series(cleanTask, () => {
|
||||||
const pipeline = createPipeline(false);
|
const pipeline = createPipeline(false);
|
||||||
const input = gulp.src(src, srcOpts);
|
const input = gulp.src(src, srcOpts);
|
||||||
const watchInput = watcher(src, srcOpts);
|
const watchInput = watcher(src, srcOpts);
|
||||||
@@ -130,43 +120,35 @@ const tasks = compilations.map(function (tsconfigFile) {
|
|||||||
return watchInput
|
return watchInput
|
||||||
.pipe(util.incremental(pipeline, input))
|
.pipe(util.incremental(pipeline, input))
|
||||||
.pipe(gulp.dest(out));
|
.pipe(gulp.dest(out));
|
||||||
});
|
}));
|
||||||
|
|
||||||
gulp.task(cleanBuild, cb => rimraf(out, cb));
|
const compileBuildTask = task.define(`compile-build-extension-${name}`, task.series(cleanTask, () => {
|
||||||
|
|
||||||
gulp.task(compileBuild, [clean], () => {
|
|
||||||
const pipeline = createPipeline(true, true);
|
const pipeline = createPipeline(true, true);
|
||||||
const input = gulp.src(src, srcOpts);
|
const input = gulp.src(src, srcOpts);
|
||||||
|
|
||||||
return input
|
return input
|
||||||
.pipe(pipeline())
|
.pipe(pipeline())
|
||||||
.pipe(gulp.dest(out));
|
.pipe(gulp.dest(out));
|
||||||
});
|
}));
|
||||||
|
|
||||||
gulp.task(watchBuild, [clean], () => {
|
// Tasks
|
||||||
const pipeline = createPipeline(true);
|
gulp.task(compileTask);
|
||||||
const input = gulp.src(src, srcOpts);
|
gulp.task(watchTask);
|
||||||
const watchInput = watcher(src, srcOpts);
|
|
||||||
|
|
||||||
return watchInput
|
|
||||||
.pipe(util.incremental(() => pipeline(), input))
|
|
||||||
.pipe(gulp.dest(out));
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
clean: clean,
|
compileTask: compileTask,
|
||||||
compile: compile,
|
watchTask: watchTask,
|
||||||
watch: watch,
|
compileBuildTask: compileBuildTask
|
||||||
cleanBuild: cleanBuild,
|
|
||||||
compileBuild: compileBuild,
|
|
||||||
watchBuild: watchBuild
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('clean-extensions', tasks.map(t => t.clean));
|
const compileExtensionsTask = task.define('compile-extensions', task.parallel(...tasks.map(t => t.compileTask)));
|
||||||
gulp.task('compile-extensions', tasks.map(t => t.compile));
|
gulp.task(compileExtensionsTask);
|
||||||
gulp.task('watch-extensions', tasks.map(t => t.watch));
|
exports.compileExtensionsTask = compileExtensionsTask;
|
||||||
|
|
||||||
gulp.task('clean-extensions-build', tasks.map(t => t.cleanBuild));
|
const watchExtensionsTask = task.define('watch-extensions', task.parallel(...tasks.map(t => t.watchTask)));
|
||||||
gulp.task('compile-extensions-build', tasks.map(t => t.compileBuild));
|
gulp.task(watchExtensionsTask);
|
||||||
gulp.task('watch-extensions-build', tasks.map(t => t.watchBuild));
|
exports.watchExtensionsTask = watchExtensionsTask;
|
||||||
|
|
||||||
|
const compileExtensionsBuildTask = task.define('compile-extensions-build', task.parallel(...tasks.map(t => t.compileBuildTask)));
|
||||||
|
exports.compileExtensionsBuildTask = compileExtensionsBuildTask;
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ const indentationFilter = [
|
|||||||
|
|
||||||
// except specific files
|
// except specific files
|
||||||
'!ThirdPartyNotices.txt',
|
'!ThirdPartyNotices.txt',
|
||||||
'!LICENSE.txt',
|
'!LICENSE.{txt,rtf}',
|
||||||
|
'!LICENSES.chromium.html',
|
||||||
'!**/LICENSE',
|
'!**/LICENSE',
|
||||||
'!src/vs/nls.js',
|
'!src/vs/nls.js',
|
||||||
'!src/vs/nls.build.js',
|
'!src/vs/nls.build.js',
|
||||||
@@ -50,7 +51,6 @@ const indentationFilter = [
|
|||||||
'!src/vs/css.build.js',
|
'!src/vs/css.build.js',
|
||||||
'!src/vs/loader.js',
|
'!src/vs/loader.js',
|
||||||
'!src/vs/base/common/marked/marked.js',
|
'!src/vs/base/common/marked/marked.js',
|
||||||
'!src/vs/base/common/winjs.base.js',
|
|
||||||
'!src/vs/base/node/terminateProcess.sh',
|
'!src/vs/base/node/terminateProcess.sh',
|
||||||
'!src/vs/base/node/cpuUsage.sh',
|
'!src/vs/base/node/cpuUsage.sh',
|
||||||
'!test/assert.js',
|
'!test/assert.js',
|
||||||
@@ -82,14 +82,21 @@ const indentationFilter = [
|
|||||||
'!src/typings/**/*.d.ts',
|
'!src/typings/**/*.d.ts',
|
||||||
'!extensions/**/*.d.ts',
|
'!extensions/**/*.d.ts',
|
||||||
'!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe,ico,icns}',
|
'!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe,ico,icns}',
|
||||||
'!build/{lib,tslintRules}/**/*.js',
|
'!build/{lib,tslintRules,download}/**/*.js',
|
||||||
'!build/**/*.sh',
|
'!build/**/*.sh',
|
||||||
'!build/azure-pipelines/**/*.js',
|
'!build/azure-pipelines/**/*.js',
|
||||||
'!build/azure-pipelines/**/*.config',
|
'!build/azure-pipelines/**/*.config',
|
||||||
'!**/Dockerfile',
|
'!**/Dockerfile',
|
||||||
|
'!**/Dockerfile.*',
|
||||||
'!**/*.Dockerfile',
|
'!**/*.Dockerfile',
|
||||||
'!**/*.dockerfile',
|
'!**/*.dockerfile',
|
||||||
'!extensions/markdown-language-features/media/*.js'
|
'!extensions/markdown-language-features/media/*.js',
|
||||||
|
// {{SQL CARBON EDIT}}
|
||||||
|
'!**/*.{xlf,docx,sql,vsix}',
|
||||||
|
'!extensions/mssql/sqltoolsservice/**',
|
||||||
|
'!extensions/import/flatfileimportservice/**',
|
||||||
|
'!extensions/admin-tool-ext-win/ssmsmin/**',
|
||||||
|
'!extensions/resource-deployment/notebooks/**'
|
||||||
];
|
];
|
||||||
|
|
||||||
const copyrightFilter = [
|
const copyrightFilter = [
|
||||||
@@ -110,13 +117,46 @@ const copyrightFilter = [
|
|||||||
'!**/*.opts',
|
'!**/*.opts',
|
||||||
'!**/*.disabled',
|
'!**/*.disabled',
|
||||||
'!**/*.code-workspace',
|
'!**/*.code-workspace',
|
||||||
|
'!**/promise-polyfill/polyfill.js',
|
||||||
'!build/**/*.init',
|
'!build/**/*.init',
|
||||||
'!resources/linux/snap/snapcraft.yaml',
|
'!resources/linux/snap/snapcraft.yaml',
|
||||||
'!resources/linux/snap/electron-launch',
|
'!resources/linux/snap/electron-launch',
|
||||||
'!resources/win32/bin/code.js',
|
'!resources/win32/bin/code.js',
|
||||||
|
'!resources/completions/**',
|
||||||
'!extensions/markdown-language-features/media/highlight.css',
|
'!extensions/markdown-language-features/media/highlight.css',
|
||||||
'!extensions/html-language-features/server/src/modes/typescript/*',
|
'!extensions/html-language-features/server/src/modes/typescript/*',
|
||||||
'!extensions/*/server/bin/*'
|
'!extensions/*/server/bin/*',
|
||||||
|
// {{SQL CARBON EDIT}}
|
||||||
|
'!extensions/notebook/src/intellisense/text.ts',
|
||||||
|
'!extensions/mssql/src/objectExplorerNodeProvider/webhdfs.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/tableRenderers.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/common/url.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/common/renderMimeInterfaces.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/common/outputProcessor.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/common/mimemodel.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/cellViews/media/*.css',
|
||||||
|
'!src/sql/base/browser/ui/table/plugins/rowSelectionModel.plugin.ts',
|
||||||
|
'!src/sql/base/browser/ui/table/plugins/rowDetailView.ts',
|
||||||
|
'!src/sql/base/browser/ui/table/plugins/headerFilter.plugin.ts',
|
||||||
|
'!src/sql/base/browser/ui/table/plugins/checkboxSelectColumn.plugin.ts',
|
||||||
|
'!src/sql/base/browser/ui/table/plugins/cellSelectionModel.plugin.ts',
|
||||||
|
'!src/sql/base/browser/ui/table/plugins/autoSizeColumns.plugin.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/sanitizer.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/renderers.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/registry.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/factories.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/models/nbformat.ts',
|
||||||
|
'!extensions/markdown-language-features/media/tomorrow.css',
|
||||||
|
'!src/sql/workbench/electron-browser/modelComponents/media/highlight.css',
|
||||||
|
'!src/sql/parts/modelComponents/highlight.css',
|
||||||
|
'!extensions/mssql/sqltoolsservice/**',
|
||||||
|
'!extensions/import/flatfileimportservice/**',
|
||||||
|
'!extensions/notebook/src/prompts/**',
|
||||||
|
'!extensions/mssql/src/prompts/**',
|
||||||
|
'!extensions/notebook/resources/jupyter_config/**',
|
||||||
|
'!**/*.gif',
|
||||||
|
'!**/*.xlf',
|
||||||
|
'!**/*.dacpac'
|
||||||
];
|
];
|
||||||
|
|
||||||
const eslintFilter = [
|
const eslintFilter = [
|
||||||
@@ -127,7 +167,6 @@ const eslintFilter = [
|
|||||||
'!src/vs/nls.js',
|
'!src/vs/nls.js',
|
||||||
'!src/vs/css.build.js',
|
'!src/vs/css.build.js',
|
||||||
'!src/vs/nls.build.js',
|
'!src/vs/nls.build.js',
|
||||||
'!src/**/winjs.base.js',
|
|
||||||
'!src/**/marked.js',
|
'!src/**/marked.js',
|
||||||
'!**/test/**'
|
'!**/test/**'
|
||||||
];
|
];
|
||||||
@@ -146,6 +185,11 @@ const tslintFilter = [
|
|||||||
'!extensions/html-language-features/server/lib/jquery.d.ts'
|
'!extensions/html-language-features/server/lib/jquery.d.ts'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// {{SQL CARBON EDIT}}
|
||||||
|
const useStrictFilter = [
|
||||||
|
'src/**'
|
||||||
|
];
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
const copyrightHeaderLines = [
|
const copyrightHeaderLines = [
|
||||||
'/*---------------------------------------------------------------------------------------------',
|
'/*---------------------------------------------------------------------------------------------',
|
||||||
@@ -163,8 +207,7 @@ gulp.task('eslint', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('tslint', () => {
|
gulp.task('tslint', () => {
|
||||||
// {{SQL CARBON EDIT}}
|
const options = { emitError: true };
|
||||||
const options = { emitError: false };
|
|
||||||
|
|
||||||
return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
|
return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
|
||||||
.pipe(filter(tslintFilter))
|
.pipe(filter(tslintFilter))
|
||||||
@@ -197,8 +240,8 @@ function hygiene(some) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const copyrights = es.through(function (file) {
|
const copyrights = es.through(function (file) {
|
||||||
const lines = file.__lines;
|
|
||||||
|
|
||||||
|
const lines = file.__lines;
|
||||||
for (let i = 0; i < copyrightHeaderLines.length; i++) {
|
for (let i = 0; i < copyrightHeaderLines.length; i++) {
|
||||||
if (lines[i] !== copyrightHeaderLines[i]) {
|
if (lines[i] !== copyrightHeaderLines[i]) {
|
||||||
console.error(file.relative + ': Missing or bad copyright statement');
|
console.error(file.relative + ': Missing or bad copyright statement');
|
||||||
@@ -210,6 +253,23 @@ function hygiene(some) {
|
|||||||
this.emit('data', file);
|
this.emit('data', file);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// {{SQL CARBON EDIT}}
|
||||||
|
// Check for unnecessary 'use strict' lines. These are automatically added by the alwaysStrict compiler option so don't need to be added manually
|
||||||
|
const useStrict = es.through(function (file) {
|
||||||
|
const lines = file.__lines;
|
||||||
|
// Only take the first 10 lines to reduce false positives- the compiler will throw an error if it's not the first non-comment line in a file
|
||||||
|
// (10 is used to account for copyright and extraneous newlines)
|
||||||
|
lines.slice(0, 10).forEach((line, i) => {
|
||||||
|
if (/\s*'use\s*strict\s*'/.test(line)) {
|
||||||
|
console.error(file.relative + '(' + (i + 1) + ',1): Unnecessary \'use strict\' - this is already added by the compiler');
|
||||||
|
errorCount++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.emit('data', file);
|
||||||
|
});
|
||||||
|
// {{SQL CARBON EDIT}} END
|
||||||
|
|
||||||
const formatting = es.map(function (file, cb) {
|
const formatting = es.map(function (file, cb) {
|
||||||
tsfmt.processString(file.path, file.contents.toString('utf8'), {
|
tsfmt.processString(file.path, file.contents.toString('utf8'), {
|
||||||
verify: false,
|
verify: false,
|
||||||
@@ -230,7 +290,7 @@ function hygiene(some) {
|
|||||||
let formatted = result.dest.replace(/\r\n/gm, '\n');
|
let formatted = result.dest.replace(/\r\n/gm, '\n');
|
||||||
|
|
||||||
if (original !== formatted) {
|
if (original !== formatted) {
|
||||||
console.error('File not formatted:', file.relative);
|
console.error("File not formatted. Run the 'Format Document' command to fix it:", file.relative);
|
||||||
errorCount++;
|
errorCount++;
|
||||||
}
|
}
|
||||||
cb(null, file);
|
cb(null, file);
|
||||||
@@ -262,27 +322,52 @@ function hygiene(some) {
|
|||||||
.pipe(filter(f => !f.stat.isDirectory()))
|
.pipe(filter(f => !f.stat.isDirectory()))
|
||||||
.pipe(filter(indentationFilter))
|
.pipe(filter(indentationFilter))
|
||||||
.pipe(indentation)
|
.pipe(indentation)
|
||||||
.pipe(filter(copyrightFilter));
|
.pipe(filter(copyrightFilter))
|
||||||
// {{SQL CARBON EDIT}}
|
.pipe(copyrights);
|
||||||
// .pipe(copyrights);
|
|
||||||
|
|
||||||
const typescript = result
|
const typescript = result
|
||||||
.pipe(filter(tslintFilter))
|
.pipe(filter(tslintFilter))
|
||||||
.pipe(formatting)
|
.pipe(formatting)
|
||||||
.pipe(tsl);
|
.pipe(tsl)
|
||||||
|
// {{SQL CARBON EDIT}}
|
||||||
|
.pipe(filter(useStrictFilter))
|
||||||
|
.pipe(useStrict);
|
||||||
|
|
||||||
const javascript = result
|
const javascript = result
|
||||||
.pipe(filter(eslintFilter))
|
.pipe(filter(eslintFilter))
|
||||||
.pipe(gulpeslint('src/.eslintrc'))
|
.pipe(gulpeslint('src/.eslintrc'))
|
||||||
.pipe(gulpeslint.formatEach('compact'));
|
.pipe(gulpeslint.formatEach('compact'))
|
||||||
// {{SQL CARBON EDIT}}
|
.pipe(gulpeslint.failAfterError());
|
||||||
// .pipe(gulpeslint.failAfterError());
|
|
||||||
|
|
||||||
let count = 0;
|
let count = 0;
|
||||||
return es.merge(typescript, javascript)
|
return es.merge(typescript, javascript)
|
||||||
.pipe(es.through(function (data) {
|
.pipe(es.through(function (data) {
|
||||||
// {{SQL CARBON EDIT}}
|
count++;
|
||||||
this.emit('end');
|
if (process.env['TRAVIS'] && count % 10 === 0) {
|
||||||
|
process.stdout.write('.');
|
||||||
|
}
|
||||||
|
this.emit('data', data);
|
||||||
|
}, function () {
|
||||||
|
process.stdout.write('\n');
|
||||||
|
|
||||||
|
const tslintResult = tsLinter.getResult();
|
||||||
|
if (tslintResult.failures.length > 0) {
|
||||||
|
for (const failure of tslintResult.failures) {
|
||||||
|
const name = failure.getFileName();
|
||||||
|
const position = failure.getStartPosition();
|
||||||
|
const line = position.getLineAndCharacter().line;
|
||||||
|
const character = position.getLineAndCharacter().character;
|
||||||
|
|
||||||
|
console.error(`${name}:${line + 1}:${character + 1}:${failure.getFailure()}`);
|
||||||
|
}
|
||||||
|
errorCount += tslintResult.failures.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errorCount > 0) {
|
||||||
|
this.emit('error', 'Hygiene failed with ' + errorCount + ' errors. Check \'build/gulpfile.hygiene.js\'.');
|
||||||
|
} else {
|
||||||
|
this.emit('end');
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -300,7 +385,7 @@ function createGitIndexVinyls(paths) {
|
|||||||
return e(err);
|
return e(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
cp.exec(`git show :${relativePath}`, { maxBuffer: 2000 * 1024, encoding: 'buffer' }, (err, out) => {
|
cp.exec(`git show ":${relativePath}"`, { maxBuffer: 2000 * 1024, encoding: 'buffer' }, (err, out) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return e(err);
|
return e(err);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,21 +6,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const gulp = require('gulp');
|
const gulp = require('gulp');
|
||||||
const json = require('gulp-json-editor');
|
|
||||||
const buffer = require('gulp-buffer');
|
|
||||||
const filter = require('gulp-filter');
|
|
||||||
const es = require('event-stream');
|
|
||||||
const util = require('./lib/util');
|
|
||||||
const remote = require('gulp-remote-src');
|
|
||||||
const zip = require('gulp-vinyl-zip');
|
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
const jeditor = require('gulp-json-editor');
|
const jeditor = require('gulp-json-editor');
|
||||||
|
const product = require('../product.json');
|
||||||
const pkg = require('../package.json');
|
|
||||||
|
|
||||||
gulp.task('mixin', function () {
|
gulp.task('mixin', function () {
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
const updateUrl = process.env['SQLOPS_UPDATEURL'];
|
const updateUrl = process.env['SQLOPS_UPDATEURL'];
|
||||||
if (!updateUrl) {
|
if (!updateUrl) {
|
||||||
console.log('Missing SQLOPS_UPDATEURL, skipping mixin');
|
console.log('Missing SQLOPS_UPDATEURL, skipping mixin');
|
||||||
@@ -34,19 +26,53 @@ gulp.task('mixin', function () {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}} - apply ADS insiders values if needed
|
||||||
let serviceUrl = 'https://sqlopsextensions.blob.core.windows.net/marketplace/v1/extensionsGallery.json';
|
|
||||||
if (quality === 'insider') {
|
|
||||||
serviceUrl = `https://sqlopsextensions.blob.core.windows.net/marketplace/v1/extensionsGallery-${quality}.json`;
|
|
||||||
}
|
|
||||||
let newValues = {
|
let newValues = {
|
||||||
|
"nameShort": product.nameShort,
|
||||||
|
"nameLong": product.nameLong,
|
||||||
|
"applicationName": product.applicationName,
|
||||||
|
"dataFolderName": product.dataFolderName,
|
||||||
|
"win32MutexName": product.win32MutexName,
|
||||||
|
"win32DirName": product.win32DirName,
|
||||||
|
"win32NameVersion": product.win32NameVersion,
|
||||||
|
"win32RegValueName": product.win32RegValueName,
|
||||||
|
"win32AppId": product.win32AppId,
|
||||||
|
"win32x64AppId": product.win32x64AppId,
|
||||||
|
"win32UserAppId": product.win32UserAppId,
|
||||||
|
"win32x64UserAppId": product.win32x64UserAppId,
|
||||||
|
"win32AppUserModelId": product.win32AppUserModelId,
|
||||||
|
"win32ShellNameShort": product.win32ShellNameShort,
|
||||||
|
"darwinBundleIdentifier": product.darwinBundleIdentifier,
|
||||||
"updateUrl": updateUrl,
|
"updateUrl": updateUrl,
|
||||||
"quality": quality,
|
"quality": quality,
|
||||||
"extensionsGallery": {
|
"extensionsGallery": {
|
||||||
"serviceUrl": serviceUrl
|
"serviceUrl": 'https://sqlopsextensions.blob.core.windows.net/marketplace/v1/extensionsGallery.json'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (quality === 'insider') {
|
||||||
|
let dashSuffix = '-insiders';
|
||||||
|
let dotSuffix = '.insiders';
|
||||||
|
let displaySuffix = ' - Insiders';
|
||||||
|
|
||||||
|
newValues.extensionsGallery.serviceUrl = `https://sqlopsextensions.blob.core.windows.net/marketplace/v1/extensionsGallery-${quality}.json`;
|
||||||
|
newValues.nameShort += dashSuffix;
|
||||||
|
newValues.nameLong += displaySuffix;
|
||||||
|
newValues.applicationName += dashSuffix;
|
||||||
|
newValues.dataFolderName += dashSuffix;
|
||||||
|
newValues.win32MutexName += dashSuffix;
|
||||||
|
newValues.win32DirName += displaySuffix;
|
||||||
|
newValues.win32NameVersion += displaySuffix;
|
||||||
|
newValues.win32RegValueName += dashSuffix;
|
||||||
|
newValues.win32AppId = "{{9F0801B2-DEE3-4272-A2C6-FBDF25BAAF0F}";
|
||||||
|
newValues.win32x64AppId = "{{6748A5FD-29EB-4BA6-B3C6-E7B981B8D6B0}";
|
||||||
|
newValues.win32UserAppId = "{{0F8CD1ED-483C-40EB-8AD2-8ED784651AA1}";
|
||||||
|
newValues.win32x64UserAppId += dashSuffix;
|
||||||
|
newValues.win32AppUserModelId += dotSuffix;
|
||||||
|
newValues.win32ShellNameShort += displaySuffix;
|
||||||
|
newValues.darwinBundleIdentifier += dotSuffix;
|
||||||
|
}
|
||||||
|
|
||||||
return gulp.src('./product.json')
|
return gulp.src('./product.json')
|
||||||
.pipe(jeditor(newValues))
|
.pipe(jeditor(newValues))
|
||||||
.pipe(gulp.dest('.'));
|
.pipe(gulp.dest('.'));
|
||||||
|
|||||||
16
build/gulpfile.reh.js
Normal file
16
build/gulpfile.reh.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const gulp = require('gulp');
|
||||||
|
|
||||||
|
const noop = () => { return Promise.resolve(); };
|
||||||
|
|
||||||
|
gulp.task('vscode-reh-win32-ia32-min', noop);
|
||||||
|
gulp.task('vscode-reh-win32-x64-min', noop);
|
||||||
|
gulp.task('vscode-reh-darwin-min', noop);
|
||||||
|
gulp.task('vscode-reh-linux-x64-min', noop);
|
||||||
|
gulp.task('vscode-reh-linux-arm-min', noop);
|
||||||
@@ -28,7 +28,6 @@ const formatFiles = (some) => {
|
|||||||
console.info('ran formatting on file ' + file.path + ' result: ' + result.message);
|
console.info('ran formatting on file ' + file.path + ' result: ' + result.message);
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
console.error(result.message);
|
console.error(result.message);
|
||||||
errorCount++;
|
|
||||||
}
|
}
|
||||||
cb(null, file);
|
cb(null, file);
|
||||||
|
|
||||||
@@ -40,7 +39,7 @@ const formatFiles = (some) => {
|
|||||||
.pipe(filter(f => !f.stat.isDirectory()))
|
.pipe(filter(f => !f.stat.isDirectory()))
|
||||||
.pipe(formatting);
|
.pipe(formatting);
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
const formatStagedFiles = () => {
|
const formatStagedFiles = () => {
|
||||||
const cp = require('child_process');
|
const cp = require('child_process');
|
||||||
@@ -81,4 +80,4 @@ const formatStagedFiles = () => {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
@@ -20,6 +20,7 @@ const filter = require('gulp-filter');
|
|||||||
const json = require('gulp-json-editor');
|
const json = require('gulp-json-editor');
|
||||||
const _ = require('underscore');
|
const _ = require('underscore');
|
||||||
const util = require('./lib/util');
|
const util = require('./lib/util');
|
||||||
|
const task = require('./lib/task');
|
||||||
const ext = require('./lib/extensions');
|
const ext = require('./lib/extensions');
|
||||||
const buildfile = require('../src/buildfile');
|
const buildfile = require('../src/buildfile');
|
||||||
const common = require('./lib/optimize');
|
const common = require('./lib/optimize');
|
||||||
@@ -32,12 +33,11 @@ const i18n = require('./lib/i18n');
|
|||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
const serviceDownloader = require('service-downloader').ServiceDownloadProvider;
|
const serviceDownloader = require('service-downloader').ServiceDownloadProvider;
|
||||||
const platformInfo = require('service-downloader/out/platform').PlatformInformation;
|
const platformInfo = require('service-downloader/out/platform').PlatformInformation;
|
||||||
const glob = require('glob');
|
|
||||||
// {{SQL CARBON EDIT}} - End
|
// {{SQL CARBON EDIT}} - End
|
||||||
const deps = require('./dependencies');
|
const deps = require('./dependencies');
|
||||||
const getElectronVersion = require('./lib/electron').getElectronVersion;
|
const getElectronVersion = require('./lib/electron').getElectronVersion;
|
||||||
const createAsar = require('./lib/asar').createAsar;
|
const createAsar = require('./lib/asar').createAsar;
|
||||||
const minimist = require('minimist');
|
const { compileBuildTask } = require('./gulpfile.compile');
|
||||||
|
|
||||||
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
|
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@@ -52,7 +52,7 @@ const nodeModules = [
|
|||||||
'rxjs/Observable',
|
'rxjs/Observable',
|
||||||
'rxjs/Subject',
|
'rxjs/Subject',
|
||||||
'rxjs/Observer',
|
'rxjs/Observer',
|
||||||
'ng2-charts/ng2-charts']
|
'ng2-charts']
|
||||||
.concat(Object.keys(product.dependencies || {}))
|
.concat(Object.keys(product.dependencies || {}))
|
||||||
.concat(_.uniq(productionDependencies.map(d => d.name)))
|
.concat(_.uniq(productionDependencies.map(d => d.name)))
|
||||||
.concat(baseModules);
|
.concat(baseModules);
|
||||||
@@ -75,16 +75,19 @@ const vscodeResources = [
|
|||||||
'out-build/bootstrap-window.js',
|
'out-build/bootstrap-window.js',
|
||||||
'out-build/paths.js',
|
'out-build/paths.js',
|
||||||
'out-build/vs/**/*.{svg,png,cur,html}',
|
'out-build/vs/**/*.{svg,png,cur,html}',
|
||||||
|
'!out-build/vs/code/browser/**/*.html',
|
||||||
'out-build/vs/base/common/performance.js',
|
'out-build/vs/base/common/performance.js',
|
||||||
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh}',
|
'out-build/vs/base/node/languagePacks.js',
|
||||||
|
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh,ps.sh}',
|
||||||
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
|
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
|
||||||
'out-build/vs/workbench/browser/media/*-theme.css',
|
'out-build/vs/workbench/browser/media/*-theme.css',
|
||||||
'out-build/vs/workbench/parts/debug/**/*.json',
|
'out-build/vs/workbench/contrib/debug/**/*.json',
|
||||||
'out-build/vs/workbench/parts/execution/**/*.scpt',
|
'out-build/vs/workbench/contrib/externalTerminal/**/*.scpt',
|
||||||
'out-build/vs/workbench/parts/webview/electron-browser/webview-pre.js',
|
'out-build/vs/workbench/contrib/webview/browser/pre/*.js',
|
||||||
|
'out-build/vs/workbench/contrib/webview/electron-browser/pre/*.js',
|
||||||
'out-build/vs/**/markdown.css',
|
'out-build/vs/**/markdown.css',
|
||||||
'out-build/vs/workbench/parts/tasks/**/*.json',
|
'out-build/vs/workbench/contrib/tasks/**/*.json',
|
||||||
'out-build/vs/workbench/parts/welcome/walkThrough/**/*.md',
|
'out-build/vs/workbench/contrib/welcome/walkThrough/**/*.md',
|
||||||
'out-build/vs/workbench/services/files/**/*.exe',
|
'out-build/vs/workbench/services/files/**/*.exe',
|
||||||
'out-build/vs/workbench/services/files/**/*.md',
|
'out-build/vs/workbench/services/files/**/*.md',
|
||||||
'out-build/vs/code/electron-browser/workbench/**',
|
'out-build/vs/code/electron-browser/workbench/**',
|
||||||
@@ -99,19 +102,17 @@ const vscodeResources = [
|
|||||||
'out-build/sql/parts/admin/**/*.html',
|
'out-build/sql/parts/admin/**/*.html',
|
||||||
'out-build/sql/parts/connection/connectionDialog/media/*.{gif,png,svg}',
|
'out-build/sql/parts/connection/connectionDialog/media/*.{gif,png,svg}',
|
||||||
'out-build/sql/parts/common/dblist/**/*.html',
|
'out-build/sql/parts/common/dblist/**/*.html',
|
||||||
'out-build/sql/parts/dashboard/**/*.html',
|
'out-build/sql/workbench/parts/dashboard/**/*.html',
|
||||||
'out-build/sql/parts/disasterRecovery/**/*.html',
|
'out-build/sql/parts/disasterRecovery/**/*.html',
|
||||||
'out-build/sql/parts/common/modal/media/**',
|
'out-build/sql/parts/common/modal/media/**',
|
||||||
'out-build/sql/parts/grid/load/lib/**',
|
'out-build/sql/workbench/parts/grid/media/**',
|
||||||
'out-build/sql/parts/grid/load/loadJquery.js',
|
'out-build/sql/workbench/parts/grid/views/**/*.html',
|
||||||
'out-build/sql/parts/grid/media/**',
|
|
||||||
'out-build/sql/parts/grid/views/**/*.html',
|
|
||||||
'out-build/sql/parts/tasks/**/*.html',
|
'out-build/sql/parts/tasks/**/*.html',
|
||||||
'out-build/sql/parts/taskHistory/viewlet/media/**',
|
'out-build/sql/parts/taskHistory/viewlet/media/**',
|
||||||
'out-build/sql/parts/jobManagement/common/media/*.svg',
|
'out-build/sql/parts/jobManagement/common/media/*.svg',
|
||||||
'out-build/sql/media/objectTypes/*.svg',
|
'out-build/sql/media/objectTypes/*.svg',
|
||||||
'out-build/sql/media/icons/*.svg',
|
'out-build/sql/media/icons/*.svg',
|
||||||
'out-build/sql/parts/notebook/media/**/*.svg',
|
'out-build/sql/workbench/parts/notebook/media/**/*.svg',
|
||||||
'!**/test/**'
|
'!**/test/**'
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -121,29 +122,41 @@ const BUNDLED_FILE_HEADER = [
|
|||||||
' *--------------------------------------------------------*/'
|
' *--------------------------------------------------------*/'
|
||||||
].join('\n');
|
].join('\n');
|
||||||
|
|
||||||
gulp.task('clean-optimized-vscode', util.rimraf('out-vscode'));
|
const optimizeVSCodeTask = task.define('optimize-vscode', task.series(
|
||||||
gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compile-extensions-build'], common.optimizeTask({
|
task.parallel(
|
||||||
src: 'out-build',
|
util.rimraf('out-vscode'),
|
||||||
entryPoints: vscodeEntryPoints,
|
compileBuildTask
|
||||||
otherSources: [],
|
),
|
||||||
resources: vscodeResources,
|
common.optimizeTask({
|
||||||
loaderConfig: common.loaderConfig(nodeModules),
|
src: 'out-build',
|
||||||
header: BUNDLED_FILE_HEADER,
|
entryPoints: vscodeEntryPoints,
|
||||||
out: 'out-vscode',
|
resources: vscodeResources,
|
||||||
bundleInfo: undefined
|
loaderConfig: common.loaderConfig(nodeModules),
|
||||||
}));
|
header: BUNDLED_FILE_HEADER,
|
||||||
|
out: 'out-vscode',
|
||||||
|
bundleInfo: undefined
|
||||||
|
})
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
gulp.task('optimize-index-js', ['optimize-vscode'], () => {
|
const optimizeIndexJSTask = task.define('optimize-index-js', task.series(
|
||||||
const fullpath = path.join(process.cwd(), 'out-vscode/vs/code/electron-browser/workbench/workbench.js');
|
optimizeVSCodeTask,
|
||||||
const contents = fs.readFileSync(fullpath).toString();
|
() => {
|
||||||
const newContents = contents.replace('[/*BUILD->INSERT_NODE_MODULES*/]', JSON.stringify(nodeModules));
|
const fullpath = path.join(process.cwd(), 'out-vscode/bootstrap-window.js');
|
||||||
fs.writeFileSync(fullpath, newContents);
|
const contents = fs.readFileSync(fullpath).toString();
|
||||||
});
|
const newContents = contents.replace('[/*BUILD->INSERT_NODE_MODULES*/]', JSON.stringify(nodeModules));
|
||||||
|
fs.writeFileSync(fullpath, newContents);
|
||||||
|
}
|
||||||
|
));
|
||||||
|
|
||||||
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
|
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
|
||||||
gulp.task('clean-minified-vscode', util.rimraf('out-vscode-min'));
|
const minifyVSCodeTask = task.define('minify-vscode', task.series(
|
||||||
gulp.task('minify-vscode', ['clean-minified-vscode', 'optimize-index-js'], common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`));
|
task.parallel(
|
||||||
|
util.rimraf('out-vscode-min'),
|
||||||
|
optimizeIndexJSTask
|
||||||
|
),
|
||||||
|
common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`)
|
||||||
|
));
|
||||||
|
|
||||||
// Package
|
// Package
|
||||||
|
|
||||||
@@ -164,7 +177,7 @@ const config = {
|
|||||||
version: getElectronVersion(),
|
version: getElectronVersion(),
|
||||||
productAppName: product.nameLong,
|
productAppName: product.nameLong,
|
||||||
companyName: 'Microsoft Corporation',
|
companyName: 'Microsoft Corporation',
|
||||||
copyright: 'Copyright (C) 2018 Microsoft. All rights reserved',
|
copyright: 'Copyright (C) 2019 Microsoft. All rights reserved',
|
||||||
darwinIcon: 'resources/darwin/code.icns',
|
darwinIcon: 'resources/darwin/code.icns',
|
||||||
darwinBundleIdentifier: product.darwinBundleIdentifier,
|
darwinBundleIdentifier: product.darwinBundleIdentifier,
|
||||||
darwinApplicationCategoryType: 'public.app-category.developer-tools',
|
darwinApplicationCategoryType: 'public.app-category.developer-tools',
|
||||||
@@ -180,13 +193,13 @@ const config = {
|
|||||||
urlSchemes: [product.urlProtocol]
|
urlSchemes: [product.urlProtocol]
|
||||||
}],
|
}],
|
||||||
darwinForceDarkModeSupport: true,
|
darwinForceDarkModeSupport: true,
|
||||||
darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : void 0,
|
darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : undefined,
|
||||||
linuxExecutableName: product.applicationName,
|
linuxExecutableName: product.applicationName,
|
||||||
winIcon: 'resources/win32/code.ico',
|
winIcon: 'resources/win32/code.ico',
|
||||||
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || void 0,
|
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || undefined,
|
||||||
|
|
||||||
// @ts-ignore JSON checking: electronRepository is optional
|
// @ts-ignore JSON checking: electronRepository is optional
|
||||||
repo: product.electronRepository || void 0
|
repo: product.electronRepository || undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
function getElectron(arch) {
|
function getElectron(arch) {
|
||||||
@@ -206,13 +219,11 @@ function getElectron(arch) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('clean-electron', util.rimraf('.build/electron'));
|
gulp.task(task.define('electron', task.series(util.rimraf('.build/electron'), getElectron(process.arch))));
|
||||||
gulp.task('electron', ['clean-electron'], getElectron(process.arch));
|
gulp.task(task.define('electron-ia32', task.series(util.rimraf('.build/electron'), getElectron('ia32'))));
|
||||||
gulp.task('electron-ia32', ['clean-electron'], getElectron('ia32'));
|
gulp.task(task.define('electron-x64', task.series(util.rimraf('.build/electron'), getElectron('x64'))));
|
||||||
gulp.task('electron-x64', ['clean-electron'], getElectron('x64'));
|
gulp.task(task.define('electron-arm', task.series(util.rimraf('.build/electron'), getElectron('armv7l'))));
|
||||||
gulp.task('electron-arm', ['clean-electron'], getElectron('arm'));
|
gulp.task(task.define('electron-arm64', task.series(util.rimraf('.build/electron'), getElectron('arm64'))));
|
||||||
gulp.task('electron-arm64', ['clean-electron'], getElectron('arm64'));
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compute checksums for some files.
|
* Compute checksums for some files.
|
||||||
@@ -248,15 +259,14 @@ function computeChecksum(filename) {
|
|||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
function packageTask(platform, arch, opts) {
|
function packageTask(platform, arch, sourceFolderName, destinationFolderName, opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
const destination = path.join(path.dirname(root), destinationFolderName);
|
||||||
const destination = path.join(path.dirname(root), 'azuredatastudio') + (platform ? '-' + platform : '') + (arch ? '-' + arch : '');
|
|
||||||
platform = platform || process.platform;
|
platform = platform || process.platform;
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
const out = opts.minified ? 'out-vscode-min' : 'out-vscode';
|
const out = sourceFolderName;
|
||||||
|
|
||||||
const checksums = computeChecksums(out, [
|
const checksums = computeChecksums(out, [
|
||||||
'vs/workbench/workbench.main.js',
|
'vs/workbench/workbench.main.js',
|
||||||
@@ -309,14 +319,13 @@ function packageTask(platform, arch, opts) {
|
|||||||
const productJsonStream = gulp.src(['product.json'], { base: '.' })
|
const productJsonStream = gulp.src(['product.json'], { base: '.' })
|
||||||
.pipe(json(productJsonUpdate));
|
.pipe(json(productJsonUpdate));
|
||||||
|
|
||||||
const license = gulp.src(['LICENSES.chromium.html', 'LICENSE.txt', 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.' });
|
const license = gulp.src(['LICENSES.chromium.html', product.licenseFileName, 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.', allowEmpty: true });
|
||||||
|
|
||||||
const watermark = gulp.src(['resources/letterpress.svg', 'resources/letterpress-dark.svg', 'resources/letterpress-hc.svg'], { base: '.' });
|
|
||||||
|
|
||||||
// TODO the API should be copied to `out` during compile, not here
|
// TODO the API should be copied to `out` during compile, not here
|
||||||
const api = gulp.src('src/vs/vscode.d.ts').pipe(rename('out/vs/vscode.d.ts'));
|
const api = gulp.src('src/vs/vscode.d.ts').pipe(rename('out/vs/vscode.d.ts'));
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
const dataApi = gulp.src('src/vs/data.d.ts').pipe(rename('out/sql/data.d.ts'));
|
const dataApi = gulp.src('src/sql/azdata.d.ts').pipe(rename('out/sql/azdata.d.ts'));
|
||||||
|
const sqlopsAPI = gulp.src('src/sql/sqlops.d.ts').pipe(rename('out/sql/sqlops.d.ts'));
|
||||||
|
|
||||||
const depsSrc = [
|
const depsSrc = [
|
||||||
..._.flatten(productionDependencies.map(d => path.relative(root, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
|
..._.flatten(productionDependencies.map(d => path.relative(root, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
|
||||||
@@ -326,31 +335,7 @@ function packageTask(platform, arch, opts) {
|
|||||||
|
|
||||||
const deps = gulp.src(depsSrc, { base: '.', dot: true })
|
const deps = gulp.src(depsSrc, { base: '.', dot: true })
|
||||||
.pipe(filter(['**', '!**/package-lock.json']))
|
.pipe(filter(['**', '!**/package-lock.json']))
|
||||||
.pipe(util.cleanNodeModule('fsevents', ['binding.gyp', 'fsevents.cc', 'build/**', 'src/**', 'test/**'], ['**/*.node']))
|
.pipe(util.cleanNodeModules(path.join(__dirname, '.nativeignore')))
|
||||||
.pipe(util.cleanNodeModule('vscode-sqlite3', ['binding.gyp', 'benchmark/**', 'cloudformation/**', 'deps/**', 'test/**', 'build/**', 'src/**'], ['build/Release/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node', 'src/*.js']))
|
|
||||||
.pipe(util.cleanNodeModule('windows-mutex', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('native-keymap', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('native-is-elevated', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('native-watchdog', ['binding.gyp', 'build/**', 'src/**'], ['build/Release/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('spdlog', ['binding.gyp', 'build/**', 'deps/**', 'src/**', 'test/**'], ['build/Release/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('jschardet', ['dist/**']))
|
|
||||||
.pipe(util.cleanNodeModule('windows-foreground-love', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('windows-process-tree', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('gc-signals', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node', 'src/index.js']))
|
|
||||||
.pipe(util.cleanNodeModule('keytar', ['binding.gyp', 'build/**', 'src/**', 'script/**', 'node_modules/**'], ['**/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('node-pty', ['binding.gyp', 'build/**', 'src/**', 'tools/**'], ['build/Release/*.exe', 'build/Release/*.dll', 'build/Release/*.node']))
|
|
||||||
// {{SQL CARBON EDIT}}
|
|
||||||
.pipe(util.cleanNodeModule('chart.js', ['node_modules/**'], undefined))
|
|
||||||
.pipe(util.cleanNodeModule('emmet', ['node_modules/**'], undefined))
|
|
||||||
.pipe(util.cleanNodeModule('pty.js', ['build/**'], ['build/Release/**']))
|
|
||||||
.pipe(util.cleanNodeModule('jquery-ui', ['external/**', 'demos/**'], undefined))
|
|
||||||
.pipe(util.cleanNodeModule('core-js', ['**/**'], undefined))
|
|
||||||
.pipe(util.cleanNodeModule('slickgrid', ['node_modules/**', 'examples/**'], undefined))
|
|
||||||
.pipe(util.cleanNodeModule('nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
|
|
||||||
.pipe(util.cleanNodeModule('vscode-nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
|
|
||||||
// {{SQL CARBON EDIT}} - End
|
|
||||||
.pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node']))
|
|
||||||
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar'));
|
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar'));
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
@@ -361,50 +346,29 @@ function packageTask(platform, arch, opts) {
|
|||||||
'node_modules/underscore/**/*.*',
|
'node_modules/underscore/**/*.*',
|
||||||
'node_modules/zone.js/**/*.*',
|
'node_modules/zone.js/**/*.*',
|
||||||
'node_modules/chart.js/**/*.*',
|
'node_modules/chart.js/**/*.*',
|
||||||
|
'node_modules/chartjs-color/**/*.*',
|
||||||
|
'node_modules/chartjs-color-string/**/*.*',
|
||||||
|
'node_modules/color-convert/**/*.*',
|
||||||
|
'node_modules/color-name/**/*.*',
|
||||||
|
'node_modules/moment/**/*.*'
|
||||||
], { base: '.', dot: true });
|
], { base: '.', dot: true });
|
||||||
|
|
||||||
let all = es.merge(
|
let all = es.merge(
|
||||||
packageJsonStream,
|
packageJsonStream,
|
||||||
productJsonStream,
|
productJsonStream,
|
||||||
license,
|
license,
|
||||||
watermark,
|
|
||||||
api,
|
api,
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
copiedModules,
|
copiedModules,
|
||||||
dataApi,
|
dataApi,
|
||||||
|
sqlopsAPI,
|
||||||
sources,
|
sources,
|
||||||
deps
|
deps
|
||||||
);
|
);
|
||||||
|
|
||||||
if (platform === 'win32') {
|
if (platform === 'win32') {
|
||||||
all = es.merge(all, gulp.src([
|
all = es.merge(all, gulp.src([
|
||||||
'resources/win32/bower.ico',
|
// {{SQL CARBON EDIT}} remove unused icons
|
||||||
'resources/win32/c.ico',
|
|
||||||
'resources/win32/config.ico',
|
|
||||||
'resources/win32/cpp.ico',
|
|
||||||
'resources/win32/csharp.ico',
|
|
||||||
'resources/win32/css.ico',
|
|
||||||
'resources/win32/default.ico',
|
|
||||||
'resources/win32/go.ico',
|
|
||||||
'resources/win32/html.ico',
|
|
||||||
'resources/win32/jade.ico',
|
|
||||||
'resources/win32/java.ico',
|
|
||||||
'resources/win32/javascript.ico',
|
|
||||||
'resources/win32/json.ico',
|
|
||||||
'resources/win32/less.ico',
|
|
||||||
'resources/win32/markdown.ico',
|
|
||||||
'resources/win32/php.ico',
|
|
||||||
'resources/win32/powershell.ico',
|
|
||||||
'resources/win32/python.ico',
|
|
||||||
'resources/win32/react.ico',
|
|
||||||
'resources/win32/ruby.ico',
|
|
||||||
'resources/win32/sass.ico',
|
|
||||||
'resources/win32/shell.ico',
|
|
||||||
'resources/win32/sql.ico',
|
|
||||||
'resources/win32/typescript.ico',
|
|
||||||
'resources/win32/vue.ico',
|
|
||||||
'resources/win32/xml.ico',
|
|
||||||
'resources/win32/yaml.ico',
|
|
||||||
'resources/win32/code_70x70.png',
|
'resources/win32/code_70x70.png',
|
||||||
'resources/win32/code_150x150.png'
|
'resources/win32/code_150x150.png'
|
||||||
], { base: '.' }));
|
], { base: '.' }));
|
||||||
@@ -423,8 +387,10 @@ function packageTask(platform, arch, opts) {
|
|||||||
.pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
|
.pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
|
||||||
.pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version']));
|
.pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version']));
|
||||||
|
|
||||||
|
// result = es.merge(result, gulp.src('resources/completions/**', { base: '.' }));
|
||||||
|
|
||||||
if (platform === 'win32') {
|
if (platform === 'win32') {
|
||||||
result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32' }));
|
result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32', allowEmpty: true }));
|
||||||
|
|
||||||
result = es.merge(result, gulp.src('resources/win32/bin/code.cmd', { base: 'resources/win32' })
|
result = es.merge(result, gulp.src('resources/win32/bin/code.cmd', { base: 'resources/win32' })
|
||||||
.pipe(replace('@@NAME@@', product.nameShort))
|
.pipe(replace('@@NAME@@', product.nameShort))
|
||||||
@@ -432,14 +398,18 @@ function packageTask(platform, arch, opts) {
|
|||||||
|
|
||||||
result = es.merge(result, gulp.src('resources/win32/bin/code.sh', { base: 'resources/win32' })
|
result = es.merge(result, gulp.src('resources/win32/bin/code.sh', { base: 'resources/win32' })
|
||||||
.pipe(replace('@@NAME@@', product.nameShort))
|
.pipe(replace('@@NAME@@', product.nameShort))
|
||||||
|
.pipe(replace('@@PRODNAME@@', product.nameLong))
|
||||||
|
.pipe(replace('@@VERSION@@', version))
|
||||||
.pipe(replace('@@COMMIT@@', commit))
|
.pipe(replace('@@COMMIT@@', commit))
|
||||||
.pipe(replace('@@APPNAME@@', product.applicationName))
|
.pipe(replace('@@APPNAME@@', product.applicationName))
|
||||||
|
.pipe(replace('@@QUALITY@@', quality))
|
||||||
.pipe(rename(function (f) { f.basename = product.applicationName; f.extname = ''; })));
|
.pipe(rename(function (f) { f.basename = product.applicationName; f.extname = ''; })));
|
||||||
|
|
||||||
result = es.merge(result, gulp.src('resources/win32/VisualElementsManifest.xml', { base: 'resources/win32' })
|
result = es.merge(result, gulp.src('resources/win32/VisualElementsManifest.xml', { base: 'resources/win32' })
|
||||||
.pipe(rename(product.nameShort + '.VisualElementsManifest.xml')));
|
.pipe(rename(product.nameShort + '.VisualElementsManifest.xml')));
|
||||||
} else if (platform === 'linux') {
|
} else if (platform === 'linux') {
|
||||||
result = es.merge(result, gulp.src('resources/linux/bin/code.sh', { base: '.' })
|
result = es.merge(result, gulp.src('resources/linux/bin/code.sh', { base: '.' })
|
||||||
|
.pipe(replace('@@PRODNAME@@', product.nameLong))
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(rename('bin/' + product.applicationName)));
|
.pipe(rename('bin/' + product.applicationName)));
|
||||||
}
|
}
|
||||||
@@ -459,38 +429,35 @@ function packageTask(platform, arch, opts) {
|
|||||||
|
|
||||||
const buildRoot = path.dirname(root);
|
const buildRoot = path.dirname(root);
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
const BUILD_TARGETS = [
|
||||||
gulp.task('vscode-win32-x64-azurecore', ['optimize-vscode'], ext.packageExtensionTask('azurecore', 'win32', 'x64'));
|
{ platform: 'win32', arch: 'ia32' },
|
||||||
gulp.task('vscode-darwin-azurecore', ['optimize-vscode'], ext.packageExtensionTask('azurecore', 'darwin'));
|
{ platform: 'win32', arch: 'x64' },
|
||||||
gulp.task('vscode-linux-x64-azurecore', ['optimize-vscode'], ext.packageExtensionTask('azurecore', 'linux', 'x64'));
|
{ platform: 'darwin', arch: null, opts: { stats: true } },
|
||||||
|
{ platform: 'linux', arch: 'ia32' },
|
||||||
|
{ platform: 'linux', arch: 'x64' },
|
||||||
|
{ platform: 'linux', arch: 'arm' },
|
||||||
|
{ platform: 'linux', arch: 'arm64' },
|
||||||
|
];
|
||||||
|
BUILD_TARGETS.forEach(buildTarget => {
|
||||||
|
const dashed = (str) => (str ? `-${str}` : ``);
|
||||||
|
const platform = buildTarget.platform;
|
||||||
|
const arch = buildTarget.arch;
|
||||||
|
const opts = buildTarget.opts;
|
||||||
|
|
||||||
gulp.task('vscode-win32-x64-mssql', ['vscode-linux-x64-azurecore', 'optimize-vscode'], ext.packageExtensionTask('mssql', 'win32', 'x64'));
|
['', 'min'].forEach(minified => {
|
||||||
gulp.task('vscode-darwin-mssql', ['vscode-linux-x64-azurecore', 'optimize-vscode'], ext.packageExtensionTask('mssql', 'darwin'));
|
const sourceFolderName = `out-vscode${dashed(minified)}`;
|
||||||
gulp.task('vscode-linux-x64-mssql', ['vscode-linux-x64-azurecore', 'optimize-vscode'], ext.packageExtensionTask('mssql', 'linux', 'x64'));
|
const destinationFolderName = `azuredatastudio${dashed(platform)}${dashed(arch)}`;
|
||||||
|
|
||||||
gulp.task('clean-vscode-win32-ia32', util.rimraf(path.join(buildRoot, 'azuredatastudio-win32-ia32')));
|
const vscodeTask = task.define(`vscode${dashed(platform)}${dashed(arch)}${dashed(minified)}`, task.series(
|
||||||
gulp.task('clean-vscode-win32-x64', util.rimraf(path.join(buildRoot, 'azuredatastudio-win32-x64')));
|
task.parallel(
|
||||||
gulp.task('clean-vscode-darwin', util.rimraf(path.join(buildRoot, 'azuredatastudio-darwin')));
|
minified ? minifyVSCodeTask : optimizeVSCodeTask,
|
||||||
gulp.task('clean-vscode-linux-ia32', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-ia32')));
|
util.rimraf(path.join(buildRoot, destinationFolderName))
|
||||||
gulp.task('clean-vscode-linux-x64', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-x64')));
|
),
|
||||||
gulp.task('clean-vscode-linux-arm', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-arm')));
|
packageTask(platform, arch, sourceFolderName, destinationFolderName, opts)
|
||||||
gulp.task('clean-vscode-linux-arm64', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-arm64')));
|
));
|
||||||
|
gulp.task(vscodeTask);
|
||||||
gulp.task('vscode-win32-ia32', ['optimize-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32'));
|
});
|
||||||
gulp.task('vscode-win32-x64', ['vscode-win32-x64-azurecore', 'vscode-win32-x64-mssql', 'optimize-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64'));
|
});
|
||||||
gulp.task('vscode-darwin', ['vscode-darwin-azurecore', 'vscode-darwin-mssql', 'optimize-vscode', 'clean-vscode-darwin'], packageTask('darwin', null, { stats: true }));
|
|
||||||
gulp.task('vscode-linux-ia32', ['optimize-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32'));
|
|
||||||
gulp.task('vscode-linux-x64', ['vscode-linux-x64-azurecore', 'vscode-linux-x64-mssql', 'optimize-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64'));
|
|
||||||
gulp.task('vscode-linux-arm', ['optimize-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm'));
|
|
||||||
gulp.task('vscode-linux-arm64', ['optimize-vscode', 'clean-vscode-linux-arm64'], packageTask('linux', 'arm64'));
|
|
||||||
|
|
||||||
gulp.task('vscode-win32-ia32-min', ['minify-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32', { minified: true }));
|
|
||||||
gulp.task('vscode-win32-x64-min', ['minify-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64', { minified: true }));
|
|
||||||
gulp.task('vscode-darwin-min', ['minify-vscode', 'clean-vscode-darwin'], packageTask('darwin', null, { minified: true, stats: true }));
|
|
||||||
gulp.task('vscode-linux-ia32-min', ['minify-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32', { minified: true }));
|
|
||||||
gulp.task('vscode-linux-x64-min', ['minify-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64', { minified: true }));
|
|
||||||
gulp.task('vscode-linux-arm-min', ['minify-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm', { minified: true }));
|
|
||||||
gulp.task('vscode-linux-arm64-min', ['minify-vscode', 'clean-vscode-linux-arm64'], packageTask('linux', 'arm64', { minified: true }));
|
|
||||||
|
|
||||||
// Transifex Localizations
|
// Transifex Localizations
|
||||||
|
|
||||||
@@ -513,30 +480,42 @@ const apiHostname = process.env.TRANSIFEX_API_URL;
|
|||||||
const apiName = process.env.TRANSIFEX_API_NAME;
|
const apiName = process.env.TRANSIFEX_API_NAME;
|
||||||
const apiToken = process.env.TRANSIFEX_API_TOKEN;
|
const apiToken = process.env.TRANSIFEX_API_TOKEN;
|
||||||
|
|
||||||
gulp.task('vscode-translations-push', ['optimize-vscode'], function () {
|
gulp.task(task.define(
|
||||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
'vscode-translations-push',
|
||||||
const pathToExtensions = './extensions/*';
|
task.series(
|
||||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
optimizeVSCodeTask,
|
||||||
|
function () {
|
||||||
|
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||||
|
const pathToExtensions = './extensions/*';
|
||||||
|
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||||
|
|
||||||
return es.merge(
|
return es.merge(
|
||||||
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
|
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
|
||||||
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
|
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
|
||||||
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
||||||
).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken)
|
).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken)
|
||||||
).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken));
|
).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken));
|
||||||
});
|
}
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
gulp.task('vscode-translations-export', ['optimize-vscode'], function () {
|
gulp.task(task.define(
|
||||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
'vscode-translations-export',
|
||||||
const pathToExtensions = './extensions/*';
|
task.series(
|
||||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
optimizeVSCodeTask,
|
||||||
|
function () {
|
||||||
|
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||||
|
const pathToExtensions = './extensions/*';
|
||||||
|
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||||
|
|
||||||
return es.merge(
|
return es.merge(
|
||||||
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
|
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
|
||||||
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
|
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
|
||||||
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
||||||
).pipe(vfs.dest('../vscode-translations-export'));
|
).pipe(vfs.dest('../vscode-translations-export'));
|
||||||
});
|
}
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
gulp.task('vscode-translations-pull', function () {
|
gulp.task('vscode-translations-pull', function () {
|
||||||
return es.merge([...i18n.defaultLanguages, ...i18n.extraLanguages].map(language => {
|
return es.merge([...i18n.defaultLanguages, ...i18n.extraLanguages].map(language => {
|
||||||
@@ -557,7 +536,7 @@ gulp.task('vscode-translations-import', function () {
|
|||||||
|
|
||||||
// Sourcemaps
|
// Sourcemaps
|
||||||
|
|
||||||
gulp.task('upload-vscode-sourcemaps', ['vscode-darwin-min', 'minify-vscode'], () => {
|
gulp.task('upload-vscode-sourcemaps', () => {
|
||||||
const vs = gulp.src('out-vscode-min/**/*.map', { base: 'out-vscode-min' })
|
const vs = gulp.src('out-vscode-min/**/*.map', { base: 'out-vscode-min' })
|
||||||
.pipe(es.mapSync(f => {
|
.pipe(es.mapSync(f => {
|
||||||
f.path = `${f.base}/core/${f.relative}`;
|
f.path = `${f.base}/core/${f.relative}`;
|
||||||
@@ -581,57 +560,8 @@ gulp.task('upload-vscode-sourcemaps', ['vscode-darwin-min', 'minify-vscode'], ()
|
|||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
|
|
||||||
gulp.task('upload-vscode-configuration', ['generate-vscode-configuration'], () => {
|
|
||||||
if (!shouldSetupSettingsSearch()) {
|
|
||||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
|
||||||
console.log(`Only runs on master and release branches, not ${branch}`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!fs.existsSync(allConfigDetailsPath)) {
|
|
||||||
throw new Error(`configuration file at ${allConfigDetailsPath} does not exist`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const settingsSearchBuildId = getSettingsSearchBuildId(packageJson);
|
|
||||||
if (!settingsSearchBuildId) {
|
|
||||||
throw new Error('Failed to compute build number');
|
|
||||||
}
|
|
||||||
|
|
||||||
return gulp.src(allConfigDetailsPath)
|
|
||||||
.pipe(azure.upload({
|
|
||||||
account: process.env.AZURE_STORAGE_ACCOUNT,
|
|
||||||
key: process.env.AZURE_STORAGE_ACCESS_KEY,
|
|
||||||
container: 'configuration',
|
|
||||||
prefix: `${settingsSearchBuildId}/${commit}/`
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
|
|
||||||
function shouldSetupSettingsSearch() {
|
|
||||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
|
||||||
return branch && (/\/master$/.test(branch) || branch.indexOf('/release/') >= 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSettingsSearchBuildId(packageJson) {
|
|
||||||
try {
|
|
||||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
|
||||||
const branchId = branch.indexOf('/release/') >= 0 ? 0 :
|
|
||||||
/\/master$/.test(branch) ? 1 :
|
|
||||||
2; // Some unexpected branch
|
|
||||||
|
|
||||||
const out = cp.execSync(`git rev-list HEAD --count`);
|
|
||||||
const count = parseInt(out.toString());
|
|
||||||
|
|
||||||
// <version number><commit count><branchId (avoid unlikely conflicts)>
|
|
||||||
// 1.25.1, 1,234,567 commits, master = 1250112345671
|
|
||||||
return util.versionStringToNumber(packageJson.version) * 1e8 + count * 10 + branchId;
|
|
||||||
} catch (e) {
|
|
||||||
throw new Error('Could not determine build number: ' + e.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// This task is only run for the MacOS build
|
// This task is only run for the MacOS build
|
||||||
gulp.task('generate-vscode-configuration', () => {
|
const generateVSCodeConfigurationTask = task.define('generate-vscode-configuration', () => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const buildDir = process.env['AGENT_BUILDDIRECTORY'];
|
const buildDir = process.env['AGENT_BUILDDIRECTORY'];
|
||||||
if (!buildDir) {
|
if (!buildDir) {
|
||||||
@@ -668,6 +598,61 @@ gulp.task('generate-vscode-configuration', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
|
||||||
|
gulp.task(task.define(
|
||||||
|
'upload-vscode-configuration',
|
||||||
|
task.series(
|
||||||
|
generateVSCodeConfigurationTask,
|
||||||
|
() => {
|
||||||
|
if (!shouldSetupSettingsSearch()) {
|
||||||
|
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||||
|
console.log(`Only runs on master and release branches, not ${branch}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fs.existsSync(allConfigDetailsPath)) {
|
||||||
|
throw new Error(`configuration file at ${allConfigDetailsPath} does not exist`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const settingsSearchBuildId = getSettingsSearchBuildId(packageJson);
|
||||||
|
if (!settingsSearchBuildId) {
|
||||||
|
throw new Error('Failed to compute build number');
|
||||||
|
}
|
||||||
|
|
||||||
|
return gulp.src(allConfigDetailsPath)
|
||||||
|
.pipe(azure.upload({
|
||||||
|
account: process.env.AZURE_STORAGE_ACCOUNT,
|
||||||
|
key: process.env.AZURE_STORAGE_ACCESS_KEY,
|
||||||
|
container: 'configuration',
|
||||||
|
prefix: `${settingsSearchBuildId}/${commit}/`
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
function shouldSetupSettingsSearch() {
|
||||||
|
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||||
|
return branch && (/\/master$/.test(branch) || branch.indexOf('/release/') >= 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSettingsSearchBuildId(packageJson) {
|
||||||
|
try {
|
||||||
|
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||||
|
const branchId = branch.indexOf('/release/') >= 0 ? 0 :
|
||||||
|
/\/master$/.test(branch) ? 1 :
|
||||||
|
2; // Some unexpected branch
|
||||||
|
|
||||||
|
const out = cp.execSync(`git rev-list HEAD --count`);
|
||||||
|
const count = parseInt(out.toString());
|
||||||
|
|
||||||
|
// <version number><commit count><branchId (avoid unlikely conflicts)>
|
||||||
|
// 1.25.1, 1,234,567 commits, master = 1250112345671
|
||||||
|
return util.versionStringToNumber(packageJson.version) * 1e8 + count * 10 + branchId;
|
||||||
|
} catch (e) {
|
||||||
|
throw new Error('Could not determine build number: ' + e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
// Install service locally before building carbon
|
// Install service locally before building carbon
|
||||||
|
|
||||||
@@ -692,3 +677,26 @@ function installService() {
|
|||||||
gulp.task('install-sqltoolsservice', () => {
|
gulp.task('install-sqltoolsservice', () => {
|
||||||
return installService();
|
return installService();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function installSsmsMin() {
|
||||||
|
const config = require('../extensions/admin-tool-ext-win/src/config.json');
|
||||||
|
return platformInfo.getCurrent().then(p => {
|
||||||
|
const runtime = p.runtimeId;
|
||||||
|
// fix path since it won't be correct
|
||||||
|
config.installDirectory = path.join(__dirname, '..', 'extensions', 'admin-tool-ext-win', config.installDirectory);
|
||||||
|
var installer = new serviceDownloader(config);
|
||||||
|
const serviceInstallFolder = installer.getInstallDirectory(runtime);
|
||||||
|
const serviceCleanupFolder = path.join(serviceInstallFolder, '..');
|
||||||
|
console.log('Cleaning up the install folder: ' + serviceCleanupFolder);
|
||||||
|
return del(serviceCleanupFolder + '/*').then(() => {
|
||||||
|
console.log('Installing the service. Install folder: ' + serviceInstallFolder);
|
||||||
|
return installer.installService(runtime);
|
||||||
|
}, delError => {
|
||||||
|
console.log('failed to delete the install folder error: ' + delError);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
gulp.task('install-ssmsmin', () => {
|
||||||
|
return installSsmsMin();
|
||||||
|
});
|
||||||
|
|||||||
@@ -12,9 +12,13 @@ const shell = require('gulp-shell');
|
|||||||
const es = require('event-stream');
|
const es = require('event-stream');
|
||||||
const vfs = require('vinyl-fs');
|
const vfs = require('vinyl-fs');
|
||||||
const util = require('./lib/util');
|
const util = require('./lib/util');
|
||||||
|
const task = require('./lib/task');
|
||||||
const packageJson = require('../package.json');
|
const packageJson = require('../package.json');
|
||||||
const product = require('../product.json');
|
const product = require('../product.json');
|
||||||
const rpmDependencies = require('../resources/linux/rpm/dependencies.json');
|
const rpmDependencies = require('../resources/linux/rpm/dependencies.json');
|
||||||
|
const path = require('path');
|
||||||
|
const root = path.dirname(__dirname);
|
||||||
|
const commit = util.getVersion(root);
|
||||||
|
|
||||||
const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
|
const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
|
||||||
|
|
||||||
@@ -23,7 +27,7 @@ function getDebPackageArch(arch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function prepareDebPackage(arch) {
|
function prepareDebPackage(arch) {
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
const binaryDir = '../azuredatastudio-linux-' + arch;
|
const binaryDir = '../azuredatastudio-linux-' + arch;
|
||||||
const debArch = getDebPackageArch(arch);
|
const debArch = getDebPackageArch(arch);
|
||||||
const destination = '.build/linux/deb/' + debArch + '/' + product.applicationName + '-' + debArch;
|
const destination = '.build/linux/deb/' + debArch + '/' + product.applicationName + '-' + debArch;
|
||||||
@@ -39,7 +43,7 @@ function prepareDebPackage(arch) {
|
|||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(replace('@@ICON@@', product.applicationName))
|
.pipe(replace('@@ICON@@', product.linuxIconName))
|
||||||
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
||||||
|
|
||||||
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
||||||
@@ -49,7 +53,13 @@ function prepareDebPackage(arch) {
|
|||||||
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
|
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
|
||||||
|
|
||||||
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
||||||
.pipe(rename('usr/share/pixmaps/' + product.applicationName + '.png'));
|
.pipe(rename('usr/share/pixmaps/' + product.linuxIconName + '.png'));
|
||||||
|
|
||||||
|
// const bash_completion = gulp.src('resources/completions/bash/code')
|
||||||
|
// .pipe(rename('usr/share/bash-completion/completions/code'));
|
||||||
|
|
||||||
|
// const zsh_completion = gulp.src('resources/completions/zsh/_code')
|
||||||
|
// .pipe(rename('usr/share/zsh/vendor-completions/_code'));
|
||||||
|
|
||||||
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
||||||
.pipe(rename(function (p) { p.dirname = 'usr/share/' + product.applicationName + '/' + p.dirname; }));
|
.pipe(rename(function (p) { p.dirname = 'usr/share/' + product.applicationName + '/' + p.dirname; }));
|
||||||
@@ -85,7 +95,7 @@ function prepareDebPackage(arch) {
|
|||||||
.pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@'))
|
.pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@'))
|
||||||
.pipe(rename('DEBIAN/postinst'));
|
.pipe(rename('DEBIAN/postinst'));
|
||||||
|
|
||||||
const all = es.merge(control, postinst, postrm, prerm, desktops, appdata, icon, code);
|
const all = es.merge(control, postinst, postrm, prerm, desktops, appdata, icon, /* bash_completion, zsh_completion, */ code);
|
||||||
|
|
||||||
return all.pipe(vfs.dest(destination));
|
return all.pipe(vfs.dest(destination));
|
||||||
};
|
};
|
||||||
@@ -124,7 +134,7 @@ function prepareRpmPackage(arch) {
|
|||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(replace('@@ICON@@', product.applicationName))
|
.pipe(replace('@@ICON@@', product.linuxIconName))
|
||||||
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
||||||
|
|
||||||
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
||||||
@@ -134,7 +144,13 @@ function prepareRpmPackage(arch) {
|
|||||||
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
|
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
|
||||||
|
|
||||||
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
||||||
.pipe(rename('BUILD/usr/share/pixmaps/' + product.applicationName + '.png'));
|
.pipe(rename('BUILD/usr/share/pixmaps/' + product.linuxIconName + '.png'));
|
||||||
|
|
||||||
|
// const bash_completion = gulp.src('resources/completions/bash/code')
|
||||||
|
// .pipe(rename('BUILD/usr/share/bash-completion/completions/code'));
|
||||||
|
|
||||||
|
// const zsh_completion = gulp.src('resources/completions/zsh/_code')
|
||||||
|
// .pipe(rename('BUILD/usr/share/zsh/site-functions/_code'));
|
||||||
|
|
||||||
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
||||||
.pipe(rename(function (p) { p.dirname = 'BUILD/usr/share/' + product.applicationName + '/' + p.dirname; }));
|
.pipe(rename(function (p) { p.dirname = 'BUILD/usr/share/' + product.applicationName + '/' + p.dirname; }));
|
||||||
@@ -142,6 +158,7 @@ function prepareRpmPackage(arch) {
|
|||||||
const spec = gulp.src('resources/linux/rpm/code.spec.template', { base: '.' })
|
const spec = gulp.src('resources/linux/rpm/code.spec.template', { base: '.' })
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||||
|
.pipe(replace('@@ICON@@', product.linuxIconName))
|
||||||
.pipe(replace('@@VERSION@@', packageJson.version))
|
.pipe(replace('@@VERSION@@', packageJson.version))
|
||||||
.pipe(replace('@@RELEASE@@', linuxPackageRevision))
|
.pipe(replace('@@RELEASE@@', linuxPackageRevision))
|
||||||
.pipe(replace('@@ARCHITECTURE@@', rpmArch))
|
.pipe(replace('@@ARCHITECTURE@@', rpmArch))
|
||||||
@@ -156,7 +173,7 @@ function prepareRpmPackage(arch) {
|
|||||||
const specIcon = gulp.src('resources/linux/rpm/code.xpm', { base: '.' })
|
const specIcon = gulp.src('resources/linux/rpm/code.xpm', { base: '.' })
|
||||||
.pipe(rename('SOURCES/' + product.applicationName + '.xpm'));
|
.pipe(rename('SOURCES/' + product.applicationName + '.xpm'));
|
||||||
|
|
||||||
const all = es.merge(code, desktops, appdata, icon, spec, specIcon);
|
const all = es.merge(code, desktops, appdata, icon, /* bash_completion, zsh_completion, */ spec, specIcon);
|
||||||
|
|
||||||
return all.pipe(vfs.dest(getRpmBuildPath(rpmArch)));
|
return all.pipe(vfs.dest(getRpmBuildPath(rpmArch)));
|
||||||
};
|
};
|
||||||
@@ -180,36 +197,39 @@ function getSnapBuildPath(arch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function prepareSnapPackage(arch) {
|
function prepareSnapPackage(arch) {
|
||||||
const binaryDir = '../VSCode-linux-' + arch;
|
// {{SQL CARBON EDIT}}
|
||||||
|
const binaryDir = '../azuredatastudio-linux-' + arch;
|
||||||
const destination = getSnapBuildPath(arch);
|
const destination = getSnapBuildPath(arch);
|
||||||
|
|
||||||
return function () {
|
return function () {
|
||||||
const desktop = gulp.src('resources/linux/code.desktop', { base: '.' })
|
const desktop = gulp.src('resources/linux/code.desktop', { base: '.' })
|
||||||
|
.pipe(rename(`usr/share/applications/${product.applicationName}.desktop`));
|
||||||
|
|
||||||
|
const desktopUrlHandler = gulp.src('resources/linux/code-url-handler.desktop', { base: '.' })
|
||||||
|
.pipe(rename(`usr/share/applications/${product.applicationName}-url-handler.desktop`));
|
||||||
|
|
||||||
|
const desktops = es.merge(desktop, desktopUrlHandler)
|
||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.applicationName}.png`))
|
.pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.linuxIconName}.png`))
|
||||||
.pipe(rename(`usr/share/applications/${product.applicationName}.desktop`));
|
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
||||||
|
|
||||||
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
||||||
.pipe(rename(`usr/share/pixmaps/${product.applicationName}.png`));
|
.pipe(rename(`usr/share/pixmaps/${product.linuxIconName}.png`));
|
||||||
|
|
||||||
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
||||||
.pipe(rename(function (p) { p.dirname = `usr/share/${product.applicationName}/${p.dirname}`; }));
|
.pipe(rename(function (p) { p.dirname = `usr/share/${product.applicationName}/${p.dirname}`; }));
|
||||||
|
|
||||||
const snapcraft = gulp.src('resources/linux/snap/snapcraft.yaml', { base: '.' })
|
const snapcraft = gulp.src('resources/linux/snap/snapcraft.yaml', { base: '.' })
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(replace('@@VERSION@@', `${packageJson.version}-${linuxPackageRevision}`))
|
.pipe(replace('@@VERSION@@', commit.substr(0, 8)))
|
||||||
.pipe(rename('snap/snapcraft.yaml'));
|
.pipe(rename('snap/snapcraft.yaml'));
|
||||||
|
|
||||||
const snapUpdate = gulp.src('resources/linux/snap/snapUpdate.sh', { base: '.' })
|
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
|
||||||
.pipe(rename(`usr/share/${product.applicationName}/snapUpdate.sh`));
|
|
||||||
|
|
||||||
const electronLaunch = gulp.src('resources/linux/snap/electron-launch', { base: '.' })
|
const electronLaunch = gulp.src('resources/linux/snap/electron-launch', { base: '.' })
|
||||||
.pipe(rename('electron-launch'));
|
.pipe(rename('electron-launch'));
|
||||||
|
|
||||||
const all = es.merge(desktop, icon, code, snapcraft, electronLaunch, snapUpdate);
|
const all = es.merge(desktops, icon, code, snapcraft, electronLaunch);
|
||||||
|
|
||||||
return all.pipe(vfs.dest(destination));
|
return all.pipe(vfs.dest(destination));
|
||||||
};
|
};
|
||||||
@@ -220,116 +240,36 @@ function buildSnapPackage(arch) {
|
|||||||
return shell.task(`cd ${snapBuildPath} && snapcraft build`);
|
return shell.task(`cd ${snapBuildPath} && snapcraft build`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFlatpakArch(arch) {
|
const BUILD_TARGETS = [
|
||||||
return { x64: 'x86_64', ia32: 'i386', arm: 'arm' }[arch];
|
{ arch: 'ia32' },
|
||||||
}
|
{ arch: 'x64' },
|
||||||
|
{ arch: 'arm' },
|
||||||
|
{ arch: 'arm64' },
|
||||||
|
];
|
||||||
|
|
||||||
function prepareFlatpak(arch) {
|
BUILD_TARGETS.forEach((buildTarget) => {
|
||||||
// {{SQL CARBON EDIT}}
|
const arch = buildTarget.arch;
|
||||||
const binaryDir = '../azuredatastudio-linux-' + arch;
|
|
||||||
const flatpakArch = getFlatpakArch(arch);
|
|
||||||
const destination = '.build/linux/flatpak/' + flatpakArch;
|
|
||||||
|
|
||||||
return function () {
|
{
|
||||||
// This is not imported in the global scope to avoid requiring ImageMagick
|
const debArch = getDebPackageArch(arch);
|
||||||
// (or GraphicsMagick) when not building building Flatpak bundles.
|
const prepareDebTask = task.define(`vscode-linux-${arch}-prepare-deb`, task.series(util.rimraf(`.build/linux/deb/${debArch}`), prepareDebPackage(arch)));
|
||||||
const imgResize = require('gulp-image-resize');
|
// gulp.task(prepareDebTask);
|
||||||
|
const buildDebTask = task.define(`vscode-linux-${arch}-build-deb`, task.series(prepareDebTask, buildDebPackage(arch)));
|
||||||
const all = [16, 24, 32, 48, 64, 128, 192, 256, 512].map(function (size) {
|
gulp.task(buildDebTask);
|
||||||
return gulp.src('resources/linux/code.png', { base: '.' })
|
|
||||||
.pipe(imgResize({ width: size, height: size, format: "png", noProfile: true }))
|
|
||||||
.pipe(rename('share/icons/hicolor/' + size + 'x' + size + '/apps/' + flatpakManifest.appId + '.png'));
|
|
||||||
});
|
|
||||||
|
|
||||||
all.push(gulp.src('resources/linux/code.desktop', { base: '.' })
|
|
||||||
.pipe(replace('Exec=/usr/share/@@NAME@@/@@NAME@@', 'Exec=' + product.applicationName))
|
|
||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
|
||||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
|
||||||
.pipe(rename('share/applications/' + flatpakManifest.appId + '.desktop')));
|
|
||||||
|
|
||||||
all.push(gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
|
||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
|
||||||
.pipe(replace('@@NAME@@', flatpakManifest.appId))
|
|
||||||
.pipe(replace('@@LICENSE@@', product.licenseName))
|
|
||||||
.pipe(rename('share/appdata/' + flatpakManifest.appId + '.appdata.xml')));
|
|
||||||
|
|
||||||
all.push(gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
|
||||||
.pipe(rename(function (p) {
|
|
||||||
p.dirname = 'share/' + product.applicationName + '/' + p.dirname;
|
|
||||||
})));
|
|
||||||
|
|
||||||
return es.merge(all).pipe(vfs.dest(destination));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildFlatpak(arch) {
|
|
||||||
const flatpakArch = getFlatpakArch(arch);
|
|
||||||
const manifest = {};
|
|
||||||
for (var k in flatpakManifest) {
|
|
||||||
manifest[k] = flatpakManifest[k];
|
|
||||||
}
|
}
|
||||||
manifest.files = [
|
|
||||||
['.build/linux/flatpak/' + flatpakArch, '/'],
|
{
|
||||||
];
|
const rpmArch = getRpmPackageArch(arch);
|
||||||
const buildOptions = {
|
const prepareRpmTask = task.define(`vscode-linux-${arch}-prepare-rpm`, task.series(util.rimraf(`.build/linux/rpm/${rpmArch}`), prepareRpmPackage(arch)));
|
||||||
arch: flatpakArch,
|
// gulp.task(prepareRpmTask);
|
||||||
subject: product.nameLong + ' ' + packageJson.version + '.' + linuxPackageRevision,
|
const buildRpmTask = task.define(`vscode-linux-${arch}-build-rpm`, task.series(prepareRpmTask, buildRpmPackage(arch)));
|
||||||
};
|
gulp.task(buildRpmTask);
|
||||||
// If requested, use the configured path for the OSTree repository.
|
|
||||||
if (process.env.FLATPAK_REPO) {
|
|
||||||
buildOptions.repoDir = process.env.FLATPAK_REPO;
|
|
||||||
} else {
|
|
||||||
buildOptions.bundlePath = manifest.appId + '-' + flatpakArch + '.flatpak';
|
|
||||||
}
|
}
|
||||||
// Setup PGP signing if requested.
|
|
||||||
if (process.env.GPG_KEY_ID !== undefined) {
|
{
|
||||||
buildOptions.gpgSign = process.env.GPG_KEY_ID;
|
const prepareSnapTask = task.define(`vscode-linux-${arch}-prepare-snap`, task.series(util.rimraf(`.build/linux/snap/${arch}`), prepareSnapPackage(arch)));
|
||||||
if (process.env.GPG_HOMEDIR) {
|
gulp.task(prepareSnapTask);
|
||||||
buildOptions.gpgHomedir = process.env.GPG_HOME_DIR;
|
const buildSnapTask = task.define(`vscode-linux-${arch}-build-snap`, task.series(prepareSnapTask, buildSnapPackage(arch)));
|
||||||
}
|
gulp.task(buildSnapTask);
|
||||||
}
|
}
|
||||||
return function (cb) {
|
});
|
||||||
require('flatpak-bundler').bundle(manifest, buildOptions, cb);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
gulp.task('clean-vscode-linux-ia32-deb', util.rimraf('.build/linux/deb/i386'));
|
|
||||||
gulp.task('clean-vscode-linux-x64-deb', util.rimraf('.build/linux/deb/amd64'));
|
|
||||||
gulp.task('clean-vscode-linux-arm-deb', util.rimraf('.build/linux/deb/armhf'));
|
|
||||||
gulp.task('clean-vscode-linux-arm64-deb', util.rimraf('.build/linux/deb/arm64'));
|
|
||||||
gulp.task('clean-vscode-linux-ia32-rpm', util.rimraf('.build/linux/rpm/i386'));
|
|
||||||
gulp.task('clean-vscode-linux-x64-rpm', util.rimraf('.build/linux/rpm/x86_64'));
|
|
||||||
gulp.task('clean-vscode-linux-arm-rpm', util.rimraf('.build/linux/rpm/armhf'));
|
|
||||||
gulp.task('clean-vscode-linux-arm64-rpm', util.rimraf('.build/linux/rpm/arm64'));
|
|
||||||
gulp.task('clean-vscode-linux-ia32-snap', util.rimraf('.build/linux/snap/x64'));
|
|
||||||
gulp.task('clean-vscode-linux-x64-snap', util.rimraf('.build/linux/snap/x64'));
|
|
||||||
gulp.task('clean-vscode-linux-arm-snap', util.rimraf('.build/linux/snap/x64'));
|
|
||||||
gulp.task('clean-vscode-linux-arm64-snap', util.rimraf('.build/linux/snap/x64'));
|
|
||||||
|
|
||||||
gulp.task('vscode-linux-ia32-prepare-deb', ['clean-vscode-linux-ia32-deb'], prepareDebPackage('ia32'));
|
|
||||||
gulp.task('vscode-linux-x64-prepare-deb', ['clean-vscode-linux-x64-deb'], prepareDebPackage('x64'));
|
|
||||||
gulp.task('vscode-linux-arm-prepare-deb', ['clean-vscode-linux-arm-deb'], prepareDebPackage('arm'));
|
|
||||||
gulp.task('vscode-linux-arm64-prepare-deb', ['clean-vscode-linux-arm64-deb'], prepareDebPackage('arm64'));
|
|
||||||
gulp.task('vscode-linux-ia32-build-deb', ['vscode-linux-ia32-prepare-deb'], buildDebPackage('ia32'));
|
|
||||||
gulp.task('vscode-linux-x64-build-deb', ['vscode-linux-x64-prepare-deb'], buildDebPackage('x64'));
|
|
||||||
gulp.task('vscode-linux-arm-build-deb', ['vscode-linux-arm-prepare-deb'], buildDebPackage('arm'));
|
|
||||||
gulp.task('vscode-linux-arm64-build-deb', ['vscode-linux-arm64-prepare-deb'], buildDebPackage('arm64'));
|
|
||||||
|
|
||||||
gulp.task('vscode-linux-ia32-prepare-rpm', ['clean-vscode-linux-ia32-rpm'], prepareRpmPackage('ia32'));
|
|
||||||
gulp.task('vscode-linux-x64-prepare-rpm', ['clean-vscode-linux-x64-rpm'], prepareRpmPackage('x64'));
|
|
||||||
gulp.task('vscode-linux-arm-prepare-rpm', ['clean-vscode-linux-arm-rpm'], prepareRpmPackage('arm'));
|
|
||||||
gulp.task('vscode-linux-arm64-prepare-rpm', ['clean-vscode-linux-arm64-rpm'], prepareRpmPackage('arm64'));
|
|
||||||
gulp.task('vscode-linux-ia32-build-rpm', ['vscode-linux-ia32-prepare-rpm'], buildRpmPackage('ia32'));
|
|
||||||
gulp.task('vscode-linux-x64-build-rpm', ['vscode-linux-x64-prepare-rpm'], buildRpmPackage('x64'));
|
|
||||||
gulp.task('vscode-linux-arm-build-rpm', ['vscode-linux-arm-prepare-rpm'], buildRpmPackage('arm'));
|
|
||||||
gulp.task('vscode-linux-arm64-build-rpm', ['vscode-linux-arm64-prepare-rpm'], buildRpmPackage('arm64'));
|
|
||||||
|
|
||||||
gulp.task('vscode-linux-ia32-prepare-snap', ['clean-vscode-linux-ia32-snap'], prepareSnapPackage('ia32'));
|
|
||||||
gulp.task('vscode-linux-x64-prepare-snap', ['clean-vscode-linux-x64-snap'], prepareSnapPackage('x64'));
|
|
||||||
gulp.task('vscode-linux-arm-prepare-snap', ['clean-vscode-linux-arm-snap'], prepareSnapPackage('arm'));
|
|
||||||
gulp.task('vscode-linux-arm64-prepare-snap', ['clean-vscode-linux-arm64-snap'], prepareSnapPackage('arm64'));
|
|
||||||
gulp.task('vscode-linux-ia32-build-snap', ['vscode-linux-ia32-prepare-snap'], buildSnapPackage('ia32'));
|
|
||||||
gulp.task('vscode-linux-x64-build-snap', ['vscode-linux-x64-prepare-snap'], buildSnapPackage('x64'));
|
|
||||||
gulp.task('vscode-linux-arm-build-snap', ['vscode-linux-arm-prepare-snap'], buildSnapPackage('arm'));
|
|
||||||
gulp.task('vscode-linux-arm64-build-snap', ['vscode-linux-arm64-prepare-snap'], buildSnapPackage('arm64'));
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const assert = require('assert');
|
|||||||
const cp = require('child_process');
|
const cp = require('child_process');
|
||||||
const _7z = require('7zip')['7z'];
|
const _7z = require('7zip')['7z'];
|
||||||
const util = require('./lib/util');
|
const util = require('./lib/util');
|
||||||
|
const task = require('./lib/task');
|
||||||
const pkg = require('../package.json');
|
const pkg = require('../package.json');
|
||||||
const product = require('../product.json');
|
const product = require('../product.json');
|
||||||
const vfs = require('vinyl-fs');
|
const vfs = require('vinyl-fs');
|
||||||
@@ -26,7 +27,7 @@ const zipPath = arch => path.join(zipDir(arch), `VSCode-win32-${arch}.zip`);
|
|||||||
const setupDir = (arch, target) => path.join(repoPath, '.build', `win32-${arch}`, `${target}-setup`);
|
const setupDir = (arch, target) => path.join(repoPath, '.build', `win32-${arch}`, `${target}-setup`);
|
||||||
const issPath = path.join(__dirname, 'win32', 'code.iss');
|
const issPath = path.join(__dirname, 'win32', 'code.iss');
|
||||||
const innoSetupPath = path.join(path.dirname(path.dirname(require.resolve('innosetup-compiler'))), 'bin', 'ISCC.exe');
|
const innoSetupPath = path.join(path.dirname(path.dirname(require.resolve('innosetup-compiler'))), 'bin', 'ISCC.exe');
|
||||||
const signPS1 = path.join(repoPath, 'build', 'azure-pipelines', 'win32', 'sign.ps1');
|
// const signPS1 = path.join(repoPath, 'build', 'azure-pipelines', 'win32', 'sign.ps1');
|
||||||
|
|
||||||
function packageInnoSetup(iss, options, cb) {
|
function packageInnoSetup(iss, options, cb) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
@@ -107,8 +108,8 @@ function buildWin32Setup(arch, target) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function defineWin32SetupTasks(arch, target) {
|
function defineWin32SetupTasks(arch, target) {
|
||||||
gulp.task(`clean-vscode-win32-${arch}-${target}-setup`, util.rimraf(setupDir(arch, target)));
|
const cleanTask = util.rimraf(setupDir(arch, target));
|
||||||
gulp.task(`vscode-win32-${arch}-${target}-setup`, [`clean-vscode-win32-${arch}-${target}-setup`], buildWin32Setup(arch, target));
|
gulp.task(task.define(`vscode-win32-${arch}-${target}-setup`, task.series(cleanTask, buildWin32Setup(arch, target))));
|
||||||
}
|
}
|
||||||
|
|
||||||
defineWin32SetupTasks('ia32', 'system');
|
defineWin32SetupTasks('ia32', 'system');
|
||||||
@@ -126,11 +127,8 @@ function archiveWin32Setup(arch) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('clean-vscode-win32-ia32-archive', util.rimraf(zipDir('ia32')));
|
gulp.task(task.define('vscode-win32-ia32-archive', task.series(util.rimraf(zipDir('ia32')), archiveWin32Setup('ia32'))));
|
||||||
gulp.task('vscode-win32-ia32-archive', ['clean-vscode-win32-ia32-archive'], archiveWin32Setup('ia32'));
|
gulp.task(task.define('vscode-win32-x64-archive', task.series(util.rimraf(zipDir('x64')), archiveWin32Setup('x64'))));
|
||||||
|
|
||||||
gulp.task('clean-vscode-win32-x64-archive', util.rimraf(zipDir('x64')));
|
|
||||||
gulp.task('vscode-win32-x64-archive', ['clean-vscode-win32-x64-archive'], archiveWin32Setup('x64'));
|
|
||||||
|
|
||||||
function copyInnoUpdater(arch) {
|
function copyInnoUpdater(arch) {
|
||||||
return () => {
|
return () => {
|
||||||
@@ -139,9 +137,6 @@ function copyInnoUpdater(arch) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('vscode-win32-ia32-copy-inno-updater', copyInnoUpdater('ia32'));
|
|
||||||
gulp.task('vscode-win32-x64-copy-inno-updater', copyInnoUpdater('x64'));
|
|
||||||
|
|
||||||
function patchInnoUpdater(arch) {
|
function patchInnoUpdater(arch) {
|
||||||
return cb => {
|
return cb => {
|
||||||
const icon = path.join(repoPath, 'resources', 'win32', 'code.ico');
|
const icon = path.join(repoPath, 'resources', 'win32', 'code.ico');
|
||||||
@@ -149,5 +144,5 @@ function patchInnoUpdater(arch) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('vscode-win32-ia32-inno-updater', ['vscode-win32-ia32-copy-inno-updater'], patchInnoUpdater('ia32'));
|
gulp.task(task.define('vscode-win32-ia32-inno-updater', task.series(copyInnoUpdater('ia32'), patchInnoUpdater('ia32'))));
|
||||||
gulp.task('vscode-win32-x64-inno-updater', ['vscode-win32-x64-copy-inno-updater'], patchInnoUpdater('x64'));
|
gulp.task(task.define('vscode-win32-x64-inno-updater', task.series(copyInnoUpdater('x64'), patchInnoUpdater('x64'))));
|
||||||
@@ -14,7 +14,8 @@ const es = require('event-stream');
|
|||||||
const rename = require('gulp-rename');
|
const rename = require('gulp-rename');
|
||||||
const vfs = require('vinyl-fs');
|
const vfs = require('vinyl-fs');
|
||||||
const ext = require('./extensions');
|
const ext = require('./extensions');
|
||||||
const util = require('gulp-util');
|
const fancyLog = require('fancy-log');
|
||||||
|
const ansiColors = require('ansi-colors');
|
||||||
|
|
||||||
const root = path.dirname(path.dirname(__dirname));
|
const root = path.dirname(path.dirname(__dirname));
|
||||||
const builtInExtensions = require('../builtInExtensions.json');
|
const builtInExtensions = require('../builtInExtensions.json');
|
||||||
@@ -43,7 +44,7 @@ function isUpToDate(extension) {
|
|||||||
|
|
||||||
function syncMarketplaceExtension(extension) {
|
function syncMarketplaceExtension(extension) {
|
||||||
if (isUpToDate(extension)) {
|
if (isUpToDate(extension)) {
|
||||||
util.log(util.colors.blue('[marketplace]'), `${extension.name}@${extension.version}`, util.colors.green('✔︎'));
|
fancyLog(ansiColors.blue('[marketplace]'), `${extension.name}@${extension.version}`, ansiColors.green('✔︎'));
|
||||||
return es.readArray([]);
|
return es.readArray([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,13 +53,13 @@ function syncMarketplaceExtension(extension) {
|
|||||||
return ext.fromMarketplace(extension.name, extension.version, extension.metadata)
|
return ext.fromMarketplace(extension.name, extension.version, extension.metadata)
|
||||||
.pipe(rename(p => p.dirname = `${extension.name}/${p.dirname}`))
|
.pipe(rename(p => p.dirname = `${extension.name}/${p.dirname}`))
|
||||||
.pipe(vfs.dest('.build/builtInExtensions'))
|
.pipe(vfs.dest('.build/builtInExtensions'))
|
||||||
.on('end', () => util.log(util.colors.blue('[marketplace]'), extension.name, util.colors.green('✔︎')));
|
.on('end', () => fancyLog(ansiColors.blue('[marketplace]'), extension.name, ansiColors.green('✔︎')));
|
||||||
}
|
}
|
||||||
|
|
||||||
function syncExtension(extension, controlState) {
|
function syncExtension(extension, controlState) {
|
||||||
switch (controlState) {
|
switch (controlState) {
|
||||||
case 'disabled':
|
case 'disabled':
|
||||||
util.log(util.colors.blue('[disabled]'), util.colors.gray(extension.name));
|
fancyLog(ansiColors.blue('[disabled]'), ansiColors.gray(extension.name));
|
||||||
return es.readArray([]);
|
return es.readArray([]);
|
||||||
|
|
||||||
case 'marketplace':
|
case 'marketplace':
|
||||||
@@ -66,15 +67,15 @@ function syncExtension(extension, controlState) {
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
if (!fs.existsSync(controlState)) {
|
if (!fs.existsSync(controlState)) {
|
||||||
util.log(util.colors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but that path does not exist.`));
|
fancyLog(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but that path does not exist.`));
|
||||||
return es.readArray([]);
|
return es.readArray([]);
|
||||||
|
|
||||||
} else if (!fs.existsSync(path.join(controlState, 'package.json'))) {
|
} else if (!fs.existsSync(path.join(controlState, 'package.json'))) {
|
||||||
util.log(util.colors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but there is no 'package.json' file in that directory.`));
|
fancyLog(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but there is no 'package.json' file in that directory.`));
|
||||||
return es.readArray([]);
|
return es.readArray([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
util.log(util.colors.blue('[local]'), `${extension.name}: ${util.colors.cyan(controlState)}`, util.colors.green('✔︎'));
|
fancyLog(ansiColors.blue('[local]'), `${extension.name}: ${ansiColors.cyan(controlState)}`, ansiColors.green('✔︎'));
|
||||||
return es.readArray([]);
|
return es.readArray([]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -93,8 +94,8 @@ function writeControlFile(control) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
util.log('Syncronizing built-in extensions...');
|
fancyLog('Syncronizing built-in extensions...');
|
||||||
util.log(`You can manage built-in extensions with the ${util.colors.cyan('--builtin')} flag`);
|
fancyLog(`You can manage built-in extensions with the ${ansiColors.cyan('--builtin')} flag`);
|
||||||
|
|
||||||
const control = readControlFile();
|
const control = readControlFile();
|
||||||
const streams = [];
|
const streams = [];
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ const monacodts = require("../monaco/api");
|
|||||||
const nls = require("./nls");
|
const nls = require("./nls");
|
||||||
const reporter_1 = require("./reporter");
|
const reporter_1 = require("./reporter");
|
||||||
const util = require("./util");
|
const util = require("./util");
|
||||||
const util2 = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const watch = require('./watch');
|
const watch = require('./watch');
|
||||||
const reporter = reporter_1.createReporter();
|
const reporter = reporter_1.createReporter();
|
||||||
function getTypeScriptCompilerOptions(src) {
|
function getTypeScriptCompilerOptions(src) {
|
||||||
@@ -126,6 +127,20 @@ class MonacoGenerator {
|
|||||||
this._declarationResolver.invalidateCache(moduleId);
|
this._declarationResolver.invalidateCache(moduleId);
|
||||||
this._executeSoon();
|
this._executeSoon();
|
||||||
});
|
});
|
||||||
|
watcher.addListener('error', (err) => {
|
||||||
|
console.error(`Encountered error while watching ${filePath}.`);
|
||||||
|
console.log(err);
|
||||||
|
delete this._watchedFiles[filePath];
|
||||||
|
for (let i = 0; i < this._watchers.length; i++) {
|
||||||
|
if (this._watchers[i] === watcher) {
|
||||||
|
this._watchers.splice(i, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
watcher.close();
|
||||||
|
this._declarationResolver.invalidateCache(moduleId);
|
||||||
|
this._executeSoon();
|
||||||
|
});
|
||||||
this._watchers.push(watcher);
|
this._watchers.push(watcher);
|
||||||
};
|
};
|
||||||
this._fsProvider = new class extends monacodts.FSProvider {
|
this._fsProvider = new class extends monacodts.FSProvider {
|
||||||
@@ -165,7 +180,7 @@ class MonacoGenerator {
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
_log(message, ...rest) {
|
_log(message, ...rest) {
|
||||||
util2.log(util2.colors.cyan('[monaco.d.ts]'), message, ...rest);
|
fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest);
|
||||||
}
|
}
|
||||||
execute() {
|
execute() {
|
||||||
const startTime = Date.now();
|
const startTime = Date.now();
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ import * as monacodts from '../monaco/api';
|
|||||||
import * as nls from './nls';
|
import * as nls from './nls';
|
||||||
import { createReporter } from './reporter';
|
import { createReporter } from './reporter';
|
||||||
import * as util from './util';
|
import * as util from './util';
|
||||||
import * as util2 from 'gulp-util';
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
|
|
||||||
const watch = require('./watch');
|
const watch = require('./watch');
|
||||||
|
|
||||||
const reporter = createReporter();
|
const reporter = createReporter();
|
||||||
@@ -159,6 +161,20 @@ class MonacoGenerator {
|
|||||||
this._declarationResolver.invalidateCache(moduleId);
|
this._declarationResolver.invalidateCache(moduleId);
|
||||||
this._executeSoon();
|
this._executeSoon();
|
||||||
});
|
});
|
||||||
|
watcher.addListener('error', (err) => {
|
||||||
|
console.error(`Encountered error while watching ${filePath}.`);
|
||||||
|
console.log(err);
|
||||||
|
delete this._watchedFiles[filePath];
|
||||||
|
for (let i = 0; i < this._watchers.length; i++) {
|
||||||
|
if (this._watchers[i] === watcher) {
|
||||||
|
this._watchers.splice(i, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
watcher.close();
|
||||||
|
this._declarationResolver.invalidateCache(moduleId);
|
||||||
|
this._executeSoon();
|
||||||
|
});
|
||||||
this._watchers.push(watcher);
|
this._watchers.push(watcher);
|
||||||
};
|
};
|
||||||
this._fsProvider = new class extends monacodts.FSProvider {
|
this._fsProvider = new class extends monacodts.FSProvider {
|
||||||
@@ -204,7 +220,7 @@ class MonacoGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _log(message: any, ...rest: any[]): void {
|
private _log(message: any, ...rest: any[]): void {
|
||||||
util2.log(util2.colors.cyan('[monaco.d.ts]'), message, ...rest);
|
fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest);
|
||||||
}
|
}
|
||||||
|
|
||||||
public execute(): void {
|
public execute(): void {
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ const remote = require("gulp-remote-src");
|
|||||||
const vzip = require('gulp-vinyl-zip');
|
const vzip = require('gulp-vinyl-zip');
|
||||||
const filter = require("gulp-filter");
|
const filter = require("gulp-filter");
|
||||||
const rename = require("gulp-rename");
|
const rename = require("gulp-rename");
|
||||||
const util = require('gulp-util');
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const buffer = require('gulp-buffer');
|
const buffer = require('gulp-buffer');
|
||||||
const json = require("gulp-json-editor");
|
const json = require("gulp-json-editor");
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
@@ -39,8 +40,19 @@ function packageBuiltInExtensions() {
|
|||||||
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
||||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) >= 0);
|
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) >= 0);
|
||||||
|
const visxDirectory = path.join(path.dirname(root), 'vsix');
|
||||||
|
try {
|
||||||
|
if (!fs.existsSync(visxDirectory)) {
|
||||||
|
fs.mkdirSync(visxDirectory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
// don't fail the build if the output directory already exists
|
||||||
|
console.warn(err);
|
||||||
|
}
|
||||||
sqlBuiltInLocalExtensionDescriptions.forEach(element => {
|
sqlBuiltInLocalExtensionDescriptions.forEach(element => {
|
||||||
const packagePath = path.join(path.dirname(root), element.name + '.vsix');
|
let pkgJson = JSON.parse(fs.readFileSync(path.join(element.path, 'package.json'), { encoding: 'utf8' }));
|
||||||
|
const packagePath = path.join(visxDirectory, `${pkgJson.name}-${pkgJson.version}.vsix`);
|
||||||
console.info('Creating vsix for ' + element.path + ' result:' + packagePath);
|
console.info('Creating vsix for ' + element.path + ' result:' + packagePath);
|
||||||
vsce.createVSIX({
|
vsce.createVSIX({
|
||||||
cwd: element.path,
|
cwd: element.path,
|
||||||
@@ -136,7 +148,7 @@ function fromLocalWebpack(extensionPath, sourceMappingURLBase) {
|
|||||||
.pipe(packageJsonFilter.restore);
|
.pipe(packageJsonFilter.restore);
|
||||||
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
|
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
|
||||||
const webpackDone = (err, stats) => {
|
const webpackDone = (err, stats) => {
|
||||||
util.log(`Bundled extension: ${util.colors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
||||||
if (err) {
|
if (err) {
|
||||||
result.emit('error', err);
|
result.emit('error', err);
|
||||||
}
|
}
|
||||||
@@ -214,7 +226,7 @@ const baseHeaders = {
|
|||||||
function fromMarketplace(extensionName, version, metadata) {
|
function fromMarketplace(extensionName, version, metadata) {
|
||||||
const [publisher, name] = extensionName.split('.');
|
const [publisher, name] = extensionName.split('.');
|
||||||
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
|
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
|
||||||
util.log('Downloading extension:', util.colors.yellow(`${extensionName}@${version}`), '...');
|
fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...');
|
||||||
const options = {
|
const options = {
|
||||||
base: url,
|
base: url,
|
||||||
requestOptions: {
|
requestOptions: {
|
||||||
@@ -236,6 +248,7 @@ exports.fromMarketplace = fromMarketplace;
|
|||||||
const excludedExtensions = [
|
const excludedExtensions = [
|
||||||
'vscode-api-tests',
|
'vscode-api-tests',
|
||||||
'vscode-colorize-tests',
|
'vscode-colorize-tests',
|
||||||
|
'vscode-test-resolver',
|
||||||
'ms-vscode.node-debug',
|
'ms-vscode.node-debug',
|
||||||
'ms-vscode.node-debug2',
|
'ms-vscode.node-debug2',
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
@@ -245,14 +258,17 @@ const excludedExtensions = [
|
|||||||
const sqlBuiltInExtensions = [
|
const sqlBuiltInExtensions = [
|
||||||
// Add SQL built-in extensions here.
|
// Add SQL built-in extensions here.
|
||||||
// the extension will be excluded from SQLOps package and will have separate vsix packages
|
// the extension will be excluded from SQLOps package and will have separate vsix packages
|
||||||
|
'admin-tool-ext-win',
|
||||||
'agent',
|
'agent',
|
||||||
'import',
|
'import',
|
||||||
'profiler',
|
'profiler',
|
||||||
'admin-pack',
|
'admin-pack',
|
||||||
'big-data-cluster',
|
'big-data-cluster',
|
||||||
'dacpac'
|
'dacpac',
|
||||||
|
'schema-compare',
|
||||||
|
'resource-deployment',
|
||||||
|
'cms'
|
||||||
];
|
];
|
||||||
var azureExtensions = ['azurecore', 'mssql'];
|
|
||||||
const builtInExtensions = require('../builtInExtensions.json');
|
const builtInExtensions = require('../builtInExtensions.json');
|
||||||
/**
|
/**
|
||||||
* We're doing way too much stuff at once, with webpack et al. So much stuff
|
* We're doing way too much stuff at once, with webpack et al. So much stuff
|
||||||
@@ -288,8 +304,7 @@ function packageExtensionsStream(optsIn) {
|
|||||||
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
|
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
|
||||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1)
|
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1);
|
||||||
.filter(({ name }) => azureExtensions.indexOf(name) === -1);
|
|
||||||
const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => {
|
const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => {
|
||||||
return fromLocal(extension.path, opts.sourceMappingURLBase)
|
return fromLocal(extension.path, opts.sourceMappingURLBase)
|
||||||
.pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
|
.pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
|
||||||
@@ -299,9 +314,7 @@ function packageExtensionsStream(optsIn) {
|
|||||||
..._.flatten(extensionsProductionDependencies.map((d) => path.relative(root, d.path)).map((d) => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
|
..._.flatten(extensionsProductionDependencies.map((d) => path.relative(root, d.path)).map((d) => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
|
||||||
];
|
];
|
||||||
const localExtensionDependencies = () => gulp.src(extensionDepsSrc, { base: '.', dot: true })
|
const localExtensionDependencies = () => gulp.src(extensionDepsSrc, { base: '.', dot: true })
|
||||||
.pipe(filter(['**', '!**/package-lock.json']))
|
.pipe(filter(['**', '!**/package-lock.json']));
|
||||||
.pipe(util2.cleanNodeModule('account-provider-azure', ['node_modules/date-utils/doc/**', 'node_modules/adal_node/node_modules/**'], undefined))
|
|
||||||
.pipe(util2.cleanNodeModule('typescript', ['**/**'], undefined));
|
|
||||||
// Original code commented out here
|
// Original code commented out here
|
||||||
// const localExtensionDependencies = () => gulp.src('extensions/node_modules/**', { base: '.' });
|
// const localExtensionDependencies = () => gulp.src('extensions/node_modules/**', { base: '.' });
|
||||||
// const marketplaceExtensions = () => es.merge(
|
// const marketplaceExtensions = () => es.merge(
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ import remote = require('gulp-remote-src');
|
|||||||
const vzip = require('gulp-vinyl-zip');
|
const vzip = require('gulp-vinyl-zip');
|
||||||
import filter = require('gulp-filter');
|
import filter = require('gulp-filter');
|
||||||
import rename = require('gulp-rename');
|
import rename = require('gulp-rename');
|
||||||
const util = require('gulp-util');
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
const buffer = require('gulp-buffer');
|
const buffer = require('gulp-buffer');
|
||||||
import json = require('gulp-json-editor');
|
import json = require('gulp-json-editor');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
@@ -42,8 +43,18 @@ export function packageBuiltInExtensions() {
|
|||||||
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
||||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) >= 0);
|
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) >= 0);
|
||||||
|
const visxDirectory = path.join(path.dirname(root), 'vsix');
|
||||||
|
try {
|
||||||
|
if (!fs.existsSync(visxDirectory)) {
|
||||||
|
fs.mkdirSync(visxDirectory);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
// don't fail the build if the output directory already exists
|
||||||
|
console.warn(err);
|
||||||
|
}
|
||||||
sqlBuiltInLocalExtensionDescriptions.forEach(element => {
|
sqlBuiltInLocalExtensionDescriptions.forEach(element => {
|
||||||
const packagePath = path.join(path.dirname(root), element.name + '.vsix');
|
let pkgJson = JSON.parse(fs.readFileSync(path.join(element.path, 'package.json'), { encoding: 'utf8' }));
|
||||||
|
const packagePath = path.join(visxDirectory, `${pkgJson.name}-${pkgJson.version}.vsix`);
|
||||||
console.info('Creating vsix for ' + element.path + ' result:' + packagePath);
|
console.info('Creating vsix for ' + element.path + ' result:' + packagePath);
|
||||||
vsce.createVSIX({
|
vsce.createVSIX({
|
||||||
cwd: element.path,
|
cwd: element.path,
|
||||||
@@ -155,7 +166,7 @@ function fromLocalWebpack(extensionPath: string, sourceMappingURLBase: string |
|
|||||||
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
|
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
|
||||||
|
|
||||||
const webpackDone = (err: any, stats: any) => {
|
const webpackDone = (err: any, stats: any) => {
|
||||||
util.log(`Bundled extension: ${util.colors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
||||||
if (err) {
|
if (err) {
|
||||||
result.emit('error', err);
|
result.emit('error', err);
|
||||||
}
|
}
|
||||||
@@ -249,7 +260,7 @@ export function fromMarketplace(extensionName: string, version: string, metadata
|
|||||||
const [publisher, name] = extensionName.split('.');
|
const [publisher, name] = extensionName.split('.');
|
||||||
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
|
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
|
||||||
|
|
||||||
util.log('Downloading extension:', util.colors.yellow(`${extensionName}@${version}`), '...');
|
fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...');
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
base: url,
|
base: url,
|
||||||
@@ -282,6 +293,7 @@ interface IPackageExtensionsOptions {
|
|||||||
const excludedExtensions = [
|
const excludedExtensions = [
|
||||||
'vscode-api-tests',
|
'vscode-api-tests',
|
||||||
'vscode-colorize-tests',
|
'vscode-colorize-tests',
|
||||||
|
'vscode-test-resolver',
|
||||||
'ms-vscode.node-debug',
|
'ms-vscode.node-debug',
|
||||||
'ms-vscode.node-debug2',
|
'ms-vscode.node-debug2',
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
@@ -292,14 +304,17 @@ const excludedExtensions = [
|
|||||||
const sqlBuiltInExtensions = [
|
const sqlBuiltInExtensions = [
|
||||||
// Add SQL built-in extensions here.
|
// Add SQL built-in extensions here.
|
||||||
// the extension will be excluded from SQLOps package and will have separate vsix packages
|
// the extension will be excluded from SQLOps package and will have separate vsix packages
|
||||||
|
'admin-tool-ext-win',
|
||||||
'agent',
|
'agent',
|
||||||
'import',
|
'import',
|
||||||
'profiler',
|
'profiler',
|
||||||
'admin-pack',
|
'admin-pack',
|
||||||
'big-data-cluster',
|
'big-data-cluster',
|
||||||
'dacpac'
|
'dacpac',
|
||||||
|
'schema-compare',
|
||||||
|
'resource-deployment',
|
||||||
|
'cms'
|
||||||
];
|
];
|
||||||
var azureExtensions = ['azurecore', 'mssql'];
|
|
||||||
// {{SQL CARBON EDIT}} - End
|
// {{SQL CARBON EDIT}} - End
|
||||||
|
|
||||||
interface IBuiltInExtension {
|
interface IBuiltInExtension {
|
||||||
@@ -348,8 +363,7 @@ export function packageExtensionsStream(optsIn?: IPackageExtensionsOptions): Nod
|
|||||||
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
|
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
|
||||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1)
|
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1);
|
||||||
.filter(({ name }) => azureExtensions.indexOf(name) === -1);
|
|
||||||
|
|
||||||
const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => {
|
const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => {
|
||||||
return fromLocal(extension.path, opts.sourceMappingURLBase)
|
return fromLocal(extension.path, opts.sourceMappingURLBase)
|
||||||
@@ -362,9 +376,7 @@ export function packageExtensionsStream(optsIn?: IPackageExtensionsOptions): Nod
|
|||||||
];
|
];
|
||||||
|
|
||||||
const localExtensionDependencies = () => gulp.src(extensionDepsSrc, { base: '.', dot: true })
|
const localExtensionDependencies = () => gulp.src(extensionDepsSrc, { base: '.', dot: true })
|
||||||
.pipe(filter(['**', '!**/package-lock.json']))
|
.pipe(filter(['**', '!**/package-lock.json']))
|
||||||
.pipe(util2.cleanNodeModule('account-provider-azure', ['node_modules/date-utils/doc/**', 'node_modules/adal_node/node_modules/**'], undefined))
|
|
||||||
.pipe(util2.cleanNodeModule('typescript', ['**/**'], undefined));
|
|
||||||
|
|
||||||
// Original code commented out here
|
// Original code commented out here
|
||||||
// const localExtensionDependencies = () => gulp.src('extensions/node_modules/**', { base: '.' });
|
// const localExtensionDependencies = () => gulp.src('extensions/node_modules/**', { base: '.' });
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ function getVersion(repo) {
|
|||||||
head = fs.readFileSync(headPath, 'utf8').trim();
|
head = fs.readFileSync(headPath, 'utf8').trim();
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
return void 0;
|
return undefined;
|
||||||
}
|
}
|
||||||
if (/^[0-9a-f]{40}$/i.test(head)) {
|
if (/^[0-9a-f]{40}$/i.test(head)) {
|
||||||
return head;
|
return head;
|
||||||
}
|
}
|
||||||
const refMatch = /^ref: (.*)$/.exec(head);
|
const refMatch = /^ref: (.*)$/.exec(head);
|
||||||
if (!refMatch) {
|
if (!refMatch) {
|
||||||
return void 0;
|
return undefined;
|
||||||
}
|
}
|
||||||
const ref = refMatch[1];
|
const ref = refMatch[1];
|
||||||
const refPath = path.join(git, ref);
|
const refPath = path.join(git, ref);
|
||||||
@@ -40,7 +40,7 @@ function getVersion(repo) {
|
|||||||
refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim();
|
refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim();
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
return void 0;
|
return undefined;
|
||||||
}
|
}
|
||||||
const refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm;
|
const refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm;
|
||||||
let refsMatch;
|
let refsMatch;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export function getVersion(repo: string): string | undefined {
|
|||||||
try {
|
try {
|
||||||
head = fs.readFileSync(headPath, 'utf8').trim();
|
head = fs.readFileSync(headPath, 'utf8').trim();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return void 0;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/^[0-9a-f]{40}$/i.test(head)) {
|
if (/^[0-9a-f]{40}$/i.test(head)) {
|
||||||
@@ -28,7 +28,7 @@ export function getVersion(repo: string): string | undefined {
|
|||||||
const refMatch = /^ref: (.*)$/.exec(head);
|
const refMatch = /^ref: (.*)$/.exec(head);
|
||||||
|
|
||||||
if (!refMatch) {
|
if (!refMatch) {
|
||||||
return void 0;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ref = refMatch[1];
|
const ref = refMatch[1];
|
||||||
@@ -46,7 +46,7 @@ export function getVersion(repo: string): string | undefined {
|
|||||||
try {
|
try {
|
||||||
refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim();
|
refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return void 0;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm;
|
const refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm;
|
||||||
|
|||||||
@@ -13,15 +13,16 @@ const xml2js = require("xml2js");
|
|||||||
const glob = require("glob");
|
const glob = require("glob");
|
||||||
const https = require("https");
|
const https = require("https");
|
||||||
const gulp = require("gulp");
|
const gulp = require("gulp");
|
||||||
const util = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const iconv = require("iconv-lite");
|
const iconv = require("iconv-lite");
|
||||||
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
|
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
|
||||||
function log(message, ...rest) {
|
function log(message, ...rest) {
|
||||||
util.log(util.colors.green('[i18n]'), message, ...rest);
|
fancyLog(ansiColors.green('[i18n]'), message, ...rest);
|
||||||
}
|
}
|
||||||
exports.defaultLanguages = [
|
exports.defaultLanguages = [
|
||||||
{ id: 'zh-tw', folderName: 'cht', transifexId: 'zh-hant' },
|
{ id: 'zh-tw', folderName: 'cht', translationId: 'zh-hant' },
|
||||||
{ id: 'zh-cn', folderName: 'chs', transifexId: 'zh-hans' },
|
{ id: 'zh-cn', folderName: 'chs', translationId: 'zh-hans' },
|
||||||
{ id: 'ja', folderName: 'jpn' },
|
{ id: 'ja', folderName: 'jpn' },
|
||||||
{ id: 'ko', folderName: 'kor' },
|
{ id: 'ko', folderName: 'kor' },
|
||||||
{ id: 'de', folderName: 'deu' },
|
{ id: 'de', folderName: 'deu' },
|
||||||
@@ -371,7 +372,11 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
let languageDirectory = path.join(__dirname, '..', '..', 'i18n');
|
let languageDirectory = path.join(__dirname, '..', '..', '..', 'vscode-loc', 'i18n');
|
||||||
|
if (!fs.existsSync(languageDirectory)) {
|
||||||
|
log(`No VS Code localization repository found. Looking at ${languageDirectory}`);
|
||||||
|
log(`To bundle translations please check out the vscode-loc repository as a sibling of the vscode repository.`);
|
||||||
|
}
|
||||||
let sortedLanguages = sortLanguages(languages);
|
let sortedLanguages = sortLanguages(languages);
|
||||||
sortedLanguages.forEach((language) => {
|
sortedLanguages.forEach((language) => {
|
||||||
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
||||||
@@ -379,22 +384,25 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) {
|
|||||||
}
|
}
|
||||||
statistics[language.id] = 0;
|
statistics[language.id] = 0;
|
||||||
let localizedModules = Object.create(null);
|
let localizedModules = Object.create(null);
|
||||||
let languageFolderName = language.folderName || language.id;
|
let languageFolderName = language.translationId || language.id;
|
||||||
let cwd = path.join(languageDirectory, languageFolderName, 'src');
|
let i18nFile = path.join(languageDirectory, `vscode-language-pack-${languageFolderName}`, 'translations', 'main.i18n.json');
|
||||||
|
let allMessages;
|
||||||
|
if (fs.existsSync(i18nFile)) {
|
||||||
|
let content = stripComments(fs.readFileSync(i18nFile, 'utf8'));
|
||||||
|
allMessages = JSON.parse(content);
|
||||||
|
}
|
||||||
modules.forEach((module) => {
|
modules.forEach((module) => {
|
||||||
let order = keysSection[module];
|
let order = keysSection[module];
|
||||||
let i18nFile = path.join(cwd, module) + '.i18n.json';
|
let moduleMessage;
|
||||||
let messages = null;
|
if (allMessages) {
|
||||||
if (fs.existsSync(i18nFile)) {
|
moduleMessage = allMessages.contents[module];
|
||||||
let content = stripComments(fs.readFileSync(i18nFile, 'utf8'));
|
|
||||||
messages = JSON.parse(content);
|
|
||||||
}
|
}
|
||||||
else {
|
if (!moduleMessage) {
|
||||||
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
||||||
log(`No localized messages found for module ${module}. Using default messages.`);
|
log(`No localized messages found for module ${module}. Using default messages.`);
|
||||||
}
|
}
|
||||||
messages = defaultMessages[module];
|
moduleMessage = defaultMessages[module];
|
||||||
statistics[language.id] = statistics[language.id] + Object.keys(messages).length;
|
statistics[language.id] = statistics[language.id] + Object.keys(moduleMessage).length;
|
||||||
}
|
}
|
||||||
let localizedMessages = [];
|
let localizedMessages = [];
|
||||||
order.forEach((keyInfo) => {
|
order.forEach((keyInfo) => {
|
||||||
@@ -405,7 +413,7 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) {
|
|||||||
else {
|
else {
|
||||||
key = keyInfo.key;
|
key = keyInfo.key;
|
||||||
}
|
}
|
||||||
let message = messages[key];
|
let message = moduleMessage[key];
|
||||||
if (!message) {
|
if (!message) {
|
||||||
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
||||||
log(`No localized message found for key ${key} in module ${module}. Using default message.`);
|
log(`No localized message found for key ${key} in module ${module}. Using default message.`);
|
||||||
@@ -490,7 +498,7 @@ function getResource(sourceFile) {
|
|||||||
else if (/^vs\/code/.test(sourceFile)) {
|
else if (/^vs\/code/.test(sourceFile)) {
|
||||||
return { name: 'vs/code', project: workbenchProject };
|
return { name: 'vs/code', project: workbenchProject };
|
||||||
}
|
}
|
||||||
else if (/^vs\/workbench\/parts/.test(sourceFile)) {
|
else if (/^vs\/workbench\/contrib/.test(sourceFile)) {
|
||||||
resource = sourceFile.split('/', 4).join('/');
|
resource = sourceFile.split('/', 4).join('/');
|
||||||
return { name: resource, project: workbenchProject };
|
return { name: resource, project: workbenchProject };
|
||||||
}
|
}
|
||||||
@@ -578,7 +586,7 @@ function createXlfFilesForExtensions() {
|
|||||||
}
|
}
|
||||||
return _xlf;
|
return _xlf;
|
||||||
}
|
}
|
||||||
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`]).pipe(event_stream_1.through(function (file) {
|
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe(event_stream_1.through(function (file) {
|
||||||
if (file.isBuffer()) {
|
if (file.isBuffer()) {
|
||||||
const buffer = file.contents;
|
const buffer = file.contents;
|
||||||
const basename = path.basename(file.path);
|
const basename = path.basename(file.path);
|
||||||
@@ -955,7 +963,7 @@ function retrieveResource(language, resource, apiHostname, credentials) {
|
|||||||
return limiter.queue(() => new Promise((resolve, reject) => {
|
return limiter.queue(() => new Promise((resolve, reject) => {
|
||||||
const slug = resource.name.replace(/\//g, '_');
|
const slug = resource.name.replace(/\//g, '_');
|
||||||
const project = resource.project;
|
const project = resource.project;
|
||||||
let transifexLanguageId = language.id === 'ps' ? 'en' : language.transifexId || language.id;
|
let transifexLanguageId = language.id === 'ps' ? 'en' : language.translationId || language.id;
|
||||||
const options = {
|
const options = {
|
||||||
hostname: apiHostname,
|
hostname: apiHostname,
|
||||||
path: `/api/2/project/${project}/resource/${slug}/translation/${transifexLanguageId}?file&mode=onlyreviewed`,
|
path: `/api/2/project/${project}/resource/${slug}/translation/${transifexLanguageId}?file&mode=onlyreviewed`,
|
||||||
@@ -1038,7 +1046,7 @@ function prepareI18nPackFiles(externalExtensions, resultingTranslationPaths, pse
|
|||||||
let extensionsPacks = {};
|
let extensionsPacks = {};
|
||||||
let errors = [];
|
let errors = [];
|
||||||
return event_stream_1.through(function (xlf) {
|
return event_stream_1.through(function (xlf) {
|
||||||
let project = path.dirname(xlf.relative);
|
let project = path.basename(path.dirname(xlf.relative));
|
||||||
let resource = path.basename(xlf.relative, '.xlf');
|
let resource = path.basename(xlf.relative, '.xlf');
|
||||||
let contents = xlf.contents.toString();
|
let contents = xlf.contents.toString();
|
||||||
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
||||||
|
|||||||
@@ -27,135 +27,159 @@
|
|||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/cli",
|
"name": "vs/workbench/api/common",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/codeEditor",
|
"name": "vs/workbench/contrib/cli",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/comments",
|
"name": "vs/workbench/contrib/codeEditor",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/debug",
|
"name": "vs/workbench/contrib/codeinset",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/emmet",
|
"name": "vs/workbench/contrib/callHierarchy",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/execution",
|
"name": "vs/workbench/contrib/comments",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/extensions",
|
"name": "vs/workbench/contrib/debug",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/feedback",
|
"name": "vs/workbench/contrib/emmet",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/files",
|
"name": "vs/workbench/contrib/extensions",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/html",
|
"name": "vs/workbench/contrib/externalTerminal",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/markers",
|
"name": "vs/workbench/contrib/feedback",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/localizations",
|
"name": "vs/workbench/contrib/files",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/logs",
|
"name": "vs/workbench/contrib/html",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/output",
|
"name": "vs/workbench/contrib/issue",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/performance",
|
"name": "vs/workbench/contrib/markers",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/preferences",
|
"name": "vs/workbench/contrib/localizations",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/quickopen",
|
"name": "vs/workbench/contrib/logs",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/relauncher",
|
"name": "vs/workbench/contrib/output",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/scm",
|
"name": "vs/workbench/contrib/performance",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/search",
|
"name": "vs/workbench/contrib/preferences",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/snippets",
|
"name": "vs/workbench/contrib/quickopen",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/stats",
|
"name": "vs/workbench/contrib/remote",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/surveys",
|
"name": "vs/workbench/contrib/relauncher",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/tasks",
|
"name": "vs/workbench/contrib/scm",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/terminal",
|
"name": "vs/workbench/contrib/search",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/themes",
|
"name": "vs/workbench/contrib/snippets",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/trust",
|
"name": "vs/workbench/contrib/format",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/update",
|
"name": "vs/workbench/contrib/stats",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/url",
|
"name": "vs/workbench/contrib/surveys",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/watermark",
|
"name": "vs/workbench/contrib/tasks",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/webview",
|
"name": "vs/workbench/contrib/terminal",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/welcome",
|
"name": "vs/workbench/contrib/themes",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/outline",
|
"name": "vs/workbench/contrib/trust",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/contrib/update",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/contrib/url",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/contrib/watermark",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/contrib/webview",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/contrib/welcome",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/contrib/outline",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -195,13 +219,17 @@
|
|||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/services/jsonschemas",
|
"name": "vs/workbench/services/extensionManagement",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/services/files",
|
"name": "vs/workbench/services/files",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/services/integrity",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/services/keybinding",
|
"name": "vs/workbench/services/keybinding",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
@@ -238,6 +266,10 @@
|
|||||||
"name": "vs/workbench/services/decorations",
|
"name": "vs/workbench/services/decorations",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/services/label",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/services/preferences",
|
"name": "vs/workbench/services/preferences",
|
||||||
"project": "vscode-preferences"
|
"project": "vscode-preferences"
|
||||||
|
|||||||
@@ -13,19 +13,19 @@ import * as xml2js from 'xml2js';
|
|||||||
import * as glob from 'glob';
|
import * as glob from 'glob';
|
||||||
import * as https from 'https';
|
import * as https from 'https';
|
||||||
import * as gulp from 'gulp';
|
import * as gulp from 'gulp';
|
||||||
|
import * as fancyLog from 'fancy-log';
|
||||||
import * as util from 'gulp-util';
|
import * as ansiColors from 'ansi-colors';
|
||||||
import * as iconv from 'iconv-lite';
|
import * as iconv from 'iconv-lite';
|
||||||
|
|
||||||
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
|
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
|
||||||
|
|
||||||
function log(message: any, ...rest: any[]): void {
|
function log(message: any, ...rest: any[]): void {
|
||||||
util.log(util.colors.green('[i18n]'), message, ...rest);
|
fancyLog(ansiColors.green('[i18n]'), message, ...rest);
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Language {
|
export interface Language {
|
||||||
id: string; // laguage id, e.g. zh-tw, de
|
id: string; // language id, e.g. zh-tw, de
|
||||||
transifexId?: string; // language id used in transifex, e.g zh-hant, de (optional, if not set, the id is used)
|
translationId?: string; // language id used in translation tools, e.g zh-hant, de (optional, if not set, the id is used)
|
||||||
folderName?: string; // language specific folder name, e.g. cht, deu (optional, if not set, the id is used)
|
folderName?: string; // language specific folder name, e.g. cht, deu (optional, if not set, the id is used)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,8 +38,8 @@ export interface InnoSetup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const defaultLanguages: Language[] = [
|
export const defaultLanguages: Language[] = [
|
||||||
{ id: 'zh-tw', folderName: 'cht', transifexId: 'zh-hant' },
|
{ id: 'zh-tw', folderName: 'cht', translationId: 'zh-hant' },
|
||||||
{ id: 'zh-cn', folderName: 'chs', transifexId: 'zh-hans' },
|
{ id: 'zh-cn', folderName: 'chs', translationId: 'zh-hans' },
|
||||||
{ id: 'ja', folderName: 'jpn' },
|
{ id: 'ja', folderName: 'jpn' },
|
||||||
{ id: 'ko', folderName: 'kor' },
|
{ id: 'ko', folderName: 'kor' },
|
||||||
{ id: 'de', folderName: 'deu' },
|
{ id: 'de', folderName: 'deu' },
|
||||||
@@ -144,6 +144,15 @@ interface BundledExtensionFormat {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface I18nFormat {
|
||||||
|
version: string;
|
||||||
|
contents: {
|
||||||
|
[module: string]: {
|
||||||
|
[messageKey: string]: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export class Line {
|
export class Line {
|
||||||
private buffer: string[] = [];
|
private buffer: string[] = [];
|
||||||
|
|
||||||
@@ -486,7 +495,11 @@ function processCoreBundleFormat(fileHeader: string, languages: Language[], json
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
let languageDirectory = path.join(__dirname, '..', '..', 'i18n');
|
let languageDirectory = path.join(__dirname, '..', '..', '..', 'vscode-loc', 'i18n');
|
||||||
|
if (!fs.existsSync(languageDirectory)) {
|
||||||
|
log(`No VS Code localization repository found. Looking at ${languageDirectory}`);
|
||||||
|
log(`To bundle translations please check out the vscode-loc repository as a sibling of the vscode repository.`);
|
||||||
|
}
|
||||||
let sortedLanguages = sortLanguages(languages);
|
let sortedLanguages = sortLanguages(languages);
|
||||||
sortedLanguages.forEach((language) => {
|
sortedLanguages.forEach((language) => {
|
||||||
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
||||||
@@ -495,21 +508,25 @@ function processCoreBundleFormat(fileHeader: string, languages: Language[], json
|
|||||||
|
|
||||||
statistics[language.id] = 0;
|
statistics[language.id] = 0;
|
||||||
let localizedModules: Map<string[]> = Object.create(null);
|
let localizedModules: Map<string[]> = Object.create(null);
|
||||||
let languageFolderName = language.folderName || language.id;
|
let languageFolderName = language.translationId || language.id;
|
||||||
let cwd = path.join(languageDirectory, languageFolderName, 'src');
|
let i18nFile = path.join(languageDirectory, `vscode-language-pack-${languageFolderName}`, 'translations', 'main.i18n.json');
|
||||||
|
let allMessages: I18nFormat | undefined;
|
||||||
|
if (fs.existsSync(i18nFile)) {
|
||||||
|
let content = stripComments(fs.readFileSync(i18nFile, 'utf8'));
|
||||||
|
allMessages = JSON.parse(content);
|
||||||
|
}
|
||||||
modules.forEach((module) => {
|
modules.forEach((module) => {
|
||||||
let order = keysSection[module];
|
let order = keysSection[module];
|
||||||
let i18nFile = path.join(cwd, module) + '.i18n.json';
|
let moduleMessage: { [messageKey: string]: string } | undefined;
|
||||||
let messages: Map<string> | null = null;
|
if (allMessages) {
|
||||||
if (fs.existsSync(i18nFile)) {
|
moduleMessage = allMessages.contents[module];
|
||||||
let content = stripComments(fs.readFileSync(i18nFile, 'utf8'));
|
}
|
||||||
messages = JSON.parse(content);
|
if (!moduleMessage) {
|
||||||
} else {
|
|
||||||
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
||||||
log(`No localized messages found for module ${module}. Using default messages.`);
|
log(`No localized messages found for module ${module}. Using default messages.`);
|
||||||
}
|
}
|
||||||
messages = defaultMessages[module];
|
moduleMessage = defaultMessages[module];
|
||||||
statistics[language.id] = statistics[language.id] + Object.keys(messages).length;
|
statistics[language.id] = statistics[language.id] + Object.keys(moduleMessage).length;
|
||||||
}
|
}
|
||||||
let localizedMessages: string[] = [];
|
let localizedMessages: string[] = [];
|
||||||
order.forEach((keyInfo) => {
|
order.forEach((keyInfo) => {
|
||||||
@@ -519,7 +536,7 @@ function processCoreBundleFormat(fileHeader: string, languages: Language[], json
|
|||||||
} else {
|
} else {
|
||||||
key = keyInfo.key;
|
key = keyInfo.key;
|
||||||
}
|
}
|
||||||
let message: string = messages![key];
|
let message: string = moduleMessage![key];
|
||||||
if (!message) {
|
if (!message) {
|
||||||
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
||||||
log(`No localized message found for key ${key} in module ${module}. Using default message.`);
|
log(`No localized message found for key ${key} in module ${module}. Using default message.`);
|
||||||
@@ -605,7 +622,7 @@ export function getResource(sourceFile: string): Resource {
|
|||||||
return { name: 'vs/base', project: editorProject };
|
return { name: 'vs/base', project: editorProject };
|
||||||
} else if (/^vs\/code/.test(sourceFile)) {
|
} else if (/^vs\/code/.test(sourceFile)) {
|
||||||
return { name: 'vs/code', project: workbenchProject };
|
return { name: 'vs/code', project: workbenchProject };
|
||||||
} else if (/^vs\/workbench\/parts/.test(sourceFile)) {
|
} else if (/^vs\/workbench\/contrib/.test(sourceFile)) {
|
||||||
resource = sourceFile.split('/', 4).join('/');
|
resource = sourceFile.split('/', 4).join('/');
|
||||||
return { name: resource, project: workbenchProject };
|
return { name: resource, project: workbenchProject };
|
||||||
} else if (/^vs\/workbench\/services/.test(sourceFile)) {
|
} else if (/^vs\/workbench\/services/.test(sourceFile)) {
|
||||||
@@ -692,7 +709,7 @@ export function createXlfFilesForExtensions(): ThroughStream {
|
|||||||
}
|
}
|
||||||
return _xlf;
|
return _xlf;
|
||||||
}
|
}
|
||||||
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`]).pipe(through(function (file: File) {
|
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe(through(function (file: File) {
|
||||||
if (file.isBuffer()) {
|
if (file.isBuffer()) {
|
||||||
const buffer: Buffer = file.contents as Buffer;
|
const buffer: Buffer = file.contents as Buffer;
|
||||||
const basename = path.basename(file.path);
|
const basename = path.basename(file.path);
|
||||||
@@ -1093,7 +1110,7 @@ function retrieveResource(language: Language, resource: Resource, apiHostname: s
|
|||||||
return limiter.queue(() => new Promise<File | null>((resolve, reject) => {
|
return limiter.queue(() => new Promise<File | null>((resolve, reject) => {
|
||||||
const slug = resource.name.replace(/\//g, '_');
|
const slug = resource.name.replace(/\//g, '_');
|
||||||
const project = resource.project;
|
const project = resource.project;
|
||||||
let transifexLanguageId = language.id === 'ps' ? 'en' : language.transifexId || language.id;
|
let transifexLanguageId = language.id === 'ps' ? 'en' : language.translationId || language.id;
|
||||||
const options = {
|
const options = {
|
||||||
hostname: apiHostname,
|
hostname: apiHostname,
|
||||||
path: `/api/2/project/${project}/resource/${slug}/translation/${transifexLanguageId}?file&mode=onlyreviewed`,
|
path: `/api/2/project/${project}/resource/${slug}/translation/${transifexLanguageId}?file&mode=onlyreviewed`,
|
||||||
@@ -1194,7 +1211,7 @@ export function prepareI18nPackFiles(externalExtensions: Map<string>, resultingT
|
|||||||
let extensionsPacks: Map<I18nPack> = {};
|
let extensionsPacks: Map<I18nPack> = {};
|
||||||
let errors: any[] = [];
|
let errors: any[] = [];
|
||||||
return through(function (this: ThroughStream, xlf: File) {
|
return through(function (this: ThroughStream, xlf: File) {
|
||||||
let project = path.dirname(xlf.relative);
|
let project = path.basename(path.dirname(xlf.relative));
|
||||||
let resource = path.basename(xlf.relative, '.xlf');
|
let resource = path.basename(xlf.relative, '.xlf');
|
||||||
let contents = xlf.contents.toString();
|
let contents = xlf.contents.toString();
|
||||||
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
||||||
@@ -1361,4 +1378,4 @@ function decodeEntities(value: string): string {
|
|||||||
|
|
||||||
function pseudify(message: string) {
|
function pseudify(message: string) {
|
||||||
return '\uFF3B' + message.replace(/[aouei]/g, '$&$&') + '\uFF3D';
|
return '\uFF3B' + message.replace(/[aouei]/g, '$&$&') + '\uFF3D';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ const flatmap = require("gulp-flatmap");
|
|||||||
const sourcemaps = require("gulp-sourcemaps");
|
const sourcemaps = require("gulp-sourcemaps");
|
||||||
const uglify = require("gulp-uglify");
|
const uglify = require("gulp-uglify");
|
||||||
const composer = require("gulp-uglify/composer");
|
const composer = require("gulp-uglify/composer");
|
||||||
const gulpUtil = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const pump = require("pump");
|
const pump = require("pump");
|
||||||
const uglifyes = require("uglify-es");
|
const uglifyes = require("uglify-es");
|
||||||
@@ -24,7 +25,7 @@ const stats_1 = require("./stats");
|
|||||||
const util = require("./util");
|
const util = require("./util");
|
||||||
const REPO_ROOT_PATH = path.join(__dirname, '../..');
|
const REPO_ROOT_PATH = path.join(__dirname, '../..');
|
||||||
function log(prefix, message) {
|
function log(prefix, message) {
|
||||||
gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message);
|
fancyLog(ansiColors.cyan('[' + prefix + ']'), message);
|
||||||
}
|
}
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
function loaderConfig(emptyPaths) {
|
function loaderConfig(emptyPaths) {
|
||||||
@@ -115,7 +116,6 @@ function toBundleStream(src, bundledFileHeader, bundles) {
|
|||||||
function optimizeTask(opts) {
|
function optimizeTask(opts) {
|
||||||
const src = opts.src;
|
const src = opts.src;
|
||||||
const entryPoints = opts.entryPoints;
|
const entryPoints = opts.entryPoints;
|
||||||
const otherSources = opts.otherSources;
|
|
||||||
const resources = opts.resources;
|
const resources = opts.resources;
|
||||||
const loaderConfig = opts.loaderConfig;
|
const loaderConfig = opts.loaderConfig;
|
||||||
const bundledFileHeader = opts.header;
|
const bundledFileHeader = opts.header;
|
||||||
@@ -138,7 +138,7 @@ function optimizeTask(opts) {
|
|||||||
}
|
}
|
||||||
filteredResources.push('!' + resource);
|
filteredResources.push('!' + resource);
|
||||||
});
|
});
|
||||||
gulp.src(filteredResources, { base: `${src}` }).pipe(resourcesStream);
|
gulp.src(filteredResources, { base: `${src}`, allowEmpty: true }).pipe(resourcesStream);
|
||||||
const bundleInfoArray = [];
|
const bundleInfoArray = [];
|
||||||
if (opts.bundleInfo) {
|
if (opts.bundleInfo) {
|
||||||
bundleInfoArray.push(new VinylFile({
|
bundleInfoArray.push(new VinylFile({
|
||||||
@@ -149,20 +149,7 @@ function optimizeTask(opts) {
|
|||||||
}
|
}
|
||||||
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
||||||
});
|
});
|
||||||
const otherSourcesStream = es.through();
|
const result = es.merge(loader(src, bundledFileHeader, bundleLoader), bundlesStream, resourcesStream, bundleInfoStream);
|
||||||
const otherSourcesStreamArr = [];
|
|
||||||
gulp.src(otherSources, { base: `${src}` })
|
|
||||||
.pipe(es.through(function (data) {
|
|
||||||
otherSourcesStreamArr.push(toConcatStream(src, bundledFileHeader, [data], data.relative));
|
|
||||||
}, function () {
|
|
||||||
if (!otherSourcesStreamArr.length) {
|
|
||||||
setTimeout(function () { otherSourcesStream.emit('end'); }, 0);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
es.merge(otherSourcesStreamArr).pipe(otherSourcesStream);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
const result = es.merge(loader(src, bundledFileHeader, bundleLoader), bundlesStream, otherSourcesStream, resourcesStream, bundleInfoStream);
|
|
||||||
return result
|
return result
|
||||||
.pipe(sourcemaps.write('./', {
|
.pipe(sourcemaps.write('./', {
|
||||||
sourceRoot: undefined,
|
sourceRoot: undefined,
|
||||||
@@ -225,7 +212,12 @@ function minifyTask(src, sourceMapBaseUrl) {
|
|||||||
return cb => {
|
return cb => {
|
||||||
const jsFilter = filter('**/*.js', { restore: true });
|
const jsFilter = filter('**/*.js', { restore: true });
|
||||||
const cssFilter = filter('**/*.css', { restore: true });
|
const cssFilter = filter('**/*.css', { restore: true });
|
||||||
pump(gulp.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, sourcemaps.init({ loadMaps: true }), uglifyWithCopyrights(), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.write('./', {
|
pump(gulp.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, sourcemaps.init({ loadMaps: true }), uglifyWithCopyrights(), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.mapSources((sourcePath) => {
|
||||||
|
if (sourcePath === 'bootstrap-fork.js') {
|
||||||
|
return 'bootstrap-fork.orig.js';
|
||||||
|
}
|
||||||
|
return sourcePath;
|
||||||
|
}), sourcemaps.write('./', {
|
||||||
sourceMappingURL,
|
sourceMappingURL,
|
||||||
sourceRoot: undefined,
|
sourceRoot: undefined,
|
||||||
includeContent: true,
|
includeContent: true,
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ import * as flatmap from 'gulp-flatmap';
|
|||||||
import * as sourcemaps from 'gulp-sourcemaps';
|
import * as sourcemaps from 'gulp-sourcemaps';
|
||||||
import * as uglify from 'gulp-uglify';
|
import * as uglify from 'gulp-uglify';
|
||||||
import * as composer from 'gulp-uglify/composer';
|
import * as composer from 'gulp-uglify/composer';
|
||||||
import * as gulpUtil from 'gulp-util';
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as pump from 'pump';
|
import * as pump from 'pump';
|
||||||
import * as sm from 'source-map';
|
import * as sm from 'source-map';
|
||||||
@@ -28,7 +29,7 @@ import * as util from './util';
|
|||||||
const REPO_ROOT_PATH = path.join(__dirname, '../..');
|
const REPO_ROOT_PATH = path.join(__dirname, '../..');
|
||||||
|
|
||||||
function log(prefix: string, message: string): void {
|
function log(prefix: string, message: string): void {
|
||||||
gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message);
|
fancyLog(ansiColors.cyan('[' + prefix + ']'), message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
@@ -143,10 +144,6 @@ export interface IOptimizeTaskOpts {
|
|||||||
* (for AMD files, will get bundled and get Copyright treatment)
|
* (for AMD files, will get bundled and get Copyright treatment)
|
||||||
*/
|
*/
|
||||||
entryPoints: bundle.IEntryPoint[];
|
entryPoints: bundle.IEntryPoint[];
|
||||||
/**
|
|
||||||
* (for non-AMD files that should get Copyright treatment)
|
|
||||||
*/
|
|
||||||
otherSources: string[];
|
|
||||||
/**
|
/**
|
||||||
* (svg, etc.)
|
* (svg, etc.)
|
||||||
*/
|
*/
|
||||||
@@ -177,7 +174,6 @@ export interface IOptimizeTaskOpts {
|
|||||||
export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream {
|
export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream {
|
||||||
const src = opts.src;
|
const src = opts.src;
|
||||||
const entryPoints = opts.entryPoints;
|
const entryPoints = opts.entryPoints;
|
||||||
const otherSources = opts.otherSources;
|
|
||||||
const resources = opts.resources;
|
const resources = opts.resources;
|
||||||
const loaderConfig = opts.loaderConfig;
|
const loaderConfig = opts.loaderConfig;
|
||||||
const bundledFileHeader = opts.header;
|
const bundledFileHeader = opts.header;
|
||||||
@@ -202,7 +198,7 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
|
|||||||
}
|
}
|
||||||
filteredResources.push('!' + resource);
|
filteredResources.push('!' + resource);
|
||||||
});
|
});
|
||||||
gulp.src(filteredResources, { base: `${src}` }).pipe(resourcesStream);
|
gulp.src(filteredResources, { base: `${src}`, allowEmpty: true }).pipe(resourcesStream);
|
||||||
|
|
||||||
const bundleInfoArray: VinylFile[] = [];
|
const bundleInfoArray: VinylFile[] = [];
|
||||||
if (opts.bundleInfo) {
|
if (opts.bundleInfo) {
|
||||||
@@ -215,24 +211,9 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
|
|||||||
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
||||||
});
|
});
|
||||||
|
|
||||||
const otherSourcesStream = es.through();
|
|
||||||
const otherSourcesStreamArr: NodeJS.ReadWriteStream[] = [];
|
|
||||||
|
|
||||||
gulp.src(otherSources, { base: `${src}` })
|
|
||||||
.pipe(es.through(function (data) {
|
|
||||||
otherSourcesStreamArr.push(toConcatStream(src, bundledFileHeader, [data], data.relative));
|
|
||||||
}, function () {
|
|
||||||
if (!otherSourcesStreamArr.length) {
|
|
||||||
setTimeout(function () { otherSourcesStream.emit('end'); }, 0);
|
|
||||||
} else {
|
|
||||||
es.merge(otherSourcesStreamArr).pipe(otherSourcesStream);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
const result = es.merge(
|
const result = es.merge(
|
||||||
loader(src, bundledFileHeader, bundleLoader),
|
loader(src, bundledFileHeader, bundleLoader),
|
||||||
bundlesStream,
|
bundlesStream,
|
||||||
otherSourcesStream,
|
|
||||||
resourcesStream,
|
resourcesStream,
|
||||||
bundleInfoStream
|
bundleInfoStream
|
||||||
);
|
);
|
||||||
@@ -319,6 +300,13 @@ export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) =>
|
|||||||
cssFilter,
|
cssFilter,
|
||||||
minifyCSS({ reduceIdents: false }),
|
minifyCSS({ reduceIdents: false }),
|
||||||
cssFilter.restore,
|
cssFilter.restore,
|
||||||
|
(<any>sourcemaps).mapSources((sourcePath: string) => {
|
||||||
|
if (sourcePath === 'bootstrap-fork.js') {
|
||||||
|
return 'bootstrap-fork.orig.js';
|
||||||
|
}
|
||||||
|
|
||||||
|
return sourcePath;
|
||||||
|
}),
|
||||||
sourcemaps.write('./', {
|
sourcemaps.write('./', {
|
||||||
sourceMappingURL,
|
sourceMappingURL,
|
||||||
sourceRoot: undefined,
|
sourceRoot: undefined,
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const es = require("event-stream");
|
const es = require("event-stream");
|
||||||
const _ = require("underscore");
|
const _ = require("underscore");
|
||||||
const util = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const allErrors = [];
|
const allErrors = [];
|
||||||
@@ -17,7 +18,7 @@ function onStart() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
startTime = new Date().getTime();
|
startTime = new Date().getTime();
|
||||||
util.log(`Starting ${util.colors.green('compilation')}...`);
|
fancyLog(`Starting ${ansiColors.green('compilation')}...`);
|
||||||
}
|
}
|
||||||
function onEnd() {
|
function onEnd() {
|
||||||
if (--count > 0) {
|
if (--count > 0) {
|
||||||
@@ -38,7 +39,7 @@ function log() {
|
|||||||
errors.map(err => {
|
errors.map(err => {
|
||||||
if (!seen.has(err)) {
|
if (!seen.has(err)) {
|
||||||
seen.add(err);
|
seen.add(err);
|
||||||
util.log(`${util.colors.red('Error')}: ${err}`);
|
fancyLog(`${ansiColors.red('Error')}: ${err}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
|
const regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
|
||||||
@@ -53,7 +54,7 @@ function log() {
|
|||||||
catch (err) {
|
catch (err) {
|
||||||
//noop
|
//noop
|
||||||
}
|
}
|
||||||
util.log(`Finished ${util.colors.green('compilation')} with ${errors.length} errors after ${util.colors.magenta((new Date().getTime() - startTime) + ' ms')}`);
|
fancyLog(`Finished ${ansiColors.green('compilation')} with ${errors.length} errors after ${ansiColors.magenta((new Date().getTime() - startTime) + ' ms')}`);
|
||||||
}
|
}
|
||||||
function createReporter() {
|
function createReporter() {
|
||||||
const errors = [];
|
const errors = [];
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
|
|
||||||
import * as es from 'event-stream';
|
import * as es from 'event-stream';
|
||||||
import * as _ from 'underscore';
|
import * as _ from 'underscore';
|
||||||
import * as util from 'gulp-util';
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
@@ -21,7 +22,7 @@ function onStart(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
startTime = new Date().getTime();
|
startTime = new Date().getTime();
|
||||||
util.log(`Starting ${util.colors.green('compilation')}...`);
|
fancyLog(`Starting ${ansiColors.green('compilation')}...`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEnd(): void {
|
function onEnd(): void {
|
||||||
@@ -47,7 +48,7 @@ function log(): void {
|
|||||||
errors.map(err => {
|
errors.map(err => {
|
||||||
if (!seen.has(err)) {
|
if (!seen.has(err)) {
|
||||||
seen.add(err);
|
seen.add(err);
|
||||||
util.log(`${util.colors.red('Error')}: ${err}`);
|
fancyLog(`${ansiColors.red('Error')}: ${err}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -65,7 +66,7 @@ function log(): void {
|
|||||||
//noop
|
//noop
|
||||||
}
|
}
|
||||||
|
|
||||||
util.log(`Finished ${util.colors.green('compilation')} with ${errors.length} errors after ${util.colors.magenta((new Date().getTime() - startTime!) + ' ms')}`);
|
fancyLog(`Finished ${ansiColors.green('compilation')} with ${errors.length} errors after ${ansiColors.magenta((new Date().getTime() - startTime!) + ' ms')}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IReporter {
|
export interface IReporter {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function writeFile(filePath, contents) {
|
|||||||
fs.writeFileSync(filePath, contents);
|
fs.writeFileSync(filePath, contents);
|
||||||
}
|
}
|
||||||
function extractEditor(options) {
|
function extractEditor(options) {
|
||||||
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.json')).toString());
|
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.monaco.json')).toString());
|
||||||
let compilerOptions;
|
let compilerOptions;
|
||||||
if (tsConfig.extends) {
|
if (tsConfig.extends) {
|
||||||
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
|
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
|
||||||
@@ -36,13 +36,12 @@ function extractEditor(options) {
|
|||||||
compilerOptions = tsConfig.compilerOptions;
|
compilerOptions = tsConfig.compilerOptions;
|
||||||
}
|
}
|
||||||
tsConfig.compilerOptions = compilerOptions;
|
tsConfig.compilerOptions = compilerOptions;
|
||||||
|
compilerOptions.noEmit = false;
|
||||||
compilerOptions.noUnusedLocals = false;
|
compilerOptions.noUnusedLocals = false;
|
||||||
compilerOptions.preserveConstEnums = false;
|
compilerOptions.preserveConstEnums = false;
|
||||||
compilerOptions.declaration = false;
|
compilerOptions.declaration = false;
|
||||||
|
compilerOptions.noImplicitAny = false;
|
||||||
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
||||||
delete compilerOptions.types;
|
|
||||||
delete tsConfig.extends;
|
|
||||||
tsConfig.exclude = [];
|
|
||||||
options.compilerOptions = compilerOptions;
|
options.compilerOptions = compilerOptions;
|
||||||
let result = tss.shake(options);
|
let result = tss.shake(options);
|
||||||
for (let fileName in result) {
|
for (let fileName in result) {
|
||||||
@@ -92,6 +91,8 @@ function extractEditor(options) {
|
|||||||
}
|
}
|
||||||
delete tsConfig.compilerOptions.moduleResolution;
|
delete tsConfig.compilerOptions.moduleResolution;
|
||||||
writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t'));
|
writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t'));
|
||||||
|
const tsConfigBase = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.base.json')).toString());
|
||||||
|
writeOutputFile('tsconfig.base.json', JSON.stringify(tsConfigBase, null, '\t'));
|
||||||
[
|
[
|
||||||
'vs/css.build.js',
|
'vs/css.build.js',
|
||||||
'vs/css.d.ts',
|
'vs/css.d.ts',
|
||||||
@@ -119,8 +120,7 @@ function createESMSourcesAndResources2(options) {
|
|||||||
return path.join(OUT_RESOURCES_FOLDER, dest);
|
return path.join(OUT_RESOURCES_FOLDER, dest);
|
||||||
};
|
};
|
||||||
const allFiles = walkDirRecursive(SRC_FOLDER);
|
const allFiles = walkDirRecursive(SRC_FOLDER);
|
||||||
for (let i = 0; i < allFiles.length; i++) {
|
for (const file of allFiles) {
|
||||||
const file = allFiles[i];
|
|
||||||
if (options.ignores.indexOf(file.replace(/\\/g, '/')) >= 0) {
|
if (options.ignores.indexOf(file.replace(/\\/g, '/')) >= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ function writeFile(filePath: string, contents: Buffer | string): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: string }): void {
|
export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: string }): void {
|
||||||
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.json')).toString());
|
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.monaco.json')).toString());
|
||||||
let compilerOptions: { [key: string]: any };
|
let compilerOptions: { [key: string]: any };
|
||||||
if (tsConfig.extends) {
|
if (tsConfig.extends) {
|
||||||
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
|
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
|
||||||
@@ -40,14 +40,13 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str
|
|||||||
}
|
}
|
||||||
tsConfig.compilerOptions = compilerOptions;
|
tsConfig.compilerOptions = compilerOptions;
|
||||||
|
|
||||||
|
compilerOptions.noEmit = false;
|
||||||
compilerOptions.noUnusedLocals = false;
|
compilerOptions.noUnusedLocals = false;
|
||||||
compilerOptions.preserveConstEnums = false;
|
compilerOptions.preserveConstEnums = false;
|
||||||
compilerOptions.declaration = false;
|
compilerOptions.declaration = false;
|
||||||
|
compilerOptions.noImplicitAny = false;
|
||||||
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
||||||
|
|
||||||
delete compilerOptions.types;
|
|
||||||
delete tsConfig.extends;
|
|
||||||
tsConfig.exclude = [];
|
|
||||||
|
|
||||||
options.compilerOptions = compilerOptions;
|
options.compilerOptions = compilerOptions;
|
||||||
|
|
||||||
@@ -101,6 +100,8 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str
|
|||||||
|
|
||||||
delete tsConfig.compilerOptions.moduleResolution;
|
delete tsConfig.compilerOptions.moduleResolution;
|
||||||
writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t'));
|
writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t'));
|
||||||
|
const tsConfigBase = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.base.json')).toString());
|
||||||
|
writeOutputFile('tsconfig.base.json', JSON.stringify(tsConfigBase, null, '\t'));
|
||||||
|
|
||||||
[
|
[
|
||||||
'vs/css.build.js',
|
'vs/css.build.js',
|
||||||
@@ -139,8 +140,7 @@ export function createESMSourcesAndResources2(options: IOptions2): void {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const allFiles = walkDirRecursive(SRC_FOLDER);
|
const allFiles = walkDirRecursive(SRC_FOLDER);
|
||||||
for (let i = 0; i < allFiles.length; i++) {
|
for (const file of allFiles) {
|
||||||
const file = allFiles[i];
|
|
||||||
|
|
||||||
if (options.ignores.indexOf(file.replace(/\\/g, '/')) >= 0) {
|
if (options.ignores.indexOf(file.replace(/\\/g, '/')) >= 0) {
|
||||||
continue;
|
continue;
|
||||||
@@ -244,7 +244,6 @@ export function createESMSourcesAndResources2(options: IOptions2): void {
|
|||||||
let mode = 0;
|
let mode = 0;
|
||||||
for (let i = 0; i < lines.length; i++) {
|
for (let i = 0; i < lines.length; i++) {
|
||||||
const line = lines[i];
|
const line = lines[i];
|
||||||
|
|
||||||
if (mode === 0) {
|
if (mode === 0) {
|
||||||
if (/\/\/ ESM-comment-begin/.test(line)) {
|
if (/\/\/ ESM-comment-begin/.test(line)) {
|
||||||
mode = 1;
|
mode = 1;
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const es = require("event-stream");
|
const es = require("event-stream");
|
||||||
const util = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const appInsights = require("applicationinsights");
|
const appInsights = require("applicationinsights");
|
||||||
class Entry {
|
class Entry {
|
||||||
constructor(name, totalCount, totalSize) {
|
constructor(name, totalCount, totalSize) {
|
||||||
@@ -24,13 +25,13 @@ class Entry {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (this.totalCount === 1) {
|
if (this.totalCount === 1) {
|
||||||
return `Stats for '${util.colors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
return `Stats for '${ansiColors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const count = this.totalCount < 100
|
const count = this.totalCount < 100
|
||||||
? util.colors.green(this.totalCount.toString())
|
? ansiColors.green(this.totalCount.toString())
|
||||||
: util.colors.red(this.totalCount.toString());
|
: ansiColors.red(this.totalCount.toString());
|
||||||
return `Stats for '${util.colors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
return `Stats for '${ansiColors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -57,13 +58,13 @@ function createStatsStream(group, log) {
|
|||||||
}, function () {
|
}, function () {
|
||||||
if (log) {
|
if (log) {
|
||||||
if (entry.totalCount === 1) {
|
if (entry.totalCount === 1) {
|
||||||
util.log(`Stats for '${util.colors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const count = entry.totalCount < 100
|
const count = entry.totalCount < 100
|
||||||
? util.colors.green(entry.totalCount.toString())
|
? ansiColors.green(entry.totalCount.toString())
|
||||||
: util.colors.red(entry.totalCount.toString());
|
: ansiColors.red(entry.totalCount.toString());
|
||||||
util.log(`Stats for '${util.colors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.emit('end');
|
this.emit('end');
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import * as es from 'event-stream';
|
import * as es from 'event-stream';
|
||||||
import * as util from 'gulp-util';
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
import * as File from 'vinyl';
|
import * as File from 'vinyl';
|
||||||
import * as appInsights from 'applicationinsights';
|
import * as appInsights from 'applicationinsights';
|
||||||
|
|
||||||
@@ -22,14 +23,14 @@ class Entry {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.totalCount === 1) {
|
if (this.totalCount === 1) {
|
||||||
return `Stats for '${util.colors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
return `Stats for '${ansiColors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const count = this.totalCount < 100
|
const count = this.totalCount < 100
|
||||||
? util.colors.green(this.totalCount.toString())
|
? ansiColors.green(this.totalCount.toString())
|
||||||
: util.colors.red(this.totalCount.toString());
|
: ansiColors.red(this.totalCount.toString());
|
||||||
|
|
||||||
return `Stats for '${util.colors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
return `Stats for '${ansiColors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -58,14 +59,14 @@ export function createStatsStream(group: string, log?: boolean): es.ThroughStrea
|
|||||||
}, function () {
|
}, function () {
|
||||||
if (log) {
|
if (log) {
|
||||||
if (entry.totalCount === 1) {
|
if (entry.totalCount === 1) {
|
||||||
util.log(`Stats for '${util.colors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const count = entry.totalCount < 100
|
const count = entry.totalCount < 100
|
||||||
? util.colors.green(entry.totalCount.toString())
|
? ansiColors.green(entry.totalCount.toString())
|
||||||
: util.colors.red(entry.totalCount.toString());
|
: ansiColors.red(entry.totalCount.toString());
|
||||||
|
|
||||||
util.log(`Stats for '${util.colors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
96
build/lib/task.js
Normal file
96
build/lib/task.js
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
'use strict';
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
|
function _isPromise(p) {
|
||||||
|
if (typeof p.then === 'function') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function _renderTime(time) {
|
||||||
|
return `${Math.round(time)} ms`;
|
||||||
|
}
|
||||||
|
async function _execute(task) {
|
||||||
|
const name = task.taskName || task.displayName || `<anonymous>`;
|
||||||
|
if (!task._tasks) {
|
||||||
|
fancyLog('Starting', ansiColors.cyan(name), '...');
|
||||||
|
}
|
||||||
|
const startTime = process.hrtime();
|
||||||
|
await _doExecute(task);
|
||||||
|
const elapsedArr = process.hrtime(startTime);
|
||||||
|
const elapsedNanoseconds = (elapsedArr[0] * 1e9 + elapsedArr[1]);
|
||||||
|
if (!task._tasks) {
|
||||||
|
fancyLog(`Finished`, ansiColors.cyan(name), 'after', ansiColors.magenta(_renderTime(elapsedNanoseconds / 1e6)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function _doExecute(task) {
|
||||||
|
// Always invoke as if it were a callback task
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (task.length === 1) {
|
||||||
|
// this is a callback task
|
||||||
|
task((err) => {
|
||||||
|
if (err) {
|
||||||
|
return reject(err);
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const taskResult = task();
|
||||||
|
if (typeof taskResult === 'undefined') {
|
||||||
|
// this is a sync task
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (_isPromise(taskResult)) {
|
||||||
|
// this is a promise returning task
|
||||||
|
taskResult.then(resolve, reject);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// this is a stream returning task
|
||||||
|
taskResult.on('end', _ => resolve());
|
||||||
|
taskResult.on('error', err => reject(err));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function series(...tasks) {
|
||||||
|
const result = async () => {
|
||||||
|
for (let i = 0; i < tasks.length; i++) {
|
||||||
|
await _execute(tasks[i]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
result._tasks = tasks;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
exports.series = series;
|
||||||
|
function parallel(...tasks) {
|
||||||
|
const result = async () => {
|
||||||
|
await Promise.all(tasks.map(t => _execute(t)));
|
||||||
|
};
|
||||||
|
result._tasks = tasks;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
exports.parallel = parallel;
|
||||||
|
function define(name, task) {
|
||||||
|
if (task._tasks) {
|
||||||
|
// This is a composite task
|
||||||
|
const lastTask = task._tasks[task._tasks.length - 1];
|
||||||
|
if (lastTask._tasks || lastTask.taskName) {
|
||||||
|
// This is a composite task without a real task function
|
||||||
|
// => generate a fake task function
|
||||||
|
return define(name, series(task, () => Promise.resolve()));
|
||||||
|
}
|
||||||
|
lastTask.taskName = name;
|
||||||
|
task.displayName = name;
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
// This is a simple task
|
||||||
|
task.taskName = name;
|
||||||
|
task.displayName = name;
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
exports.define = define;
|
||||||
125
build/lib/task.ts
Normal file
125
build/lib/task.ts
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
|
|
||||||
|
export interface BaseTask {
|
||||||
|
displayName?: string;
|
||||||
|
taskName?: string;
|
||||||
|
_tasks?: Task[];
|
||||||
|
}
|
||||||
|
export interface PromiseTask extends BaseTask {
|
||||||
|
(): Promise<void>;
|
||||||
|
}
|
||||||
|
export interface StreamTask extends BaseTask {
|
||||||
|
(): NodeJS.ReadWriteStream;
|
||||||
|
}
|
||||||
|
export interface CallbackTask extends BaseTask {
|
||||||
|
(cb?: (err?: any) => void): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Task = PromiseTask | StreamTask | CallbackTask;
|
||||||
|
|
||||||
|
function _isPromise(p: Promise<void> | NodeJS.ReadWriteStream): p is Promise<void> {
|
||||||
|
if (typeof (<any>p).then === 'function') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _renderTime(time: number): string {
|
||||||
|
return `${Math.round(time)} ms`;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function _execute(task: Task): Promise<void> {
|
||||||
|
const name = task.taskName || task.displayName || `<anonymous>`;
|
||||||
|
if (!task._tasks) {
|
||||||
|
fancyLog('Starting', ansiColors.cyan(name), '...');
|
||||||
|
}
|
||||||
|
const startTime = process.hrtime();
|
||||||
|
await _doExecute(task);
|
||||||
|
const elapsedArr = process.hrtime(startTime);
|
||||||
|
const elapsedNanoseconds = (elapsedArr[0] * 1e9 + elapsedArr[1]);
|
||||||
|
if (!task._tasks) {
|
||||||
|
fancyLog(`Finished`, ansiColors.cyan(name), 'after', ansiColors.magenta(_renderTime(elapsedNanoseconds / 1e6)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function _doExecute(task: Task): Promise<void> {
|
||||||
|
// Always invoke as if it were a callback task
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (task.length === 1) {
|
||||||
|
// this is a callback task
|
||||||
|
task((err) => {
|
||||||
|
if (err) {
|
||||||
|
return reject(err);
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const taskResult = task();
|
||||||
|
|
||||||
|
if (typeof taskResult === 'undefined') {
|
||||||
|
// this is a sync task
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_isPromise(taskResult)) {
|
||||||
|
// this is a promise returning task
|
||||||
|
taskResult.then(resolve, reject);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// this is a stream returning task
|
||||||
|
taskResult.on('end', _ => resolve());
|
||||||
|
taskResult.on('error', err => reject(err));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function series(...tasks: Task[]): PromiseTask {
|
||||||
|
const result = async () => {
|
||||||
|
for (let i = 0; i < tasks.length; i++) {
|
||||||
|
await _execute(tasks[i]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
result._tasks = tasks;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function parallel(...tasks: Task[]): PromiseTask {
|
||||||
|
const result = async () => {
|
||||||
|
await Promise.all(tasks.map(t => _execute(t)));
|
||||||
|
};
|
||||||
|
result._tasks = tasks;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function define(name: string, task: Task): Task {
|
||||||
|
if (task._tasks) {
|
||||||
|
// This is a composite task
|
||||||
|
const lastTask = task._tasks[task._tasks.length - 1];
|
||||||
|
|
||||||
|
if (lastTask._tasks || lastTask.taskName) {
|
||||||
|
// This is a composite task without a real task function
|
||||||
|
// => generate a fake task function
|
||||||
|
return define(name, series(task, () => Promise.resolve()));
|
||||||
|
}
|
||||||
|
|
||||||
|
lastTask.taskName = name;
|
||||||
|
task.displayName = name;
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is a simple task
|
||||||
|
task.taskName = name;
|
||||||
|
task.displayName = name;
|
||||||
|
return task;
|
||||||
|
}
|
||||||
@@ -27,13 +27,13 @@ suite('XLF Parser Tests', () => {
|
|||||||
});
|
});
|
||||||
test('JSON file source path to Transifex resource match', () => {
|
test('JSON file source path to Transifex resource match', () => {
|
||||||
const editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench';
|
const editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench';
|
||||||
const platform = { name: 'vs/platform', project: editorProject }, editorContrib = { name: 'vs/editor/contrib', project: editorProject }, editor = { name: 'vs/editor', project: editorProject }, base = { name: 'vs/base', project: editorProject }, code = { name: 'vs/code', project: workbenchProject }, workbenchParts = { name: 'vs/workbench/parts/html', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject }, workbench = { name: 'vs/workbench', project: workbenchProject };
|
const platform = { name: 'vs/platform', project: editorProject }, editorContrib = { name: 'vs/editor/contrib', project: editorProject }, editor = { name: 'vs/editor', project: editorProject }, base = { name: 'vs/base', project: editorProject }, code = { name: 'vs/code', project: workbenchProject }, workbenchParts = { name: 'vs/workbench/contrib/html', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject }, workbench = { name: 'vs/workbench', project: workbenchProject };
|
||||||
assert.deepEqual(i18n.getResource('vs/platform/actions/browser/menusExtensionPoint'), platform);
|
assert.deepEqual(i18n.getResource('vs/platform/actions/browser/menusExtensionPoint'), platform);
|
||||||
assert.deepEqual(i18n.getResource('vs/editor/contrib/clipboard/browser/clipboard'), editorContrib);
|
assert.deepEqual(i18n.getResource('vs/editor/contrib/clipboard/browser/clipboard'), editorContrib);
|
||||||
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
|
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
|
||||||
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base);
|
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base);
|
||||||
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code);
|
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/parts/html/browser/webview'), workbenchParts);
|
assert.deepEqual(i18n.getResource('vs/workbench/contrib/html/browser/webview'), workbenchParts);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices);
|
assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
|
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ suite('XLF Parser Tests', () => {
|
|||||||
editor = { name: 'vs/editor', project: editorProject },
|
editor = { name: 'vs/editor', project: editorProject },
|
||||||
base = { name: 'vs/base', project: editorProject },
|
base = { name: 'vs/base', project: editorProject },
|
||||||
code = { name: 'vs/code', project: workbenchProject },
|
code = { name: 'vs/code', project: workbenchProject },
|
||||||
workbenchParts = { name: 'vs/workbench/parts/html', project: workbenchProject },
|
workbenchParts = { name: 'vs/workbench/contrib/html', project: workbenchProject },
|
||||||
workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject },
|
workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject },
|
||||||
workbench = { name: 'vs/workbench', project: workbenchProject};
|
workbench = { name: 'vs/workbench', project: workbenchProject};
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ suite('XLF Parser Tests', () => {
|
|||||||
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
|
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
|
||||||
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base);
|
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base);
|
||||||
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code);
|
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/parts/html/browser/webview'), workbenchParts);
|
assert.deepEqual(i18n.getResource('vs/workbench/contrib/html/browser/webview'), workbenchParts);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices);
|
assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
|
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ var ShakeLevel;
|
|||||||
ShakeLevel[ShakeLevel["ClassMembers"] = 2] = "ClassMembers";
|
ShakeLevel[ShakeLevel["ClassMembers"] = 2] = "ClassMembers";
|
||||||
})(ShakeLevel = exports.ShakeLevel || (exports.ShakeLevel = {}));
|
})(ShakeLevel = exports.ShakeLevel || (exports.ShakeLevel = {}));
|
||||||
function printDiagnostics(diagnostics) {
|
function printDiagnostics(diagnostics) {
|
||||||
for (let i = 0; i < diagnostics.length; i++) {
|
for (const diag of diagnostics) {
|
||||||
const diag = diagnostics[i];
|
|
||||||
let result = '';
|
let result = '';
|
||||||
if (diag.file) {
|
if (diag.file) {
|
||||||
result += `${diag.file.fileName}: `;
|
result += `${diag.file.fileName}: `;
|
||||||
@@ -97,6 +96,11 @@ function discoverAndReadFiles(options) {
|
|||||||
FILES[`${moduleId}.d.ts`] = dts_filecontents;
|
FILES[`${moduleId}.d.ts`] = dts_filecontents;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
const js_filename = path.join(options.sourcesRoot, moduleId + '.js');
|
||||||
|
if (fs.existsSync(js_filename)) {
|
||||||
|
// This is an import for a .js file, so ignore it...
|
||||||
|
continue;
|
||||||
|
}
|
||||||
let ts_filename;
|
let ts_filename;
|
||||||
if (options.redirects[moduleId]) {
|
if (options.redirects[moduleId]) {
|
||||||
ts_filename = path.join(options.sourcesRoot, options.redirects[moduleId] + '.ts');
|
ts_filename = path.join(options.sourcesRoot, options.redirects[moduleId] + '.ts');
|
||||||
@@ -475,8 +479,7 @@ function generateResult(languageService, shakeLevel) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let survivingImports = [];
|
let survivingImports = [];
|
||||||
for (let i = 0; i < node.importClause.namedBindings.elements.length; i++) {
|
for (const importNode of node.importClause.namedBindings.elements) {
|
||||||
const importNode = node.importClause.namedBindings.elements[i];
|
|
||||||
if (getColor(importNode) === 2 /* Black */) {
|
if (getColor(importNode) === 2 /* Black */) {
|
||||||
survivingImports.push(importNode.getFullText(sourceFile));
|
survivingImports.push(importNode.getFullText(sourceFile));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,15 +61,14 @@ export interface ITreeShakingResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function printDiagnostics(diagnostics: ReadonlyArray<ts.Diagnostic>): void {
|
function printDiagnostics(diagnostics: ReadonlyArray<ts.Diagnostic>): void {
|
||||||
for (let i = 0; i < diagnostics.length; i++) {
|
for (const diag of diagnostics) {
|
||||||
const diag = diagnostics[i];
|
|
||||||
let result = '';
|
let result = '';
|
||||||
if (diag.file) {
|
if (diag.file) {
|
||||||
result += `${diag.file.fileName}: `;
|
result += `${diag.file.fileName}: `;
|
||||||
}
|
}
|
||||||
if (diag.file && diag.start) {
|
if (diag.file && diag.start) {
|
||||||
let location = diag.file.getLineAndCharacterOfPosition(diag.start);
|
let location = diag.file.getLineAndCharacterOfPosition(diag.start);
|
||||||
result += `- ${location.line + 1},${location.character} - `
|
result += `- ${location.line + 1},${location.character} - `;
|
||||||
}
|
}
|
||||||
result += JSON.stringify(diag.messageText);
|
result += JSON.stringify(diag.messageText);
|
||||||
console.log(result);
|
console.log(result);
|
||||||
@@ -160,6 +159,12 @@ function discoverAndReadFiles(options: ITreeShakingOptions): IFileMap {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const js_filename = path.join(options.sourcesRoot, moduleId + '.js');
|
||||||
|
if (fs.existsSync(js_filename)) {
|
||||||
|
// This is an import for a .js file, so ignore it...
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
let ts_filename: string;
|
let ts_filename: string;
|
||||||
if (options.redirects[moduleId]) {
|
if (options.redirects[moduleId]) {
|
||||||
ts_filename = path.join(options.sourcesRoot, options.redirects[moduleId] + '.ts');
|
ts_filename = path.join(options.sourcesRoot, options.redirects[moduleId] + '.ts');
|
||||||
@@ -459,7 +464,7 @@ function markNodes(languageService: ts.LanguageService, options: ITreeShakingOpt
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (black_queue.length === 0) {
|
if (black_queue.length === 0) {
|
||||||
for (let i = 0; i < gray_queue.length; i++) {
|
for (let i = 0; i< gray_queue.length; i++) {
|
||||||
const node = gray_queue[i];
|
const node = gray_queue[i];
|
||||||
const nodeParent = node.parent;
|
const nodeParent = node.parent;
|
||||||
if ((ts.isClassDeclaration(nodeParent) || ts.isInterfaceDeclaration(nodeParent)) && nodeOrChildIsBlack(nodeParent)) {
|
if ((ts.isClassDeclaration(nodeParent) || ts.isInterfaceDeclaration(nodeParent)) && nodeOrChildIsBlack(nodeParent)) {
|
||||||
@@ -604,8 +609,7 @@ function generateResult(languageService: ts.LanguageService, shakeLevel: ShakeLe
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let survivingImports: string[] = [];
|
let survivingImports: string[] = [];
|
||||||
for (let i = 0; i < node.importClause.namedBindings.elements.length; i++) {
|
for (const importNode of node.importClause.namedBindings.elements) {
|
||||||
const importNode = node.importClause.namedBindings.elements[i];
|
|
||||||
if (getColor(importNode) === NodeColor.Black) {
|
if (getColor(importNode) === NodeColor.Black) {
|
||||||
survivingImports.push(importNode.getFullText(sourceFile));
|
survivingImports.push(importNode.getFullText(sourceFile));
|
||||||
}
|
}
|
||||||
|
|||||||
54
build/lib/tslint/noNlsInStandaloneEditorRule.js
Normal file
54
build/lib/tslint/noNlsInStandaloneEditorRule.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
"use strict";
|
||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const ts = require("typescript");
|
||||||
|
const Lint = require("tslint");
|
||||||
|
const path_1 = require("path");
|
||||||
|
class Rule extends Lint.Rules.AbstractRule {
|
||||||
|
apply(sourceFile) {
|
||||||
|
if (/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(sourceFile.fileName)
|
||||||
|
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(sourceFile.fileName)
|
||||||
|
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(sourceFile.fileName)
|
||||||
|
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(sourceFile.fileName)
|
||||||
|
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(sourceFile.fileName)) {
|
||||||
|
return this.applyWithWalker(new NoNlsInStandaloneEditorRuleWalker(sourceFile, this.getOptions()));
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.Rule = Rule;
|
||||||
|
class NoNlsInStandaloneEditorRuleWalker extends Lint.RuleWalker {
|
||||||
|
constructor(file, opts) {
|
||||||
|
super(file, opts);
|
||||||
|
}
|
||||||
|
visitImportEqualsDeclaration(node) {
|
||||||
|
if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) {
|
||||||
|
this._validateImport(node.moduleReference.expression.getText(), node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
visitImportDeclaration(node) {
|
||||||
|
this._validateImport(node.moduleSpecifier.getText(), node);
|
||||||
|
}
|
||||||
|
visitCallExpression(node) {
|
||||||
|
super.visitCallExpression(node);
|
||||||
|
// import('foo') statements inside the code
|
||||||
|
if (node.expression.kind === ts.SyntaxKind.ImportKeyword) {
|
||||||
|
const [path] = node.arguments;
|
||||||
|
this._validateImport(path.getText(), node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_validateImport(path, node) {
|
||||||
|
// remove quotes
|
||||||
|
path = path.slice(1, -1);
|
||||||
|
// resolve relative paths
|
||||||
|
if (path[0] === '.') {
|
||||||
|
path = path_1.join(this.getSourceFile().fileName, path);
|
||||||
|
}
|
||||||
|
if (/vs(\/|\\)nls/.test(path)) {
|
||||||
|
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Not allowed to import vs/nls in standalone editor modules. Use standaloneStrings.ts`));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
67
build/lib/tslint/noNlsInStandaloneEditorRule.ts
Normal file
67
build/lib/tslint/noNlsInStandaloneEditorRule.ts
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
import * as ts from 'typescript';
|
||||||
|
import * as Lint from 'tslint';
|
||||||
|
import { join } from 'path';
|
||||||
|
|
||||||
|
export class Rule extends Lint.Rules.AbstractRule {
|
||||||
|
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
|
||||||
|
if (
|
||||||
|
/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(sourceFile.fileName)
|
||||||
|
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(sourceFile.fileName)
|
||||||
|
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(sourceFile.fileName)
|
||||||
|
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(sourceFile.fileName)
|
||||||
|
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(sourceFile.fileName)
|
||||||
|
) {
|
||||||
|
return this.applyWithWalker(new NoNlsInStandaloneEditorRuleWalker(sourceFile, this.getOptions()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class NoNlsInStandaloneEditorRuleWalker extends Lint.RuleWalker {
|
||||||
|
|
||||||
|
constructor(file: ts.SourceFile, opts: Lint.IOptions) {
|
||||||
|
super(file, opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected visitImportEqualsDeclaration(node: ts.ImportEqualsDeclaration): void {
|
||||||
|
if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) {
|
||||||
|
this._validateImport(node.moduleReference.expression.getText(), node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected visitImportDeclaration(node: ts.ImportDeclaration): void {
|
||||||
|
this._validateImport(node.moduleSpecifier.getText(), node);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected visitCallExpression(node: ts.CallExpression): void {
|
||||||
|
super.visitCallExpression(node);
|
||||||
|
|
||||||
|
// import('foo') statements inside the code
|
||||||
|
if (node.expression.kind === ts.SyntaxKind.ImportKeyword) {
|
||||||
|
const [path] = node.arguments;
|
||||||
|
this._validateImport(path.getText(), node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private _validateImport(path: string, node: ts.Node): void {
|
||||||
|
// remove quotes
|
||||||
|
path = path.slice(1, -1);
|
||||||
|
|
||||||
|
// resolve relative paths
|
||||||
|
if (path[0] === '.') {
|
||||||
|
path = join(this.getSourceFile().fileName, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
/vs(\/|\\)nls/.test(path)
|
||||||
|
) {
|
||||||
|
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Not allowed to import vs/nls in standalone editor modules. Use standaloneStrings.ts`));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -45,8 +45,8 @@ class NoStandaloneEditorRuleWalker extends Lint.RuleWalker {
|
|||||||
if (path[0] === '.') {
|
if (path[0] === '.') {
|
||||||
path = path_1.join(this.getSourceFile().fileName, path);
|
path = path_1.join(this.getSourceFile().fileName, path);
|
||||||
}
|
}
|
||||||
if (/vs(\/|\\)editor(\/|\\)standalone/.test(path)
|
if (/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(path)
|
||||||
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone/.test(path)
|
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(path)
|
||||||
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(path)
|
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(path)
|
||||||
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(path)
|
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(path)
|
||||||
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(path)) {
|
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(path)) {
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ class NoStandaloneEditorRuleWalker extends Lint.RuleWalker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
/vs(\/|\\)editor(\/|\\)standalone/.test(path)
|
/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(path)
|
||||||
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone/.test(path)
|
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(path)
|
||||||
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(path)
|
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(path)
|
||||||
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(path)
|
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(path)
|
||||||
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(path)
|
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(path)
|
||||||
|
|||||||
@@ -109,8 +109,7 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker {
|
|||||||
this.recordKey(keyArg, this.messageIndex && callInfo ? callInfo.callExpression.arguments[this.messageIndex] : undefined);
|
this.recordKey(keyArg, this.messageIndex && callInfo ? callInfo.callExpression.arguments[this.messageIndex] : undefined);
|
||||||
}
|
}
|
||||||
else if (isObjectLiteral(keyArg)) {
|
else if (isObjectLiteral(keyArg)) {
|
||||||
for (let i = 0; i < keyArg.properties.length; i++) {
|
for (const property of keyArg.properties) {
|
||||||
const property = keyArg.properties[i];
|
|
||||||
if (isPropertyAssignment(property)) {
|
if (isPropertyAssignment(property)) {
|
||||||
const name = property.name.getText();
|
const name = property.name.getText();
|
||||||
if (name === 'key') {
|
if (name === 'key') {
|
||||||
|
|||||||
@@ -148,8 +148,7 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker {
|
|||||||
if (isStringLiteral(keyArg)) {
|
if (isStringLiteral(keyArg)) {
|
||||||
this.recordKey(keyArg, this.messageIndex && callInfo ? callInfo.callExpression.arguments[this.messageIndex] : undefined);
|
this.recordKey(keyArg, this.messageIndex && callInfo ? callInfo.callExpression.arguments[this.messageIndex] : undefined);
|
||||||
} else if (isObjectLiteral(keyArg)) {
|
} else if (isObjectLiteral(keyArg)) {
|
||||||
for (let i = 0; i < keyArg.properties.length; i++) {
|
for (const property of keyArg.properties) {
|
||||||
const property = keyArg.properties[i];
|
|
||||||
if (isPropertyAssignment(property)) {
|
if (isPropertyAssignment(property)) {
|
||||||
const name = property.name.getText();
|
const name = property.name.getText();
|
||||||
if (name === 'key') {
|
if (name === 'key') {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class TranslationRemindRuleWalker extends Lint.RuleWalker {
|
|||||||
visitImportLikeDeclaration(node) {
|
visitImportLikeDeclaration(node) {
|
||||||
const currentFile = node.getSourceFile().fileName;
|
const currentFile = node.getSourceFile().fileName;
|
||||||
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
|
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
|
||||||
const matchPart = currentFile.match(/vs\/workbench\/parts\/\w+/);
|
const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/);
|
||||||
if (!matchService && !matchPart) {
|
if (!matchService && !matchPart) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class TranslationRemindRuleWalker extends Lint.RuleWalker {
|
|||||||
private visitImportLikeDeclaration(node: ts.ImportDeclaration | ts.ImportEqualsDeclaration) {
|
private visitImportLikeDeclaration(node: ts.ImportDeclaration | ts.ImportEqualsDeclaration) {
|
||||||
const currentFile = node.getSourceFile().fileName;
|
const currentFile = node.getSourceFile().fileName;
|
||||||
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
|
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
|
||||||
const matchPart = currentFile.match(/vs\/workbench\/parts\/\w+/);
|
const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/);
|
||||||
if (!matchService && !matchPart) {
|
if (!matchService && !matchPart) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,12 +8,13 @@ const es = require("event-stream");
|
|||||||
const debounce = require("debounce");
|
const debounce = require("debounce");
|
||||||
const _filter = require("gulp-filter");
|
const _filter = require("gulp-filter");
|
||||||
const rename = require("gulp-rename");
|
const rename = require("gulp-rename");
|
||||||
const _ = require("underscore");
|
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const _rimraf = require("rimraf");
|
const _rimraf = require("rimraf");
|
||||||
const git = require("./git");
|
const git = require("./git");
|
||||||
const VinylFile = require("vinyl");
|
const VinylFile = require("vinyl");
|
||||||
|
const download_1 = require("../download/download");
|
||||||
|
const REPO_ROOT = path.join(__dirname, '../../');
|
||||||
const NoCancellationToken = { isCancellationRequested: () => false };
|
const NoCancellationToken = { isCancellationRequested: () => false };
|
||||||
function incremental(streamProvider, initial, supportsCancellation) {
|
function incremental(streamProvider, initial, supportsCancellation) {
|
||||||
const input = es.through();
|
const input = es.through();
|
||||||
@@ -98,22 +99,18 @@ function skipDirectories() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.skipDirectories = skipDirectories;
|
exports.skipDirectories = skipDirectories;
|
||||||
function cleanNodeModule(name, excludes, includes) {
|
function cleanNodeModules(rulePath) {
|
||||||
const toGlob = (path) => '**/node_modules/' + name + (path ? '/' + path : '');
|
const rules = fs.readFileSync(rulePath, 'utf8')
|
||||||
const negate = (str) => '!' + str;
|
.split(/\r?\n/g)
|
||||||
const allFilter = _filter(toGlob('**'), { restore: true });
|
.map(line => line.trim())
|
||||||
const globs = [toGlob('**')].concat(excludes.map(_.compose(negate, toGlob)));
|
.filter(line => line && !/^#/.test(line));
|
||||||
|
const excludes = rules.filter(line => !/^!/.test(line)).map(line => `!**/node_modules/${line}`);
|
||||||
|
const includes = rules.filter(line => /^!/.test(line)).map(line => `**/node_modules/${line.substr(1)}`);
|
||||||
const input = es.through();
|
const input = es.through();
|
||||||
const nodeModuleInput = input.pipe(allFilter);
|
const output = es.merge(input.pipe(_filter(['**', ...excludes])), input.pipe(_filter(includes)));
|
||||||
let output = nodeModuleInput.pipe(_filter(globs));
|
|
||||||
if (includes) {
|
|
||||||
const includeGlobs = includes.map(toGlob);
|
|
||||||
output = es.merge(output, nodeModuleInput.pipe(_filter(includeGlobs)));
|
|
||||||
}
|
|
||||||
output = output.pipe(allFilter.restore);
|
|
||||||
return es.duplex(input, output);
|
return es.duplex(input, output);
|
||||||
}
|
}
|
||||||
exports.cleanNodeModule = cleanNodeModule;
|
exports.cleanNodeModules = cleanNodeModules;
|
||||||
function loadSourcemaps() {
|
function loadSourcemaps() {
|
||||||
const input = es.through();
|
const input = es.through();
|
||||||
const output = input
|
const output = input
|
||||||
@@ -180,7 +177,8 @@ function rimraf(dir) {
|
|||||||
return cb(err);
|
return cb(err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
return cb => retry(cb);
|
retry.taskName = `clean-${path.basename(dir)}`;
|
||||||
|
return retry;
|
||||||
}
|
}
|
||||||
exports.rimraf = rimraf;
|
exports.rimraf = rimraf;
|
||||||
function getVersion(root) {
|
function getVersion(root) {
|
||||||
@@ -220,3 +218,38 @@ function versionStringToNumber(versionStr) {
|
|||||||
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
|
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
|
||||||
}
|
}
|
||||||
exports.versionStringToNumber = versionStringToNumber;
|
exports.versionStringToNumber = versionStringToNumber;
|
||||||
|
function download(requestOptions) {
|
||||||
|
const result = es.through();
|
||||||
|
const filename = path.join(REPO_ROOT, `.build/tmp-${Date.now()}-${path.posix.basename(requestOptions.path)}`);
|
||||||
|
const opts = {
|
||||||
|
requestOptions: requestOptions,
|
||||||
|
destinationPath: filename
|
||||||
|
};
|
||||||
|
download_1.downloadInExternalProcess(opts).then(() => {
|
||||||
|
fs.stat(filename, (err, stat) => {
|
||||||
|
if (err) {
|
||||||
|
result.emit('error', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fs.readFile(filename, (err, data) => {
|
||||||
|
if (err) {
|
||||||
|
result.emit('error', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fs.unlink(filename, () => {
|
||||||
|
result.emit('data', new VinylFile({
|
||||||
|
path: path.normalize(requestOptions.path),
|
||||||
|
stat: stat,
|
||||||
|
base: path.normalize(requestOptions.path),
|
||||||
|
contents: data
|
||||||
|
}));
|
||||||
|
result.emit('end');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}, (err) => {
|
||||||
|
result.emit('error', err);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
exports.download = download;
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ import * as git from './git';
|
|||||||
import * as VinylFile from 'vinyl';
|
import * as VinylFile from 'vinyl';
|
||||||
import { ThroughStream } from 'through';
|
import { ThroughStream } from 'through';
|
||||||
import * as sm from 'source-map';
|
import * as sm from 'source-map';
|
||||||
|
import { IDownloadOptions, downloadInExternalProcess, IDownloadRequestOptions } from '../download/download';
|
||||||
|
|
||||||
|
const REPO_ROOT = path.join(__dirname, '../../');
|
||||||
|
|
||||||
export interface ICancellationToken {
|
export interface ICancellationToken {
|
||||||
isCancellationRequested(): boolean;
|
isCancellationRequested(): boolean;
|
||||||
@@ -129,23 +132,21 @@ export function skipDirectories(): NodeJS.ReadWriteStream {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function cleanNodeModule(name: string, excludes: string[], includes?: string[]): NodeJS.ReadWriteStream {
|
export function cleanNodeModules(rulePath: string): NodeJS.ReadWriteStream {
|
||||||
const toGlob = (path: string) => '**/node_modules/' + name + (path ? '/' + path : '');
|
const rules = fs.readFileSync(rulePath, 'utf8')
|
||||||
const negate = (str: string) => '!' + str;
|
.split(/\r?\n/g)
|
||||||
|
.map(line => line.trim())
|
||||||
|
.filter(line => line && !/^#/.test(line));
|
||||||
|
|
||||||
const allFilter = _filter(toGlob('**'), { restore: true });
|
const excludes = rules.filter(line => !/^!/.test(line)).map(line => `!**/node_modules/${line}`);
|
||||||
const globs = [toGlob('**')].concat(excludes.map(_.compose(negate, toGlob) as (x: string) => string));
|
const includes = rules.filter(line => /^!/.test(line)).map(line => `**/node_modules/${line.substr(1)}`);
|
||||||
|
|
||||||
const input = es.through();
|
const input = es.through();
|
||||||
const nodeModuleInput = input.pipe(allFilter);
|
const output = es.merge(
|
||||||
let output: NodeJS.ReadWriteStream = nodeModuleInput.pipe(_filter(globs));
|
input.pipe(_filter(['**', ...excludes])),
|
||||||
|
input.pipe(_filter(includes))
|
||||||
|
);
|
||||||
|
|
||||||
if (includes) {
|
|
||||||
const includeGlobs = includes.map(toGlob);
|
|
||||||
output = es.merge(output, nodeModuleInput.pipe(_filter(includeGlobs)));
|
|
||||||
}
|
|
||||||
|
|
||||||
output = output.pipe(allFilter.restore);
|
|
||||||
return es.duplex(input, output);
|
return es.duplex(input, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,8 +234,8 @@ export function rimraf(dir: string): (cb: any) => void {
|
|||||||
return cb(err);
|
return cb(err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
retry.taskName = `clean-${path.basename(dir)}`;
|
||||||
return cb => retry(cb);
|
return retry;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getVersion(root: string): string | undefined {
|
export function getVersion(root: string): string | undefined {
|
||||||
@@ -280,3 +281,38 @@ export function versionStringToNumber(versionStr: string) {
|
|||||||
|
|
||||||
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
|
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function download(requestOptions: IDownloadRequestOptions): NodeJS.ReadWriteStream {
|
||||||
|
const result = es.through();
|
||||||
|
const filename = path.join(REPO_ROOT, `.build/tmp-${Date.now()}-${path.posix.basename(requestOptions.path)}`);
|
||||||
|
const opts: IDownloadOptions = {
|
||||||
|
requestOptions: requestOptions,
|
||||||
|
destinationPath: filename
|
||||||
|
};
|
||||||
|
downloadInExternalProcess(opts).then(() => {
|
||||||
|
fs.stat(filename, (err, stat) => {
|
||||||
|
if (err) {
|
||||||
|
result.emit('error', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fs.readFile(filename, (err, data) => {
|
||||||
|
if (err) {
|
||||||
|
result.emit('error', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fs.unlink(filename, () => {
|
||||||
|
result.emit('data', new VinylFile({
|
||||||
|
path: path.normalize(requestOptions.path),
|
||||||
|
stat: stat,
|
||||||
|
base: path.normalize(requestOptions.path),
|
||||||
|
contents: data
|
||||||
|
}));
|
||||||
|
result.emit('end');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}, (err) => {
|
||||||
|
result.emit('error', err);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ function handleDeletions() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let watch = void 0;
|
let watch = undefined;
|
||||||
|
|
||||||
if (!watch) {
|
if (!watch) {
|
||||||
watch = process.platform === 'win32' ? require('./watch-win32') : require('gulp-watch');
|
watch = process.platform === 'win32' ? require('./watch-win32') : require('gulp-watch');
|
||||||
|
|||||||
@@ -7,23 +7,54 @@ herein, whether by implication, estoppel or otherwise.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%% nodejs path library (https://github.com/nodejs/node/tree/43dd49c9782848c25e5b03448c8a0f923f13c158)
|
||||||
%% winjs version 4.4.0 (https://github.com/winjs/winjs)
|
|
||||||
=========================================
|
=========================================
|
||||||
WinJS
|
Copyright Joyent, Inc. and other Node contributors.
|
||||||
|
|
||||||
Copyright (c) Microsoft Corporation
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||||
|
persons to whom the Software is furnished to do so, subject to the
|
||||||
|
following conditions:
|
||||||
|
|
||||||
All rights reserved.
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
MIT License
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||||
|
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||||
|
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||||
|
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
=========================================
|
||||||
|
END OF nodejs path library NOTICES AND INFORMATION
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
%% promise-polyfill version 8.1.0 (https://github.com/taylorhakes/promise-polyfill)
|
||||||
|
=========================================
|
||||||
|
Copyright (c) 2014 Taylor Hakes
|
||||||
|
Copyright (c) 2014 Forbes Lindesay
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
=========================================
|
=========================================
|
||||||
END OF winjs NOTICES AND INFORMATION
|
END OF winjs NOTICES AND INFORMATION
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const ts = require("typescript");
|
const ts = require("typescript");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const util = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const dtsv = '2';
|
const dtsv = '2';
|
||||||
const tsfmt = require('../../tsfmt.json');
|
const tsfmt = require('../../tsfmt.json');
|
||||||
const SRC = path.join(__dirname, '../../src');
|
const SRC = path.join(__dirname, '../../src');
|
||||||
exports.RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
|
exports.RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
|
||||||
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
||||||
function logErr(message, ...rest) {
|
function logErr(message, ...rest) {
|
||||||
util.log(util.colors.yellow(`[monaco.d.ts]`), message, ...rest);
|
fancyLog(ansiColors.yellow(`[monaco.d.ts]`), message, ...rest);
|
||||||
}
|
}
|
||||||
function isDeclaration(a) {
|
function isDeclaration(a) {
|
||||||
return (a.kind === ts.SyntaxKind.InterfaceDeclaration
|
return (a.kind === ts.SyntaxKind.InterfaceDeclaration
|
||||||
@@ -456,11 +457,20 @@ class FSProvider {
|
|||||||
existsSync(filePath) {
|
existsSync(filePath) {
|
||||||
return fs.existsSync(filePath);
|
return fs.existsSync(filePath);
|
||||||
}
|
}
|
||||||
|
statSync(filePath) {
|
||||||
|
return fs.statSync(filePath);
|
||||||
|
}
|
||||||
readFileSync(_moduleId, filePath) {
|
readFileSync(_moduleId, filePath) {
|
||||||
return fs.readFileSync(filePath);
|
return fs.readFileSync(filePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.FSProvider = FSProvider;
|
exports.FSProvider = FSProvider;
|
||||||
|
class CacheEntry {
|
||||||
|
constructor(sourceFile, mtime) {
|
||||||
|
this.sourceFile = sourceFile;
|
||||||
|
this.mtime = mtime;
|
||||||
|
}
|
||||||
|
}
|
||||||
class DeclarationResolver {
|
class DeclarationResolver {
|
||||||
constructor(_fsProvider) {
|
constructor(_fsProvider) {
|
||||||
this._fsProvider = _fsProvider;
|
this._fsProvider = _fsProvider;
|
||||||
@@ -470,31 +480,43 @@ class DeclarationResolver {
|
|||||||
this._sourceFileCache[moduleId] = null;
|
this._sourceFileCache[moduleId] = null;
|
||||||
}
|
}
|
||||||
getDeclarationSourceFile(moduleId) {
|
getDeclarationSourceFile(moduleId) {
|
||||||
|
if (this._sourceFileCache[moduleId]) {
|
||||||
|
// Since we cannot trust file watching to invalidate the cache, check also the mtime
|
||||||
|
const fileName = this._getFileName(moduleId);
|
||||||
|
const mtime = this._fsProvider.statSync(fileName).mtime.getTime();
|
||||||
|
if (this._sourceFileCache[moduleId].mtime !== mtime) {
|
||||||
|
this._sourceFileCache[moduleId] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!this._sourceFileCache[moduleId]) {
|
if (!this._sourceFileCache[moduleId]) {
|
||||||
this._sourceFileCache[moduleId] = this._getDeclarationSourceFile(moduleId);
|
this._sourceFileCache[moduleId] = this._getDeclarationSourceFile(moduleId);
|
||||||
}
|
}
|
||||||
return this._sourceFileCache[moduleId];
|
return this._sourceFileCache[moduleId] ? this._sourceFileCache[moduleId].sourceFile : null;
|
||||||
|
}
|
||||||
|
_getFileName(moduleId) {
|
||||||
|
if (/\.d\.ts$/.test(moduleId)) {
|
||||||
|
return path.join(SRC, moduleId);
|
||||||
|
}
|
||||||
|
return path.join(SRC, `${moduleId}.ts`);
|
||||||
}
|
}
|
||||||
_getDeclarationSourceFile(moduleId) {
|
_getDeclarationSourceFile(moduleId) {
|
||||||
if (/\.d\.ts$/.test(moduleId)) {
|
const fileName = this._getFileName(moduleId);
|
||||||
const fileName = path.join(SRC, moduleId);
|
|
||||||
if (!this._fsProvider.existsSync(fileName)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
|
||||||
return ts.createSourceFile(fileName, fileContents, ts.ScriptTarget.ES5);
|
|
||||||
}
|
|
||||||
const fileName = path.join(SRC, `${moduleId}.ts`);
|
|
||||||
if (!this._fsProvider.existsSync(fileName)) {
|
if (!this._fsProvider.existsSync(fileName)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
const mtime = this._fsProvider.statSync(fileName).mtime.getTime();
|
||||||
|
if (/\.d\.ts$/.test(moduleId)) {
|
||||||
|
// const mtime = this._fsProvider.statFileSync()
|
||||||
|
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
||||||
|
return new CacheEntry(ts.createSourceFile(fileName, fileContents, ts.ScriptTarget.ES5), mtime);
|
||||||
|
}
|
||||||
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
||||||
const fileMap = {
|
const fileMap = {
|
||||||
'file.ts': fileContents
|
'file.ts': fileContents
|
||||||
};
|
};
|
||||||
const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {}));
|
const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {}));
|
||||||
const text = service.getEmitOutput('file.ts', true).outputFiles[0].text;
|
const text = service.getEmitOutput('file.ts', true).outputFiles[0].text;
|
||||||
return ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5);
|
return new CacheEntry(ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5), mtime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.DeclarationResolver = DeclarationResolver;
|
exports.DeclarationResolver = DeclarationResolver;
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as ts from 'typescript';
|
import * as ts from 'typescript';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as util from 'gulp-util';
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
|
|
||||||
const dtsv = '2';
|
const dtsv = '2';
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ export const RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
|
|||||||
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
||||||
|
|
||||||
function logErr(message: any, ...rest: any[]): void {
|
function logErr(message: any, ...rest: any[]): void {
|
||||||
util.log(util.colors.yellow(`[monaco.d.ts]`), message, ...rest);
|
fancyLog(ansiColors.yellow(`[monaco.d.ts]`), message, ...rest);
|
||||||
}
|
}
|
||||||
|
|
||||||
type SourceFileGetter = (moduleId: string) => ts.SourceFile | null;
|
type SourceFileGetter = (moduleId: string) => ts.SourceFile | null;
|
||||||
@@ -547,14 +548,24 @@ export class FSProvider {
|
|||||||
public existsSync(filePath: string): boolean {
|
public existsSync(filePath: string): boolean {
|
||||||
return fs.existsSync(filePath);
|
return fs.existsSync(filePath);
|
||||||
}
|
}
|
||||||
|
public statSync(filePath: string): fs.Stats {
|
||||||
|
return fs.statSync(filePath);
|
||||||
|
}
|
||||||
public readFileSync(_moduleId: string, filePath: string): Buffer {
|
public readFileSync(_moduleId: string, filePath: string): Buffer {
|
||||||
return fs.readFileSync(filePath);
|
return fs.readFileSync(filePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class CacheEntry {
|
||||||
|
constructor(
|
||||||
|
public readonly sourceFile: ts.SourceFile,
|
||||||
|
public readonly mtime: number
|
||||||
|
) {}
|
||||||
|
}
|
||||||
|
|
||||||
export class DeclarationResolver {
|
export class DeclarationResolver {
|
||||||
|
|
||||||
private _sourceFileCache: { [moduleId: string]: ts.SourceFile | null; };
|
private _sourceFileCache: { [moduleId: string]: CacheEntry | null; };
|
||||||
|
|
||||||
constructor(private readonly _fsProvider: FSProvider) {
|
constructor(private readonly _fsProvider: FSProvider) {
|
||||||
this._sourceFileCache = Object.create(null);
|
this._sourceFileCache = Object.create(null);
|
||||||
@@ -565,32 +576,51 @@ export class DeclarationResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getDeclarationSourceFile(moduleId: string): ts.SourceFile | null {
|
public getDeclarationSourceFile(moduleId: string): ts.SourceFile | null {
|
||||||
|
if (this._sourceFileCache[moduleId]) {
|
||||||
|
// Since we cannot trust file watching to invalidate the cache, check also the mtime
|
||||||
|
const fileName = this._getFileName(moduleId);
|
||||||
|
const mtime = this._fsProvider.statSync(fileName).mtime.getTime();
|
||||||
|
if (this._sourceFileCache[moduleId]!.mtime !== mtime) {
|
||||||
|
this._sourceFileCache[moduleId] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!this._sourceFileCache[moduleId]) {
|
if (!this._sourceFileCache[moduleId]) {
|
||||||
this._sourceFileCache[moduleId] = this._getDeclarationSourceFile(moduleId);
|
this._sourceFileCache[moduleId] = this._getDeclarationSourceFile(moduleId);
|
||||||
}
|
}
|
||||||
return this._sourceFileCache[moduleId];
|
return this._sourceFileCache[moduleId] ? this._sourceFileCache[moduleId]!.sourceFile : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _getDeclarationSourceFile(moduleId: string): ts.SourceFile | null {
|
private _getFileName(moduleId: string): string {
|
||||||
if (/\.d\.ts$/.test(moduleId)) {
|
if (/\.d\.ts$/.test(moduleId)) {
|
||||||
const fileName = path.join(SRC, moduleId);
|
return path.join(SRC, moduleId);
|
||||||
if (!this._fsProvider.existsSync(fileName)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
|
||||||
return ts.createSourceFile(fileName, fileContents, ts.ScriptTarget.ES5);
|
|
||||||
}
|
}
|
||||||
const fileName = path.join(SRC, `${moduleId}.ts`);
|
return path.join(SRC, `${moduleId}.ts`);
|
||||||
|
}
|
||||||
|
|
||||||
|
private _getDeclarationSourceFile(moduleId: string): CacheEntry | null {
|
||||||
|
const fileName = this._getFileName(moduleId);
|
||||||
if (!this._fsProvider.existsSync(fileName)) {
|
if (!this._fsProvider.existsSync(fileName)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
const mtime = this._fsProvider.statSync(fileName).mtime.getTime();
|
||||||
|
if (/\.d\.ts$/.test(moduleId)) {
|
||||||
|
// const mtime = this._fsProvider.statFileSync()
|
||||||
|
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
||||||
|
return new CacheEntry(
|
||||||
|
ts.createSourceFile(fileName, fileContents, ts.ScriptTarget.ES5),
|
||||||
|
mtime
|
||||||
|
);
|
||||||
|
}
|
||||||
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
||||||
const fileMap: IFileMap = {
|
const fileMap: IFileMap = {
|
||||||
'file.ts': fileContents
|
'file.ts': fileContents
|
||||||
};
|
};
|
||||||
const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {}));
|
const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {}));
|
||||||
const text = service.getEmitOutput('file.ts', true).outputFiles[0].text;
|
const text = service.getEmitOutput('file.ts', true).outputFiles[0].text;
|
||||||
return ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5);
|
return new CacheEntry(
|
||||||
|
ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5),
|
||||||
|
mtime
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,12 +21,11 @@ declare namespace monaco {
|
|||||||
export class Emitter<T> {
|
export class Emitter<T> {
|
||||||
constructor();
|
constructor();
|
||||||
readonly event: Event<T>;
|
readonly event: Event<T>;
|
||||||
fire(event?: T): void;
|
fire(event: T): void;
|
||||||
dispose(): void;
|
dispose(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include(vs/platform/markers/common/markers): MarkerTag, MarkerSeverity
|
#include(vs/platform/markers/common/markers): MarkerTag, MarkerSeverity
|
||||||
#include(vs/base/common/winjs.base.d.ts): Promise
|
|
||||||
#include(vs/base/common/cancellation): CancellationTokenSource, CancellationToken
|
#include(vs/base/common/cancellation): CancellationTokenSource, CancellationToken
|
||||||
#include(vs/base/common/uri): URI, UriComponents
|
#include(vs/base/common/uri): URI, UriComponents
|
||||||
#include(vs/base/common/keyCodes): KeyCode
|
#include(vs/base/common/keyCodes): KeyCode
|
||||||
@@ -86,4 +85,4 @@ declare namespace monaco.worker {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//dtsv=2
|
//dtsv=2
|
||||||
|
|||||||
@@ -10,9 +10,10 @@ import { CountBadge } from './vs/base/browser/ui/countBadge/countBadge';
|
|||||||
import { SimpleWorkerClient, create as create1 } from './vs/base/common/worker/simpleWorker';
|
import { SimpleWorkerClient, create as create1 } from './vs/base/common/worker/simpleWorker';
|
||||||
import { create as create2 } from './vs/editor/common/services/editorSimpleWorker';
|
import { create as create2 } from './vs/editor/common/services/editorSimpleWorker';
|
||||||
import { QuickOpenWidget } from './vs/base/parts/quickopen/browser/quickOpenWidget';
|
import { QuickOpenWidget } from './vs/base/parts/quickopen/browser/quickOpenWidget';
|
||||||
|
import { WorkbenchAsyncDataTree } from './vs/platform/list/browser/listService';
|
||||||
import { SyncDescriptor0, SyncDescriptor1, SyncDescriptor2, SyncDescriptor3, SyncDescriptor4, SyncDescriptor5, SyncDescriptor6, SyncDescriptor7, SyncDescriptor8 } from './vs/platform/instantiation/common/descriptors';
|
import { SyncDescriptor0, SyncDescriptor1, SyncDescriptor2, SyncDescriptor3, SyncDescriptor4, SyncDescriptor5, SyncDescriptor6, SyncDescriptor7, SyncDescriptor8 } from './vs/platform/instantiation/common/descriptors';
|
||||||
import { PolyfillPromise } from './vs/base/common/winjs.polyfill.promise';
|
|
||||||
import { DiffNavigator } from './vs/editor/browser/widget/diffNavigator';
|
import { DiffNavigator } from './vs/editor/browser/widget/diffNavigator';
|
||||||
|
import { DocumentRangeFormattingEditProvider } from './vs/editor/common/modes';
|
||||||
import * as editorAPI from './vs/editor/editor.api';
|
import * as editorAPI from './vs/editor/editor.api';
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
@@ -23,6 +24,7 @@ import * as editorAPI from './vs/editor/editor.api';
|
|||||||
a = (<IWorkspaceContextService>b).getWorkspace; // IWorkspaceFolderProvider
|
a = (<IWorkspaceContextService>b).getWorkspace; // IWorkspaceFolderProvider
|
||||||
a = (<CountBadge>b).style; // IThemable
|
a = (<CountBadge>b).style; // IThemable
|
||||||
a = (<QuickOpenWidget>b).style; // IThemable
|
a = (<QuickOpenWidget>b).style; // IThemable
|
||||||
|
a = (<WorkbenchAsyncDataTree<any,any>>b).style; // IThemable
|
||||||
a = (<IEnvironmentService>b).userHome; // IUserHomeProvider
|
a = (<IEnvironmentService>b).userHome; // IUserHomeProvider
|
||||||
a = (<DiffNavigator>b).previous; // IDiffNavigator
|
a = (<DiffNavigator>b).previous; // IDiffNavigator
|
||||||
a = (<ServiceIdentifier<any>>b).type;
|
a = (<ServiceIdentifier<any>>b).type;
|
||||||
@@ -31,14 +33,7 @@ import * as editorAPI from './vs/editor/editor.api';
|
|||||||
a = (<SimpleWorkerClient<any>>b).getProxyObject; // IWorkerClient
|
a = (<SimpleWorkerClient<any>>b).getProxyObject; // IWorkerClient
|
||||||
a = create1;
|
a = create1;
|
||||||
a = create2;
|
a = create2;
|
||||||
|
a = (<DocumentRangeFormattingEditProvider>b).extensionId;
|
||||||
// promise polyfill
|
|
||||||
a = PolyfillPromise.all;
|
|
||||||
a = PolyfillPromise.race;
|
|
||||||
a = PolyfillPromise.resolve;
|
|
||||||
a = PolyfillPromise.reject;
|
|
||||||
a = (<PolyfillPromise>b).then;
|
|
||||||
a = (<PolyfillPromise>b).catch;
|
|
||||||
|
|
||||||
// injection madness
|
// injection madness
|
||||||
a = (<SyncDescriptor0<any>>b).ctor;
|
a = (<SyncDescriptor0<any>>b).ctor;
|
||||||
@@ -73,7 +68,6 @@ import * as editorAPI from './vs/editor/editor.api';
|
|||||||
a = editorAPI.SelectionDirection;
|
a = editorAPI.SelectionDirection;
|
||||||
a = editorAPI.MarkerSeverity;
|
a = editorAPI.MarkerSeverity;
|
||||||
a = editorAPI.MarkerTag;
|
a = editorAPI.MarkerTag;
|
||||||
a = editorAPI.Promise;
|
|
||||||
a = editorAPI.Uri;
|
a = editorAPI.Uri;
|
||||||
a = editorAPI.Token;
|
a = editorAPI.Token;
|
||||||
a = editorAPI.editor;
|
a = editorAPI.editor;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "monaco-editor-core",
|
"name": "monaco-editor-core",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.14.3",
|
"version": "0.16.0",
|
||||||
"description": "A browser based code editor",
|
"description": "A browser based code editor",
|
||||||
"author": "Microsoft Corporation",
|
"author": "Microsoft Corporation",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -17,7 +17,17 @@ function yarnInstall(location, opts) {
|
|||||||
opts.cwd = location;
|
opts.cwd = location;
|
||||||
opts.stdio = 'inherit';
|
opts.stdio = 'inherit';
|
||||||
|
|
||||||
const result = cp.spawnSync(yarn, ['install'], opts);
|
const raw = process.env['npm_config_argv'] || '{}';
|
||||||
|
const argv = JSON.parse(raw);
|
||||||
|
const original = argv.original || [];
|
||||||
|
const args = ['install'];
|
||||||
|
|
||||||
|
if (original.indexOf('--ignore-optional') > -1) {
|
||||||
|
args.push('--ignore-optional');
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('Installing dependencies in \'%s\'.', location);
|
||||||
|
const result = cp.spawnSync(yarn, args, opts);
|
||||||
|
|
||||||
if (result.error || result.status !== 0) {
|
if (result.error || result.status !== 0) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
@@ -26,6 +36,8 @@ function yarnInstall(location, opts) {
|
|||||||
|
|
||||||
yarnInstall('extensions'); // node modules shared by all extensions
|
yarnInstall('extensions'); // node modules shared by all extensions
|
||||||
|
|
||||||
|
yarnInstall('remote'); // node modules used by vscode server
|
||||||
|
|
||||||
const allExtensionFolders = fs.readdirSync('extensions');
|
const allExtensionFolders = fs.readdirSync('extensions');
|
||||||
const extensions = allExtensionFolders.filter(e => {
|
const extensions = allExtensionFolders.filter(e => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user