mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-11 10:43:31 +02:00
Compare commits
924 Commits
v1.0.1
...
@tauri-app
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf331cdc3e | ||
|
|
574076541a | ||
|
|
89f3048f52 | ||
|
|
08f57efefd | ||
|
|
63da834ce4 | ||
|
|
c2d3afa4fb | ||
|
|
924387092e | ||
|
|
d2786bf699 | ||
|
|
674accad75 | ||
|
|
09152d83e1 | ||
|
|
3752eb1e6b | ||
|
|
d104abb656 | ||
|
|
940aa183c7 | ||
|
|
a423c52c1c | ||
|
|
c12ed92da5 | ||
|
|
8b66174f0d | ||
|
|
07b02c9f96 | ||
|
|
8ee8f09390 | ||
|
|
78fc841370 | ||
|
|
a301be52d2 | ||
|
|
5909662766 | ||
|
|
253595a22d | ||
|
|
a020828d0e | ||
|
|
e48157da2f | ||
|
|
44e3335da8 | ||
|
|
bf708a21a8 | ||
|
|
f6d81dfe08 | ||
|
|
50aabad1f6 | ||
|
|
d78fa20d86 | ||
|
|
3b69c1384b | ||
|
|
704260bb3c | ||
|
|
36b082a9c8 | ||
|
|
f45d35cf06 | ||
|
|
ef35a793c5 | ||
|
|
15c62b5d99 | ||
|
|
9b90b67ed2 | ||
|
|
f1b0b00159 | ||
|
|
6bb721cd3d | ||
|
|
7f885bd5ed | ||
|
|
2eb21378a6 | ||
|
|
ab9ec42c10 | ||
|
|
07b6f9fa83 | ||
|
|
db9ec4e79c | ||
|
|
2a9a28044b | ||
|
|
5ee5ed4dc6 | ||
|
|
b8fd8e1bac | ||
|
|
0749a84ae0 | ||
|
|
80db9dff28 | ||
|
|
532279b724 | ||
|
|
3e98145ac3 | ||
|
|
fd2f8ab774 | ||
|
|
caddd5bdd8 | ||
|
|
72c2636527 | ||
|
|
83e024c670 | ||
|
|
07c9e352df | ||
|
|
d00178d60c | ||
|
|
705da977a9 | ||
|
|
1675e41f05 | ||
|
|
f9638b6315 | ||
|
|
aeddc40b9e | ||
|
|
fe6f81fa88 | ||
|
|
9dd67abd93 | ||
|
|
dbe81b8410 | ||
|
|
017861e4d5 | ||
|
|
77cc49ac3c | ||
|
|
e3b6d38d26 | ||
|
|
b705f89a10 | ||
|
|
97a05145fb | ||
|
|
b15948b11c | ||
|
|
5163861588 | ||
|
|
80a215a6f3 | ||
|
|
01ae1218dc | ||
|
|
d42668ce17 | ||
|
|
1ab0db6352 | ||
|
|
e816a46b95 | ||
|
|
a4b82d9dba | ||
|
|
b735b6799f | ||
|
|
7b5e8712e7 | ||
|
|
2421073576 | ||
|
|
510b62261c | ||
|
|
b0f27814b9 | ||
|
|
cc3d8e7731 | ||
|
|
8ce51cec3b | ||
|
|
0bff8c325d | ||
|
|
a9b2c0625c | ||
|
|
7aa30dec85 | ||
|
|
4926648751 | ||
|
|
06890c70c6 | ||
|
|
1ca69bcf2f | ||
|
|
6bdba1f330 | ||
|
|
b546b42db7 | ||
|
|
67d7877f27 | ||
|
|
89911296e4 | ||
|
|
8f8729d918 | ||
|
|
446fc99bbe | ||
|
|
6e48837860 | ||
|
|
883e52153e | ||
|
|
5966812735 | ||
|
|
b44e9c0fcb | ||
|
|
b2f83f03a8 | ||
|
|
0a2175eabb | ||
|
|
645e1dcc6e | ||
|
|
50a3d170f2 | ||
|
|
9b230de7bc | ||
|
|
50e9caad64 | ||
|
|
e5cc72eb40 | ||
|
|
0d0501cb7b | ||
|
|
1c582a942e | ||
|
|
3c371aa8ee | ||
|
|
c1bc4d2948 | ||
|
|
f9c97b7e5b | ||
|
|
5ff9d4592a | ||
|
|
30adc8d45d | ||
|
|
777ddf434a | ||
|
|
327c7aec30 | ||
|
|
14e29f320d | ||
|
|
cf7d584033 | ||
|
|
61cc7d9c5a | ||
|
|
c4b5df12bb | ||
|
|
977a39f4f7 | ||
|
|
c34710de67 | ||
|
|
5e05236b49 | ||
|
|
b3e53e7243 | ||
|
|
5046270273 | ||
|
|
b8756bc34e | ||
|
|
f26d9f0884 | ||
|
|
8accd6940e | ||
|
|
26ccfef999 | ||
|
|
d8f1b6c59b | ||
|
|
4b6a602a89 | ||
|
|
92bc7d0e16 | ||
|
|
9e3aff0a3a | ||
|
|
e221aae531 | ||
|
|
626121e7bf | ||
|
|
2ba8856343 | ||
|
|
f964cbdb93 | ||
|
|
0f7b2c4298 | ||
|
|
14544e4b87 | ||
|
|
1d5aa38ae4 | ||
|
|
416370a627 | ||
|
|
2c7d683ae3 | ||
|
|
b6ef1fab0e | ||
|
|
bf859859d6 | ||
|
|
a635ec2345 | ||
|
|
ae75004cee | ||
|
|
13ce9ac836 | ||
|
|
5264e41db3 | ||
|
|
5f75ebbbbb | ||
|
|
10da70307a | ||
|
|
cfe6fa6c91 | ||
|
|
ae13be2d17 | ||
|
|
3880b42d18 | ||
|
|
9bead42dbc | ||
|
|
2da043f04d | ||
|
|
de985bad18 | ||
|
|
be8e5aa307 | ||
|
|
94bef1c705 | ||
|
|
99865d9e9a | ||
|
|
550173aaf5 | ||
|
|
f259db3596 | ||
|
|
2b0212af49 | ||
|
|
dfe0badf19 | ||
|
|
d6e10e216e | ||
|
|
9d40840299 | ||
|
|
113bcd7b68 | ||
|
|
d0ae67503c | ||
|
|
441eb4f4a5 | ||
|
|
bab05ff607 | ||
|
|
f552c1796a | ||
|
|
21cdbb41a3 | ||
|
|
1241014a46 | ||
|
|
40d340021c | ||
|
|
cdd5516f33 | ||
|
|
19249d78fb | ||
|
|
d6eb46cf11 | ||
|
|
3671edbcff | ||
|
|
a3277a245c | ||
|
|
d1e09da084 | ||
|
|
c001a91d15 | ||
|
|
0af553da72 | ||
|
|
e9e68abb33 | ||
|
|
c68fbfcb2d | ||
|
|
d1858de7a0 | ||
|
|
9aa34ada57 | ||
|
|
e8ff6b153e | ||
|
|
5ecb46b341 | ||
|
|
dcdbe3eb6c | ||
|
|
2f8881c010 | ||
|
|
995ffc629b | ||
|
|
b3ebe4de3c | ||
|
|
4bf1e85e6b | ||
|
|
0b0bc81710 | ||
|
|
1945dec81f | ||
|
|
e3bfb01411 | ||
|
|
dfbbca423b | ||
|
|
0797a002ca | ||
|
|
53ab2042fd | ||
|
|
50878901ba | ||
|
|
49beb67dab | ||
|
|
e152662687 | ||
|
|
13279917d4 | ||
|
|
85112e7f8f | ||
|
|
09f7f57eea | ||
|
|
f19c7fc5c3 | ||
|
|
8c5fcf41e3 | ||
|
|
58d6b899e2 | ||
|
|
964d81ff01 | ||
|
|
a7777ff485 | ||
|
|
72a3d75e8f | ||
|
|
ca977f4b87 | ||
|
|
9308dee0a1 | ||
|
|
10e362d098 | ||
|
|
b420962377 | ||
|
|
cca5301b88 | ||
|
|
eeb6be5422 | ||
|
|
a6b52e44f2 | ||
|
|
9edebbba4e | ||
|
|
cb1d4164e7 | ||
|
|
6c408b736c | ||
|
|
c272e4afbf | ||
|
|
e374bc130d | ||
|
|
57f73f1b6a | ||
|
|
2d35f937de | ||
|
|
4dd4893d7d | ||
|
|
ef962c43af | ||
|
|
290e366ae9 | ||
|
|
c98273387c | ||
|
|
2eab150563 | ||
|
|
fdaee9a5ce | ||
|
|
71a0240166 | ||
|
|
a2be88a21d | ||
|
|
907425df55 | ||
|
|
764968ab38 | ||
|
|
757e959eb2 | ||
|
|
fa7f9b77ab | ||
|
|
eeff1784e1 | ||
|
|
e05cd940d6 | ||
|
|
f6a13f6f23 | ||
|
|
eba8e1315e | ||
|
|
6e36ebbf84 | ||
|
|
32218a6f8c | ||
|
|
0ae53f4139 | ||
|
|
46df2c9b91 | ||
|
|
f4aedce96c | ||
|
|
539247aacf | ||
|
|
dad4f54eec | ||
|
|
df6712cfb3 | ||
|
|
1a3dcdb830 | ||
|
|
8c0166f459 | ||
|
|
fdf68405a4 | ||
|
|
be6f4319ff | ||
|
|
2acc474ccb | ||
|
|
4b3d66c793 | ||
|
|
49dbbbbcdf | ||
|
|
6afd34727f | ||
|
|
066c09a6ea | ||
|
|
28921cb8e8 | ||
|
|
2071265fea | ||
|
|
3fb3f11fc8 | ||
|
|
b7ae725c5e | ||
|
|
bd96edd2b9 | ||
|
|
aa94f049c1 | ||
|
|
c1d36e4953 | ||
|
|
4cfb686d2b | ||
|
|
d5769b3bfb | ||
|
|
066417d3f0 | ||
|
|
29a287ee82 | ||
|
|
d75c1b829b | ||
|
|
696d77c3ce | ||
|
|
5d85d0990c | ||
|
|
076e1a81a5 | ||
|
|
fc2e4083b0 | ||
|
|
1d99f8a3c2 | ||
|
|
d33672cffe | ||
|
|
ba6e5813e6 | ||
|
|
a6da7ef8af | ||
|
|
db7c5fbf2e | ||
|
|
52474e479d | ||
|
|
b41b57ebb2 | ||
|
|
647800c563 | ||
|
|
3a8bb4c153 | ||
|
|
c2acf96306 | ||
|
|
f8bdc7be62 | ||
|
|
0503eb69ce | ||
|
|
85e77fb797 | ||
|
|
3327dd641d | ||
|
|
c596aaefcf | ||
|
|
4d4b72ba38 | ||
|
|
d7a0a2cd1a | ||
|
|
0ddbb3a1dc | ||
|
|
3303041c92 | ||
|
|
27c5f364a8 | ||
|
|
000104bc3b | ||
|
|
8fd9cfa1f2 | ||
|
|
17d5a4f51f | ||
|
|
d68a25e32e | ||
|
|
154ccbe503 | ||
|
|
6c5ade08d9 | ||
|
|
1b8001b8b8 | ||
|
|
c4d6fb4b1e | ||
|
|
65fd674f50 | ||
|
|
35cd751adc | ||
|
|
ff5e4dbbb0 | ||
|
|
df89ccc191 | ||
|
|
60334f9e02 | ||
|
|
0f707d2b53 | ||
|
|
2317913b71 | ||
|
|
359058cecc | ||
|
|
45330e3819 | ||
|
|
17da87d3cd | ||
|
|
8b9f6cf868 | ||
|
|
4c39e46a3b | ||
|
|
43858a3197 | ||
|
|
3cb7a3e642 | ||
|
|
baa581b814 | ||
|
|
fb7ef8dacd | ||
|
|
1161b6788e | ||
|
|
76714dc628 | ||
|
|
af93729031 | ||
|
|
262776d8d8 | ||
|
|
86d3c0cc0f | ||
|
|
a541820aa8 | ||
|
|
0974ecccd6 | ||
|
|
5ec6353a60 | ||
|
|
9e67ec68ac | ||
|
|
ffd4db5ae4 | ||
|
|
ac183948d6 | ||
|
|
0032daf2a3 | ||
|
|
5eba069b1d | ||
|
|
2b487c9467 | ||
|
|
b9eac96cdc | ||
|
|
1253bbf7ae | ||
|
|
61e3ad89e9 | ||
|
|
fc7f9ebada | ||
|
|
0302138f2f | ||
|
|
c7056d1b20 | ||
|
|
acc36fe117 | ||
|
|
cd3846c8ce | ||
|
|
fd3b5a16b1 | ||
|
|
82169e69fc | ||
|
|
aecf146909 | ||
|
|
2b26b2e611 | ||
|
|
d2710e9d2e | ||
|
|
3700793a2f | ||
|
|
21d5eb84ab | ||
|
|
46a58afd9e | ||
|
|
3cc295e997 | ||
|
|
2948820579 | ||
|
|
e0c30a7e8b | ||
|
|
441f964654 | ||
|
|
2c1fd570f8 | ||
|
|
7c23720920 | ||
|
|
fb485d25a0 | ||
|
|
a08d1b248f | ||
|
|
dc682155de | ||
|
|
e092f79946 | ||
|
|
c2b0dab7ef | ||
|
|
b257bebf9e | ||
|
|
bf49a7679a | ||
|
|
469d9f8a4a | ||
|
|
41e10b22fa | ||
|
|
96d346222f | ||
|
|
2b47426be8 | ||
|
|
aa2a30e96b | ||
|
|
540ddd4e6a | ||
|
|
2659ca1ab4 | ||
|
|
24490bca19 | ||
|
|
73a0ad41c7 | ||
|
|
422b481798 | ||
|
|
6a6b1388ea | ||
|
|
6788bb4984 | ||
|
|
2915bd068e | ||
|
|
5053a9c4c4 | ||
|
|
20f582f6c3 | ||
|
|
dafdcc9b42 | ||
|
|
7fd4ca0aef | ||
|
|
0dfd5f875f | ||
|
|
14b3667420 | ||
|
|
bf804657f5 | ||
|
|
93452b791a | ||
|
|
6d6b6e653e | ||
|
|
40f137c214 | ||
|
|
e8e214b72e | ||
|
|
eae0150b0a | ||
|
|
51460340bf | ||
|
|
dfb5f52d3c | ||
|
|
80069e1dc0 | ||
|
|
5fcb55e420 | ||
|
|
ee71c31fd0 | ||
|
|
6ff801e27d | ||
|
|
44b4e2ee00 | ||
|
|
5a1d86b346 | ||
|
|
f4c9635724 | ||
|
|
565dc3baa7 | ||
|
|
a3c9754950 | ||
|
|
708efbd9b7 | ||
|
|
da30753754 | ||
|
|
0b46637eba | ||
|
|
d3e4fb20b5 | ||
|
|
919d96dd8a | ||
|
|
6c7eac7288 | ||
|
|
901ce937d6 | ||
|
|
81b9c505cc | ||
|
|
7489f96697 | ||
|
|
a926b49a01 | ||
|
|
5fdc616df9 | ||
|
|
1487b18dcb | ||
|
|
7f820ee190 | ||
|
|
54c6f158d9 | ||
|
|
23282873e7 | ||
|
|
eb1ec0416c | ||
|
|
5e0c4489df | ||
|
|
d788d23071 | ||
|
|
a7ee5ca7c3 | ||
|
|
ff4ea1eabb | ||
|
|
57c6bf07bb | ||
|
|
38ee5066e7 | ||
|
|
8c07076e25 | ||
|
|
2f70d8da2b | ||
|
|
c46c09f31d | ||
|
|
c2867a65d8 | ||
|
|
058469114d | ||
|
|
00c60097c5 | ||
|
|
1d0de2a558 | ||
|
|
1fa729b218 | ||
|
|
808deecfff | ||
|
|
b7a2ce2c63 | ||
|
|
3536aa00d1 | ||
|
|
1c8229fbe2 | ||
|
|
e513b69d98 | ||
|
|
cfcc7f3c20 | ||
|
|
5fdf8dcb8e | ||
|
|
36e4837cea | ||
|
|
17bf7f1f0f | ||
|
|
46e6187c89 | ||
|
|
3d16461b68 | ||
|
|
8661e4a0d7 | ||
|
|
f6c3ea6faa | ||
|
|
bfa69691a5 | ||
|
|
e8014a7f61 | ||
|
|
138cb8d739 | ||
|
|
852e11e17b | ||
|
|
c9364c2a4c | ||
|
|
a8d640b3c6 | ||
|
|
b72adc0a66 | ||
|
|
7e8e0e76ec | ||
|
|
50576a5e1e | ||
|
|
314f0e212f | ||
|
|
f7ac2e9250 | ||
|
|
db7765edad | ||
|
|
d20a728892 | ||
|
|
9da996073f | ||
|
|
ed6b81b29d | ||
|
|
b0d3128597 | ||
|
|
2d9936931a | ||
|
|
0d6bc3b583 | ||
|
|
aff1fd2c7d | ||
|
|
7a17c1e89f | ||
|
|
e71e375c29 | ||
|
|
36540ce3c3 | ||
|
|
275800a603 | ||
|
|
f29c56da8c | ||
|
|
328583e12e | ||
|
|
26f306d65c | ||
|
|
87ea607ef4 | ||
|
|
763f0bdcb0 | ||
|
|
27fa1022ee | ||
|
|
e601b9a790 | ||
|
|
60e6f6c3f1 | ||
|
|
35b587c830 | ||
|
|
b9559b35d1 | ||
|
|
d4f89af18d | ||
|
|
8fb1df8aa6 | ||
|
|
e0631d379c | ||
|
|
581b515e08 | ||
|
|
20ff1f4596 | ||
|
|
fc193a502f | ||
|
|
d4d6a98d98 | ||
|
|
a822a6ad74 | ||
|
|
6ed2b04872 | ||
|
|
7ccfa2fb0b | ||
|
|
1b9f0ec350 | ||
|
|
2455328f81 | ||
|
|
f4fe3beb84 | ||
|
|
54a4a14b41 | ||
|
|
b3591d46e6 | ||
|
|
0b4882ed92 | ||
|
|
ca3a53005a | ||
|
|
6ccfce4180 | ||
|
|
7aca4527e8 | ||
|
|
9d543f6ed3 | ||
|
|
2761dd037f | ||
|
|
9afbeb6b7a | ||
|
|
6e60bd637c | ||
|
|
8e4820642e | ||
|
|
a788aea85d | ||
|
|
7aab3e2076 | ||
|
|
05662b3129 | ||
|
|
62f8659bef | ||
|
|
8ac2f412be | ||
|
|
01b876761a | ||
|
|
8eabb09e80 | ||
|
|
49dff27ef1 | ||
|
|
b08ae637a0 | ||
|
|
8c842a54a6 | ||
|
|
72aa17f79a | ||
|
|
7ae67dde69 | ||
|
|
2809171fb4 | ||
|
|
4b9a5af3cf | ||
|
|
d2df2e831b | ||
|
|
c94e1326a7 | ||
|
|
4892637f83 | ||
|
|
ce76d95ab1 | ||
|
|
2265e09718 | ||
|
|
6d5dc9489c | ||
|
|
d703c7f459 | ||
|
|
281714e567 | ||
|
|
c1d84e8127 | ||
|
|
04ddee91e8 | ||
|
|
864dfe4de5 | ||
|
|
077605f58b | ||
|
|
00e1efaa9b | ||
|
|
7a8d570db7 | ||
|
|
0d5835d133 | ||
|
|
488a7562bb | ||
|
|
3f35b45263 | ||
|
|
146a794cb6 | ||
|
|
ff99a9bf74 | ||
|
|
bf550f94cc | ||
|
|
f439122622 | ||
|
|
9d2144128f | ||
|
|
f5305de251 | ||
|
|
d17027e1a0 | ||
|
|
72621892fe | ||
|
|
89602cdce3 | ||
|
|
c2608423b6 | ||
|
|
1956a3aeda | ||
|
|
14d567f7ec | ||
|
|
72389b00d7 | ||
|
|
4f2fd4dcf7 | ||
|
|
cf0986491c | ||
|
|
d7ffa7f95e | ||
|
|
015020760a | ||
|
|
a02c6c4c81 | ||
|
|
cd8c074ae6 | ||
|
|
f7a080a121 | ||
|
|
bca09f7f5f | ||
|
|
2bf9c27375 | ||
|
|
3dc38b150e | ||
|
|
28133c5155 | ||
|
|
1efe861d3c | ||
|
|
0eddb812c6 | ||
|
|
19ec53fae4 | ||
|
|
73fd60eef2 | ||
|
|
5fd4d20e3b | ||
|
|
4ab5545b7a | ||
|
|
233e43b0c3 | ||
|
|
d0d873e39a | ||
|
|
9db9e6c037 | ||
|
|
62144ef3be | ||
|
|
eaf0d71779 | ||
|
|
75a0c79dea | ||
|
|
c14b1df372 | ||
|
|
41a471b23a | ||
|
|
9e7ce0a8ee | ||
|
|
b293da35dd | ||
|
|
fdcd77338c | ||
|
|
9093ef3314 | ||
|
|
ffe21e0225 | ||
|
|
4f087cfd92 | ||
|
|
7225501c13 | ||
|
|
9c632ee35d | ||
|
|
b5059d77e9 | ||
|
|
f81c3f2922 | ||
|
|
8866ecac3c | ||
|
|
0f26960891 | ||
|
|
c7bffb01be | ||
|
|
9d872ab872 | ||
|
|
b6027b2dd2 | ||
|
|
2a0b2cea03 | ||
|
|
873840a204 | ||
|
|
445a8b6062 | ||
|
|
677db85877 | ||
|
|
c0989848b9 | ||
|
|
04681a6b13 | ||
|
|
2d545eff58 | ||
|
|
0e8d3a6f16 | ||
|
|
b490308c88 | ||
|
|
527bd9feea | ||
|
|
d710946064 | ||
|
|
15ebeb1851 | ||
|
|
50fbd49273 | ||
|
|
677838ccfa | ||
|
|
168c3d0148 | ||
|
|
2eec3e13fb | ||
|
|
a883c31088 | ||
|
|
f2d7405df4 | ||
|
|
1ecaeb29aa | ||
|
|
7e3d672b9b | ||
|
|
bb2510876d | ||
|
|
ed43ff3243 | ||
|
|
5fe68b1cec | ||
|
|
3d37ed38c7 | ||
|
|
830ae97955 | ||
|
|
67f14b4ce8 | ||
|
|
6e879742f0 | ||
|
|
a836373328 | ||
|
|
2e1bd04775 | ||
|
|
45a5cd569b | ||
|
|
3afccfce17 | ||
|
|
1aba1780de | ||
|
|
878421beb7 | ||
|
|
777c086590 | ||
|
|
60e08605d5 | ||
|
|
d8b996c00a | ||
|
|
7aaf27ce5f | ||
|
|
014aeca11f | ||
|
|
e7078a3030 | ||
|
|
b41447b811 | ||
|
|
aa119f2836 | ||
|
|
99fe1c562f | ||
|
|
9b1a6a1c02 | ||
|
|
c6321a610c | ||
|
|
e055c69c23 | ||
|
|
582c25a0f0 | ||
|
|
dc9269bc8d | ||
|
|
6c13840cee | ||
|
|
2d9c2b4724 | ||
|
|
23859f7502 | ||
|
|
ab29908aba | ||
|
|
873b9aee90 | ||
|
|
35264b4c18 | ||
|
|
a178f95d68 | ||
|
|
cc186c7a0e | ||
|
|
79dd6e16a7 | ||
|
|
9417ce401c | ||
|
|
7a231cd1c9 | ||
|
|
6ca8a056e8 | ||
|
|
e599d92681 | ||
|
|
a3a70218f3 | ||
|
|
cb6ee77e69 | ||
|
|
5b1e99f264 | ||
|
|
e00b1e5f94 | ||
|
|
161d5be49a | ||
|
|
e7ccbd8573 | ||
|
|
9076d5d2e7 | ||
|
|
ef41c5bfd4 | ||
|
|
0b43033c5c | ||
|
|
a65b5fea3d | ||
|
|
87ebf4e084 | ||
|
|
e37b7677cd | ||
|
|
fc2bac959b | ||
|
|
9d8b377481 | ||
|
|
4137ab44a8 | ||
|
|
bddf59e5d0 | ||
|
|
b713aed21b | ||
|
|
d23d6f60e8 | ||
|
|
357480f4ae | ||
|
|
95f467add5 | ||
|
|
b8bf8e0fac | ||
|
|
60bf067913 | ||
|
|
49f06ca4b9 | ||
|
|
4036e15f5a | ||
|
|
8357ce5b2e | ||
|
|
ecf6a8ad10 | ||
|
|
208ce34f1e | ||
|
|
4cbdf0fb1c | ||
|
|
f756cd5e7e | ||
|
|
a5861d8294 | ||
|
|
1129f4f575 | ||
|
|
d4cac20292 | ||
|
|
095b18620b | ||
|
|
a4aec9f0a8 | ||
|
|
39bf895b73 | ||
|
|
7c0fa1f3f9 | ||
|
|
a6c94119d8 | ||
|
|
321f3fed19 | ||
|
|
39443b4350 | ||
|
|
6f41a27124 | ||
|
|
1377f8e13b | ||
|
|
8f1ace7795 | ||
|
|
63011ca84e | ||
|
|
73d9cd51b2 | ||
|
|
a06dc69931 | ||
|
|
ca3cd8b3d1 | ||
|
|
0d3a97ec7b | ||
|
|
04201d43b1 | ||
|
|
d9d430e5a5 | ||
|
|
5d89905e39 | ||
|
|
eedfa5e618 | ||
|
|
7d9aa3987e | ||
|
|
1dd722c4a7 | ||
|
|
f98e1b128c | ||
|
|
82e915c487 | ||
|
|
628285c1cf | ||
|
|
54c337e06f | ||
|
|
e8e2853830 | ||
|
|
b9316a64ea | ||
|
|
ae65951bc4 | ||
|
|
08a44490d7 | ||
|
|
3baa6ac9b8 | ||
|
|
aec5537de0 | ||
|
|
4c5a30370c | ||
|
|
013fb354d9 | ||
|
|
adba73a9ff | ||
|
|
1d7171a1ec | ||
|
|
ecb489a77c | ||
|
|
0563fe3d46 | ||
|
|
18b17a954c | ||
|
|
60c15750c1 | ||
|
|
ee9706d8ae | ||
|
|
7950fcb9a8 | ||
|
|
e4292ce7be | ||
|
|
db26aaf2b4 | ||
|
|
c8445a69ca | ||
|
|
c764408da7 | ||
|
|
2954f6d252 | ||
|
|
0967da262e | ||
|
|
e939e6d9e4 | ||
|
|
3ceed62686 | ||
|
|
83a6dab7b2 | ||
|
|
9190206387 | ||
|
|
fbdd0a7ca9 | ||
|
|
3c62dbc902 | ||
|
|
255ebcb7ef | ||
|
|
447370fa50 | ||
|
|
9b793eeb68 | ||
|
|
5e74aefd4a | ||
|
|
6b737315b0 | ||
|
|
1c98751da4 | ||
|
|
b779e52ba7 | ||
|
|
3fdd287704 | ||
|
|
f4121c128e | ||
|
|
5b0b8ef83f | ||
|
|
e9412fb983 | ||
|
|
83eefccefd | ||
|
|
cdb5c8e068 | ||
|
|
824aec9e40 | ||
|
|
1d55a5fe1f | ||
|
|
bf5a9ab9e6 | ||
|
|
12e9d811e6 | ||
|
|
0837454b00 | ||
|
|
e6d9b670b0 | ||
|
|
8183153a86 | ||
|
|
5790218fb6 | ||
|
|
a9381f3b40 | ||
|
|
8fd79b8fc0 | ||
|
|
14f337d8ad | ||
|
|
4cd8507ea0 | ||
|
|
89af335156 | ||
|
|
bca796be2f | ||
|
|
0668dd4220 | ||
|
|
b9fb53ed73 | ||
|
|
ef8ca7b363 | ||
|
|
d88de30076 | ||
|
|
1629c5ad27 | ||
|
|
8a380fc4e3 | ||
|
|
2901145c49 | ||
|
|
38449bc57d | ||
|
|
8f6ab87fb4 | ||
|
|
cf6f0c511b | ||
|
|
bd51cddd6f | ||
|
|
4fa968dc0e | ||
|
|
e9f1e627f8 | ||
|
|
ab5a307bc1 | ||
|
|
238fdc9563 | ||
|
|
d35cc77831 | ||
|
|
169682219a | ||
|
|
4ac8006efd | ||
|
|
02a2ec52f1 | ||
|
|
28a1ec34a4 | ||
|
|
436f3d8d66 | ||
|
|
fa44c44379 | ||
|
|
fea70effad | ||
|
|
e16b366174 | ||
|
|
9ac6135c2a | ||
|
|
8bf0f66c06 | ||
|
|
9bbc30590b | ||
|
|
c53d9ea1b3 | ||
|
|
e4d5022077 | ||
|
|
725236cea0 | ||
|
|
d2572050be | ||
|
|
20a7036ba5 | ||
|
|
6ba99689aa | ||
|
|
8958e9fdb5 | ||
|
|
6119f4582e | ||
|
|
ff8fd7619a | ||
|
|
0e925fd8f0 | ||
|
|
64546cb9cc | ||
|
|
96885b6e5a | ||
|
|
9e48da502f | ||
|
|
3951aac930 | ||
|
|
e86c9df9f0 | ||
|
|
4d063ae9ee | ||
|
|
fd992c547e | ||
|
|
e602432ef6 | ||
|
|
698a31aa79 | ||
|
|
57ab9847eb | ||
|
|
4c24d10ff3 | ||
|
|
5813f08386 | ||
|
|
08584fc657 | ||
|
|
4e8b122df6 | ||
|
|
ed581950ea | ||
|
|
f957cbb56c | ||
|
|
5109c27501 | ||
|
|
d88b9de7aa | ||
|
|
1caf485fce | ||
|
|
3b44b01412 | ||
|
|
49f9334e19 | ||
|
|
3be8c238cc | ||
|
|
e59407f2bd | ||
|
|
58fc1f2150 | ||
|
|
f7d2dfc7a6 | ||
|
|
964926ff85 | ||
|
|
52f0c8bb83 | ||
|
|
fa23310f23 | ||
|
|
dcd506676c | ||
|
|
d6f7d3cfe8 | ||
|
|
90d5929fea | ||
|
|
f21cbecdeb | ||
|
|
331f346002 | ||
|
|
e6012b88af | ||
|
|
9f1d34c288 | ||
|
|
5c5c42edb6 | ||
|
|
75d3d677ae | ||
|
|
ae83d008f9 | ||
|
|
c04d0340e2 | ||
|
|
5cc1fd0f7b | ||
|
|
d576e8ae72 | ||
|
|
ba5560b2a1 | ||
|
|
0ad9531d79 | ||
|
|
0983d7ce7f | ||
|
|
024620529e | ||
|
|
596fa08d48 | ||
|
|
77e48ab7db | ||
|
|
d8cf9f9fcd | ||
|
|
433dafa01a | ||
|
|
810b3be080 | ||
|
|
77f4a7173b | ||
|
|
08deda5f99 | ||
|
|
aa9f1243e6 | ||
|
|
f7ea867d31 | ||
|
|
816f474c3e | ||
|
|
47fab6809a | ||
|
|
e903dfe762 | ||
|
|
b47d8c88c5 | ||
|
|
9b7caab672 | ||
|
|
2adef93faf | ||
|
|
c7fec3e1ff | ||
|
|
fd4c851ee9 | ||
|
|
d2b6351157 | ||
|
|
c2c1e6f081 | ||
|
|
38604a111e | ||
|
|
5785aeb806 | ||
|
|
6218c31e17 | ||
|
|
6d4945c9f0 | ||
|
|
b2a8930b3c | ||
|
|
b48962ed15 | ||
|
|
accbc5e880 | ||
|
|
679abc6a9a | ||
|
|
9a8f8fc815 | ||
|
|
f116ee6a12 | ||
|
|
9af43134e1 | ||
|
|
635f23b88a | ||
|
|
b1d53426d1 | ||
|
|
89cb252640 | ||
|
|
597c98203c | ||
|
|
261d1bc9d4 | ||
|
|
ac72800fb6 | ||
|
|
c635a0dad4 | ||
|
|
3b4ed970e6 | ||
|
|
d5e6f7fa5c | ||
|
|
bc370e3268 | ||
|
|
d3e19e3420 | ||
|
|
47666c4a0b | ||
|
|
95abf48e21 | ||
|
|
7bbf167c1c | ||
|
|
a30f95f76e | ||
|
|
6fb49fd19b | ||
|
|
9170c92070 | ||
|
|
d5e910ebcc | ||
|
|
fa028ebf3c | ||
|
|
2e61abaa9a | ||
|
|
038c2cc8b1 | ||
|
|
326f87df26 | ||
|
|
adea3f1e81 | ||
|
|
8e3e7fc646 | ||
|
|
92aca55a6f | ||
|
|
b02fc90f45 | ||
|
|
e29fff2566 | ||
|
|
64416100c6 | ||
|
|
f8a3becb28 | ||
|
|
f7c59ecfc8 | ||
|
|
b8cd2a7993 | ||
|
|
a1d569bbc9 | ||
|
|
c02337be29 | ||
|
|
f65eb4f84d | ||
|
|
3fbaee454d | ||
|
|
7e3ac8475c | ||
|
|
23d3d847d1 | ||
|
|
34879f7344 | ||
|
|
e046e04c63 | ||
|
|
9105588373 | ||
|
|
0fa745344e | ||
|
|
dbb8c87b96 | ||
|
|
edb9ab2069 | ||
|
|
8dd03e69b0 | ||
|
|
573b4c0b3c | ||
|
|
d4cdf80781 | ||
|
|
35b53784ee | ||
|
|
60adaf4a97 | ||
|
|
3df6c8c645 | ||
|
|
9217d88f94 | ||
|
|
d0758e5fca | ||
|
|
63841c1060 | ||
|
|
185b0e314e | ||
|
|
8e808fece9 | ||
|
|
2e74d20e83 | ||
|
|
23a48007c0 | ||
|
|
bf764e83e0 | ||
|
|
3125a5a383 | ||
|
|
1b581747c5 | ||
|
|
1316602346 | ||
|
|
28c8171f47 |
2
.cargo/config.toml
Normal file
2
.cargo/config.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[env]
|
||||
__TAURI_WORKSPACE__ = "true"
|
||||
@@ -1,14 +1,24 @@
|
||||
{
|
||||
"gitSiteUrl": "https://www.github.com/tauri-apps/tauri/",
|
||||
"timeout": 3600000,
|
||||
"changeTags": {
|
||||
"feat": "New Features",
|
||||
"enhance": "Enhancements",
|
||||
"bug": "Bug Fixes",
|
||||
"pref": "Performance Improvements",
|
||||
"changes": "What's Changed",
|
||||
"sec": "Security fixes",
|
||||
"deps": "Dependencies",
|
||||
"breaking": "Breaking Changes"
|
||||
},
|
||||
"defaultChangeTag": "changes",
|
||||
"pkgManagers": {
|
||||
"rust": {
|
||||
"errorOnVersionRange": "^2.0.0-0",
|
||||
"version": true,
|
||||
"getPublishedVersion": "cargo search ${ pkgFile.pkg.package.name } --limit 1 | sed -nE \"s/^[^\\\"]*\\\"//; s/\\\".*//1p\"",
|
||||
"getPublishedVersion": "node ../../.scripts/covector/package-latest-version.js cargo ${ pkgFile.pkg.package.name } ${ pkgFile.pkg.package.version }",
|
||||
"prepublish": [
|
||||
"sudo apt-get update",
|
||||
"sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf",
|
||||
"sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev",
|
||||
"cargo install cargo-audit --features=fix",
|
||||
{
|
||||
"command": "cargo generate-lockfile",
|
||||
@@ -17,12 +27,7 @@
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo \"# Cargo Audit\"",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```'",
|
||||
"command": "echo '<details>\n<summary><em><h4>Cargo Audit</h4></em></summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
@@ -33,7 +38,7 @@
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```'",
|
||||
"command": "echo '```\n\n</details>\n'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
}
|
||||
@@ -45,12 +50,7 @@
|
||||
"dryRunCommand": true
|
||||
},
|
||||
{
|
||||
"command": "echo \"# Cargo Publish\"",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```'",
|
||||
"command": "echo '<details>\n<summary><em><h4>Cargo Publish</h4></em></summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
@@ -60,7 +60,7 @@
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```'",
|
||||
"command": "echo '```\n\n</details>\n'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
}
|
||||
@@ -72,7 +72,7 @@
|
||||
],
|
||||
"assets": [
|
||||
{
|
||||
"path": "${ pkg.path }/target/package/${ pkg.pkg }-${ pkgFile.version }.crate",
|
||||
"path": "./target/package/${ pkg.pkg }-${ pkgFile.version }.crate",
|
||||
"name": "${ pkg.pkg }-${ pkgFile.version }.crate"
|
||||
}
|
||||
]
|
||||
@@ -80,19 +80,14 @@
|
||||
"javascript": {
|
||||
"errorOnVersionRange": "^2.0.0-0",
|
||||
"version": true,
|
||||
"getPublishedVersion": "npm view ${ pkgFile.pkg.name } version",
|
||||
"getPublishedVersion": "node ../../.scripts/covector/package-latest-version.js npm ${ pkgFile.pkg.name } ${ pkgFile.pkg.version }",
|
||||
"prepublish": [
|
||||
{
|
||||
"command": "yarn",
|
||||
"dryRunCommand": true
|
||||
},
|
||||
{
|
||||
"command": "echo \"# Yarn Audit\n\"",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '<details>\n<summary>click to view</summary>\n\n```'",
|
||||
"command": "echo '<details>\n<summary><em><h4>Yarn Audit</h4></em></summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
@@ -115,12 +110,7 @@
|
||||
"publish": [
|
||||
"sleep 15s",
|
||||
{
|
||||
"command": "echo \"# Yarn Package Publish\"",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```'",
|
||||
"command": "echo '<details>\n<summary><em><h4>Yarn Publish</h4></em></summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
@@ -130,7 +120,7 @@
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```'",
|
||||
"command": "echo '```\n\n</details>\n'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
}
|
||||
@@ -143,13 +133,13 @@
|
||||
}
|
||||
},
|
||||
"packages": {
|
||||
"api": {
|
||||
"@tauri-apps/api": {
|
||||
"path": "./tooling/api",
|
||||
"manager": "javascript",
|
||||
"assets": [
|
||||
{
|
||||
"path": "./tooling/api/dist/tauri-apps-api-${ pkgFile.version }.tgz",
|
||||
"name": "api-${ pkgFile.version }.tgz"
|
||||
"name": "tauri-apps-api-${ pkgFile.version }.tgz"
|
||||
}
|
||||
],
|
||||
"prepublish": [
|
||||
@@ -158,12 +148,7 @@
|
||||
"dryRunCommand": true
|
||||
},
|
||||
{
|
||||
"command": "echo \"# Yarn Audit\n\"",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '<details>\n<summary>click to view</summary>\n\n```'",
|
||||
"command": "echo '<details>\n<summary><em><h4>Yarn Audit</h4></em></summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
@@ -185,12 +170,7 @@
|
||||
],
|
||||
"publish": [
|
||||
{
|
||||
"command": "echo \"# Yarn Package Publish\"",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```'",
|
||||
"command": "echo '<details>\n<summary><em><h4>Yarn Publish</h4></em></summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
@@ -200,7 +180,7 @@
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```'",
|
||||
"command": "echo '```\n\n</details>\n'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
}
|
||||
@@ -239,7 +219,16 @@
|
||||
"path": "./core/tauri-build",
|
||||
"manager": "rust",
|
||||
"dependencies": ["tauri-codegen", "tauri-utils"],
|
||||
"postversion": "node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }"
|
||||
"postversion": [
|
||||
"node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
|
||||
"cargo build --manifest-path ../tauri-config-schema/Cargo.toml"
|
||||
],
|
||||
"assets": [
|
||||
{
|
||||
"path": "./tooling/cli/schema.json",
|
||||
"name": "schema.json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"tauri": {
|
||||
"path": "./core/tauri",
|
||||
@@ -252,20 +241,27 @@
|
||||
],
|
||||
"postversion": "node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }"
|
||||
},
|
||||
"cli.js": {
|
||||
"@tauri-apps/cli": {
|
||||
"path": "./tooling/cli/node",
|
||||
"manager": "javascript",
|
||||
"dependencies": ["cli.rs"],
|
||||
"postversion": "node ../../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
|
||||
"getPublishedVersion": "node ../../../.scripts/covector/package-latest-version.js npm ${ pkgFile.pkg.name } ${ pkgFile.pkg.version }",
|
||||
"dependencies": ["tauri-cli"],
|
||||
"postversion": [
|
||||
"node ../../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
|
||||
"cargo build --manifest-path ../../../core/tauri-config-schema/Cargo.toml"
|
||||
],
|
||||
"prepublish": [],
|
||||
"publish": [],
|
||||
"postpublish": []
|
||||
},
|
||||
"cli.rs": {
|
||||
"tauri-cli": {
|
||||
"path": "./tooling/cli",
|
||||
"manager": "rust",
|
||||
"dependencies": ["tauri-bundler", "tauri-utils"],
|
||||
"postversion": "cargo check",
|
||||
"postversion": [
|
||||
"cargo check",
|
||||
"cargo build --manifest-path ../../core/tauri-config-schema/Cargo.toml"
|
||||
],
|
||||
"assets": [
|
||||
{
|
||||
"path": "${ pkg.path }/target/package/tauri-cli-${ pkgFile.version }.crate",
|
||||
@@ -275,7 +271,8 @@
|
||||
},
|
||||
"tauri-driver": {
|
||||
"path": "./tooling/webdriver",
|
||||
"manager": "rust"
|
||||
"manager": "rust",
|
||||
"postversion": "cargo check"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
44
.changes/readme.md
Normal file
44
.changes/readme.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Changes
|
||||
|
||||
##### via https://github.com/jbolda/covector
|
||||
|
||||
As you create PRs and make changes that require a version bump, please add a new markdown file in this folder. You do not note the version _number_, but rather the type of bump that you expect: major, minor, or patch. The filename is not important, as long as it is a `.md`, but we recommend that it represents the overall change for organizational purposes.
|
||||
|
||||
When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process.
|
||||
|
||||
Use the following format:
|
||||
|
||||
```md
|
||||
---
|
||||
'package-a': patch
|
||||
'package-b': patch
|
||||
---
|
||||
|
||||
Change summary goes here
|
||||
```
|
||||
|
||||
Summaries do not have a specific character limit, but are text only. These summaries are used within the (future implementation of) changelogs. They will give context to the change and also point back to the original PR if more details and context are needed.
|
||||
|
||||
Changes will be designated as a `major`, `minor` or `patch` as further described in [semver](https://semver.org/).
|
||||
|
||||
Given a version number MAJOR.MINOR.PATCH, increment the:
|
||||
|
||||
- MAJOR version when you make incompatible API changes,
|
||||
- MINOR version when you add functionality in a backwards compatible manner, and
|
||||
- PATCH version when you make backwards compatible bug fixes.
|
||||
|
||||
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format, but will be discussed prior to usage (as extra steps will be necessary in consideration of merging and publishing).
|
||||
|
||||
Additionally you could specify a tag for the change file to group it with other changes by prefixing the bump with `:<tag>`, for example:
|
||||
|
||||
```md
|
||||
---
|
||||
'package-a': patch:bug
|
||||
---
|
||||
|
||||
Change summary goes here
|
||||
```
|
||||
|
||||
which will group this change file with other changes that specify the `bug` tag.
|
||||
|
||||
For list of available tags, see the `changeTags` key in [./config.json](./config.json)
|
||||
@@ -5,7 +5,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
|
||||
|
||||
# Derived from Tauri contribution and setup guides:
|
||||
# See: https://github.com/tauri-apps/tauri/blob/dev/.github/CONTRIBUTING.md#development-guide
|
||||
# See: https://tauri.studio/v1/guides/getting-started/prerequisites/#setting-up-linux
|
||||
# See: https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-linux
|
||||
ARG TAURI_BUILD_DEPS="build-essential curl libappindicator3-dev libgtk-3-dev librsvg2-dev libssl-dev libwebkit2gtk-4.0-dev wget"
|
||||
|
||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
|
||||
@@ -24,7 +24,7 @@ Prerequisites are mainly derived from VS Code's instructions for usage of develo
|
||||
|
||||
### A note on filesystem performance
|
||||
|
||||
Due to limititations in how Docker shares files between the Docker host and a container, it's also recommended that developers [clone Tauri source code into a container volume](https://code.visualstudio.com/remote/advancedcontainers/improve-performance#_use-clone-repository-in-container-volume). This is optional, but highly advised as many filesystem/IO heavy opearations (`cargo build`, `yarn install`, etc) will be very slow if they operate on directories shared with a Docker container from the Docker host.
|
||||
Due to limitations in how Docker shares files between the Docker host and a container, it's also recommended that developers [clone Tauri source code into a container volume](https://code.visualstudio.com/remote/advancedcontainers/improve-performance#_use-clone-repository-in-container-volume). This is optional, but highly advised as many filesystem/IO heavy operations (`cargo build`, `yarn install`, etc) will be very slow if they operate on directories shared with a Docker container from the Docker host.
|
||||
|
||||
To do this, open your project with VS Code and run **Remote-Containers: Clone Repository in Container Volume...** from the Command Palette (<kbd>F1</kbd>).
|
||||
|
||||
|
||||
44
.docker/cross/aarch64.Dockerfile
Normal file
44
.docker/cross/aarch64.Dockerfile
Normal file
@@ -0,0 +1,44 @@
|
||||
FROM ubuntu:18.04
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
COPY common.sh lib.sh /
|
||||
RUN /common.sh
|
||||
|
||||
COPY cmake.sh /
|
||||
RUN /cmake.sh
|
||||
|
||||
COPY xargo.sh /
|
||||
RUN /xargo.sh
|
||||
|
||||
RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
|
||||
g++-aarch64-linux-gnu \
|
||||
libc6-dev-arm64-cross
|
||||
|
||||
COPY deny-debian-packages.sh /
|
||||
RUN TARGET_ARCH=arm64 /deny-debian-packages.sh \
|
||||
binutils \
|
||||
binutils-aarch64-linux-gnu
|
||||
|
||||
COPY qemu.sh /
|
||||
RUN /qemu.sh aarch64 softmmu
|
||||
|
||||
COPY dropbear.sh /
|
||||
RUN /dropbear.sh
|
||||
|
||||
COPY linux-image.sh /
|
||||
RUN /linux-image.sh aarch64
|
||||
|
||||
COPY linux-runner /
|
||||
|
||||
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
|
||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="/linux-runner aarch64" \
|
||||
CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc \
|
||||
CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ \
|
||||
BINDGEN_EXTRA_CLANG_ARGS_aarch64_unknown_linux_gnu="--sysroot=/usr/aarch64-linux-gnu" \
|
||||
QEMU_LD_PREFIX=/usr/aarch64-linux-gnu \
|
||||
RUST_TEST_THREADS=1 \
|
||||
PKG_CONFIG_PATH="/usr/lib/aarch64-linux-gnu/pkgconfig/:${PKG_CONFIG_PATH}"
|
||||
|
||||
RUN dpkg --add-architecture arm64
|
||||
RUN apt-get update
|
||||
RUN apt-get install --assume-yes --no-install-recommends libssl-dev:arm64 libdbus-1-dev:arm64 libsoup2.4-dev:arm64 libssl-dev:arm64 libgtk-3-dev:arm64 webkit2gtk-4.0-dev:arm64 libappindicator3-1:arm64 librsvg2-dev:arm64 patchelf:arm64
|
||||
31
.docker/cross/cmake.sh
Executable file
31
.docker/cross/cmake.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. lib.sh
|
||||
|
||||
main() {
|
||||
local version=3.23.1
|
||||
|
||||
install_packages curl
|
||||
|
||||
local td
|
||||
td="$(mktemp -d)"
|
||||
|
||||
pushd "${td}"
|
||||
|
||||
curl --retry 3 -sSfL "https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-linux-x86_64.sh" -o cmake.sh
|
||||
sh cmake.sh --skip-license --prefix=/usr/local
|
||||
|
||||
popd
|
||||
|
||||
purge_packages
|
||||
|
||||
rm -rf "${td}"
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
rm "${0}"
|
||||
}
|
||||
|
||||
main "${@}"
|
||||
40
.docker/cross/common.sh
Executable file
40
.docker/cross/common.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. lib.sh
|
||||
|
||||
# For architectures except amd64 and i386, look for packages on ports.ubuntu.com instead.
|
||||
# This is important if you enable additional architectures so you can install libraries to cross-compile against.
|
||||
# Look for 'dpkg --add-architecture' in the README for more details.
|
||||
if grep -i ubuntu /etc/os-release >/dev/null; then
|
||||
sed 's/http:\/\/\(.*\).ubuntu.com\/ubuntu\//[arch-=amd64,i386] http:\/\/ports.ubuntu.com\/ubuntu-ports\//g' /etc/apt/sources.list > /etc/apt/sources.list.d/ports.list
|
||||
sed -i 's/http:\/\/\(.*\).ubuntu.com\/ubuntu\//[arch=amd64,i386] http:\/\/\1.archive.ubuntu.com\/ubuntu\//g' /etc/apt/sources.list
|
||||
fi
|
||||
|
||||
install_packages \
|
||||
autoconf \
|
||||
automake \
|
||||
binutils \
|
||||
ca-certificates \
|
||||
curl \
|
||||
file \
|
||||
gcc \
|
||||
git \
|
||||
libtool \
|
||||
m4 \
|
||||
make
|
||||
|
||||
if_centos install_packages \
|
||||
clang-devel \
|
||||
gcc-c++ \
|
||||
glibc-devel \
|
||||
pkgconfig
|
||||
|
||||
if_ubuntu install_packages \
|
||||
g++ \
|
||||
libc6-dev \
|
||||
libclang-dev \
|
||||
pkg-config
|
||||
19
.docker/cross/deny-debian-packages.sh
Executable file
19
.docker/cross/deny-debian-packages.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
main() {
|
||||
local package
|
||||
|
||||
for package in "${@}"; do
|
||||
echo "Package: ${package}:${TARGET_ARCH}
|
||||
Pin: release *
|
||||
Pin-Priority: -1" > "/etc/apt/preferences.d/${package}"
|
||||
echo "${package}"
|
||||
done
|
||||
|
||||
rm "${0}"
|
||||
}
|
||||
|
||||
main "${@}"
|
||||
56
.docker/cross/dropbear.sh
Executable file
56
.docker/cross/dropbear.sh
Executable file
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. lib.sh
|
||||
|
||||
main() {
|
||||
local version=2022.82
|
||||
|
||||
install_packages \
|
||||
autoconf \
|
||||
automake \
|
||||
bzip2 \
|
||||
curl \
|
||||
make
|
||||
|
||||
if_centos install_packages zlib-devel
|
||||
if_ubuntu install_packages zlib1g-dev
|
||||
|
||||
local td
|
||||
td="$(mktemp -d)"
|
||||
|
||||
pushd "${td}"
|
||||
|
||||
curl --retry 3 -sSfL "https://matt.ucc.asn.au/dropbear/releases/dropbear-${version}.tar.bz2" -O
|
||||
tar --strip-components=1 -xjf "dropbear-${version}.tar.bz2"
|
||||
|
||||
# Remove some unwanted message
|
||||
sed -i '/skipping hostkey/d' cli-kex.c
|
||||
sed -i '/failed to identify current user/d' cli-runopts.c
|
||||
|
||||
./configure \
|
||||
--disable-syslog \
|
||||
--disable-shadow \
|
||||
--disable-lastlog \
|
||||
--disable-utmp \
|
||||
--disable-utmpx \
|
||||
--disable-wtmp \
|
||||
--disable-wtmpx \
|
||||
--disable-pututline \
|
||||
--disable-pututxline
|
||||
|
||||
make "-j$(nproc)" PROGRAMS=dbclient
|
||||
cp dbclient /usr/local/bin/
|
||||
|
||||
purge_packages
|
||||
|
||||
popd
|
||||
|
||||
rm -rf "${td}"
|
||||
rm "${0}"
|
||||
}
|
||||
|
||||
main "${@}"
|
||||
45
.docker/cross/lib.sh
Normal file
45
.docker/cross/lib.sh
Normal file
@@ -0,0 +1,45 @@
|
||||
purge_list=()
|
||||
|
||||
install_packages() {
|
||||
if grep -i ubuntu /etc/os-release; then
|
||||
apt-get update
|
||||
|
||||
for pkg in "${@}"; do
|
||||
if ! dpkg -L "${pkg}" >/dev/null 2>/dev/null; then
|
||||
apt-get install --assume-yes --no-install-recommends "${pkg}"
|
||||
|
||||
purge_list+=( "${pkg}" )
|
||||
fi
|
||||
done
|
||||
else
|
||||
for pkg in "${@}"; do
|
||||
if ! yum list installed "${pkg}" >/dev/null 2>/dev/null; then
|
||||
yum install -y "${pkg}"
|
||||
|
||||
purge_list+=( "${pkg}" )
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
purge_packages() {
|
||||
if (( ${#purge_list[@]} )); then
|
||||
if grep -i ubuntu /etc/os-release; then
|
||||
apt-get purge --assume-yes --auto-remove "${purge_list[@]}"
|
||||
else
|
||||
yum remove -y "${purge_list[@]}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
if_centos() {
|
||||
if grep -q -i centos /etc/os-release; then
|
||||
eval "${@}"
|
||||
fi
|
||||
}
|
||||
|
||||
if_ubuntu() {
|
||||
if grep -q -i ubuntu /etc/os-release; then
|
||||
eval "${@}"
|
||||
fi
|
||||
}
|
||||
274
.docker/cross/linux-image.sh
Executable file
274
.docker/cross/linux-image.sh
Executable file
@@ -0,0 +1,274 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. lib.sh
|
||||
|
||||
main() {
|
||||
# arch in the rust target
|
||||
local arch="${1}" \
|
||||
kversion=4.19.0-20
|
||||
|
||||
local debsource="deb http://http.debian.net/debian/ buster main"
|
||||
debsource="${debsource}\ndeb http://security.debian.org/ buster/updates main"
|
||||
|
||||
local dropbear="dropbear-bin"
|
||||
|
||||
local -a deps
|
||||
local kernel=
|
||||
local libgcc="libgcc1"
|
||||
|
||||
# select debian arch and kernel version
|
||||
case "${arch}" in
|
||||
aarch64)
|
||||
arch=arm64
|
||||
kernel="${kversion}-arm64"
|
||||
;;
|
||||
armv7)
|
||||
arch=armhf
|
||||
kernel="${kversion}-armmp"
|
||||
;;
|
||||
i686)
|
||||
arch=i386
|
||||
kernel="${kversion}-686"
|
||||
;;
|
||||
mips|mipsel)
|
||||
kernel="${kversion}-4kc-malta"
|
||||
;;
|
||||
mips64el)
|
||||
kernel="${kversion}-5kc-malta"
|
||||
;;
|
||||
powerpc)
|
||||
# there is no buster powerpc port, so we use jessie
|
||||
# use a more recent kernel from backports
|
||||
kversion='4.9.0-0.bpo.6'
|
||||
kernel="${kversion}-powerpc"
|
||||
debsource="deb http://archive.debian.org/debian jessie main"
|
||||
debsource="${debsource}\ndeb http://archive.debian.org/debian jessie-backports main"
|
||||
debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unstable main"
|
||||
debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unreleased main"
|
||||
|
||||
# archive.debian.org Release files are expired.
|
||||
echo "Acquire::Check-Valid-Until false;" | tee -a /etc/apt/apt.conf.d/10-nocheckvalid
|
||||
echo "APT::Get::AllowUnauthenticated true;" | tee -a /etc/apt/apt.conf.d/10-nocheckvalid
|
||||
|
||||
dropbear="dropbear"
|
||||
deps=(libcrypt1:"${arch}")
|
||||
;;
|
||||
powerpc64)
|
||||
# there is no stable port
|
||||
arch=ppc64
|
||||
# https://packages.debian.org/en/sid/linux-image-powerpc64
|
||||
kversion='5.*'
|
||||
kernel="${kversion}-powerpc64"
|
||||
libgcc="libgcc-s1"
|
||||
debsource="deb http://ftp.ports.debian.org/debian-ports unstable main"
|
||||
debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unreleased main"
|
||||
# sid version of dropbear requires these dependencies
|
||||
deps=(libcrypt1:"${arch}")
|
||||
;;
|
||||
powerpc64le)
|
||||
arch=ppc64el
|
||||
kernel="${kversion}-powerpc64le"
|
||||
;;
|
||||
s390x)
|
||||
arch=s390x
|
||||
kernel="${kversion}-s390x"
|
||||
;;
|
||||
sparc64)
|
||||
# there is no stable port
|
||||
# https://packages.debian.org/en/sid/linux-image-sparc64
|
||||
kernel='*-sparc64'
|
||||
libgcc="libgcc-s1"
|
||||
debsource="deb http://ftp.ports.debian.org/debian-ports unstable main"
|
||||
debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unreleased main"
|
||||
# sid version of dropbear requires these dependencies
|
||||
deps=(libcrypt1:"${arch}")
|
||||
;;
|
||||
x86_64)
|
||||
arch=amd64
|
||||
kernel="${kversion}-amd64"
|
||||
;;
|
||||
*)
|
||||
echo "Invalid arch: ${arch}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
install_packages ca-certificates \
|
||||
curl \
|
||||
cpio \
|
||||
sharutils \
|
||||
gnupg
|
||||
|
||||
# Download packages
|
||||
mv /etc/apt/sources.list /etc/apt/sources.list.bak
|
||||
echo -e "${debsource}" > /etc/apt/sources.list
|
||||
|
||||
# Old ubuntu does not support --add-architecture, so we directly change multiarch file
|
||||
if [ -f /etc/dpkg/dpkg.cfg.d/multiarch ]; then
|
||||
cp /etc/dpkg/dpkg.cfg.d/multiarch /etc/dpkg/dpkg.cfg.d/multiarch.bak
|
||||
fi
|
||||
dpkg --add-architecture "${arch}" || echo "foreign-architecture ${arch}" > /etc/dpkg/dpkg.cfg.d/multiarch
|
||||
|
||||
# Add Debian keys.
|
||||
curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/archive-key-{7.0,8,9,10}.asc' -O
|
||||
curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/archive-key-{8,9,10}-security.asc' -O
|
||||
curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/release-{7,8,9,10}.asc' -O
|
||||
curl --retry 3 -sSfL 'https://www.ports.debian.org/archive_{2020,2021,2022}.key' -O
|
||||
|
||||
for key in *.asc *.key; do
|
||||
apt-key add "${key}"
|
||||
rm "${key}"
|
||||
done
|
||||
|
||||
# allow apt-get to retry downloads
|
||||
echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries
|
||||
|
||||
apt-get update
|
||||
|
||||
mkdir -p "/qemu/${arch}"
|
||||
chmod 777 /qemu "/qemu/${arch}"
|
||||
|
||||
cd "/qemu/${arch}"
|
||||
apt-get -d --no-install-recommends download \
|
||||
${deps[@]+"${deps[@]}"} \
|
||||
"busybox:${arch}" \
|
||||
"${dropbear}:${arch}" \
|
||||
"libtommath1:${arch}" \
|
||||
"libtomcrypt1:${arch}" \
|
||||
"libgmp10:${arch}" \
|
||||
"libc6:${arch}" \
|
||||
"${libgcc}:${arch}" \
|
||||
"libstdc++6:${arch}" \
|
||||
"linux-image-${kernel}:${arch}" \
|
||||
ncurses-base \
|
||||
"zlib1g:${arch}"
|
||||
cd /qemu
|
||||
|
||||
# Install packages
|
||||
root="root-${arch}"
|
||||
mkdir -p "${root}"/{bin,etc/dropbear,root,sys,dev,proc,sbin,tmp,usr/{bin,sbin},var/log}
|
||||
for deb in "${arch}"/*deb; do
|
||||
dpkg -x "${deb}" "${root}"/
|
||||
done
|
||||
|
||||
cp "${root}/boot/vmlinu"* kernel
|
||||
|
||||
# initrd
|
||||
mkdir -p "${root}/modules"
|
||||
cp -v \
|
||||
"${root}/lib/modules"/*/kernel/drivers/net/net_failover.ko \
|
||||
"${root}/lib/modules"/*/kernel/drivers/net/virtio_net.ko \
|
||||
"${root}/lib/modules"/*/kernel/drivers/virtio/* \
|
||||
"${root}/lib/modules"/*/kernel/fs/netfs/netfs.ko \
|
||||
"${root}/lib/modules"/*/kernel/fs/9p/9p.ko \
|
||||
"${root}/lib/modules"/*/kernel/fs/fscache/fscache.ko \
|
||||
"${root}/lib/modules"/*/kernel/net/9p/9pnet.ko \
|
||||
"${root}/lib/modules"/*/kernel/net/9p/9pnet_virtio.ko \
|
||||
"${root}/lib/modules"/*/kernel/net/core/failover.ko \
|
||||
"${root}/modules" || true # some file may not exist
|
||||
rm -rf "${root:?}/boot"
|
||||
rm -rf "${root:?}/lib/modules"
|
||||
|
||||
cat << 'EOF' > "${root}/etc/hosts"
|
||||
127.0.0.1 localhost qemu
|
||||
EOF
|
||||
|
||||
cat << 'EOF' > $root/etc/hostname
|
||||
qemu
|
||||
EOF
|
||||
|
||||
cat << 'EOF' > $root/etc/passwd
|
||||
root::0:0:root:/root:/bin/sh
|
||||
EOF
|
||||
|
||||
cat << 'EOF' | uudecode -o $root/etc/dropbear/dropbear_rsa_host_key
|
||||
begin 600 dropbear_rsa_host_key
|
||||
M````!W-S:"UR<V$````#`0`!```!`0"N!-<%K,3Z.!Z,OEMB2.N\O.$IWQ*F
|
||||
M#5%(_;(^2YKY_J_.RQW/7U@_MK&J#!Z0_\;EH#98ZW*E1\.<FF%P/*Y.W56-
|
||||
M31.'EJE`TN@=T5EC(8"Y%3'ZBYH)^WIVJ]S*G/_;#RH\_?S"U^1L_<<.F`O+
|
||||
MZVI?*]\KTDOT&QV0#B-M;"%_7:\>+3[X=QMH,B<HM$+0E[\B6*^!XKLR@V,K
|
||||
M)<V80HHK:_#;D]26XKN&CB./EZAC%4)78R!G""4HT@UK<5I4B^$/""`,?*\T
|
||||
M>*4$RYULV,V3X6]K:7@Q?80"#WXGGQZNFN6CZ7LTDX(F6J[\]F5<0`HEOF:Z
|
||||
MX;^53`L'4I/A```!``$L:$Z*#6<^3@+O%.[-#/5H+.C'3\#QQZN[1;J>L`8I
|
||||
MZ_&T'!"J'/Y+?R?55G:M^=]R*-&I3TOJYZA8@&H51ZOAF59'1_>>Z@?E4#)$
|
||||
MQU)X/RWH51ZB5KSDWJS:D'7GD(!?NAY`C'7\)I:_4)J")QBV/P"RJQGHG'%B
|
||||
M1BT2LE6676>`1K,0\NIMZTKQNB(IC+88<7#8%_-=P<&6<"9LH>60TSS?3?-C
|
||||
MN`T36YB/3^<(Q;`N1NT>I9EZS`BAC^-?.:,R\7EL"<4>7E=]^1]B\K9])AQU
|
||||
MBM\]M;4V(S(6KH-I.4[6>9E+@\UEM.J6:[2LUEEJDG:G:+:/EVF^Y75@(S$`
|
||||
M``"!`.O+KW=&*CBCHL"11&SVO4/K]$R-]7MV7,3RR)Q[X'0;6.?4JHW!3VR6
|
||||
M*FGBY--37ZD-+UV.8_+"$<?B"#&K$.[V)F7V2\UY!7(0FZ@A2`0ADDY*J-_B
|
||||
M4AU&.*GP#F/!I([:?E],.>6PH9)(/E.\G19#G0K`LRM?JWS!58&;D0C1````
|
||||
M@0"\[@NYWSTW(?Q@:_A*1Y3/AKYO5?S=0"<2>#V-AH6W-NCSDTSRP=2D79FS
|
||||
M"D?[;.)V>8'#9&I3"MU@+:2\Z%$0-MG0+J'(0>T1_C6?*C=4U0I$DI<=@D]1
|
||||
H_&DE8Y(OT%%EPG]!$H&5HX*),_D1A2\P=R.7G'`0L%YM-79Y"T">$0``
|
||||
`
|
||||
end
|
||||
EOF
|
||||
|
||||
# dropbear complains when this file is missing
|
||||
touch "${root}/var/log/lastlog"
|
||||
|
||||
cat << 'EOF' > $root/init
|
||||
#!/bin/busybox sh
|
||||
|
||||
set -e
|
||||
|
||||
/bin/busybox --install
|
||||
|
||||
mount -t devtmpfs devtmpfs /dev
|
||||
mount -t proc none /proc
|
||||
mount -t sysfs none /sys
|
||||
mkdir /dev/pts
|
||||
mount -t devpts none /dev/pts/
|
||||
|
||||
# some archs does not have virtio modules
|
||||
insmod /modules/failover.ko || true
|
||||
insmod /modules/net_failover.ko || true
|
||||
insmod /modules/virtio.ko || true
|
||||
insmod /modules/virtio_ring.ko || true
|
||||
insmod /modules/virtio_mmio.ko || true
|
||||
insmod /modules/virtio_pci_legacy_dev.ko || true
|
||||
insmod /modules/virtio_pci_modern_dev.ko || true
|
||||
insmod /modules/virtio_pci.ko || true
|
||||
insmod /modules/virtio_net.ko || true
|
||||
insmod /modules/netfs.ko || true
|
||||
insmod /modules/fscache.ko
|
||||
insmod /modules/9pnet.ko
|
||||
insmod /modules/9pnet_virtio.ko || true
|
||||
insmod /modules/9p.ko
|
||||
|
||||
ifconfig lo 127.0.0.1
|
||||
ifconfig eth0 10.0.2.15
|
||||
route add default gw 10.0.2.2 eth0
|
||||
|
||||
mkdir /target
|
||||
mount -t 9p -o trans=virtio target /target -oversion=9p2000.u || true
|
||||
|
||||
exec dropbear -F -E -B
|
||||
EOF
|
||||
|
||||
chmod +x "${root}/init"
|
||||
cd "${root}"
|
||||
find . | cpio --create --format='newc' --quiet | gzip > ../initrd.gz
|
||||
cd -
|
||||
|
||||
# Clean up
|
||||
rm -rf "/qemu/${root}" "/qemu/${arch}"
|
||||
mv -f /etc/apt/sources.list.bak /etc/apt/sources.list
|
||||
if [ -f /etc/dpkg/dpkg.cfg.d/multiarch.bak ]; then
|
||||
mv /etc/dpkg/dpkg.cfg.d/multiarch.bak /etc/dpkg/dpkg.cfg.d/multiarch
|
||||
fi
|
||||
# can fail if arch is used (amd64 and/or i386)
|
||||
dpkg --remove-architecture "${arch}" || true
|
||||
apt-get update
|
||||
|
||||
purge_packages
|
||||
|
||||
ls -lh /qemu
|
||||
}
|
||||
|
||||
main "${@}"
|
||||
173
.docker/cross/linux-runner
Executable file
173
.docker/cross/linux-runner
Executable file
@@ -0,0 +1,173 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
LOG=/tmp/qemu.log
|
||||
LOCK=/tmp/qemu.lock
|
||||
|
||||
if [ -n "${CROSS_DEBUG}" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
# arch in the rust target
|
||||
arch="${1}"
|
||||
shift
|
||||
|
||||
if [ "${CROSS_RUNNER}" = "" ]; then
|
||||
if [[ "${arch}" == i?86 ]] || [[ "${arch}" == x86_64 ]]; then
|
||||
CROSS_RUNNER=native
|
||||
else
|
||||
CROSS_RUNNER=qemu-user
|
||||
fi
|
||||
fi
|
||||
|
||||
# select qemu arch
|
||||
qarch="${arch}"
|
||||
case "${arch}" in
|
||||
armv7)
|
||||
qarch="arm"
|
||||
;;
|
||||
i686)
|
||||
qarch="i386"
|
||||
;;
|
||||
powerpc)
|
||||
qarch="ppc"
|
||||
;;
|
||||
powerpc64)
|
||||
qarch="ppc64"
|
||||
;;
|
||||
powerpc64le)
|
||||
if [ "${CROSS_RUNNER}" = "qemu-user" ]; then
|
||||
qarch="ppc64le"
|
||||
else
|
||||
qarch="ppc64"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
case "${CROSS_RUNNER}" in
|
||||
native)
|
||||
exec "${@}"
|
||||
;;
|
||||
qemu-user)
|
||||
exec "qemu-${qarch}" "${@}"
|
||||
;;
|
||||
qemu-system)
|
||||
true
|
||||
;;
|
||||
*)
|
||||
echo "Invalid runner: \"${CROSS_RUNNER}\"";
|
||||
echo "Valid runners are: native, qemu-user and qemu-system"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
n="$(nproc)"
|
||||
memory=1G
|
||||
driver9p="virtio-9p-pci"
|
||||
drivernet="virtio-net-pci"
|
||||
|
||||
# select qemu parameters
|
||||
case "${arch}" in
|
||||
aarch64)
|
||||
# 8 is the max number of cpu supported by qemu-aarch64
|
||||
n=$(( n > 8 ? 8 : n ))
|
||||
opt="-machine virt -cpu cortex-a57"
|
||||
;;
|
||||
armv7)
|
||||
opt="-machine virt"
|
||||
driver9p="virtio-9p-device"
|
||||
drivernet="virtio-net-device"
|
||||
;;
|
||||
i686)
|
||||
opt="-append console=ttyS0"
|
||||
;;
|
||||
mips|mipsel)
|
||||
# avoid kernel error
|
||||
# https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/
|
||||
opt="-append nokaslr"
|
||||
n=1
|
||||
;;
|
||||
mips64el)
|
||||
# avoid kernel error
|
||||
# https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/
|
||||
opt="-append nokaslr -cpu MIPS64R2-generic"
|
||||
n=1
|
||||
;;
|
||||
powerpc)
|
||||
opt="-append console=ttyPZ0"
|
||||
n=1
|
||||
;;
|
||||
powerpc64|powerpc64le)
|
||||
opt="-append console=hvc0 --nodefaults -serial stdio"
|
||||
;;
|
||||
s390x)
|
||||
n=1
|
||||
driver9p="virtio-9p-ccw"
|
||||
drivernet="virtio-net-ccw"
|
||||
;;
|
||||
sparc64)
|
||||
n=1
|
||||
driver9p+=",bus=pciB"
|
||||
drivernet+=",bus=pciB"
|
||||
;;
|
||||
x86_64)
|
||||
opt="-append console=ttyS0"
|
||||
;;
|
||||
esac
|
||||
|
||||
(
|
||||
flock -n 200 || exit 0
|
||||
|
||||
echo Booting QEMU virtual machine with $n cpus...
|
||||
|
||||
QEMU_CMD="qemu-system-${qarch} \
|
||||
-m ${memory} \
|
||||
-smp ${n} \
|
||||
-nographic \
|
||||
-monitor none \
|
||||
-netdev user,id=net0,hostfwd=tcp::10022-:22 \
|
||||
-device ${drivernet},netdev=net0 \
|
||||
-kernel /qemu/kernel \
|
||||
-initrd /qemu/initrd.gz \
|
||||
${opt} \
|
||||
-fsdev local,id=fs0,path=/target,security_model=mapped \
|
||||
-device ${driver9p},fsdev=fs0,mount_tag=target"
|
||||
|
||||
touch "${LOG}"
|
||||
if [[ -n "${CROSS_DEBUG}" ]]; then
|
||||
(${QEMU_CMD} 2>&1 | tee -a "${LOG}") &
|
||||
else
|
||||
${QEMU_CMD} >> "${LOG}" 2>&1 &
|
||||
fi
|
||||
|
||||
# wait for dropbear
|
||||
for _ in $(seq 240); do
|
||||
if grep -q "Not backgrounding" "${LOG}"; then
|
||||
READY=1
|
||||
break
|
||||
fi
|
||||
sleep 0.5s
|
||||
done
|
||||
|
||||
if [ -z "${READY}" ]; then
|
||||
if [ -n "${CROSS_DEBUG}" ]; then
|
||||
echo "Not ready but continuing because CROSS_DEBUG is set"
|
||||
else
|
||||
echo "Qemu is not ready after ${SECONDS} seconds..."
|
||||
echo "Set the environment variable CROSS_DEBUG=1 to debug"
|
||||
echo "Last 100 lines of qemu output:"
|
||||
tail -n 100 "${LOG}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Booted in ${SECONDS} seconds"
|
||||
|
||||
) 200>"${LOCK}"
|
||||
|
||||
if [[ -t 1 ]] && [[ -t 2 ]]; then
|
||||
tty_flag='-t'
|
||||
fi
|
||||
|
||||
exec dbclient ${tty_flag} -p 10022 -y -y root@localhost "${@}"
|
||||
233
.docker/cross/qemu.sh
Executable file
233
.docker/cross/qemu.sh
Executable file
@@ -0,0 +1,233 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. lib.sh
|
||||
|
||||
build_static_libffi () {
|
||||
local version=3.0.13
|
||||
|
||||
local td
|
||||
td="$(mktemp -d)"
|
||||
|
||||
pushd "${td}"
|
||||
|
||||
|
||||
curl --retry 3 -sSfL "https://github.com/libffi/libffi/archive/refs/tags/v${version}.tar.gz" -O -L
|
||||
tar --strip-components=1 -xzf "v${version}.tar.gz"
|
||||
./configure --prefix="$td"/lib --disable-builddir --disable-shared --enable-static
|
||||
make "-j$(nproc)"
|
||||
install -m 644 ./.libs/libffi.a /usr/lib64/
|
||||
|
||||
popd
|
||||
|
||||
rm -rf "${td}"
|
||||
}
|
||||
|
||||
build_static_libmount () {
|
||||
local version_spec=2.23.2
|
||||
local version=2.23
|
||||
local td
|
||||
td="$(mktemp -d)"
|
||||
|
||||
pushd "${td}"
|
||||
|
||||
curl --retry 3 -sSfL "https://kernel.org/pub/linux/utils/util-linux/v${version}/util-linux-${version_spec}.tar.xz" -O -L
|
||||
tar --strip-components=1 -xJf "util-linux-${version_spec}.tar.xz"
|
||||
./configure --disable-shared --enable-static --without-ncurses
|
||||
make "-j$(nproc)" mount blkid
|
||||
install -m 644 ./.libs/*.a /usr/lib64/
|
||||
|
||||
popd
|
||||
|
||||
rm -rf "${td}"
|
||||
}
|
||||
|
||||
|
||||
build_static_libattr() {
|
||||
local version=2.4.46
|
||||
|
||||
local td
|
||||
td="$(mktemp -d)"
|
||||
|
||||
pushd "${td}"
|
||||
|
||||
yum install -y gettext
|
||||
|
||||
curl --retry 3 -sSfL "https://download.savannah.nongnu.org/releases/attr/attr-${version}.src.tar.gz" -O
|
||||
tar --strip-components=1 -xzf "attr-${version}.src.tar.gz"
|
||||
cp /usr/share/automake*/config.* .
|
||||
|
||||
./configure
|
||||
make "-j$(nproc)"
|
||||
install -m 644 ./libattr/.libs/libattr.a /usr/lib64/
|
||||
|
||||
yum remove -y gettext
|
||||
|
||||
popd
|
||||
|
||||
rm -rf "${td}"
|
||||
}
|
||||
|
||||
build_static_libcap() {
|
||||
local version=2.22
|
||||
|
||||
local td
|
||||
td="$(mktemp -d)"
|
||||
|
||||
pushd "${td}"
|
||||
|
||||
curl --retry 3 -sSfL "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-${version}.tar.xz" -O
|
||||
tar --strip-components=1 -xJf "libcap-${version}.tar.xz"
|
||||
make "-j$(nproc)"
|
||||
install -m 644 libcap/libcap.a /usr/lib64/
|
||||
|
||||
popd
|
||||
|
||||
rm -rf "${td}"
|
||||
}
|
||||
|
||||
build_static_pixman() {
|
||||
local version=0.34.0
|
||||
|
||||
local td
|
||||
td="$(mktemp -d)"
|
||||
|
||||
pushd "${td}"
|
||||
|
||||
curl --retry 3 -sSfL "https://www.cairographics.org/releases/pixman-${version}.tar.gz" -O
|
||||
tar --strip-components=1 -xzf "pixman-${version}.tar.gz"
|
||||
./configure
|
||||
make "-j$(nproc)"
|
||||
install -m 644 ./pixman/.libs/libpixman-1.a /usr/lib64/
|
||||
|
||||
popd
|
||||
|
||||
rm -rf "${td}"
|
||||
}
|
||||
|
||||
main() {
|
||||
local version=5.1.0
|
||||
|
||||
if_centos version=4.2.1
|
||||
|
||||
local arch="${1}" \
|
||||
softmmu="${2:-}"
|
||||
|
||||
install_packages \
|
||||
autoconf \
|
||||
automake \
|
||||
bison \
|
||||
bzip2 \
|
||||
curl \
|
||||
flex \
|
||||
libtool \
|
||||
make \
|
||||
patch \
|
||||
python3 \
|
||||
|
||||
if_centos install_packages \
|
||||
gcc-c++ \
|
||||
pkgconfig \
|
||||
xz \
|
||||
glib2-devel \
|
||||
glib2-static \
|
||||
glibc-static \
|
||||
libattr-devel \
|
||||
libcap-devel \
|
||||
libfdt-devel \
|
||||
pcre-static \
|
||||
pixman-devel \
|
||||
libselinux-devel \
|
||||
libselinux-static \
|
||||
libffi \
|
||||
libuuid-devel \
|
||||
libblkid-devel \
|
||||
libmount-devel \
|
||||
zlib-devel \
|
||||
zlib-static
|
||||
|
||||
if_centos 'curl --retry 3 -sSfL "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD" -o /usr/share/automake*/config.guess'
|
||||
if_centos 'curl --retry 3 -sSfL "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" -o /usr/share/automake*/config.sub'
|
||||
|
||||
# these are not packaged as static libraries in centos; build them manually
|
||||
if_centos build_static_libffi
|
||||
if_centos build_static_libmount
|
||||
if_centos build_static_libattr
|
||||
if_centos build_static_libcap
|
||||
if_centos build_static_pixman
|
||||
|
||||
if_ubuntu install_packages \
|
||||
g++ \
|
||||
pkg-config \
|
||||
xz-utils \
|
||||
libattr1-dev \
|
||||
libcap-ng-dev \
|
||||
libffi-dev \
|
||||
libglib2.0-dev \
|
||||
libpixman-1-dev \
|
||||
libselinux1-dev \
|
||||
zlib1g-dev
|
||||
|
||||
# if we have python3.6+, we can install qemu 6.1.0, which needs ninja-build
|
||||
# ubuntu 16.04 only provides python3.5, so remove when we have a newer qemu.
|
||||
is_ge_python36=$(python3 -c "import sys; print(int(sys.version_info >= (3, 6)))")
|
||||
if [[ "${is_ge_python36}" == "1" ]]; then
|
||||
if_ubuntu version=6.1.0
|
||||
if_ubuntu install_packages ninja-build
|
||||
fi
|
||||
|
||||
local td
|
||||
td="$(mktemp -d)"
|
||||
|
||||
pushd "${td}"
|
||||
|
||||
curl --retry 3 -sSfL "https://download.qemu.org/qemu-${version}.tar.xz" -O
|
||||
tar --strip-components=1 -xJf "qemu-${version}.tar.xz"
|
||||
|
||||
local targets="${arch}-linux-user"
|
||||
local virtfs=""
|
||||
case "${softmmu}" in
|
||||
softmmu)
|
||||
if [ "${arch}" = "ppc64le" ]; then
|
||||
targets="${targets},ppc64-softmmu"
|
||||
else
|
||||
targets="${targets},${arch}-softmmu"
|
||||
fi
|
||||
virtfs="--enable-virtfs"
|
||||
;;
|
||||
"")
|
||||
true
|
||||
;;
|
||||
*)
|
||||
echo "Invalid softmmu option: ${softmmu}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
./configure \
|
||||
--disable-kvm \
|
||||
--disable-vnc \
|
||||
--disable-guest-agent \
|
||||
--enable-linux-user \
|
||||
--static \
|
||||
${virtfs} \
|
||||
--target-list="${targets}"
|
||||
make "-j$(nproc)"
|
||||
make install
|
||||
|
||||
# HACK the binfmt_misc interpreter we'll use expects the QEMU binary to be
|
||||
# in /usr/bin. Create an appropriate symlink
|
||||
ln -s "/usr/local/bin/qemu-${arch}" "/usr/bin/qemu-${arch}-static"
|
||||
|
||||
purge_packages
|
||||
|
||||
popd
|
||||
|
||||
rm -rf "${td}"
|
||||
rm "${0}"
|
||||
}
|
||||
|
||||
main "${@}"
|
||||
28
.docker/cross/xargo.sh
Executable file
28
.docker/cross/xargo.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. lib.sh
|
||||
|
||||
main() {
|
||||
install_packages ca-certificates curl
|
||||
|
||||
export RUSTUP_HOME=/tmp/rustup
|
||||
export CARGO_HOME=/tmp/cargo
|
||||
|
||||
curl --retry 3 -sSfL https://sh.rustup.rs -o rustup-init.sh
|
||||
sh rustup-init.sh -y --no-modify-path --profile minimal
|
||||
rm rustup-init.sh
|
||||
|
||||
PATH="${CARGO_HOME}/bin:${PATH}" cargo install xargo --root /usr/local
|
||||
|
||||
rm -r "${RUSTUP_HOME}" "${CARGO_HOME}"
|
||||
|
||||
purge_packages
|
||||
|
||||
rm "${0}"
|
||||
}
|
||||
|
||||
main "${@}"
|
||||
2
.github/CODE_OF_CONDUCT.md
vendored
2
.github/CODE_OF_CONDUCT.md
vendored
@@ -61,7 +61,7 @@ representative at an online or offline event.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
[contact@tauri.studio](mailto:contact@tauri.studio).
|
||||
[contact@tauri.app](mailto:contact@tauri.app).
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
|
||||
24
.github/CONTRIBUTING.md
vendored
24
.github/CONTRIBUTING.md
vendored
@@ -48,26 +48,26 @@ Hi! We, the maintainers, are really excited that you are interested in contribut
|
||||
|
||||
First, [join our Discord server](https://discord.gg/SpmNs4S) and let us know that you want to contribute. This way we can point you in the right direction and help ensure your contribution will be as helpful as possible.
|
||||
|
||||
To set up your machine for development, follow the [Tauri setup guide](https://tauri.studio/guides/getting-started/prerequisites/) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [Yarn](https://yarnpkg.com/), it is only required if you are developing the Node CLI or API packages (`tooling/cli/node` and `tooling/api`). Next, fork and clone this repo. It is structured as a monorepo, which means that all the various Tauri packages are under the same repository. The development process varies depending on what part of Tauri you are contributing to, see the guides below for per-package instructions.
|
||||
To set up your machine for development, follow the [Tauri setup guide](https://tauri.app/v1/guides/getting-started/prerequisites/) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [Yarn](https://yarnpkg.com/), it is only required if you are developing the Node CLI or API packages (`tooling/cli/node` and `tooling/api`). Next, fork and clone this repo. It is structured as a monorepo, which means that all the various Tauri packages are under the same repository. The development process varies depending on what part of Tauri you are contributing to, see the guides below for per-package instructions.
|
||||
|
||||
Some Tauri packages will be automatically built when running one of the examples. Others, however, will need to be built beforehand. To build these automatically, run the `.scripts/setup.sh` (Linux and macOS) or `.scripts/setup.ps1` (Windows) script. This will install the Rust and Node.js CLI and build the JS API. After that, you should be able to run all the examples. Note that the setup script should be executed from the root folder of the respository in order to run correctly.
|
||||
Some Tauri packages will be automatically built when running one of the examples. Others, however, will need to be built beforehand. To build these automatically, run the `.scripts/setup.sh` (Linux and macOS) or `.scripts/setup.ps1` (Windows) script. This will install the Rust and Node.js CLI and build the JS API. After that, you should be able to run all the examples. Note that the setup script should be executed from the root folder of the repository in order to run correctly.
|
||||
|
||||
### Packages Overview
|
||||
|
||||
- The JS API (`/tooling/api`) contains JS bindings to the builtin Rust functions in the Rust API.
|
||||
- cli.rs (`/tooling/cli`) is the primary CLI for creating and developing Tauri apps.
|
||||
- cli.js (`/tooling/cli/node`) is a Node.js CLI wrapper for `cli.rs`.
|
||||
- Tauri Bundler (`/tooling/bundler`) is used by the Rust CLI to package executables into installers.
|
||||
- Tauri Core (`/core/tauri`) is the heart of Tauri. It contains the code that starts the app, configures communication between Rust and the Webview, and ties all the other packages together.
|
||||
- The Macros (`/core/tauri-macros`) are used by Tauri Core for various functions.
|
||||
|
||||
### Developing The Node.js CLI (cli.js)
|
||||
|
||||
`cli.js` is a wrapper to `cli.rs` so most changes should be written on the Rust CLI. The `[Tauri repo root]/tooling/cli/node` folder contains only packaging scripts to properly publish the Rust CLI binaries to NPM.
|
||||
- Tauri Bundler (`/tooling/bundler`) is used by the Rust CLI to package executables into installers.
|
||||
- The Rust CLI aka `tauri-cli` (`/tooling/cli`) is the primary CLI for creating and developing Tauri apps.
|
||||
- The JS CLI aka `@tauri-apps/cli` (`/tooling/cli/node`) is a Node.js CLI wrapper for `tauri-cli`.
|
||||
- The JS API aka `@tauri-apps/api` (`/tooling/api`) contains JS bindings to the builtin Rust functions in the Rust API.
|
||||
|
||||
### Developing Tauri Bundler and Rust CLI
|
||||
|
||||
The code for the bundler is located in `[Tauri repo root]/tooling/bundler`, and the code for the Rust CLI is located in `[Tauri repo root]/tooling/cli`. If you are using your local copy of cli.js (see above), any changes you make to the bundler and CLI will be automatically built and applied when running the build or dev command. Otherwise, running `cargo install --path .` in the Rust CLI directory will allow you to run `cargo tauri build` and `cargo tauri dev` anywhere, using the updated copy of the bundler and cli. You will have to run this command each time you make a change in either package.
|
||||
The code for the bundler is located in `[Tauri repo root]/tooling/bundler`, and the code for the Rust CLI is located in `[Tauri repo root]/tooling/cli`. If you are using your local copy of `@tauri-apps/cli` (see above), any changes you make to the bundler and CLI will be automatically built and applied when running the build or dev command. Otherwise, running `cargo install --path .` in the Rust CLI directory will allow you to run `cargo tauri build` and `cargo tauri dev` anywhere, using the updated copy of the bundler and cli. You will have to run this command each time you make a change in either package.
|
||||
|
||||
### Developing The Node.js CLI (`@tauri-apps/cli`)
|
||||
|
||||
`@tauri-apps/cli` is a wrapper to `tauri-cli` so most changes should be written on the Rust CLI. The `[Tauri repo root]/tooling/cli/node` folder contains only packaging scripts to properly publish the Rust CLI binaries to NPM.
|
||||
|
||||
### Developing Tauri Core and Related Components (Rust API, Macros, Codegen, and Utils)
|
||||
|
||||
@@ -87,4 +87,4 @@ The JS API provides bindings between the developer's JS in the Webview and the b
|
||||
|
||||
## Financial Contribution
|
||||
|
||||
Tauri is an MIT-licensed open source project. Its ongoing development can be supported via [Github Sponsors](https://github.com/sponsors/nothingismagick) or [Open Collective](https://opencollective.com/tauri). We prefer Github Sponsors as donations made are doubled through the matching fund program.
|
||||
Tauri is an MIT-licensed open source project. Its ongoing development can be supported via [GitHub Sponsors](https://github.com/sponsors/nothingismagick) or [Open Collective](https://opencollective.com/tauri). We prefer GitHub Sponsors as donations made are doubled through the matching fund program.
|
||||
|
||||
6
.github/FUNDING.yml
vendored
6
.github/FUNDING.yml
vendored
@@ -1,6 +1,10 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: nothingismagick
|
||||
github: tauri-apps
|
||||
patreon: #
|
||||
open_collective: tauri
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
|
||||
19
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
19
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -1,7 +1,11 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: 🐞 Bug Report
|
||||
title: '[bug] '
|
||||
description: Report a bug
|
||||
labels: 'type: bug'
|
||||
labels: ['type: bug', 'status: needs triage']
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
@@ -26,11 +30,10 @@ body:
|
||||
id: reproduction
|
||||
attributes:
|
||||
label: Reproduction
|
||||
description: Steps to reproduce the behavior.
|
||||
description: A link to a reproduction repo or steps to reproduce the behaviour.
|
||||
placeholder: |
|
||||
1. Go to ...
|
||||
2. Click on ...
|
||||
3. See error
|
||||
Please provide a minimal reproduction or steps to reproduce, see this guide https://stackoverflow.com/help/minimal-reproducible-example
|
||||
Why reproduction is required? see this article https://antfu.me/posts/why-reproductions-are-required
|
||||
|
||||
- type: textarea
|
||||
id: expected-behavior
|
||||
@@ -43,7 +46,7 @@ body:
|
||||
attributes:
|
||||
label: Platform and versions
|
||||
description: "Output of `npm run tauri info` or `cargo tauri info`"
|
||||
render: shell
|
||||
render: text
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -51,8 +54,8 @@ body:
|
||||
id: logs
|
||||
attributes:
|
||||
label: Stack trace
|
||||
render: shell
|
||||
|
||||
render: text
|
||||
|
||||
- type: textarea
|
||||
id: context
|
||||
attributes:
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/config.yml
vendored
4
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,3 +1,7 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
contact_links:
|
||||
- name: 💬 Discord Chat
|
||||
url: https://discord.com/invite/tauri
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
4
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -1,3 +1,7 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: 💡 Feature Request
|
||||
title: '[feat] '
|
||||
description: Suggest an idea
|
||||
|
||||
45
.github/PULL_REQUEST_TEMPLATE.md
vendored
45
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,30 +1,21 @@
|
||||
<!--
|
||||
Update "[ ]" to "[x]" to check a box
|
||||
Before submitting a PR, please read https://github.com/tauri-apps/tauri/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
|
||||
|
||||
Please make sure to read the Pull Request Guidelines: https://github.com/tauri-apps/tauri/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
|
||||
1. Give the PR a descriptive title.
|
||||
|
||||
Examples of good title:
|
||||
- fix(windows): fix race condition in event loop
|
||||
- docs: update docstrings
|
||||
- feat: add `Window::set_fullscreen`
|
||||
|
||||
Examples of bad title:
|
||||
- fix #7123
|
||||
- update docs
|
||||
- fix bugs
|
||||
|
||||
2. If there is a related issue, reference it in the PR text, e.g. closes #123.
|
||||
3. If this change requires a new version, then add a change file in `.changes` directory with the appropriate bump, see https://github.com/tauri-apps/tauri/blob/dev/.changes/readme.md
|
||||
4. Ensure that all your commits are signed https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
|
||||
5. Ensure `cargo test` and `cargo clippy` passes.
|
||||
6. Propose your changes as a draft PR if your work is still in progress.
|
||||
-->
|
||||
|
||||
### What kind of change does this PR introduce?
|
||||
<!-- Check at least one. If you are introducing a new binding, you must reference an issue where this binding has been proposed, discussed and approved by the maintainers. -->
|
||||
|
||||
- [ ] Bugfix
|
||||
- [ ] Feature
|
||||
- [ ] Docs
|
||||
- [ ] New Binding issue #___
|
||||
- [ ] Code style update
|
||||
- [ ] Refactor
|
||||
- [ ] Build-related changes
|
||||
- [ ] Other, please describe:
|
||||
|
||||
### Does this PR introduce a breaking change?
|
||||
<!-- If yes, please describe the impact and migration path for existing applications in an attached issue. -->
|
||||
|
||||
- [ ] Yes, and the changes were approved in issue #___
|
||||
- [ ] No
|
||||
|
||||
### Checklist
|
||||
- [ ] When resolving issues, they are referenced in the PR's title (e.g `fix: remove a typo, closes #___, #___`)
|
||||
- [ ] A change file is added if any packages will require a version bump due to this PR per [the instructions in the readme](https://github.com/tauri-apps/tauri/blob/dev/.changes/readme.md).
|
||||
- [ ] I have added a convincing reason for adding this feature, if necessary
|
||||
|
||||
### Other information
|
||||
|
||||
3
.github/config.yml
vendored
3
.github/config.yml
vendored
@@ -0,0 +1,3 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
10
.github/workflows/audit.yml
vendored
10
.github/workflows/audit.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -10,6 +10,7 @@ on:
|
||||
- cron: '0 0 * * *'
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/audit.yml'
|
||||
- '**/Cargo.lock'
|
||||
- '**/Cargo.toml'
|
||||
- '**/package.json'
|
||||
@@ -33,6 +34,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: yarn audit
|
||||
- name: audit workspace
|
||||
run: yarn audit
|
||||
- name: audit @tauri-apps/api
|
||||
working-directory: tooling/api
|
||||
run: yarn audit
|
||||
- name: audit @tauri-apps/cli
|
||||
working-directory: tooling/cli/node
|
||||
run: yarn audit
|
||||
|
||||
72
.github/workflows/bench.yml
vendored
72
.github/workflows/bench.yml
vendored
@@ -1,16 +1,20 @@
|
||||
name: benches
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: bench
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- next
|
||||
- 1.x
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
LC_ALL: en_US.UTF-8 # This prevents strace from changing it's number format to use commas.
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -23,7 +27,7 @@ jobs:
|
||||
matrix:
|
||||
rust: [nightly]
|
||||
platform:
|
||||
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest }
|
||||
- { target: x86_64-unknown-linux-gnu, os: ubuntu-20.04 }
|
||||
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
|
||||
@@ -34,72 +38,30 @@ jobs:
|
||||
with:
|
||||
toolchain: ${{ matrix.rust }}
|
||||
override: true
|
||||
default: true
|
||||
components: rust-src
|
||||
target: ${{ matrix.platform.target }}
|
||||
|
||||
- name: setup python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: '3.10'
|
||||
architecture: x64
|
||||
|
||||
- name: install depedencies
|
||||
- name: install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf xvfb
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev xvfb
|
||||
wget https://github.com/sharkdp/hyperfine/releases/download/v1.11.0/hyperfine_1.11.0_amd64.deb
|
||||
sudo dpkg -i hyperfine_1.11.0_amd64.deb
|
||||
pip install memory_profiler
|
||||
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache core cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_core
|
||||
with:
|
||||
path: target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
|
||||
${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-${{ matrix.rust }}-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: cache cargo `tooling/bench/tests` target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_benches
|
||||
with:
|
||||
path: tooling/bench/tests/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-${{ hashFiles('tooling/bench/tests/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-${{ hashFiles('tooling/bench/tests/Cargo.lock') }}
|
||||
${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-${{ matrix.rust }}-
|
||||
${{ matrix.platform }}-
|
||||
workspaces: |
|
||||
core -> ../target
|
||||
tooling/bench/tests
|
||||
|
||||
- name: run benchmarks
|
||||
run: |
|
||||
@@ -126,7 +88,7 @@ jobs:
|
||||
git commit --message "Update Tauri benchmarks"
|
||||
git push origin gh-pages
|
||||
|
||||
- name: Worker info
|
||||
- name: Print worker info
|
||||
run: |
|
||||
cat /proc/cpuinfo
|
||||
cat /proc/meminfo
|
||||
|
||||
32
.github/workflows/check-change-tags.yml
vendored
Normal file
32
.github/workflows/check-change-tags.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: check change tags
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.changes/*.md'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
list-files: shell
|
||||
filters: |
|
||||
changes:
|
||||
- added|modified: '.changes/*.md'
|
||||
|
||||
- name: check
|
||||
run: node ./.scripts/ci/check-change-tags.js ${{ steps.filter.outputs.changes_files }}
|
||||
if: ${{ steps.filter.outputs.changes == 'true' }}
|
||||
83
.github/workflows/check-generated-files.yml
vendored
Normal file
83
.github/workflows/check-generated-files.yml
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: check generated files
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/check-generated-files.yml'
|
||||
- 'tooling/api/src/**'
|
||||
- 'core/tauri/scripts/bundle.global.js'
|
||||
- 'core/tauri-utils/src/config.rs'
|
||||
- 'tooling/cli/schema.json'
|
||||
- 'core/tauri-config-schema/schema.json'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
api: ${{ steps.filter.outputs.api }}
|
||||
schema: ${{ steps.filter.outputs.schema }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
api:
|
||||
- 'tooling/api/src/**'
|
||||
- 'core/tauri/scripts/bundle.global.js'
|
||||
schema:
|
||||
- 'core/tauri-utils/src/config.rs'
|
||||
- 'tooling/cli/schema.json'
|
||||
- 'core/tauri-config-schema/schema.json'
|
||||
|
||||
api:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.api == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: build api
|
||||
working-directory: tooling/api
|
||||
run: yarn && yarn build
|
||||
- name: check api
|
||||
run: ./.scripts/ci/has-diff.sh
|
||||
|
||||
schema:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.schema == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
|
||||
- name: install Linux dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: core -> ../target
|
||||
|
||||
- name: generate schema.json
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --manifest-path ./core/tauri-config-schema/Cargo.toml
|
||||
|
||||
- name: check schema
|
||||
run: ./.scripts/ci/has-diff.sh
|
||||
28
.github/workflows/check-license-header.yml
vendored
Normal file
28
.github/workflows/check-license-header.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: check license headers
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
list-files: shell
|
||||
filters: |
|
||||
added:
|
||||
- added: '**'
|
||||
- name: check header license on new files
|
||||
if: ${{ steps.filter.outputs.added == 'true' }}
|
||||
run: node ./.scripts/ci/check-license-header.js ${{ steps.filter.outputs.added_files }}
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
242
.github/workflows/covector-version-or-publish-v1.yml
vendored
Normal file
242
.github/workflows/covector-version-or-publish-v1.yml
vendored
Normal file
@@ -0,0 +1,242 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: covector version or publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 1.x
|
||||
- v1/msrv-check
|
||||
|
||||
jobs:
|
||||
msrv-list:
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- {
|
||||
target: x86_64-pc-windows-msvc,
|
||||
os: windows-latest,
|
||||
toolchain: '1.61.0'
|
||||
}
|
||||
- {
|
||||
target: x86_64-unknown-linux-gnu,
|
||||
os: ubuntu-latest,
|
||||
toolchain: '1.60.0'
|
||||
}
|
||||
- {
|
||||
target: x86_64-apple-darwin,
|
||||
os: macos-13,
|
||||
toolchain: '1.60.0'
|
||||
}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: install rust ${{ matrix.platform.toolchain }}
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ matrix.platform.toolchain }}
|
||||
target: ${{ matrix.platform.target }}
|
||||
override: true
|
||||
default: true
|
||||
|
||||
- name: install Linux dependencies
|
||||
if: contains(matrix.platform.target, 'unknown-linux')
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: delete lockfile
|
||||
run: rm Cargo.lock
|
||||
|
||||
- name: Downgrade crates with MSRV conflict
|
||||
# The --precise flag can only be used once per invocation.
|
||||
run: |
|
||||
cargo update -p system-deps:6.2.2 --precise 6.1.1
|
||||
cargo update -p toml:0.7.8 --precise 0.7.3
|
||||
cargo update -p toml_edit:0.19.15 --precise 0.19.8
|
||||
cargo update -p embed-resource --precise 2.3.0
|
||||
cargo update -p notify-rust --precise 4.10.0
|
||||
cargo update -p toml_datetime --precise 0.6.1
|
||||
cargo update -p serde_spanned --precise 0.6.1
|
||||
cargo update -p winnow --precise 0.4.1
|
||||
cargo update -p plist --precise 1.5.1
|
||||
cargo update -p serde_with:3.8.2 --precise 3.0.0
|
||||
cargo update -p time --precise 0.3.15
|
||||
cargo update -p ignore --precise 0.4.18
|
||||
cargo update -p raw-window-handle --precise 0.5.0
|
||||
cargo update -p cargo_toml:0.15.3 --precise 0.15.2
|
||||
cargo update -p zbus --precise 3.13.0
|
||||
cargo update -p zbus_names --precise 2.5.0
|
||||
cargo update -p colored --precise 2.0.2
|
||||
cargo update -p arboard --precise 3.2.1
|
||||
cargo update -p tempfile --precise 3.6.0
|
||||
cargo update -p tokio --precise 1.29.0
|
||||
cargo update -p flate2 --precise 1.0.26
|
||||
cargo update -p hyper --precise 0.14.28
|
||||
cargo update -p h2 --precise 0.3.20
|
||||
cargo update -p reqwest --precise 0.11.18
|
||||
cargo update -p bstr --precise 1.6.2
|
||||
cargo update -p cfg-expr:0.15.8 --precise 0.15.4
|
||||
cargo update -p memchr --precise 2.6.2
|
||||
cargo update -p async-executor --precise 1.5.1
|
||||
cargo update -p proptest --precise 1.2.0
|
||||
cargo update -p regex --precise 1.9.6
|
||||
cargo update -p bstr --precise 1.6.2
|
||||
cargo update -p backtrace --precise 0.3.68
|
||||
cargo update -p blocking --precise 1.4.1
|
||||
cargo update -p ignore --precise 0.4.18
|
||||
cargo update -p globset --precise 0.4.13
|
||||
cargo update -p crossbeam-channel --precise 0.5.8
|
||||
cargo update -p crossbeam-utils --precise 0.8.16
|
||||
cargo update -p image --precise 0.24.4
|
||||
cargo update -p async-process --precise 1.7.0
|
||||
cargo update -p is-terminal --precise 0.4.7
|
||||
cargo update -p tar --precise 0.4.39
|
||||
cargo update -p serde_json --precise 1.0.97
|
||||
cargo update -p petgraph --precise 0.6.3
|
||||
cargo update -p os_str_bytes --precise 6.5.1
|
||||
cargo update -p thread_local --precise 1.1.7
|
||||
cargo update -p cc --precise 1.0.94
|
||||
cargo update -p home --precise 0.5.5
|
||||
cargo update -p tree_magic_mini --precise 3.0.3
|
||||
cargo update -p tokio-test --precise 0.4.3
|
||||
cargo update -p tokio-stream --precise 0.1.14
|
||||
cargo update -p tokio-util --precise 0.7.10
|
||||
cargo update -p os_pipe --precise 1.1.5
|
||||
cargo update -p syn:2.0.68 --precise 2.0.67
|
||||
cargo update -p derive_more --precise 0.99.17
|
||||
cargo update -p native-tls --precise 0.2.11
|
||||
|
||||
- name: test build
|
||||
run: cargo check --target ${{ matrix.platform.target }} --features tracing,compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart,test
|
||||
|
||||
run-integration-tests:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
needs: msrv-list
|
||||
if: github.ref == 'refs/heads/1.x'
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, macos-13, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
- name: install Linux dependencies
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev libfuse2
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: |
|
||||
core -> ../target
|
||||
tooling/cli
|
||||
|
||||
- name: build CLI
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml
|
||||
|
||||
- name: run integration tests
|
||||
run: cargo test --test '*' -- --ignored
|
||||
|
||||
- name: run CLI tests
|
||||
timeout-minutes: 30
|
||||
run: |
|
||||
cd ./tooling/cli/node
|
||||
yarn
|
||||
yarn build
|
||||
yarn test
|
||||
|
||||
version-or-publish:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 65
|
||||
outputs:
|
||||
change: ${{ steps.covector.outputs.change }}
|
||||
commandRan: ${{ steps.covector.outputs.commandRan }}
|
||||
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
|
||||
needs:
|
||||
- run-integration-tests
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
cache: yarn
|
||||
cache-dependency-path: tooling/*/yarn.lock
|
||||
|
||||
- name: cargo login
|
||||
run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }}
|
||||
- name: git config
|
||||
run: |
|
||||
git config --global user.name "${{ github.event.pusher.name }}"
|
||||
git config --global user.email "${{ github.event.pusher.email }}"
|
||||
|
||||
- name: covector version or publish (publish when no change files present)
|
||||
uses: jbolda/covector/packages/action@covector-v0
|
||||
id: covector
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
|
||||
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
command: 'version-or-publish'
|
||||
createRelease: true
|
||||
|
||||
- name: Create Pull Request With Versions Bumped
|
||||
if: steps.covector.outputs.commandRan == 'version'
|
||||
uses: tauri-apps/create-pull-request@v3
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: release/version-updates-v1
|
||||
title: Apply Version Updates From Current Changes (v1)
|
||||
commit-message: 'apply version updates'
|
||||
labels: 'version updates'
|
||||
body: ${{ steps.covector.outputs.change }}
|
||||
|
||||
- name: Trigger doc update
|
||||
if: |
|
||||
steps.covector.outputs.successfulPublish == 'true' &&
|
||||
steps.covector.outputs.packagesPublished != ''
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
|
||||
repository: tauri-apps/tauri-docs
|
||||
event-type: update-docs
|
||||
|
||||
- name: Trigger `@tauri-apps/cli` publishing workflow
|
||||
if: |
|
||||
steps.covector.outputs.successfulPublish == 'true' &&
|
||||
contains(steps.covector.outputs.packagesPublished, '@tauri-apps/cli')
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
event-type: publish-js-cli
|
||||
client-payload: >-
|
||||
{"releaseId": "${{ steps.covector.outputs['-tauri-apps-cli-releaseId'] }}" }
|
||||
|
||||
- name: Trigger `tauri-cli` publishing workflow
|
||||
if: |
|
||||
steps.covector.outputs.successfulPublish == 'true' &&
|
||||
contains(steps.covector.outputs.packagesPublished, 'tauri-cli')
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
event-type: publish-clirs
|
||||
@@ -1,8 +1,8 @@
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: version or publish
|
||||
name: covector version or publish
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -10,6 +10,51 @@ on:
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
run-integration-tests:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
- name: install Linux dependencies
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev libfuse2
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: |
|
||||
core -> ../target
|
||||
tooling/cli
|
||||
|
||||
- name: build CLI
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml
|
||||
|
||||
- name: run integration tests
|
||||
run: cargo test --test '*' -- --ignored
|
||||
|
||||
- name: run CLI tests
|
||||
timeout-minutes: 30
|
||||
run: |
|
||||
cd ./tooling/cli/node
|
||||
yarn
|
||||
yarn build
|
||||
yarn test
|
||||
|
||||
version-or-publish:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 65
|
||||
@@ -17,6 +62,8 @@ jobs:
|
||||
change: ${{ steps.covector.outputs.change }}
|
||||
commandRan: ${{ steps.covector.outputs.commandRan }}
|
||||
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
|
||||
needs:
|
||||
- run-integration-tests
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -24,13 +71,13 @@ jobs:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14
|
||||
node-version: 16
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
cache: yarn
|
||||
cache-dependency-path: tooling/*/yarn.lock
|
||||
|
||||
- name: cargo login
|
||||
run: cargo login ${{ secrets.crate_token }}
|
||||
run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }}
|
||||
- name: git config
|
||||
run: |
|
||||
git config --global user.name "${{ github.event.pusher.name }}"
|
||||
@@ -40,7 +87,7 @@ jobs:
|
||||
uses: jbolda/covector/packages/action@covector-v0
|
||||
id: covector
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
|
||||
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -49,7 +96,7 @@ jobs:
|
||||
|
||||
- name: Create Pull Request With Versions Bumped
|
||||
if: steps.covector.outputs.commandRan == 'version'
|
||||
uses: tauri-apps/create-pull-request@v3.4.1
|
||||
uses: tauri-apps/create-pull-request@v3
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: release/version-updates
|
||||
@@ -59,19 +106,29 @@ jobs:
|
||||
body: ${{ steps.covector.outputs.change }}
|
||||
|
||||
- name: Trigger doc update
|
||||
if: steps.covector.outputs.successfulPublish == 'true'
|
||||
if: |
|
||||
steps.covector.outputs.successfulPublish == 'true' &&
|
||||
steps.covector.outputs.packagesPublished != ''
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
token: ${{ secrets.TAURI_BOT_PAT }}
|
||||
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
|
||||
repository: tauri-apps/tauri-docs
|
||||
event-type: update-docs
|
||||
|
||||
- name: Trigger cli.js publishing workflow
|
||||
- name: Trigger `@tauri-apps/cli` publishing workflow
|
||||
if: |
|
||||
steps.covector.outputs.successfulPublish == 'true' &&
|
||||
contains(steps.covector.outputs.packagesPublished, 'cli.rs')
|
||||
contains(steps.covector.outputs.packagesPublished, '@tauri-apps/cli')
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
token: ${{ secrets.TAURI_BOT_PAT }}
|
||||
repository: tauri-apps/tauri
|
||||
event-type: publish-clijs
|
||||
event-type: publish-js-cli
|
||||
client-payload: >-
|
||||
{"releaseId": "${{ steps.covector.outputs['-tauri-apps-cli-releaseId'] }}" }
|
||||
|
||||
- name: Trigger `tauri-cli` publishing workflow
|
||||
if: |
|
||||
steps.covector.outputs.successfulPublish == 'true' &&
|
||||
contains(steps.covector.outputs.packagesPublished, 'tauri-cli')
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
event-type: publish-clirs
|
||||
|
||||
137
.github/workflows/docker.yml
vendored
Normal file
137
.github/workflows/docker.yml
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: docker
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
#pull_request:
|
||||
# paths:
|
||||
# - '.docker/**'
|
||||
# - '.github/workflows/docker.yml'
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: install Linux dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- name: install cross
|
||||
run: cargo install cross --git https://github.com/cross-rs/cross
|
||||
|
||||
- name: Upload cross
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: cross
|
||||
path: '~/.cargo/bin/cross'
|
||||
if-no-files-found: error
|
||||
|
||||
- name: build CLI
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml
|
||||
|
||||
- name: Upload CLI
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: cargo-tauri
|
||||
path: tooling/cli/target/debug/cargo-tauri
|
||||
if-no-files-found: error
|
||||
|
||||
docker:
|
||||
needs: setup
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target:
|
||||
- { name: 'aarch64-unknown-linux-gnu', filename: 'aarch64' }
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
default: true
|
||||
target: ${{ matrix.target.name }}
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Download cross
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: cross
|
||||
path: '~/.cargo/bin'
|
||||
|
||||
- name: Download CLI
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: cargo-tauri
|
||||
path: 'examples/api'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and export to Docker
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .docker/cross
|
||||
file: .docker/cross/${{ matrix.target.filename }}.Dockerfile
|
||||
load: true
|
||||
tags: ${{ matrix.target.name }}:latest
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
cd tooling/api
|
||||
yarn && yarn build
|
||||
cd ../../examples/api
|
||||
yarn
|
||||
. .setup-cross.sh
|
||||
chmod +x cargo-tauri
|
||||
chmod +x $HOME/.cargo/bin/cross
|
||||
./cargo-tauri build --runner cross --bundles deb --target ${{ matrix.target.name }} --verbose
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .docker/cross
|
||||
file: .docker/cross/${{ matrix.target.filename }}.Dockerfile
|
||||
push: true
|
||||
tags: ghcr.io/${{ github.repository }}/${{ matrix.target.name }}:latest
|
||||
70
.github/workflows/lint-cli.yml
vendored
Normal file
70
.github/workflows/lint-cli.yml
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: lint cli
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- 1.x
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/lint-cli.yml'
|
||||
- 'tooling/cli/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
fmt:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml --all -- --check
|
||||
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: clippy
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: tooling/cli
|
||||
|
||||
- uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml --all-targets --all-features -- -D warnings
|
||||
name: cli
|
||||
83
.github/workflows/lint-core.yml
vendored
Normal file
83
.github/workflows/lint-core.yml
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: lint core
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- 1.x
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/lint-core.yml'
|
||||
- 'core/**'
|
||||
- '!core/tauri/scripts/**'
|
||||
- 'examples/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
fmt:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
clippy:
|
||||
- { args: '', key: 'empty' }
|
||||
- {
|
||||
args: '--features compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart,test',
|
||||
key: 'all'
|
||||
}
|
||||
- { args: '--features custom-protocol', key: 'custom-protocol' }
|
||||
- { args: '--features api-all', key: 'api-all' }
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: clippy
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: core -> ../target
|
||||
save-if: ${{ matrix.clippy.key == 'all' }}
|
||||
|
||||
- uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --manifest-path ./core/tauri/Cargo.toml --all-targets ${{ matrix.clippy.args }} -- -D warnings
|
||||
name: ${{ matrix.clippy.key }}
|
||||
101
.github/workflows/lint-fmt-cli.yml
vendored
101
.github/workflows/lint-fmt-cli.yml
vendored
@@ -1,101 +0,0 @@
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: cli clippy and fmt check
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- next
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/lint-fmt-cli.yml'
|
||||
- 'tooling/cli/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
fmt_check:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml --all -- --check
|
||||
|
||||
cli_clippy_check:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: clippy
|
||||
|
||||
- name: install Linux dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-
|
||||
ubuntu-latest-stable-
|
||||
ubuntu-latest-
|
||||
|
||||
- name: Cache CLI cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_cli
|
||||
with:
|
||||
path: tooling/cli/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-
|
||||
ubuntu-latest-stable-
|
||||
ubuntu-latest-
|
||||
|
||||
- uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml --all-targets --all-features -- -D warnings
|
||||
name: cli
|
||||
116
.github/workflows/lint-fmt-core.yml
vendored
116
.github/workflows/lint-fmt-core.yml
vendored
@@ -1,116 +0,0 @@
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: core clippy and fmt check
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- next
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/lint-fmt-core.yml'
|
||||
- 'core/**'
|
||||
- 'examples/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
fmt_check:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
|
||||
core_clippy_check:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
clippy:
|
||||
- { args: '', key: 'empty' }
|
||||
- {
|
||||
args: '--features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart',
|
||||
key: 'all'
|
||||
}
|
||||
- { args: '--features custom-protocol', key: 'custom-protocol' }
|
||||
- { args: '--features api-all', key: 'api-all' }
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: install webkit2gtk
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: clippy
|
||||
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
||||
|
||||
- name: Get current date
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-
|
||||
ubuntu-latest-stable-
|
||||
ubuntu-latest-
|
||||
|
||||
- name: Cache core cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_core
|
||||
with:
|
||||
path: target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-
|
||||
ubuntu-latest-stable-
|
||||
ubuntu-latest-
|
||||
|
||||
- uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --manifest-path ./core/tauri/Cargo.toml --all-targets ${{ matrix.clippy.args }} -- -D warnings
|
||||
name: ${{ matrix.clippy.key }}
|
||||
35
.github/workflows/lint-js.yml
vendored
35
.github/workflows/lint-js.yml
vendored
@@ -1,8 +1,8 @@
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: api and cli.js lint check
|
||||
name: lint js
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -16,32 +16,45 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
eslint-check:
|
||||
eslint-cli:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14'
|
||||
node-version: 16
|
||||
cache: yarn
|
||||
cache-dependency-path: tooling/*/yarn.lock
|
||||
- name: install cli.js deps via yarn
|
||||
cache-dependency-path: tooling/cli/node/yarn.lock
|
||||
- name: install deps via yarn
|
||||
working-directory: ./tooling/cli/node/
|
||||
run: yarn
|
||||
# nothing to lint
|
||||
#- name: run cli.js lint
|
||||
#- name: run lint
|
||||
# working-directory: ./tooling/cli/node/
|
||||
# run: yarn lint
|
||||
- name: run cli.js format
|
||||
- name: run format
|
||||
working-directory: ./tooling/cli/node/
|
||||
run: yarn format:check
|
||||
|
||||
- name: install api deps via yarn
|
||||
eslint-api:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
cache: yarn
|
||||
cache-dependency-path: tooling/api/yarn.lock
|
||||
|
||||
- name: install deps via yarn
|
||||
working-directory: ./tooling/api/
|
||||
run: yarn
|
||||
- name: run api lint
|
||||
- name: run ts:check
|
||||
working-directory: ./tooling/api/
|
||||
run: yarn ts:check
|
||||
- name: run lint
|
||||
working-directory: ./tooling/api/
|
||||
run: yarn lint
|
||||
- name: run api format
|
||||
- name: run format
|
||||
working-directory: ./tooling/api/
|
||||
run: yarn format:check
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
name: publish cli.js
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: publish `@tauri-apps/cli`
|
||||
env:
|
||||
DEBUG: napi:*
|
||||
APP_NAME: cli
|
||||
MACOSX_DEPLOYMENT_TARGET: '10.13'
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
releaseId:
|
||||
description: 'ID of the `@tauri-apps/cli` release'
|
||||
required: true
|
||||
repository_dispatch:
|
||||
types: [publish-clijs]
|
||||
types: [publish-js-cli]
|
||||
|
||||
defaults:
|
||||
run:
|
||||
@@ -22,7 +30,7 @@ jobs:
|
||||
target: x86_64-apple-darwin
|
||||
architecture: x64
|
||||
build: |
|
||||
yarn build:release
|
||||
yarn build:release --target=x86_64-apple-darwin
|
||||
strip -x *.node
|
||||
- host: windows-latest
|
||||
build: yarn build:release
|
||||
@@ -32,14 +40,18 @@ jobs:
|
||||
build: yarn build:release --target i686-pc-windows-msvc
|
||||
target: i686-pc-windows-msvc
|
||||
architecture: x64
|
||||
- host: ubuntu-18.04
|
||||
- host: windows-latest
|
||||
architecture: x64
|
||||
target: aarch64-pc-windows-msvc
|
||||
build: yarn build:release --target aarch64-pc-windows-msvc --features native-tls,native-tls-vendored --cargo-flags="--no-default-features"
|
||||
- host: ubuntu-20.04
|
||||
target: x86_64-unknown-linux-gnu
|
||||
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
|
||||
build: |
|
||||
cd tooling/cli/node
|
||||
yarn build:release --target x86_64-unknown-linux-gnu
|
||||
strip *.node
|
||||
- host: ubuntu-18.04
|
||||
- host: ubuntu-20.04
|
||||
target: x86_64-unknown-linux-musl
|
||||
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
|
||||
build: |
|
||||
@@ -51,14 +63,14 @@ jobs:
|
||||
build: |
|
||||
yarn build:release --target=aarch64-apple-darwin
|
||||
strip -x *.node
|
||||
- host: ubuntu-18.04
|
||||
- host: ubuntu-20.04
|
||||
target: aarch64-unknown-linux-gnu
|
||||
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
|
||||
build: |
|
||||
cd tooling/cli/node
|
||||
yarn build:release --target aarch64-unknown-linux-gnu
|
||||
aarch64-unknown-linux-gnu-strip *.node
|
||||
- host: ubuntu-18.04
|
||||
- host: ubuntu-20.04
|
||||
architecture: x64
|
||||
target: armv7-unknown-linux-gnueabihf
|
||||
setup: |
|
||||
@@ -67,7 +79,7 @@ jobs:
|
||||
build: |
|
||||
yarn build:release --target=armv7-unknown-linux-gnueabihf
|
||||
arm-linux-gnueabihf-strip *.node
|
||||
- host: ubuntu-18.04
|
||||
- host: ubuntu-20.04
|
||||
architecture: x64
|
||||
target: aarch64-unknown-linux-musl
|
||||
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
|
||||
@@ -76,10 +88,6 @@ jobs:
|
||||
rustup target add aarch64-unknown-linux-musl
|
||||
yarn build:release --target aarch64-unknown-linux-musl
|
||||
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
|
||||
#- host: windows-latest
|
||||
# architecture: x64
|
||||
# target: aarch64-pc-windows-msvc
|
||||
# build: yarn build:release --target aarch64-pc-windows-msvc
|
||||
name: stable - ${{ matrix.settings.target }} - node@16
|
||||
runs-on: ${{ matrix.settings.host }}
|
||||
steps:
|
||||
@@ -150,7 +158,7 @@ jobs:
|
||||
# usesh: true
|
||||
# mem: 3000
|
||||
# prepare: |
|
||||
# pkg install -y curl node14 python2
|
||||
# pkg install -y curl node16 python2
|
||||
# curl -qL https://www.npmjs.com/install.sh | sh
|
||||
# npm install -g yarn
|
||||
# curl https://sh.rustup.rs -sSf --output rustup.sh
|
||||
@@ -190,14 +198,13 @@ jobs:
|
||||
matrix:
|
||||
settings:
|
||||
- host: macos-latest
|
||||
target: 'x86_64-apple-darwin'
|
||||
target: 'aarch64-apple-darwin'
|
||||
- host: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
node:
|
||||
- '12'
|
||||
- '14'
|
||||
- '16'
|
||||
- '18'
|
||||
- '20'
|
||||
runs-on: ${{ matrix.settings.host }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -228,10 +235,9 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node:
|
||||
- '12'
|
||||
- '14'
|
||||
- '16'
|
||||
- '18'
|
||||
- '20'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -255,7 +261,7 @@ jobs:
|
||||
- name: install system dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
- name: Test bindings
|
||||
run: yarn test
|
||||
test-linux-x64-musl-binding:
|
||||
@@ -266,10 +272,9 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node:
|
||||
- '12'
|
||||
- '14'
|
||||
- '16'
|
||||
- '18'
|
||||
- '20'
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
|
||||
@@ -292,14 +297,10 @@ jobs:
|
||||
- name: List packages
|
||||
run: ls -R .
|
||||
shell: bash
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
apk add openssl-dev musl-dev glib-dev cairo-dev pkgconfig gdk-pixbuf-dev webkit2gtk-dev curl libappindicator-dev patchelf librsvg-dev gtk+3.0-dev
|
||||
- name: Setup and run tests
|
||||
run: |
|
||||
yarn tauri --help
|
||||
ls -la
|
||||
# TODO: fix this test: https://github.com/tauri-apps/tauri/runs/5145729140?check_suite_focus=true#step:9:704
|
||||
#- name: Setup and run tests
|
||||
# run: |
|
||||
# rustup install stable
|
||||
@@ -314,10 +315,9 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node:
|
||||
- '12'
|
||||
- '14'
|
||||
- '16'
|
||||
- '18'
|
||||
- '20'
|
||||
image:
|
||||
- ghcr.io/napi-rs/napi-rs/nodejs:aarch64-16
|
||||
- ghcr.io/napi-rs/napi-rs/nodejs:armhf-16
|
||||
@@ -351,7 +351,7 @@ jobs:
|
||||
set -e
|
||||
export PATH=/usr/local/cargo/bin/:/usr/local/fnm:$PATH
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install --no-install-recommends -y unzip libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install --no-install-recommends -y unzip webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
bash
|
||||
curl https://sh.rustup.rs -sSf | bash -s -- -y
|
||||
curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "/usr/local/fnm" --skip-shell
|
||||
@@ -375,7 +375,7 @@ jobs:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
check-latest: true
|
||||
cache: yarn
|
||||
cache-dependency-path: 'tooling/cli/node/yarn.lock'
|
||||
@@ -396,4 +396,5 @@ jobs:
|
||||
npm publish
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
|
||||
RELEASE_ID: ${{ github.event.client_payload.releaseId || github.event.inputs.releaseId }}
|
||||
99
.github/workflows/publish-cli-rs.yml
vendored
Normal file
99
.github/workflows/publish-cli-rs.yml
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: publish `tauri-cli`
|
||||
env:
|
||||
MACOSX_DEPLOYMENT_TARGET: '10.13'
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types: [publish-clirs]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- os: ubuntu-20.04
|
||||
rust_target: x86_64-unknown-linux-gnu
|
||||
ext: ''
|
||||
args: ''
|
||||
- os: macos-latest
|
||||
rust_target: x86_64-apple-darwin
|
||||
ext: ''
|
||||
args: ''
|
||||
- os: macos-latest
|
||||
rust_target: aarch64-apple-darwin
|
||||
ext: ''
|
||||
args: ''
|
||||
- os: windows-latest
|
||||
rust_target: x86_64-pc-windows-msvc
|
||||
ext: '.exe'
|
||||
args: ''
|
||||
- os: windows-latest
|
||||
rust_target: aarch64-pc-windows-msvc
|
||||
ext: '.exe'
|
||||
args: '--no-default-features --features native-tls,native-tls-vendored'
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: 'Setup Rust'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: ${{ matrix.config.rust_target }}
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
key: ${{ matrix.config.rust_target }}
|
||||
|
||||
- name: install Linux dependencies
|
||||
if: matrix.config.os == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- name: Build CLI
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml --release ${{ matrix.config.args }}
|
||||
|
||||
- name: Upload CLI
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }}
|
||||
path: tooling/cli/target/release/cargo-tauri${{ matrix.config.ext }}
|
||||
if-no-files-found: error
|
||||
|
||||
upload:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Download built CLIs
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: outputs
|
||||
|
||||
- name: Pack archives
|
||||
run: ./.scripts/ci/pack-cli.sh
|
||||
|
||||
- name: Get CLI version
|
||||
run: echo "CLI_VERSION=$(cat tooling/cli/metadata.json | jq '."cli.js".version' -r)" >> $GITHUB_ENV
|
||||
|
||||
- name: Publish release
|
||||
uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa
|
||||
with:
|
||||
tag_name: tauri-cli-v${{ env.CLI_VERSION }}
|
||||
files: |
|
||||
outputs/cargo-tauri-*.zip
|
||||
outputs/cargo-tauri-*.tgz
|
||||
161
.github/workflows/test-bundler.yml
vendored
161
.github/workflows/test-bundler.yml
vendored
@@ -1,161 +0,0 @@
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: test bundler
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- next
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/test-bundler.yml'
|
||||
- 'tooling/bundler/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-tauri-bundler:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
||||
|
||||
- name: Get current date
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache bundler cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_bundler
|
||||
with:
|
||||
path: tooling/bundler/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: test
|
||||
run: |
|
||||
cd ./tooling/bundler
|
||||
cargo test
|
||||
|
||||
fmt_check:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --manifest-path ./tooling/bundler/Cargo.toml --all -- --check
|
||||
|
||||
clippy-check:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: install minimal stable with clippy and rustfmt
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
||||
|
||||
- name: Get current date
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache bundler cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_bundler
|
||||
with:
|
||||
path: tooling/bundler/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: clippy check
|
||||
uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --manifest-path ./tooling/bundler/Cargo.toml --all-targets -- -D warnings
|
||||
name: bundler
|
||||
72
.github/workflows/test-cli-js.yml
vendored
72
.github/workflows/test-cli-js.yml
vendored
@@ -1,23 +1,22 @@
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: test cli.js
|
||||
name: test `@tauri-apps/cli`
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- next
|
||||
- 1.x
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/test-cli-js.yml'
|
||||
# currently cli.js only tests the template
|
||||
# currently` @tauri-apps/cli` only tests the template
|
||||
- 'tooling/cli/templates/app/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
@@ -25,7 +24,7 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test-tauri-js-cli:
|
||||
test:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
strategy:
|
||||
@@ -35,6 +34,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: install Rust stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14
|
||||
node-version: 16
|
||||
cache: yarn
|
||||
cache-dependency-path: tooling/cli/node/yarn.lock
|
||||
|
||||
@@ -51,61 +51,13 @@ jobs:
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
||||
|
||||
- name: Get current date
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache CLI cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_cli
|
||||
with:
|
||||
path: tooling/cli/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache template cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_template
|
||||
with:
|
||||
path: tooling/cli/node/test/jest/fixtures/empty/src-tauri/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/templates/app/**') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/templates/app/**') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
workspaces: |
|
||||
tooling/cli
|
||||
tooling/cli/node/test/jest/fixtures/empty/src-tauri
|
||||
|
||||
- name: test
|
||||
timeout-minutes: 30
|
||||
|
||||
53
.github/workflows/test-cli-rs.yml
vendored
53
.github/workflows/test-cli-rs.yml
vendored
@@ -1,14 +1,14 @@
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: test cli.rs
|
||||
name: test `tauri-cli`
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- next
|
||||
- 1.x
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/test-cli-rs.yml'
|
||||
@@ -16,7 +16,6 @@ on:
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
@@ -24,7 +23,7 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test-tauri-cli:
|
||||
test:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
strategy:
|
||||
@@ -34,6 +33,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
@@ -46,47 +46,12 @@ jobs:
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
||||
|
||||
- name: Get current date
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
workspaces: tooling/cli
|
||||
|
||||
- name: Cache CLI cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_cli
|
||||
with:
|
||||
path: tooling/cli/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: build CLI
|
||||
- name: test CLI
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
command: test
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml
|
||||
|
||||
98
.github/workflows/test-core.yml
vendored
98
.github/workflows/test-core.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -8,17 +8,15 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- next
|
||||
- 1.x
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/test-core.yml'
|
||||
- 'core/**'
|
||||
- 'examples/**'
|
||||
- 'tooling/cli/**'
|
||||
- '!core/tauri/scripts/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
@@ -26,67 +24,63 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test-tauri-core:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
test:
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
platform:
|
||||
- {
|
||||
target: x86_64-pc-windows-msvc,
|
||||
os: windows-latest,
|
||||
toolchain: '1.61.0'
|
||||
}
|
||||
- {
|
||||
target: x86_64-unknown-linux-gnu,
|
||||
os: ubuntu-latest,
|
||||
toolchain: '1.60.0'
|
||||
}
|
||||
- {
|
||||
target: x86_64-apple-darwin,
|
||||
os: macos-13,
|
||||
toolchain: '1.60.0'
|
||||
}
|
||||
features:
|
||||
- {
|
||||
args: --no-default-features,
|
||||
key: no-default
|
||||
}
|
||||
- {
|
||||
args: --features api-all,
|
||||
key: api-all
|
||||
}
|
||||
- {
|
||||
args: --features tracing,compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart,test,
|
||||
key: all
|
||||
}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
toolchain: ${{ matrix.platform.toolchain }}
|
||||
target: ${{ matrix.platform.target }}
|
||||
override: true
|
||||
default: true
|
||||
|
||||
- name: install Linux dependencies
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
if: contains(matrix.platform.target, 'unknown-linux')
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
||||
|
||||
- name: Get current date
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache core cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_core
|
||||
with:
|
||||
path: target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
workspaces: core -> ../target
|
||||
save-if: ${{ matrix.features.key == 'all' }}
|
||||
|
||||
- name: test
|
||||
run: |
|
||||
cargo test
|
||||
cargo test --features api-all
|
||||
cargo test --features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart
|
||||
run: cargo test --target ${{ matrix.platform.target }} ${{ matrix.features.args }}
|
||||
|
||||
93
.github/workflows/test-lint-bundler.yml
vendored
Normal file
93
.github/workflows/test-lint-bundler.yml
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: test and lint bundler
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- 1.x
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/test-bundler.yml'
|
||||
- 'tooling/bundler/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: tooling/bundler
|
||||
|
||||
- name: test
|
||||
run: |
|
||||
cd ./tooling/bundler
|
||||
cargo test
|
||||
|
||||
fmt:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --manifest-path ./tooling/bundler/Cargo.toml --all -- --check
|
||||
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: install minimal stable with clippy and rustfmt
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
default: true
|
||||
components: rustfmt, clippy
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: tooling/bundler
|
||||
|
||||
- name: clippy check
|
||||
uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --manifest-path ./tooling/bundler/Cargo.toml --all-targets -- -D warnings
|
||||
name: bundler
|
||||
@@ -1,24 +1,19 @@
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: updater test artifacts
|
||||
name: test updater artifacts
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- next
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/artifacts-updater.yml'
|
||||
- 'core/tauri/**'
|
||||
- 'tooling/cli/**'
|
||||
- 'tooling/bundler/**'
|
||||
- '.github/workflows/test-updater-artifacts.yml'
|
||||
- 'examples/updater/**'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
@@ -26,7 +21,7 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-artifacs:
|
||||
test:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
strategy:
|
||||
@@ -45,63 +40,15 @@ jobs:
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
||||
|
||||
- name: Get current date
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
workspaces: |
|
||||
core -> ../target
|
||||
tooling/cli
|
||||
|
||||
- name: Cache core cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_core
|
||||
with:
|
||||
path: target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache CLI cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_cli
|
||||
with:
|
||||
path: tooling/cli/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: build and install cli.rs
|
||||
- name: build and install `tauri-cli`
|
||||
run: cargo install --path tooling/cli --force
|
||||
- name: Check whether code signing should be enabled
|
||||
id: enablecodesigning
|
||||
@@ -110,13 +57,14 @@ jobs:
|
||||
run: |
|
||||
echo "Enable code signing: ${{ env.ENABLE_CODE_SIGNING != '' }}"
|
||||
echo "::set-output name=enabled::${{ env.ENABLE_CODE_SIGNING != '' }}"
|
||||
|
||||
# run only on tauri-apps/tauri repo (require secrets)
|
||||
- name: build sample artifacts + code signing (updater)
|
||||
if: steps.enablecodesigning.outputs.enabled == 'true'
|
||||
working-directory: ./examples/updater
|
||||
run: |
|
||||
yarn install
|
||||
cargo tauri build
|
||||
cargo tauri build --verbose
|
||||
env:
|
||||
# Notarization (disabled)
|
||||
# FIXME: enable only on `dev` push maybe? as it take some times...
|
||||
@@ -130,15 +78,17 @@ jobs:
|
||||
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||
# Updater signature is exposed here to make sure it works in PR's
|
||||
TAURI_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg==
|
||||
TAURI_KEY_PASSWORD:
|
||||
# run on PRs and forks
|
||||
- name: build sample artifacts (updater)
|
||||
if: steps.enablecodesigning.outputs.enabled != 'true'
|
||||
working-directory: ./examples/updater
|
||||
run: |
|
||||
yarn install
|
||||
cargo tauri build
|
||||
cargo tauri build --verbose
|
||||
env:
|
||||
TAURI_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg==
|
||||
TAURI_KEY_PASSWORD:
|
||||
# upload assets
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
225
.github/workflows/udeps.yml
vendored
225
.github/workflows/udeps.yml
vendored
@@ -1,20 +1,17 @@
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: Udeps
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/udeps.yml'
|
||||
- 'core/**'
|
||||
- 'tooling/bundler/**'
|
||||
- 'tooling/cli/**'
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- 1.x
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
@@ -22,26 +19,58 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
udeps:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
clippy:
|
||||
- {
|
||||
path: './core/tauri/Cargo.toml',
|
||||
args: '--features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart'
|
||||
}
|
||||
- { path: './core/tauri-build/Cargo.toml', args: '--all-features' }
|
||||
- { path: './core/tauri-codegen/Cargo.toml', args: '--all-features' }
|
||||
- { path: './core/tauri-macros/Cargo.toml', args: '--all-features' }
|
||||
- { path: './core/tauri-runtime/Cargo.toml', args: '--all-features' }
|
||||
- {
|
||||
path: './core/tauri-runtime-wry/Cargo.toml',
|
||||
args: '--features devtools,system-tray,macos-private-api,objc-exception'
|
||||
}
|
||||
- { path: './core/tauri-utils/Cargo.toml', args: '--all-features' }
|
||||
- { path: './tooling/bundler/Cargo.toml', args: '--all-features' }
|
||||
- { path: './tooling/cli/Cargo.toml', args: '--all-features' }
|
||||
outputs:
|
||||
tauri: ${{ steps.filter.outputs.tauri }}
|
||||
build: ${{ steps.filter.outputs.build }}
|
||||
codegen: ${{ steps.filter.outputs.codegen }}
|
||||
macros: ${{ steps.filter.outputs.macros }}
|
||||
runtime: ${{ steps.filter.outputs.runtime }}
|
||||
wry: ${{ steps.filter.outputs.wry }}
|
||||
utils: ${{ steps.filter.outputs.utils }}
|
||||
bundler: ${{ steps.filter.outputs.bundler }}
|
||||
cli: ${{ steps.filter.outputs.cli }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
tauri:
|
||||
- 'core/tauri/**'
|
||||
- '!core/tauri/scripts/**'
|
||||
build:
|
||||
- 'core/tauri-build/**'
|
||||
codegen:
|
||||
- 'core/tauri-codegen/**'
|
||||
macros:
|
||||
- 'core/tauri-macros/**'
|
||||
runtime:
|
||||
- 'core/tauri-runtime/**'
|
||||
wry:
|
||||
- 'core/tauri-runtime-wry/**'
|
||||
utils:
|
||||
- 'core/tauri-utils/**'
|
||||
bundler:
|
||||
- 'tooling/bundler/**'
|
||||
cli:
|
||||
- 'tooling/cli/**'
|
||||
|
||||
setup:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: |
|
||||
needs.changes.outputs.tauri == 'true' ||
|
||||
needs.changes.outputs.build == 'true' ||
|
||||
needs.changes.outputs.codegen == 'true' ||
|
||||
needs.changes.outputs.macros == 'true' ||
|
||||
needs.changes.outputs.runtime == 'true' ||
|
||||
needs.changes.outputs.wry == 'true' ||
|
||||
needs.changes.outputs.utils == 'true' ||
|
||||
needs.changes.outputs.bundler == 'true' ||
|
||||
needs.changes.outputs.cli == 'true'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
@@ -51,86 +80,86 @@ jobs:
|
||||
toolchain: nightly
|
||||
override: true
|
||||
|
||||
- name: install Linux dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
ubuntu-latest-nightly-${{ env.cache-name }}-
|
||||
ubuntu-latest-nightly-
|
||||
ubuntu-latest-
|
||||
|
||||
- name: Cache core cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_core
|
||||
with:
|
||||
path: target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
|
||||
ubuntu-latest-nightly-${{ env.cache-name }}-
|
||||
ubuntu-latest-nightly-
|
||||
ubuntu-latest-
|
||||
|
||||
- name: Cache bundler cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_bundler
|
||||
with:
|
||||
path: tooling/bundler/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}
|
||||
ubuntu-latest-nightly-${{ env.cache-name }}-
|
||||
ubuntu-latest-nightly-
|
||||
ubuntu-latest-
|
||||
|
||||
- name: Cache CLI cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_cli
|
||||
with:
|
||||
path: tooling/cli/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
|
||||
ubuntu-latest-nightly-${{ env.cache-name }}-
|
||||
ubuntu-latest-nightly-
|
||||
ubuntu-latest-
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: install
|
||||
args: cargo-udeps --locked --force
|
||||
|
||||
- name: Upload udeps
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: udeps
|
||||
path: '~/.cargo/bin/cargo-udeps'
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Create udeps matrix
|
||||
id: create-matrix
|
||||
env:
|
||||
TAURI: ${{ needs.changes.outputs.tauri == 'true' }}
|
||||
BUILD: ${{ needs.changes.outputs.build == 'true' }}
|
||||
CODEGEN: ${{ needs.changes.outputs.codegen == 'true' }}
|
||||
MACROS: ${{ needs.changes.outputs.macros == 'true' }}
|
||||
RUNTIME: ${{ needs.changes.outputs.runtime == 'true' }}
|
||||
WRY: ${{ needs.changes.outputs.wry == 'true' }}
|
||||
UTILS: ${{ needs.changes.outputs.utils == 'true' }}
|
||||
BUNDLER: ${{ needs.changes.outputs.bundler == 'true' }}
|
||||
CLI: ${{ needs.changes.outputs.cli == 'true' }}
|
||||
run: |
|
||||
crates=()
|
||||
if [ "${TAURI}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri\""; fi
|
||||
if [ "${BUILD}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-build\""; fi
|
||||
if [ "${CODEGEN}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-codegen\""; fi
|
||||
if [ "${MACROS}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-macros\""; fi
|
||||
if [ "${RUNTIME}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-runtime\""; fi
|
||||
if [ "${WRY}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-runtime-wry\""; fi
|
||||
if [ "${UTILS}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-utils\""; fi
|
||||
if [ "${BUNDLER}" == "true" ]; then crates[${#crates[@]}]="\"./tooling/bundler\""; fi
|
||||
if [ "${CLI}" == "true" ]; then crates[${#crates[@]}]="\"./tooling/cli\""; fi
|
||||
echo ::set-output name=matrix::[$crates]
|
||||
outputs:
|
||||
matrix: ${{ steps.create-matrix.outputs.matrix }}
|
||||
|
||||
udeps:
|
||||
runs-on: ubuntu-latest
|
||||
needs: setup
|
||||
strategy:
|
||||
matrix:
|
||||
path: ${{ fromJson(needs.setup.outputs.matrix) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
override: true
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: |
|
||||
core -> ../target
|
||||
tooling/cli
|
||||
tooling/bundler
|
||||
|
||||
- name: Download udeps
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: udeps
|
||||
path: '~/.cargo/bin'
|
||||
|
||||
- run: chmod +x $HOME/.cargo/bin/cargo-udeps
|
||||
|
||||
- name: Install required packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: udeps
|
||||
args: --manifest-path ${{ matrix.clippy.path }} --all-targets ${{ matrix.clippy.args }}
|
||||
args: --manifest-path ${{ matrix.path }}/Cargo.toml --all-targets --all-features
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -73,7 +73,7 @@ TODO.md
|
||||
target
|
||||
|
||||
# lock for libs
|
||||
/Cargo.lock
|
||||
#/Cargo.lock Committed to prevent msrv checks from failing
|
||||
/tooling/bench/tests/Cargo.lock
|
||||
/yarn.lock
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -11,12 +11,12 @@ if [ -z "$(git diff --name-only tooling/api)" ]; then
|
||||
else
|
||||
cd tooling/api
|
||||
yarn format
|
||||
yarn lint-fix
|
||||
yarn lint:fix
|
||||
cd ../..
|
||||
fi
|
||||
|
||||
if [ -z "$(git diff --name-only tooling/cli/node)" ]; then
|
||||
echo "skipping cli.js - no changes detected"
|
||||
echo "skipping \`@tauri-apps/cli\` - no changes detected"
|
||||
else
|
||||
cd tooling/cli/node
|
||||
yarn format
|
||||
|
||||
12
.prettierignore
Normal file
12
.prettierignore
Normal file
@@ -0,0 +1,12 @@
|
||||
/.github
|
||||
/.husky
|
||||
/.vscode
|
||||
/audits
|
||||
node_modules
|
||||
target
|
||||
dist
|
||||
/core/tauri/scripts
|
||||
/tooling/cli/templates
|
||||
/tooling/cli/node
|
||||
/tooling/cli/schema.json
|
||||
/core/tauri-config-schema/schema.json
|
||||
5
.prettierrc
Normal file
5
.prettierrc
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"semi": false,
|
||||
"trailingComma": "none"
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
module.exports = {
|
||||
singleQuote: true,
|
||||
semi: false,
|
||||
trailingComma: 'none'
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env pwsh
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env sh
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
79
.scripts/ci/check-change-tags.js
Normal file
79
.scripts/ci/check-change-tags.js
Normal file
@@ -0,0 +1,79 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const ignorePackages = [
|
||||
'tauri-macros',
|
||||
'tauri-codegen',
|
||||
'tauri-runtime',
|
||||
'tauri-runtime-wry',
|
||||
'tauri-driver'
|
||||
]
|
||||
|
||||
const covectorConfig = JSON.parse(
|
||||
fs.readFileSync('.changes/config.json', 'utf8')
|
||||
)
|
||||
const tags = Object.keys(covectorConfig.changeTags)
|
||||
|
||||
const missingTagsFiles = {}
|
||||
const unknownTagsFiles = {}
|
||||
|
||||
function checkChangeFiles(changeFiles) {
|
||||
for (const file of changeFiles) {
|
||||
const content = fs.readFileSync(file, 'utf8')
|
||||
const [frontMatter] = /^---[\s\S.]*---\n/i.exec(content)
|
||||
const packages = frontMatter
|
||||
.split('\n')
|
||||
.filter((l) => !(l === '---' || !l))
|
||||
.map((l) => l.replace(/('|")/g, '').split(':'))
|
||||
|
||||
for (const [package, _, tag] of packages) {
|
||||
if (!tag) {
|
||||
if (ignorePackages.includes(package)) continue
|
||||
|
||||
if (!missingTagsFiles[file]) missingTagsFiles[file] = []
|
||||
missingTagsFiles[file].push(package)
|
||||
} else if (!tags.includes(tag)) {
|
||||
if (!unknownTagsFiles[file]) unknownTagsFiles[file] = []
|
||||
unknownTagsFiles[file].push({ package, tag })
|
||||
}
|
||||
}
|
||||
}
|
||||
const missingTagsEntries = Object.entries(missingTagsFiles)
|
||||
const unknownTagsEntries = Object.entries(unknownTagsFiles)
|
||||
if (missingTagsEntries.length > 0 || unknownTagsEntries.length > 0) {
|
||||
for (const [file, packages] of missingTagsEntries) {
|
||||
for (const package of packages) {
|
||||
console.error(
|
||||
`Package \`${package}\` is missing a change tag in ${file} `
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
for (const [file, packages] of unknownTagsEntries) {
|
||||
for (const { package, tag } of packages) {
|
||||
console.error(
|
||||
`Package \`${package}\` has an uknown change tag ${tag} in ${file} `
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
const [_bin, _script, ...files] = process.argv
|
||||
|
||||
if (files.length > 0) {
|
||||
checkChangeFiles(files.filter((f) => f.toLowerCase() !== 'readme.md'))
|
||||
} else {
|
||||
const changeFiles = fs
|
||||
.readdirSync('.changes')
|
||||
.filter((f) => f.endsWith('.md') && f.toLowerCase() !== 'readme.md')
|
||||
.map((p) => path.join('.changes', p))
|
||||
checkChangeFiles(changeFiles)
|
||||
}
|
||||
117
.scripts/ci/check-license-header.js
Normal file
117
.scripts/ci/check-license-header.js
Normal file
@@ -0,0 +1,117 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const readline = require('readline')
|
||||
|
||||
const header = `Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
SPDX-License-Identifier: MIT`
|
||||
const bundlerLicense =
|
||||
'// Copyright 2016-2019 Cargo-Bundle developers <https://github.com/burtonageo/cargo-bundle>'
|
||||
|
||||
const extensions = ['.rs', '.js', '.ts', '.yml']
|
||||
const ignore = [
|
||||
'target',
|
||||
'templates',
|
||||
'node_modules',
|
||||
'gen',
|
||||
'dist',
|
||||
'bundle.js',
|
||||
'bundle.global.js'
|
||||
]
|
||||
|
||||
async function checkFile(file) {
|
||||
if (extensions.some((e) => file.endsWith(e))) {
|
||||
const fileStream = fs.createReadStream(file)
|
||||
const rl = readline.createInterface({
|
||||
input: fileStream,
|
||||
crlfDelay: Infinity
|
||||
})
|
||||
|
||||
let contents = ``
|
||||
let i = 0
|
||||
for await (let line of rl) {
|
||||
// ignore empty lines, allow shebang and bundler license
|
||||
if (
|
||||
line.length === 0 ||
|
||||
line.startsWith('#!') ||
|
||||
line === bundlerLicense
|
||||
) {
|
||||
continue
|
||||
}
|
||||
|
||||
// strip comment marker
|
||||
if (line.startsWith('// ')) {
|
||||
line = line.substring(3)
|
||||
} else if (line.startsWith('# ')) {
|
||||
line = line.substring(2)
|
||||
}
|
||||
|
||||
contents += line
|
||||
if (++i === 3) {
|
||||
break
|
||||
}
|
||||
contents += '\n'
|
||||
}
|
||||
if (contents !== header) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
async function check(src) {
|
||||
const missingHeader = []
|
||||
|
||||
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
||||
const p = path.join(src, entry.name)
|
||||
|
||||
if (entry.isSymbolicLink() || ignore.includes(entry.name)) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (entry.isDirectory()) {
|
||||
const missing = await check(p)
|
||||
missingHeader.push(...missing)
|
||||
} else {
|
||||
const isMissing = await checkFile(p)
|
||||
if (isMissing) {
|
||||
missingHeader.push(p)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return missingHeader
|
||||
}
|
||||
|
||||
const [_bin, _script, ...files] = process.argv
|
||||
|
||||
if (files.length > 0) {
|
||||
async function run() {
|
||||
const missing = []
|
||||
for (const f of files) {
|
||||
const isMissing = await checkFile(f)
|
||||
if (isMissing) {
|
||||
missing.push(f)
|
||||
}
|
||||
}
|
||||
if (missing.length > 0) {
|
||||
console.log(missing.join('\n'))
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
run()
|
||||
} else {
|
||||
check('.').then((missing) => {
|
||||
if (missing.length > 0) {
|
||||
console.log(missing.join('\n'))
|
||||
process.exit(1)
|
||||
}
|
||||
})
|
||||
}
|
||||
13
.scripts/ci/has-diff.sh
Executable file
13
.scripts/ci/has-diff.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if git diff --quiet --ignore-submodules HEAD
|
||||
then
|
||||
echo "working directory is clean"
|
||||
else
|
||||
echo "found diff"
|
||||
exit 1
|
||||
fi
|
||||
23
.scripts/ci/pack-cli.sh
Executable file
23
.scripts/ci/pack-cli.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
for o in outputs/*; do
|
||||
pushd "$o"
|
||||
|
||||
chmod +x cargo-tauri*
|
||||
cp ../../tooling/cli/LICENSE* ../../tooling/cli/README.md .
|
||||
|
||||
target=$(basename "$o" | cut -d. -f1)
|
||||
if grep -qE '(apple|windows)' <<< "$target"; then
|
||||
zip "../${target}.zip" *
|
||||
else
|
||||
tar cv * | gzip -9 > "../${target}.tgz"
|
||||
fi
|
||||
|
||||
popd
|
||||
done
|
||||
57
.scripts/covector/package-latest-version.js
Normal file
57
.scripts/covector/package-latest-version.js
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/*
|
||||
This script is solely intended to be run as part of the `covector publish` step to
|
||||
check the latest version of a crate, considering the current minor version.
|
||||
*/
|
||||
|
||||
const https = require('https')
|
||||
|
||||
const kind = process.argv[2]
|
||||
const packageName = process.argv[3]
|
||||
const packageVersion = process.argv[4]
|
||||
const target = packageVersion.substring(0, packageVersion.lastIndexOf('.'))
|
||||
|
||||
let url = null
|
||||
switch (kind) {
|
||||
case 'cargo':
|
||||
url = `https://crates.io/api/v1/crates/${packageName}`
|
||||
break
|
||||
case 'npm':
|
||||
url = `https://registry.npmjs.org/${packageName}`
|
||||
break
|
||||
default:
|
||||
throw new Error('unexpected kind ' + kind)
|
||||
}
|
||||
|
||||
const options = {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Accept: 'application/json',
|
||||
'User-Agent': 'tauri (https://github.com/tauri-apps/tauri)'
|
||||
}
|
||||
}
|
||||
|
||||
https.get(url, options, (response) => {
|
||||
let chunks = []
|
||||
response.on('data', function (chunk) {
|
||||
chunks.push(chunk)
|
||||
})
|
||||
|
||||
response.on('end', function () {
|
||||
const data = JSON.parse(chunks.join(''))
|
||||
if (kind === 'cargo') {
|
||||
const versions = data.versions.filter((v) => v.num.startsWith(target))
|
||||
console.log(versions.length ? versions[0].num : '0.0.0')
|
||||
} else if (kind === 'npm') {
|
||||
const versions = Object.keys(data.versions).filter((v) =>
|
||||
v.startsWith(target)
|
||||
)
|
||||
console.log(versions[versions.length - 1] || '0.0.0')
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -1,43 +1,49 @@
|
||||
#!/usr/bin/env node
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/*
|
||||
This script is solely intended to be run as part of the `covector version` step to
|
||||
keep the `../tooling/cli/metadata.json` up to date with other version bumps. Long term
|
||||
we should look to find a more "rusty way" to import / "pin" a version value in our cli.rs
|
||||
we should look to find a more "rusty way" to import / "pin" a version value in our tauri-cli
|
||||
rust binaries.
|
||||
*/
|
||||
|
||||
const {
|
||||
readFileSync,
|
||||
writeFileSync
|
||||
} = require('fs')
|
||||
const { readFileSync, writeFileSync } = require('fs')
|
||||
|
||||
const packageNickname = process.argv[2]
|
||||
const filePath = packageNickname === 'cli.js' ? `../../../tooling/cli/metadata.json` : `../../tooling/cli/metadata.json`
|
||||
const filePath =
|
||||
packageNickname === '@tauri-apps/cli'
|
||||
? `../../../tooling/cli/metadata.json`
|
||||
: `../../tooling/cli/metadata.json`
|
||||
const bump = process.argv[3]
|
||||
let index = null
|
||||
|
||||
switch (bump) {
|
||||
case 'major':
|
||||
index = 0;
|
||||
break;
|
||||
index = 0
|
||||
break
|
||||
case 'minor':
|
||||
index = 1;
|
||||
break;
|
||||
index = 1
|
||||
break
|
||||
case 'patch':
|
||||
index = 2;
|
||||
break;
|
||||
index = 2
|
||||
break
|
||||
default:
|
||||
throw new Error('unexpected bump ' + bump)
|
||||
}
|
||||
|
||||
const inc = (version) => {
|
||||
const v = version.split('.')
|
||||
const n = v[index]
|
||||
v[index] = String(Number(n) + 1)
|
||||
for (let i = 0; i < v.length; i++) {
|
||||
if (i === index) {
|
||||
v[i] = String(Number(v[i]) + 1)
|
||||
} else if (i > index) {
|
||||
v[i] = 0
|
||||
}
|
||||
}
|
||||
return v.join('.')
|
||||
}
|
||||
|
||||
@@ -46,9 +52,9 @@ const metadata = JSON.parse(readFileSync(filePath, 'utf-8'))
|
||||
|
||||
// set field version
|
||||
let version
|
||||
if (packageNickname === 'cli.js') {
|
||||
version = inc(metadata[packageNickname].version)
|
||||
metadata[packageNickname].version = version
|
||||
if (packageNickname === '@tauri-apps/cli') {
|
||||
version = inc(metadata['cli.js'].version)
|
||||
metadata['cli.js'].version = version
|
||||
} else {
|
||||
version = inc(metadata[packageNickname])
|
||||
metadata[packageNickname] = version
|
||||
|
||||
7
.scripts/docker/build.sh
Executable file
7
.scripts/docker/build.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
docker build -t aarch64-unknown-linux-gnu:latest --file .docker/cross/aarch64.Dockerfile .docker/cross
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env pwsh
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#!/usr/bin/env sh
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
declare -a examples=("api" "sidecar" "updater" "resources" "tauri-dynamic-lib")
|
||||
declare -a examples=("api" "sidecar" "updater" "resources" "tauri-dynamic-lib" "workspace")
|
||||
declare -a tooling=("bench" "cli" "webdriver")
|
||||
|
||||
for example in "${examples[@]}"
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
: Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
: SPDX-License-Identifier: Apache-2.0
|
||||
: SPDX-License-Identifier: MIT
|
||||
|
||||
@ECHO OFF
|
||||
|
||||
REM Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
REM Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
REM SPDX-License-Identifier: Apache-2.0
|
||||
REM SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -59,4 +63,4 @@ IF EXIST %SourceFiles% DEL %SourceFiles%
|
||||
IF EXIST %Config% DEL %Config%
|
||||
IF EXIST %Source7ZFile% DEL %Source7ZFile%
|
||||
|
||||
ENDLOCAL
|
||||
ENDLOCAL
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# The Tauri Architecture
|
||||
https://tauri.studio
|
||||
https://tauri.app
|
||||
|
||||
https://github.com/tauri-apps/tauri
|
||||
|
||||
## Introduction
|
||||
@@ -38,16 +39,16 @@ This is common code that is reused in many places and offers useful utilities li
|
||||
|
||||
|
||||
### Tauri Tooling
|
||||
#### [api](https://github.com/tauri-apps/tauri/tree/dev/tooling/api) [TS -> JS]
|
||||
A typescript library that creates `cjs` and `esm` Javascript endpoints for you to import into your Frontend framework so that the Webview can call and listen to backend activity. We also ship the pure typescript, because for some frameworks this is more optimal. It uses the message passing of webviews to their hosts.
|
||||
#### [@tauri-apps/api](https://github.com/tauri-apps/tauri/tree/dev/tooling/api) [TS -> JS]
|
||||
A TypeScript library that creates `cjs` and `esm` JavaScript endpoints for you to import into your Frontend framework so that the Webview can call and listen to backend activity. We also ship the pure TypeScript, because for some frameworks this is more optimal. It uses the message passing of webviews to their hosts.
|
||||
|
||||
#### [bundler](https://github.com/tauri-apps/tauri/tree/dev/tooling/bundler) [RUST / SHELL]
|
||||
The bundler is a library that builds a Tauri App for the platform triple it detects / is told. At the moment it currently supports macOS, Windows and Linux - but in the near future will support mobile platforms as well. May be used outside of Tauri projects.
|
||||
|
||||
#### [cli.js](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli/node) [JS]
|
||||
It is a wrapper around [cli.rs](https://github.com/tauri-apps/tauri/blob/dev/tooling/cli) using [napi-rs](https://github.com/napi-rs/napi-rs) to produce NPM packages for each platform.
|
||||
#### [@tauri-apps/cli](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli/node) [JS]
|
||||
It is a wrapper around [tauri-cli](https://github.com/tauri-apps/tauri/blob/dev/tooling/cli) using [napi-rs](https://github.com/napi-rs/napi-rs) to produce NPM packages for each platform.
|
||||
|
||||
#### [cli.rs](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli) [RUST]
|
||||
#### [tauri-cli](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli) [RUST]
|
||||
This rust executable provides the full interface to all of the required activities for which the CLI is required. It will run on macOS, Windows, and Linux.
|
||||
|
||||
#### [create-tauri-app](https://github.com/tauri-apps/create-tauri-app) [JS]
|
||||
@@ -66,9 +67,6 @@ Tauri uses WRY as the abstract layer responsible to determine which webview is u
|
||||
|
||||
# Additional tooling
|
||||
|
||||
## [binary-releases](https://github.com/tauri-apps/binary-releases)
|
||||
This is the delivery mechanism for tauri prebuilt binaries: currently the cli.rs (used by cli.js) and rustup binaries (used by the deps install command of cli.js). These artifacts are automatically created on release.
|
||||
|
||||
## [tauri-action](https://github.com/tauri-apps/tauri-action)
|
||||
This is a github workflow that builds tauri binaries for all platforms. It is not the fastest out there, but it gets the job done and is highly configurable. Even allowing you to create a (very basic) tauri app even if tauri is not setup.
|
||||
|
||||
@@ -81,7 +79,7 @@ This plugin allows you to very quickly install tauri in a vue-cli project.
|
||||
## [tauri-vscode](https://github.com/tauri-apps/tauri-vscode)
|
||||
This project enhances the VS Code interface with several nice-to-have features.
|
||||
|
||||
# Tauri Plugins [documentation](https://tauri.studio/en/docs/guides/plugin)
|
||||
# Tauri Plugins [documentation](https://tauri.app/v1/guides/features/plugin/)
|
||||
|
||||
Generally speaking, plugins are authored by third parties (even though there may be official, supported plugins). A plugin generally does 3 things:
|
||||
1. It provides rust code to do "something".
|
||||
@@ -118,7 +116,7 @@ This will do several things:
|
||||
1. start the JS Framework devserver
|
||||
2. begin the long process of downloading and compiling the rust libraries
|
||||
3. open an application window with devtools enabled
|
||||
4. keep a long-lived console alive
|
||||
4. keep a long-lived console alive
|
||||
|
||||
If you change your HTML/CSS/TS/JS, your framework devserver should give you its best shot at instant hot module reloading and you will see the changes instantly.
|
||||
|
||||
@@ -148,7 +146,7 @@ After some time, the process will end and you can see the results in the `./src-
|
||||
End users will be provided with binaries in ways that are appropriate for their systems. Whether macOS, Linux, or Windows, direct download or store installations - they will be able to follow procedures for installing and removing that they are used to.
|
||||
|
||||
## What does the Updating flow look like?
|
||||
When a new version is ready, the developer publishes the new signed artifacts to a server (that they have configured within `tauri.conf.json`).
|
||||
When a new version is ready, the developer publishes the new signed artifacts to a server (that they have configured within `tauri.conf.json`).
|
||||
|
||||
The application can poll this server to see if there is a new release. When there is a new release, the user is prompted to update. The application update is downloaded, verified (checksum & signature), updated, closed, and restarted.
|
||||
|
||||
|
||||
5737
Cargo.lock
generated
Normal file
5737
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
11
Cargo.toml
11
Cargo.toml
@@ -1,4 +1,5 @@
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = [
|
||||
# core
|
||||
"core/tauri",
|
||||
@@ -8,10 +9,11 @@ members = [
|
||||
"core/tauri-utils",
|
||||
"core/tauri-build",
|
||||
"core/tauri-codegen",
|
||||
|
||||
"core/tauri-config-schema",
|
||||
|
||||
# integration tests
|
||||
"core/tests/restart",
|
||||
"core/tests/app-updater"
|
||||
"core/tests/app-updater",
|
||||
]
|
||||
|
||||
exclude = [
|
||||
@@ -19,12 +21,13 @@ exclude = [
|
||||
"examples/api/src-tauri",
|
||||
"examples/updater/src-tauri",
|
||||
"examples/resources/src-tauri",
|
||||
"examples/sidecar/src-tauri"
|
||||
"examples/sidecar/src-tauri",
|
||||
"examples/web/core",
|
||||
"examples/workspace",
|
||||
]
|
||||
|
||||
# default to small, optimized workspace release binaries
|
||||
[profile.release]
|
||||
strip = true
|
||||
panic = "abort"
|
||||
codegen-units = 1
|
||||
lto = true
|
||||
|
||||
@@ -6,7 +6,7 @@ PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy
|
||||
PackageHomePage: https://tauri.app
|
||||
PackageLicenseDeclared: Apache-2.0
|
||||
PackageLicenseDeclared: MIT
|
||||
PackageCopyrightText: 2019-2021, The Tauri Programme in the Commons Conservancy
|
||||
PackageCopyrightText: 2019-2022, The Tauri Programme in the Commons Conservancy
|
||||
PackageSummary: <text>Tauri is a rust project that enables developers to make secure
|
||||
and small desktop applications using a web frontend.
|
||||
</text>
|
||||
@@ -17,4 +17,4 @@ Created: 2019-05-20T09:00:00Z
|
||||
PackageDownloadLocation: git://github.com/tauri-apps/tauri
|
||||
PackageDownloadLocation: git+https://github.com/tauri-apps/tauri.git
|
||||
PackageDownloadLocation: git+ssh://github.com/tauri-apps/tauri.git
|
||||
Creator: Person: Daniel Thompson-Yvetot
|
||||
Creator: Person: Daniel Thompson-Yvetot
|
||||
|
||||
94
README.md
94
README.md
@@ -1,15 +1,13 @@
|
||||
<img src=".github/splash.png" alt="Tauri" />
|
||||
|
||||
[](https://github.com/tauri-apps/tauri/tree/dev)
|
||||
[](https://github.com/tauri-apps/tauri/tree/dev)
|
||||
[](https://opencollective.com/tauri)
|
||||
[](https://github.com/tauri-apps/tauri/actions?query=workflow%3A%22test+library%22)
|
||||
[](https://github.com/tauri-apps/tauri/actions/workflows/test-core.yml)
|
||||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri?ref=badge_shield)
|
||||
|
||||
[](https://discord.gg/SpmNs4S)
|
||||
[](https://dev.to/tauri)
|
||||
[](https://tauri.app)
|
||||
[](https://discord.gg/SpmNs4S)
|
||||
[](https://tauri.app)
|
||||
[](https://good-labs.github.io/greater-good-affirmation)
|
||||
[](https://opencollective.com/tauri)
|
||||
[](https://opencollective.com/tauri)
|
||||
|
||||
## Current Releases
|
||||
|
||||
@@ -27,12 +25,12 @@
|
||||
|
||||
### Tooling
|
||||
|
||||
| Component | Description | Version | Lin | Win | Mac |
|
||||
| --------------------------------------------------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------ | --- | --- | --- |
|
||||
| [**bundler**](https://github.com/tauri-apps/tauri/tree/dev/tooling/bundler) | manufacture the final binaries | [](https://crates.io/crates/tauri-bundler) | ✅ | ✅ | ✅ |
|
||||
| [**api.js**](https://github.com/tauri-apps/tauri/tree/dev/tooling/api) | JS API for interaction with Rust backend | [](https://www.npmjs.com/package/@tauri-apps/api) | ✅ | ✅ | ✅ |
|
||||
| [**cli.rs**](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli) | create, develop and build apps | [](https://crates.io/crates/tauri-cli) | ✅ | ✅ | ✅ |
|
||||
| [**cli.js**](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli/node) | Node.js CLI wrapper for cli.rs | [](https://www.npmjs.com/package/@tauri-apps/cli) | ✅ | ✅ | ✅ |
|
||||
| Component | Description | Version | Lin | Win | Mac |
|
||||
| ------------------------------------------------------------------------------------ | ---------------------------------------- | ------------------------------------------------------------------------------------------------------ | --- | --- | --- |
|
||||
| [**bundler**](https://github.com/tauri-apps/tauri/tree/dev/tooling/bundler) | manufacture the final binaries | [](https://crates.io/crates/tauri-bundler) | ✅ | ✅ | ✅ |
|
||||
| [**tauri-cli**](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli) | create, develop and build apps | [](https://crates.io/crates/tauri-cli) | ✅ | ✅ | ✅ |
|
||||
| [**@tauri-apps/cli**](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli/node) | Node.js CLI wrapper for `tauri-cli` | [](https://www.npmjs.com/package/@tauri-apps/cli) | ✅ | ✅ | ✅ |
|
||||
| [**@tauri-apps/api**](https://github.com/tauri-apps/tauri/tree/dev/tooling/api) | JS API for interaction with Rust backend | [](https://www.npmjs.com/package/@tauri-apps/api) | ✅ | ✅ | ✅ |
|
||||
|
||||
### Utilities and Plugins
|
||||
|
||||
@@ -51,7 +49,7 @@ To learn more about the details of how all of these pieces fit together, please
|
||||
|
||||
## Get Started
|
||||
|
||||
If you are interested in making a tauri app, please visit the [documentation website](https://tauri.studio). This README is directed towards those who are interested in contributing to the core library. But if you just want a quick overview about where `tauri` is at in its development, here's a quick burndown:
|
||||
If you are interested in making a tauri app, please visit the [documentation website](https://tauri.app). This README is directed towards those who are interested in contributing to the core library. But if you just want a quick overview about where `tauri` is at in its development, here's a quick burndown:
|
||||
|
||||
### Platforms
|
||||
|
||||
@@ -77,25 +75,21 @@ For **running** Tauri apps we support the below configurations (these are automa
|
||||
- `webkit2gtk`, `gtk3`, `libayatana-appindicator`<sup>1</sup>
|
||||
- Fedora (latest 2 versions) with the following packages installed:
|
||||
- `webkit2gtk3`, `gtk3`, `libappindicator-gtk3`<sup>1</sup>
|
||||
- Void with the following packages installed:
|
||||
- `webkit2gtk`, `gtk+3`, `libappindicator`<sup>1</sup>
|
||||
|
||||
<sup>1</sup> `appindicator` is only required if system trays are used
|
||||
|
||||
### App Bundles
|
||||
### Features
|
||||
|
||||
- [x] App Icons
|
||||
- [x] Build on macOS (.app, .dmg)
|
||||
- [x] Build on Linux (.deb, AppImage)
|
||||
- [x] Build on Windows (.exe, .msi)
|
||||
- [x] Copy Buffer
|
||||
- [x] Device Notifications (toast)
|
||||
- [x] Desktop Bundler (.app, .dmg, .deb, AppImage, .msi)
|
||||
- [x] Self Updater
|
||||
- [x] App Signing
|
||||
- [x] Frameless Mode
|
||||
- [x] Transparent Mode
|
||||
- [x] Multiwindow Mode
|
||||
- [x] Tray
|
||||
- [ ] deeplink RPC (in progress)
|
||||
- [ ] One-Time commands (coming soon)
|
||||
- [x] Native Notifications (toast)
|
||||
- [x] App Tray
|
||||
- [x] Core Plugin System
|
||||
- [x] Scoped Filesystem
|
||||
- [x] Sidecar
|
||||
|
||||
### Security Features
|
||||
|
||||
@@ -108,39 +102,9 @@ For **running** Tauri apps we support the below configurations (these are automa
|
||||
|
||||
### Utilities
|
||||
|
||||
- [x] Rust-based CLI
|
||||
- [x] GH Action for creating binaries for all platforms
|
||||
- [x] VS Code Extension
|
||||
- [x] Tauri Core Plugins
|
||||
- [x] Update core dependencies automatically from the command line
|
||||
- [x] Rust-based CLI
|
||||
|
||||
### Comparison between Tauri and Electron
|
||||
|
||||
| Detail | Tauri | Electron |
|
||||
| -------------------------- | ------ | -------------------- |
|
||||
| Installer Size Linux | 3.1 MB | 52.1 MB |
|
||||
| Memory Consumption Linux | 180 MB | 462 MB |
|
||||
| Launch Time Linux | 0.39s | 0.80s |
|
||||
| Interface Service Provider | WRY | Chromium |
|
||||
| Backend Binding | Rust | Node.js (ECMAScript) |
|
||||
| Underlying Engine | Rust | V8 (C/C++) |
|
||||
| FLOSS | Yes | No |
|
||||
| Multithreading | Yes | Yes |
|
||||
| Bytecode Delivery | Yes | No |
|
||||
| Multiple Windows | Yes | Yes |
|
||||
| Auto Updater | Yes | Yes<sup>1</sup> |
|
||||
| Custom App Icon | Yes | Yes |
|
||||
| Windows Binary | Yes | Yes |
|
||||
| macOS Binary | Yes | Yes |
|
||||
| Linux Binary | Yes | Yes |
|
||||
| iOS Binary | Soon | No |
|
||||
| Android Binary | Soon | No |
|
||||
| Desktop Tray | Yes | Yes |
|
||||
| Sidecar Binaries | Yes | No |
|
||||
|
||||
#### Notes
|
||||
|
||||
1. Electron has no native auto updater on Linux, but is offered by electron-packager
|
||||
|
||||
## Development
|
||||
|
||||
@@ -155,18 +119,6 @@ Tauri is a system composed of a number of moving pieces:
|
||||
- Netlify-hosted documentation website
|
||||
- DigitalOcean Meilisearch instance
|
||||
|
||||
### Major Runtimes
|
||||
|
||||
- Node.js for running the CLI (deno and pure rust are on the roadmap)
|
||||
- Cargo for testing, running the dev service, building binaries and as the runtime harness for the webview
|
||||
|
||||
### Major Languages
|
||||
|
||||
- Rust for the CLI
|
||||
- ECMAScript bindings to the Rust API, written in typescript
|
||||
- Rust for bindings, rust side of the API, harnesses
|
||||
- Rust plugins to Tauri backend
|
||||
|
||||
### Operating systems
|
||||
|
||||
Tauri core can be developed on Mac, Linux and Windows, but you are encouraged to use the latest possible operating systems and build tools for your OS.
|
||||
@@ -188,7 +140,7 @@ Documentation in a polyglot system is a tricky proposition. To this end, we pref
|
||||
Test all the things! We have a number of test suites, but are always looking to improve our coverage:
|
||||
|
||||
- Rust (`cargo test`) => sourced via inline `#[cfg(test)]` declarations
|
||||
- TS (`jest`) => via spec files
|
||||
- Typescript (`jest`) => via spec files
|
||||
- Smoke Tests (run on merges to latest)
|
||||
- eslint, clippy
|
||||
|
||||
|
||||
11
SECURITY.md
11
SECURITY.md
@@ -13,7 +13,16 @@ If you have found a potential security threat, vulnerability or exploit in Tauri
|
||||
or one of its upstream dependencies, please DON’T create a pull-request, DON’T
|
||||
file an issue on GitHub, DON’T mention it on Discord and DON’T create a forum thread.
|
||||
|
||||
We will be adding contact information to this page very soon.
|
||||
Please submit your report via the GitHub Private Vulnerability Disclosure functionality.
|
||||
|
||||
Find out more about the reporting process [here](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability).
|
||||
|
||||
Our team will triage your report and keep you informed about the progress.
|
||||
We may ask questions or request further guidance on reproduction of the vulnerability in the comments of the advisory, which will be publicized.
|
||||
|
||||
Additionally, we may ask you to independently verify our patch, which will be available in the private advisory branch. Please do not publish your vulnerability during the process or before coordinated public disclosure from our side. We try to adhere to common standards of publication within 90-Days of disclosure.
|
||||
|
||||
Depending on your decision to accept or deny credit for the vulnerability, you will be publicly attributed to the vulnerability and may be mentioned in our announcements.
|
||||
|
||||
At the current time we do not have the financial ability to reward bounties,
|
||||
but in extreme cases will at our discretion consider a reward.
|
||||
|
||||
@@ -1,5 +1,116 @@
|
||||
# Changelog
|
||||
|
||||
## \[1.5.3]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `tauri-utils@1.6.0`
|
||||
- Upgraded to `tauri-codegen@1.4.4`
|
||||
|
||||
## \[1.5.2]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `tauri-utils@1.5.4`
|
||||
- Upgraded to `tauri-codegen@1.4.3`
|
||||
|
||||
## \[1.5.1]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `tauri-utils@1.5.2`
|
||||
- Upgraded to `tauri-codegen@1.4.2`
|
||||
|
||||
## \[1.5.0]
|
||||
|
||||
### What's Changed
|
||||
|
||||
- [`d1e09da0`](https://www.github.com/tauri-apps/tauri/commit/d1e09da084b849b9e384fc27ed250dd17e72c7a3)([#7918](https://www.github.com/tauri-apps/tauri/pull/7918)) Bump to 1.5 due to tauri-utils dependency bump.
|
||||
|
||||
## \[1.4.1]
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- [`5ecb46b3`](https://www.github.com/tauri-apps/tauri/commit/5ecb46b3410afd1b5c82494c1e0a91d5a358c41a)([#7773](https://www.github.com/tauri-apps/tauri/pull/7773)) Automatically set rpath on macOS if frameworks are bundled and copy frameworks to `src-tauri/target/Frameworks` for usage in development.
|
||||
- [`290e366a`](https://www.github.com/tauri-apps/tauri/commit/290e366ae98e9a52b1b43bfd3e285150427ebffa)([#7419](https://www.github.com/tauri-apps/tauri/pull/7419)) Correctly copy the WebView2 runtime in development when `webviewInstallMode` is used instead of `webviewFixedRuntimePath`.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `tauri-utils@1.5.0`
|
||||
- Upgraded to `tauri-codegen@1.4.1`
|
||||
|
||||
## \[1.4.0]
|
||||
|
||||
### Enhancements
|
||||
|
||||
- [`52474e47`](https://www.github.com/tauri-apps/tauri/commit/52474e479d695865299d8c8d868fb98b99731020)([#7141](https://www.github.com/tauri-apps/tauri/pull/7141)) Enhance Cargo features check.
|
||||
- [`af937290`](https://www.github.com/tauri-apps/tauri/commit/af93729031565a69d1fde6cf16bea3b9b6e43a65)([#6676](https://www.github.com/tauri-apps/tauri/pull/6676)) On Windows, set `LegalCopyright` and `FileDescription` file properties on the executable from `tauri.bundle.copyright` and `tauri.bundle.shortDescription`,
|
||||
- [`d2710e9d`](https://www.github.com/tauri-apps/tauri/commit/d2710e9d2e8fd93975ef6494512370faa8cb3b7e)([#6944](https://www.github.com/tauri-apps/tauri/pull/6944)) Unpin `time`, `ignore`, and `winnow` crate versions. Developers now have to pin crates if needed themselves. A list of crates that need pinning to adhere to Tauri's MSRV will be visible in Tauri's GitHub workflow: https://github.com/tauri-apps/tauri/blob/dev/.github/workflows/test-core.yml#L85.
|
||||
|
||||
## \[1.3.0]
|
||||
|
||||
- Bump minimum supported Rust version to 1.60.
|
||||
- [5fdc616d](https://www.github.com/tauri-apps/tauri/commit/5fdc616df9bea633810dcb814ac615911d77222c) feat: Use the zbus-backed of notify-rust ([#6332](https://www.github.com/tauri-apps/tauri/pull/6332)) on 2023-03-31
|
||||
- Add initial support for building `nsis` bundles on non-Windows platforms.
|
||||
- [60e6f6c3](https://www.github.com/tauri-apps/tauri/commit/60e6f6c3f1605f3064b5bb177992530ff788ccf0) feat(bundler): Add support for creating NSIS bundles on unix hosts ([#5788](https://www.github.com/tauri-apps/tauri/pull/5788)) on 2023-01-19
|
||||
- Add `WindowsAttributes::app_manifest` to specify the application manifest on Windows.
|
||||
- [bca09f7f](https://www.github.com/tauri-apps/tauri/commit/bca09f7f5ff1c9c5a4b51da043bdd5da668a179b) feat(tauri-build): add option to specify Windows manifest, closes [#5584](https://www.github.com/tauri-apps/tauri/pull/5584) ([#5730](https://www.github.com/tauri-apps/tauri/pull/5730)) on 2022-12-14
|
||||
- Added support for Cargo's workspace inheritance for package information. The cli now also detects inherited `tauri` and `tauri-build` dependencies and disables manifest rewrites accordingly.
|
||||
- [cd8c074a](https://www.github.com/tauri-apps/tauri/commit/cd8c074ae6592303d3f6844a4fb6d262eae913b2) feat(cli): add support for Cargo's workspace inheritance for the package version, closes [#5070](https://www.github.com/tauri-apps/tauri/pull/5070) ([#5775](https://www.github.com/tauri-apps/tauri/pull/5775)) on 2022-12-14
|
||||
- [d20a7288](https://www.github.com/tauri-apps/tauri/commit/d20a728892eee1858ab525ab6216cd721f473ab5) feat: Further improve workspace inheritance, closes [#6122](https://www.github.com/tauri-apps/tauri/pull/6122), [#5070](https://www.github.com/tauri-apps/tauri/pull/5070) ([#6144](https://www.github.com/tauri-apps/tauri/pull/6144)) on 2023-01-26
|
||||
- Pin `winnow` crate to 0.4.1 to keep the 1.60 MSRV.
|
||||
|
||||
## \[1.2.1]
|
||||
|
||||
- Fix `allowlist > app > show/hide` always disabled when `allowlist > app > all: false`.
|
||||
- Bumped due to a bump in tauri-utils.
|
||||
- [bb251087](https://www.github.com/tauri-apps/tauri/commit/bb2510876d0bdff736d36bf3a465cdbe4ad2b90c) fix(core): extend allowlist with `app`'s allowlist, closes [#5650](https://www.github.com/tauri-apps/tauri/pull/5650) ([#5652](https://www.github.com/tauri-apps/tauri/pull/5652)) on 2022-11-18
|
||||
|
||||
## \[1.2.0]
|
||||
|
||||
- - [7d9aa398](https://www.github.com/tauri-apps/tauri/commit/7d9aa3987efce2d697179ffc33646d086c68030c) feat: bump MSRV to 1.59 ([#5296](https://www.github.com/tauri-apps/tauri/pull/5296)) on 2022-09-28
|
||||
|
||||
## \[1.1.1]
|
||||
|
||||
- Add missing allowlist config for `set_cursor_grab`, `set_cursor_visible`, `set_cursor_icon` and `set_cursor_position` APIs.
|
||||
- Bumped due to a bump in tauri-utils.
|
||||
- [c764408d](https://www.github.com/tauri-apps/tauri/commit/c764408da7fae123edd41115bda42fa75a4731d2) fix: Add missing allowlist config for cursor apis, closes [#5207](https://www.github.com/tauri-apps/tauri/pull/5207) ([#5211](https://www.github.com/tauri-apps/tauri/pull/5211)) on 2022-09-16
|
||||
|
||||
## \[1.1.0]
|
||||
|
||||
- Rerun codegen if assets or icons change.
|
||||
- [ff8fd761](https://www.github.com/tauri-apps/tauri/commit/ff8fd7619ae894b70f149b192d8635d842827141) fix(tauri-build): rerun if assets or icons change ([#4910](https://www.github.com/tauri-apps/tauri/pull/4910)) on 2022-08-10
|
||||
- Create the `desktop` and `mobile` cfg aliases.
|
||||
- [c04d0340](https://www.github.com/tauri-apps/tauri/commit/c04d0340e2f163483f3556c7aabe35322ee71e6a) feat(core): prepare build for mobile targets ([#4830](https://www.github.com/tauri-apps/tauri/pull/4830)) on 2022-08-02
|
||||
- Added support to configuration files in TOML format (Tauri.toml file).
|
||||
- [ae83d008](https://www.github.com/tauri-apps/tauri/commit/ae83d008f9e1b89bfc8dddaca42aa5c1fbc36f6d) feat: add support to TOML config file `Tauri.toml`, closes [#4806](https://www.github.com/tauri-apps/tauri/pull/4806) ([#4813](https://www.github.com/tauri-apps/tauri/pull/4813)) on 2022-08-02
|
||||
- Enhance the dialog style on Windows via the manifest dependency `Microsoft.Windows.Common-Controls v6.0.0.0`.
|
||||
- [5c5c42ed](https://www.github.com/tauri-apps/tauri/commit/5c5c42edb64adf4250af6891d7d226fda7d4d783) feat(build): use modern dialog styles on Windows, closes [#4709](https://www.github.com/tauri-apps/tauri/pull/4709) ([#4840](https://www.github.com/tauri-apps/tauri/pull/4840)) on 2022-08-02
|
||||
- Fix root of codegen output when using the `CodegenContext` API.
|
||||
- [ed581950](https://www.github.com/tauri-apps/tauri/commit/ed581950ea6fd0afee47aa73fb63083d2483429f) fix(tauri-build): use `::tauri` as root for the CodegenContext ([#4894](https://www.github.com/tauri-apps/tauri/pull/4894)) on 2022-08-08
|
||||
- Return an error if a sidecar is configured with the same file name as the application.
|
||||
- [5cc1fd0f](https://www.github.com/tauri-apps/tauri/commit/5cc1fd0f7b01b257a461d4e867ddc8cd5072ff15) feat(tauri-build): validate sidecar name, closes [#4780](https://www.github.com/tauri-apps/tauri/pull/4780) closes [#4823](https://www.github.com/tauri-apps/tauri/pull/4823) ([#4814](https://www.github.com/tauri-apps/tauri/pull/4814)) on 2022-08-02
|
||||
- Only rewrite temporary icon files when the content change, avoid needless rebuilds.
|
||||
- [f957cbb5](https://www.github.com/tauri-apps/tauri/commit/f957cbb56ccbd8d1c047a978b4579946252a6fd2) fix(codegen): write output file when contents change ([#4889](https://www.github.com/tauri-apps/tauri/pull/4889)) on 2022-08-09
|
||||
|
||||
## \[1.0.4]
|
||||
|
||||
- Reduce the amount of allocations when converting cases.
|
||||
- [bc370e32](https://www.github.com/tauri-apps/tauri/commit/bc370e326810446e15b1f50fb962b980114ba16b) feat: reduce the amount of `heck`-related allocations ([#4634](https://www.github.com/tauri-apps/tauri/pull/4634)) on 2022-07-11
|
||||
|
||||
## \[1.0.3]
|
||||
|
||||
- Improve configuration deserialization error messages.
|
||||
- [9170c920](https://www.github.com/tauri-apps/tauri/commit/9170c9207044fa561535f624916dfdbaa41ff79d) feat(core): improve config deserialization error messages ([#4607](https://www.github.com/tauri-apps/tauri/pull/4607)) on 2022-07-06
|
||||
- The `TAURI_CONFIG` environment variable now represents the configuration to be merged instead of the entire JSON.
|
||||
- [fa028ebf](https://www.github.com/tauri-apps/tauri/commit/fa028ebf3c8ca7b43a70d283a01dbea86217594f) refactor: do not pass entire config from CLI to core, send patch instead ([#4598](https://www.github.com/tauri-apps/tauri/pull/4598)) on 2022-07-06
|
||||
|
||||
## \[1.0.2]
|
||||
|
||||
- Expose `platform::windows_version` function.
|
||||
- Bumped due to a bump in tauri-utils.
|
||||
- [bf764e83](https://www.github.com/tauri-apps/tauri/commit/bf764e83e01e7443e6cc54572001e1c98c357465) feat(utils): expose `windows_version` function ([#4534](https://www.github.com/tauri-apps/tauri/pull/4534)) on 2022-06-30
|
||||
|
||||
## \[1.0.1]
|
||||
|
||||
- Changed the `BundleConfig::targets` to a `BundleTarget` enum to enhance generated documentation.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-build"
|
||||
version = "1.0.1"
|
||||
version = "1.5.3"
|
||||
authors = [ "Tauri Programme within The Commons Conservancy" ]
|
||||
categories = [ "gui", "web-programming" ]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
@@ -8,8 +8,8 @@ homepage = "https://tauri.app"
|
||||
repository = "https://github.com/tauri-apps/tauri/tree/dev/core/tauri-build"
|
||||
description = "build time code to pair with https://crates.io/crates/tauri"
|
||||
edition = "2021"
|
||||
rust-version = "1.57"
|
||||
exclude = [ ".license_template", "CHANGELOG.md", "/target" ]
|
||||
rust-version = "1.60"
|
||||
exclude = [ "CHANGELOG.md", "/target" ]
|
||||
readme = "README.md"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
@@ -19,17 +19,20 @@ rustdoc-args = [ "--cfg", "doc_cfg" ]
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
quote = { version = "1", optional = true }
|
||||
tauri-codegen = { version = "1.0.1", path = "../tauri-codegen", optional = true }
|
||||
tauri-utils = { version = "1.0.1", path = "../tauri-utils", features = [ "build", "resources" ] }
|
||||
cargo_toml = "0.11"
|
||||
tauri-codegen = { version = "1.4.4", path = "../tauri-codegen", optional = true }
|
||||
tauri-utils = { version = "1.6.0", path = "../tauri-utils", features = [ "build", "resources" ] }
|
||||
cargo_toml = "0.15"
|
||||
serde = "1"
|
||||
serde_json = "1"
|
||||
heck = "0.4"
|
||||
|
||||
[target."cfg(windows)".dependencies]
|
||||
winres = "0.1"
|
||||
heck = "0.5"
|
||||
json-patch = "1.2"
|
||||
tauri-winres = "0.1"
|
||||
semver = "1"
|
||||
walkdir = "2"
|
||||
dirs-next = "2"
|
||||
|
||||
[features]
|
||||
codegen = [ "tauri-codegen", "quote" ]
|
||||
isolation = [ "tauri-codegen/isolation", "tauri-utils/isolation" ]
|
||||
config-json5 = [ "tauri-utils/config-json5" ]
|
||||
config-toml = [ "tauri-utils/config-toml" ]
|
||||
|
||||
@@ -2,15 +2,14 @@
|
||||
|
||||
<img align="right" src="https://github.com/tauri-apps/tauri/raw/dev/app-icon.png" height="128" width="128">
|
||||
|
||||
[](https://github.com/tauri-apps/tauri)
|
||||
[](https://discord.gg/SpmNs4S)
|
||||
[](https://dev.to/tauri)
|
||||
|
||||

|
||||
[](https://tauri.app)
|
||||
|
||||
[](https://github.com/tauri-apps/tauri/tree/dev)
|
||||
[](https://opencollective.com/tauri)
|
||||
[](https://github.com/tauri-apps/tauri/actions/workflows/test-core.yml)
|
||||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri?ref=badge_shield)
|
||||
[](https://discord.gg/SpmNs4S)
|
||||
[](https://tauri.app)
|
||||
[](https://good-labs.github.io/greater-good-affirmation)
|
||||
[](https://opencollective.com/tauri)
|
||||
[](https://opencollective.com/tauri)
|
||||
|
||||
| Component | Version |
|
||||
| ----------- | ---------------------------------------------------------------------------------------------------------- |
|
||||
|
||||
211
core/tauri-build/src/allowlist.rs
Normal file
211
core/tauri-build/src/allowlist.rs
Normal file
@@ -0,0 +1,211 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use cargo_toml::{Dependency, Manifest};
|
||||
use tauri_utils::config::{Config, PatternKind, TauriConfig};
|
||||
|
||||
#[derive(Debug, Default, PartialEq, Eq)]
|
||||
struct Diff {
|
||||
remove: Vec<String>,
|
||||
add: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
enum DependencyKind {
|
||||
Build,
|
||||
Normal,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct AllowlistedDependency {
|
||||
name: String,
|
||||
alias: Option<String>,
|
||||
kind: DependencyKind,
|
||||
all_cli_managed_features: Option<Vec<&'static str>>,
|
||||
expected_features: Vec<String>,
|
||||
}
|
||||
|
||||
pub fn check(config: &Config, manifest: &mut Manifest) -> Result<()> {
|
||||
let dependencies = vec![
|
||||
AllowlistedDependency {
|
||||
name: "tauri-build".into(),
|
||||
alias: None,
|
||||
kind: DependencyKind::Build,
|
||||
all_cli_managed_features: Some(vec!["isolation"]),
|
||||
expected_features: match config.tauri.pattern {
|
||||
PatternKind::Isolation { .. } => vec!["isolation".to_string()],
|
||||
_ => vec![],
|
||||
},
|
||||
},
|
||||
AllowlistedDependency {
|
||||
name: "tauri".into(),
|
||||
alias: None,
|
||||
kind: DependencyKind::Normal,
|
||||
all_cli_managed_features: Some(TauriConfig::all_features()),
|
||||
expected_features: config
|
||||
.tauri
|
||||
.features()
|
||||
.into_iter()
|
||||
.map(|f| f.to_string())
|
||||
.collect::<Vec<String>>(),
|
||||
},
|
||||
];
|
||||
|
||||
for metadata in dependencies {
|
||||
let mut name = metadata.name.clone();
|
||||
let mut deps = find_dependency(manifest, &metadata.name, metadata.kind);
|
||||
if deps.is_empty() {
|
||||
if let Some(alias) = &metadata.alias {
|
||||
deps = find_dependency(manifest, alias, metadata.kind);
|
||||
name = alias.clone();
|
||||
}
|
||||
}
|
||||
|
||||
for dep in deps {
|
||||
if let Err(error) = check_features(dep, &metadata) {
|
||||
return Err(anyhow!("
|
||||
The `{}` dependency features on the `Cargo.toml` file does not match the allowlist defined under `tauri.conf.json`.
|
||||
Please run `tauri dev` or `tauri build` or {}.
|
||||
", name, error));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn find_dependency(manifest: &mut Manifest, name: &str, kind: DependencyKind) -> Vec<Dependency> {
|
||||
let dep = match kind {
|
||||
DependencyKind::Build => manifest.build_dependencies.remove(name),
|
||||
DependencyKind::Normal => manifest.dependencies.remove(name),
|
||||
};
|
||||
|
||||
if let Some(dep) = dep {
|
||||
vec![dep]
|
||||
} else {
|
||||
let mut deps = Vec::new();
|
||||
for target in manifest.target.values_mut() {
|
||||
if let Some(dep) = match kind {
|
||||
DependencyKind::Build => target.build_dependencies.remove(name),
|
||||
DependencyKind::Normal => target.dependencies.remove(name),
|
||||
} {
|
||||
deps.push(dep);
|
||||
}
|
||||
}
|
||||
deps
|
||||
}
|
||||
}
|
||||
|
||||
fn features_diff(current: &[String], expected: &[String]) -> Diff {
|
||||
let mut remove = Vec::new();
|
||||
let mut add = Vec::new();
|
||||
for feature in current {
|
||||
if !expected.contains(feature) {
|
||||
remove.push(feature.clone());
|
||||
}
|
||||
}
|
||||
|
||||
for feature in expected {
|
||||
if !current.contains(feature) {
|
||||
add.push(feature.clone());
|
||||
}
|
||||
}
|
||||
|
||||
Diff { remove, add }
|
||||
}
|
||||
|
||||
fn check_features(dependency: Dependency, metadata: &AllowlistedDependency) -> Result<(), String> {
|
||||
let features = match dependency {
|
||||
Dependency::Simple(_) => Vec::new(),
|
||||
Dependency::Detailed(dep) => dep.features,
|
||||
Dependency::Inherited(dep) => dep.features,
|
||||
};
|
||||
|
||||
let diff = if let Some(all_cli_managed_features) = &metadata.all_cli_managed_features {
|
||||
features_diff(
|
||||
&features
|
||||
.into_iter()
|
||||
.filter(|f| all_cli_managed_features.contains(&f.as_str()))
|
||||
.collect::<Vec<String>>(),
|
||||
&metadata.expected_features,
|
||||
)
|
||||
} else {
|
||||
features_diff(
|
||||
&features
|
||||
.into_iter()
|
||||
.filter(|f| f.starts_with("allow-"))
|
||||
.collect::<Vec<String>>(),
|
||||
&metadata.expected_features,
|
||||
)
|
||||
};
|
||||
|
||||
let mut error_message = String::new();
|
||||
if !diff.remove.is_empty() {
|
||||
error_message.push_str("remove the `");
|
||||
error_message.push_str(&diff.remove.join(", "));
|
||||
error_message.push_str(if diff.remove.len() == 1 {
|
||||
"` feature"
|
||||
} else {
|
||||
"` features"
|
||||
});
|
||||
if !diff.add.is_empty() {
|
||||
error_message.push_str(" and ");
|
||||
}
|
||||
}
|
||||
if !diff.add.is_empty() {
|
||||
error_message.push_str("add the `");
|
||||
error_message.push_str(&diff.add.join(", "));
|
||||
error_message.push_str(if diff.add.len() == 1 {
|
||||
"` feature"
|
||||
} else {
|
||||
"` features"
|
||||
});
|
||||
}
|
||||
|
||||
if error_message.is_empty() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(error_message)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::Diff;
|
||||
|
||||
#[test]
|
||||
fn array_diff() {
|
||||
for (current, expected, result) in [
|
||||
(vec![], vec![], Default::default()),
|
||||
(
|
||||
vec!["a".into()],
|
||||
vec![],
|
||||
Diff {
|
||||
remove: vec!["a".into()],
|
||||
add: vec![],
|
||||
},
|
||||
),
|
||||
(vec!["a".into()], vec!["a".into()], Default::default()),
|
||||
(
|
||||
vec!["a".into(), "b".into()],
|
||||
vec!["a".into()],
|
||||
Diff {
|
||||
remove: vec!["b".into()],
|
||||
add: vec![],
|
||||
},
|
||||
),
|
||||
(
|
||||
vec!["a".into(), "b".into()],
|
||||
vec!["a".into(), "c".into()],
|
||||
Diff {
|
||||
remove: vec!["b".into()],
|
||||
add: vec!["c".into()],
|
||||
},
|
||||
),
|
||||
] {
|
||||
assert_eq!(super::features_diff(¤t, &expected), result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -10,6 +10,7 @@ use std::{
|
||||
path::PathBuf,
|
||||
};
|
||||
use tauri_codegen::{context_codegen, ContextData};
|
||||
use tauri_utils::config::{AppUrl, WindowUrl};
|
||||
|
||||
// TODO docs
|
||||
/// A builder for generating a Tauri application context during compile time.
|
||||
@@ -52,13 +53,13 @@ impl CodegenContext {
|
||||
///
|
||||
/// **Note:** This path should be relative to the `OUT_DIR`.
|
||||
///
|
||||
/// Don't set this if you are using [`tauri::include_codegen_context!`] as that helper macro
|
||||
/// Don't set this if you are using [`tauri::tauri_build_context!`] as that helper macro
|
||||
/// expects the default value. This option can be useful if you are not using the helper and
|
||||
/// instead using [`std::include!`] on the generated code yourself.
|
||||
///
|
||||
/// Defaults to `tauri-build-context.rs`.
|
||||
///
|
||||
/// [`tauri::include_codegen_context!`]: https://docs.rs/tauri/0.12/tauri/macro.include_codegen_context.html
|
||||
/// [`tauri::tauri_build_context!`]: https://docs.rs/tauri/latest/tauri/macro.tauri_build_context.html
|
||||
#[must_use]
|
||||
pub fn out_file(mut self, filename: PathBuf) -> Self {
|
||||
self.out_file = filename;
|
||||
@@ -85,20 +86,60 @@ impl CodegenContext {
|
||||
pub fn build(self) -> PathBuf {
|
||||
match self.try_build() {
|
||||
Ok(out) => out,
|
||||
Err(error) => panic!("Error found during Codegen::build: {}", error),
|
||||
Err(error) => panic!("Error found during Codegen::build: {error}"),
|
||||
}
|
||||
}
|
||||
|
||||
/// Non-panicking [`Self::build`]
|
||||
pub fn try_build(self) -> Result<PathBuf> {
|
||||
let (config, config_parent) = tauri_codegen::get_config(&self.config_path)?;
|
||||
|
||||
// rerun if changed
|
||||
let app_url = if self.dev {
|
||||
&config.build.dev_path
|
||||
} else {
|
||||
&config.build.dist_dir
|
||||
};
|
||||
match app_url {
|
||||
AppUrl::Url(WindowUrl::App(p)) => {
|
||||
println!("cargo:rerun-if-changed={}", config_parent.join(p).display());
|
||||
}
|
||||
AppUrl::Files(files) => {
|
||||
for path in files {
|
||||
println!(
|
||||
"cargo:rerun-if-changed={}",
|
||||
config_parent.join(path).display()
|
||||
);
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
for icon in &config.tauri.bundle.icon {
|
||||
println!(
|
||||
"cargo:rerun-if-changed={}",
|
||||
config_parent.join(icon).display()
|
||||
);
|
||||
}
|
||||
if let Some(tray_icon) = config.tauri.system_tray.as_ref().map(|t| &t.icon_path) {
|
||||
println!(
|
||||
"cargo:rerun-if-changed={}",
|
||||
config_parent.join(tray_icon).display()
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
println!(
|
||||
"cargo:rerun-if-changed={}",
|
||||
config_parent.join("Info.plist").display()
|
||||
);
|
||||
|
||||
let code = context_codegen(ContextData {
|
||||
dev: self.dev,
|
||||
config,
|
||||
config_parent,
|
||||
// it's very hard to have a build script for unit tests, so assume this is always called from
|
||||
// outside the tauri crate, making the ::tauri root valid.
|
||||
root: quote::quote!(::tauri::Context),
|
||||
root: quote::quote!(::tauri),
|
||||
})?;
|
||||
|
||||
// get the full output file path
|
||||
@@ -120,7 +161,7 @@ impl CodegenContext {
|
||||
)
|
||||
})?;
|
||||
|
||||
writeln!(file, "{}", code).with_context(|| {
|
||||
writeln!(file, "{code}").with_context(|| {
|
||||
format!(
|
||||
"Unable to write tokenstream to out file during tauri-build {}",
|
||||
out.display()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,18 +1,24 @@
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#![cfg_attr(doc_cfg, feature(doc_cfg))]
|
||||
|
||||
use anyhow::Context;
|
||||
pub use anyhow::Result;
|
||||
use heck::ToSnakeCase;
|
||||
use tauri_utils::resources::{external_binaries, resource_relpath, ResourcePaths};
|
||||
use cargo_toml::Manifest;
|
||||
use heck::AsShoutySnakeCase;
|
||||
|
||||
use tauri_utils::{
|
||||
config::{BundleResources, Config, WebviewInstallMode},
|
||||
resources::{external_binaries, ResourcePaths},
|
||||
};
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
mod allowlist;
|
||||
#[cfg(feature = "codegen")]
|
||||
mod codegen;
|
||||
#[cfg(windows)]
|
||||
mod static_vcruntime;
|
||||
|
||||
#[cfg(feature = "codegen")]
|
||||
@@ -34,17 +40,29 @@ fn copy_file(from: impl AsRef<Path>, to: impl AsRef<Path>) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn copy_binaries<'a>(binaries: ResourcePaths<'a>, target_triple: &str, path: &Path) -> Result<()> {
|
||||
fn copy_binaries(
|
||||
binaries: ResourcePaths,
|
||||
target_triple: &str,
|
||||
path: &Path,
|
||||
package_name: Option<&String>,
|
||||
) -> Result<()> {
|
||||
for src in binaries {
|
||||
let src = src?;
|
||||
println!("cargo:rerun-if-changed={}", src.display());
|
||||
let dest = path.join(
|
||||
src
|
||||
.file_name()
|
||||
.expect("failed to extract external binary filename")
|
||||
.to_string_lossy()
|
||||
.replace(&format!("-{}", target_triple), ""),
|
||||
);
|
||||
let file_name = src
|
||||
.file_name()
|
||||
.expect("failed to extract external binary filename")
|
||||
.to_string_lossy()
|
||||
.replace(&format!("-{target_triple}"), "");
|
||||
|
||||
if package_name.map_or(false, |n| n == &file_name) {
|
||||
return Err(anyhow::anyhow!(
|
||||
"Cannot define a sidecar with the same name as the Cargo package name `{}`. Please change the sidecar name in the filesystem and the Tauri configuration.",
|
||||
file_name
|
||||
));
|
||||
}
|
||||
|
||||
let dest = path.join(file_name);
|
||||
if dest.exists() {
|
||||
std::fs::remove_file(&dest).unwrap();
|
||||
}
|
||||
@@ -55,11 +73,117 @@ fn copy_binaries<'a>(binaries: ResourcePaths<'a>, target_triple: &str, path: &Pa
|
||||
|
||||
/// Copies resources to a path.
|
||||
fn copy_resources(resources: ResourcePaths<'_>, path: &Path) -> Result<()> {
|
||||
for src in resources {
|
||||
let src = src?;
|
||||
println!("cargo:rerun-if-changed={}", src.display());
|
||||
let dest = path.join(resource_relpath(&src));
|
||||
copy_file(&src, &dest)?;
|
||||
for resource in resources.iter() {
|
||||
let resource = resource?;
|
||||
println!("cargo:rerun-if-changed={}", resource.path().display());
|
||||
copy_file(resource.path(), path.join(resource.target()))?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
fn symlink_dir(src: &Path, dst: &Path) -> std::io::Result<()> {
|
||||
std::os::unix::fs::symlink(src, dst)
|
||||
}
|
||||
|
||||
/// Makes a symbolic link to a directory.
|
||||
#[cfg(windows)]
|
||||
fn symlink_dir(src: &Path, dst: &Path) -> std::io::Result<()> {
|
||||
std::os::windows::fs::symlink_dir(src, dst)
|
||||
}
|
||||
|
||||
/// Makes a symbolic link to a file.
|
||||
#[cfg(unix)]
|
||||
fn symlink_file(src: &Path, dst: &Path) -> std::io::Result<()> {
|
||||
std::os::unix::fs::symlink(src, dst)
|
||||
}
|
||||
|
||||
/// Makes a symbolic link to a file.
|
||||
#[cfg(windows)]
|
||||
fn symlink_file(src: &Path, dst: &Path) -> std::io::Result<()> {
|
||||
std::os::windows::fs::symlink_file(src, dst)
|
||||
}
|
||||
|
||||
fn copy_dir(from: &Path, to: &Path) -> Result<()> {
|
||||
for entry in walkdir::WalkDir::new(from) {
|
||||
let entry = entry?;
|
||||
debug_assert!(entry.path().starts_with(from));
|
||||
let rel_path = entry.path().strip_prefix(from)?;
|
||||
let dest_path = to.join(rel_path);
|
||||
if entry.file_type().is_symlink() {
|
||||
let target = std::fs::read_link(entry.path())?;
|
||||
if entry.path().is_dir() {
|
||||
symlink_dir(&target, &dest_path)?;
|
||||
} else {
|
||||
symlink_file(&target, &dest_path)?;
|
||||
}
|
||||
} else if entry.file_type().is_dir() {
|
||||
std::fs::create_dir(dest_path)?;
|
||||
} else {
|
||||
std::fs::copy(entry.path(), dest_path)?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// Copies the framework under `{src_dir}/{framework}.framework` to `{dest_dir}/{framework}.framework`.
|
||||
fn copy_framework_from(src_dir: &Path, framework: &str, dest_dir: &Path) -> Result<bool> {
|
||||
let src_name = format!("{}.framework", framework);
|
||||
let src_path = src_dir.join(&src_name);
|
||||
if src_path.exists() {
|
||||
copy_dir(&src_path, &dest_dir.join(&src_name))?;
|
||||
Ok(true)
|
||||
} else {
|
||||
Ok(false)
|
||||
}
|
||||
}
|
||||
|
||||
// Copies the macOS application bundle frameworks to the target folder
|
||||
fn copy_frameworks(dest_dir: &Path, frameworks: &[String]) -> Result<()> {
|
||||
std::fs::create_dir_all(dest_dir).with_context(|| {
|
||||
format!(
|
||||
"Failed to create frameworks output directory at {:?}",
|
||||
dest_dir
|
||||
)
|
||||
})?;
|
||||
for framework in frameworks.iter() {
|
||||
if framework.ends_with(".framework") {
|
||||
let src_path = PathBuf::from(framework);
|
||||
let src_name = src_path
|
||||
.file_name()
|
||||
.expect("Couldn't get framework filename");
|
||||
let dest_path = dest_dir.join(src_name);
|
||||
copy_dir(&src_path, &dest_path)?;
|
||||
continue;
|
||||
} else if framework.ends_with(".dylib") {
|
||||
let src_path = PathBuf::from(framework);
|
||||
if !src_path.exists() {
|
||||
return Err(anyhow::anyhow!("Library not found: {}", framework));
|
||||
}
|
||||
let src_name = src_path.file_name().expect("Couldn't get library filename");
|
||||
let dest_path = dest_dir.join(src_name);
|
||||
copy_file(&src_path, &dest_path)?;
|
||||
continue;
|
||||
} else if framework.contains('/') {
|
||||
return Err(anyhow::anyhow!(
|
||||
"Framework path should have .framework extension: {}",
|
||||
framework
|
||||
));
|
||||
}
|
||||
if let Some(home_dir) = dirs_next::home_dir() {
|
||||
if copy_framework_from(&home_dir.join("Library/Frameworks/"), framework, dest_dir)? {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if copy_framework_from(&PathBuf::from("/Library/Frameworks/"), framework, dest_dir)?
|
||||
|| copy_framework_from(
|
||||
&PathBuf::from("/Network/Library/Frameworks/"),
|
||||
framework,
|
||||
dest_dir,
|
||||
)?
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -68,19 +192,16 @@ fn copy_resources(resources: ResourcePaths<'_>, path: &Path) -> Result<()> {
|
||||
fn has_feature(feature: &str) -> bool {
|
||||
// when a feature is enabled, Cargo sets the `CARGO_FEATURE_<name` env var to 1
|
||||
// https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts
|
||||
std::env::var(format!(
|
||||
"CARGO_FEATURE_{}",
|
||||
feature.to_snake_case().to_uppercase()
|
||||
))
|
||||
.map(|x| x == "1")
|
||||
.unwrap_or(false)
|
||||
std::env::var(format!("CARGO_FEATURE_{}", AsShoutySnakeCase(feature)))
|
||||
.map(|x| x == "1")
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
// creates a cfg alias if `has_feature` is true.
|
||||
// `alias` must be a snake case string.
|
||||
fn cfg_alias(alias: &str, has_feature: bool) {
|
||||
if has_feature {
|
||||
println!("cargo:rustc-cfg={}", alias);
|
||||
println!("cargo:rustc-cfg={alias}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,10 +217,37 @@ pub struct WindowsAttributes {
|
||||
///
|
||||
/// For MSVC the Windows SDK has to be installed. It comes with the resource compiler rc.exe.
|
||||
/// This should be set to the root directory of the Windows SDK, e.g., "C:\Program Files (x86)\Windows Kits\10" or,
|
||||
/// if multiple 10 versions are installed, set it directly to the corret bin directory "C:\Program Files (x86)\Windows Kits\10\bin\10.0.14393.0\x64"
|
||||
/// if multiple 10 versions are installed, set it directly to the correct bin directory "C:\Program Files (x86)\Windows Kits\10\bin\10.0.14393.0\x64"
|
||||
///
|
||||
/// If it is left unset, it will look up a path in the registry, i.e. HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots
|
||||
sdk_dir: Option<PathBuf>,
|
||||
/// A string containing an [application manifest] to be included with the application on Windows.
|
||||
///
|
||||
/// Defaults to:
|
||||
/// ```text
|
||||
#[doc = include_str!("window-app-manifest.xml")]
|
||||
/// ```
|
||||
///
|
||||
/// ## Warning
|
||||
///
|
||||
/// if you are using tauri's dialog APIs, you need to specify a dependency on Common Control v6 by adding the following to your custom manifest:
|
||||
/// ```text
|
||||
/// <dependency>
|
||||
/// <dependentAssembly>
|
||||
/// <assemblyIdentity
|
||||
/// type="win32"
|
||||
/// name="Microsoft.Windows.Common-Controls"
|
||||
/// version="6.0.0.0"
|
||||
/// processorArchitecture="*"
|
||||
/// publicKeyToken="6595b64144ccf1df"
|
||||
/// language="*"
|
||||
/// />
|
||||
/// </dependentAssembly>
|
||||
/// </dependency>
|
||||
/// ```
|
||||
///
|
||||
/// [application manifest]: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests
|
||||
app_manifest: Option<String>,
|
||||
}
|
||||
|
||||
impl WindowsAttributes {
|
||||
@@ -125,6 +273,63 @@ impl WindowsAttributes {
|
||||
self.sdk_dir = Some(sdk_dir.as_ref().into());
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the [application manifest] to be included with the application on Windows.
|
||||
///
|
||||
/// Defaults to:
|
||||
/// ```text
|
||||
#[doc = include_str!("window-app-manifest.xml")]
|
||||
/// ```
|
||||
///
|
||||
/// ## Warning
|
||||
///
|
||||
/// if you are using tauri's dialog APIs, you need to specify a dependency on Common Control v6 by adding the following to your custom manifest:
|
||||
/// ```text
|
||||
/// <dependency>
|
||||
/// <dependentAssembly>
|
||||
/// <assemblyIdentity
|
||||
/// type="win32"
|
||||
/// name="Microsoft.Windows.Common-Controls"
|
||||
/// version="6.0.0.0"
|
||||
/// processorArchitecture="*"
|
||||
/// publicKeyToken="6595b64144ccf1df"
|
||||
/// language="*"
|
||||
/// />
|
||||
/// </dependentAssembly>
|
||||
/// </dependency>
|
||||
/// ```
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// The following manifest will brand the exe as requesting administrator privileges.
|
||||
/// Thus, everytime it is executed, a Windows UAC dialog will appear.
|
||||
///
|
||||
/// ```rust,no_run
|
||||
/// let mut windows = tauri_build::WindowsAttributes::new();
|
||||
/// windows = windows.app_manifest(r#"
|
||||
/// <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
/// <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
/// <security>
|
||||
/// <requestedPrivileges>
|
||||
/// <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
/// </requestedPrivileges>
|
||||
/// </security>
|
||||
/// </trustInfo>
|
||||
/// </assembly>
|
||||
/// "#);
|
||||
/// let attrs = tauri_build::Attributes::new().windows_attributes(windows);
|
||||
/// tauri_build::try_build(attrs).expect("failed to run build script");
|
||||
/// ```
|
||||
///
|
||||
/// Note that you can move the manifest contents to a separate file and use `include_str!("manifest.xml")`
|
||||
/// instead of the inline string.
|
||||
///
|
||||
/// [manifest]: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests
|
||||
#[must_use]
|
||||
pub fn app_manifest<S: AsRef<str>>(mut self, manifest: S) -> Self {
|
||||
self.app_manifest = Some(manifest.as_ref().to_string());
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
/// The attributes used on the build.
|
||||
@@ -169,7 +374,15 @@ impl Attributes {
|
||||
/// This is typically desirable when running inside a build script; see [`try_build`] for no panics.
|
||||
pub fn build() {
|
||||
if let Err(error) = try_build(Attributes::default()) {
|
||||
panic!("error found during tauri-build: {:#?}", error);
|
||||
let error = format!("{error:#}");
|
||||
println!("{error}");
|
||||
if error.starts_with("unknown field") {
|
||||
print!("found an unknown configuration field. This usually means that you are using a CLI version that is newer than `tauri-build` and is incompatible. ");
|
||||
println!(
|
||||
"Please try updating the Rust crates by running `cargo update` in the Tauri app folder."
|
||||
);
|
||||
}
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,76 +390,46 @@ pub fn build() {
|
||||
#[allow(unused_variables)]
|
||||
pub fn try_build(attributes: Attributes) -> Result<()> {
|
||||
use anyhow::anyhow;
|
||||
use cargo_toml::{Dependency, Manifest};
|
||||
use tauri_utils::config::{Config, TauriConfig};
|
||||
|
||||
println!("cargo:rerun-if-env-changed=TAURI_CONFIG");
|
||||
println!("cargo:rerun-if-changed=tauri.conf.json");
|
||||
#[cfg(feature = "config-json5")]
|
||||
println!("cargo:rerun-if-changed=tauri.conf.json5");
|
||||
#[cfg(feature = "config-toml")]
|
||||
println!("cargo:rerun-if-changed=Tauri.toml");
|
||||
|
||||
let config: Config = if let Ok(env) = std::env::var("TAURI_CONFIG") {
|
||||
serde_json::from_str(&env)?
|
||||
} else {
|
||||
serde_json::from_value(tauri_utils::config::parse::read_from(
|
||||
std::env::current_dir().unwrap(),
|
||||
)?)?
|
||||
};
|
||||
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
|
||||
let mobile = target_os == "ios" || target_os == "android";
|
||||
cfg_alias("desktop", !mobile);
|
||||
cfg_alias("mobile", mobile);
|
||||
|
||||
let mut config = serde_json::from_value(tauri_utils::config::parse::read_from(
|
||||
std::env::current_dir().unwrap(),
|
||||
)?)?;
|
||||
if let Ok(env) = std::env::var("TAURI_CONFIG") {
|
||||
let merge_config: serde_json::Value = serde_json::from_str(&env)?;
|
||||
json_patch::merge(&mut config, &merge_config);
|
||||
}
|
||||
let config: Config = serde_json::from_value(config)?;
|
||||
|
||||
cfg_alias("dev", !has_feature("custom-protocol"));
|
||||
|
||||
let mut manifest = Manifest::from_path("Cargo.toml")?;
|
||||
if let Some(tauri) = manifest.dependencies.remove("tauri") {
|
||||
let features = match tauri {
|
||||
Dependency::Simple(_) => Vec::new(),
|
||||
Dependency::Detailed(dep) => dep.features,
|
||||
};
|
||||
let ws_path = get_workspace_dir()?;
|
||||
let mut manifest =
|
||||
Manifest::<cargo_toml::Value>::from_slice_with_metadata(&std::fs::read("Cargo.toml")?)?;
|
||||
|
||||
let all_cli_managed_features = TauriConfig::all_features();
|
||||
let diff = features_diff(
|
||||
&features
|
||||
.into_iter()
|
||||
.filter(|f| all_cli_managed_features.contains(&f.as_str()))
|
||||
.collect::<Vec<String>>(),
|
||||
&config
|
||||
.tauri
|
||||
.features()
|
||||
.into_iter()
|
||||
.map(|f| f.to_string())
|
||||
.collect::<Vec<String>>(),
|
||||
);
|
||||
|
||||
let mut error_message = String::new();
|
||||
if !diff.remove.is_empty() {
|
||||
error_message.push_str("remove the `");
|
||||
error_message.push_str(&diff.remove.join(", "));
|
||||
error_message.push_str(if diff.remove.len() == 1 {
|
||||
"` feature"
|
||||
} else {
|
||||
"` features"
|
||||
});
|
||||
if !diff.add.is_empty() {
|
||||
error_message.push_str(" and ");
|
||||
}
|
||||
}
|
||||
if !diff.add.is_empty() {
|
||||
error_message.push_str("add the `");
|
||||
error_message.push_str(&diff.add.join(", "));
|
||||
error_message.push_str(if diff.add.len() == 1 {
|
||||
"` feature"
|
||||
} else {
|
||||
"` features"
|
||||
});
|
||||
}
|
||||
|
||||
if !error_message.is_empty() {
|
||||
return Err(anyhow!("
|
||||
The `tauri` dependency features on the `Cargo.toml` file does not match the allowlist defined under `tauri.conf.json`.
|
||||
Please run `tauri dev` or `tauri build` or {}.
|
||||
", error_message));
|
||||
}
|
||||
if let Ok(ws_manifest) = Manifest::from_path(ws_path.join("Cargo.toml")) {
|
||||
Manifest::complete_from_path_and_workspace(
|
||||
&mut manifest,
|
||||
Path::new("Cargo.toml"),
|
||||
Some((&ws_manifest, ws_path.as_path())),
|
||||
)?;
|
||||
} else {
|
||||
Manifest::complete_from_path(&mut manifest, Path::new("Cargo.toml"))?;
|
||||
}
|
||||
|
||||
allowlist::check(&config, &mut manifest)?;
|
||||
|
||||
let target_triple = std::env::var("TARGET").unwrap();
|
||||
let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap());
|
||||
// TODO: far from ideal, but there's no other way to get the target dir, see <https://github.com/rust-lang/cargo/issues/5457>
|
||||
@@ -263,30 +446,60 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
|
||||
ResourcePaths::new(external_binaries(paths, &target_triple).as_slice(), true),
|
||||
&target_triple,
|
||||
target_dir,
|
||||
manifest.package.as_ref().map(|p| &p.name),
|
||||
)?;
|
||||
}
|
||||
|
||||
#[allow(unused_mut, clippy::redundant_clone)]
|
||||
let mut resources = config.tauri.bundle.resources.clone().unwrap_or_default();
|
||||
#[cfg(windows)]
|
||||
if let Some(fixed_webview2_runtime_path) = &config.tauri.bundle.windows.webview_fixed_runtime_path
|
||||
{
|
||||
resources.push(fixed_webview2_runtime_path.display().to_string());
|
||||
let mut resources = config
|
||||
.tauri
|
||||
.bundle
|
||||
.resources
|
||||
.clone()
|
||||
.unwrap_or_else(|| BundleResources::List(Vec::new()));
|
||||
if target_triple.contains("windows") {
|
||||
if let Some(fixed_webview2_runtime_path) =
|
||||
match &config.tauri.bundle.windows.webview_fixed_runtime_path {
|
||||
Some(path) => Some(path),
|
||||
None => match &config.tauri.bundle.windows.webview_install_mode {
|
||||
WebviewInstallMode::FixedRuntime { path } => Some(path),
|
||||
_ => None,
|
||||
},
|
||||
}
|
||||
{
|
||||
resources.push(fixed_webview2_runtime_path.display().to_string());
|
||||
}
|
||||
}
|
||||
match resources {
|
||||
BundleResources::List(res) => {
|
||||
copy_resources(ResourcePaths::new(res.as_slice(), true), target_dir)?
|
||||
}
|
||||
BundleResources::Map(map) => copy_resources(ResourcePaths::from_map(&map, true), target_dir)?,
|
||||
}
|
||||
copy_resources(ResourcePaths::new(resources.as_slice(), true), target_dir)?;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
if let Some(version) = config.tauri.bundle.macos.minimum_system_version {
|
||||
println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET={}", version);
|
||||
if target_triple.contains("darwin") {
|
||||
if let Some(frameworks) = &config.tauri.bundle.macos.frameworks {
|
||||
if !frameworks.is_empty() {
|
||||
let frameworks_dir = target_dir.parent().unwrap().join("Frameworks");
|
||||
let _ = std::fs::remove_dir_all(&frameworks_dir);
|
||||
// copy frameworks to the root `target` folder (instead of `target/debug` for instance)
|
||||
// because the rpath is set to `@executable_path/../Frameworks`.
|
||||
copy_frameworks(&frameworks_dir, frameworks)?;
|
||||
|
||||
// If we have frameworks, we need to set the @rpath
|
||||
// https://github.com/tauri-apps/tauri/issues/7710
|
||||
println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path/../Frameworks");
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(version) = &config.tauri.bundle.macos.minimum_system_version {
|
||||
println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET={version}");
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
{
|
||||
use anyhow::Context;
|
||||
if target_triple.contains("windows") {
|
||||
use semver::Version;
|
||||
use winres::{VersionInfo, WindowsResource};
|
||||
use tauri_winres::{VersionInfo, WindowsResource};
|
||||
|
||||
fn find_icon<F: Fn(&&String) -> bool>(config: &Config, predicate: F, default: &str) -> PathBuf {
|
||||
let icon_path = config
|
||||
@@ -307,27 +520,30 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
|
||||
|
||||
if window_icon_path.exists() {
|
||||
let mut res = WindowsResource::new();
|
||||
if let Some(sdk_dir) = &attributes.windows_attributes.sdk_dir {
|
||||
if let Some(sdk_dir_str) = sdk_dir.to_str() {
|
||||
res.set_toolkit_path(sdk_dir_str);
|
||||
} else {
|
||||
return Err(anyhow!(
|
||||
"sdk_dir path is not valid; only UTF-8 characters are allowed"
|
||||
));
|
||||
}
|
||||
|
||||
if let Some(manifest) = attributes.windows_attributes.app_manifest {
|
||||
res.set_manifest(&manifest);
|
||||
} else {
|
||||
res.set_manifest(include_str!("window-app-manifest.xml"));
|
||||
}
|
||||
if let Some(version) = &config.package.version {
|
||||
if let Ok(v) = Version::parse(version) {
|
||||
|
||||
if let Some(version_str) = &config.package.version {
|
||||
if let Ok(v) = Version::parse(version_str) {
|
||||
let version = v.major << 48 | v.minor << 32 | v.patch << 16;
|
||||
res.set_version_info(VersionInfo::FILEVERSION, version);
|
||||
res.set_version_info(VersionInfo::PRODUCTVERSION, version);
|
||||
}
|
||||
res.set("FileVersion", version);
|
||||
res.set("ProductVersion", version);
|
||||
res.set("FileVersion", version_str);
|
||||
res.set("ProductVersion", version_str);
|
||||
}
|
||||
if let Some(product_name) = &config.package.product_name {
|
||||
res.set("ProductName", product_name);
|
||||
res.set("FileDescription", product_name);
|
||||
}
|
||||
if let Some(short_description) = &config.tauri.bundle.short_description {
|
||||
res.set("FileDescription", short_description);
|
||||
}
|
||||
if let Some(copyright) = &config.tauri.bundle.copyright {
|
||||
res.set("LegalCopyright", copyright);
|
||||
}
|
||||
res.set_icon_with_id(&window_icon_path.display().to_string(), "32512");
|
||||
res.compile().with_context(|| {
|
||||
@@ -379,65 +595,22 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, PartialEq, Eq)]
|
||||
struct Diff {
|
||||
remove: Vec<String>,
|
||||
add: Vec<String>,
|
||||
#[derive(serde::Deserialize)]
|
||||
struct CargoMetadata {
|
||||
workspace_root: PathBuf,
|
||||
}
|
||||
|
||||
fn features_diff(current: &[String], expected: &[String]) -> Diff {
|
||||
let mut remove = Vec::new();
|
||||
let mut add = Vec::new();
|
||||
for feature in current {
|
||||
if !expected.contains(feature) {
|
||||
remove.push(feature.clone());
|
||||
}
|
||||
fn get_workspace_dir() -> Result<PathBuf> {
|
||||
let output = std::process::Command::new("cargo")
|
||||
.args(["metadata", "--no-deps", "--format-version", "1"])
|
||||
.output()?;
|
||||
|
||||
if !output.status.success() {
|
||||
return Err(anyhow::anyhow!(
|
||||
"cargo metadata command exited with a non zero exit code: {}",
|
||||
String::from_utf8(output.stderr)?
|
||||
));
|
||||
}
|
||||
|
||||
for feature in expected {
|
||||
if !current.contains(feature) {
|
||||
add.push(feature.clone());
|
||||
}
|
||||
}
|
||||
|
||||
Diff { remove, add }
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::Diff;
|
||||
|
||||
#[test]
|
||||
fn array_diff() {
|
||||
for (current, expected, result) in [
|
||||
(vec![], vec![], Default::default()),
|
||||
(
|
||||
vec!["a".into()],
|
||||
vec![],
|
||||
Diff {
|
||||
remove: vec!["a".into()],
|
||||
add: vec![],
|
||||
},
|
||||
),
|
||||
(vec!["a".into()], vec!["a".into()], Default::default()),
|
||||
(
|
||||
vec!["a".into(), "b".into()],
|
||||
vec!["a".into()],
|
||||
Diff {
|
||||
remove: vec!["b".into()],
|
||||
add: vec![],
|
||||
},
|
||||
),
|
||||
(
|
||||
vec!["a".into(), "b".into()],
|
||||
vec!["a".into(), "c".into()],
|
||||
Diff {
|
||||
remove: vec!["b".into()],
|
||||
add: vec!["c".into()],
|
||||
},
|
||||
),
|
||||
] {
|
||||
assert_eq!(super::features_diff(¤t, &expected), result);
|
||||
}
|
||||
}
|
||||
Ok(serde_json::from_slice::<CargoMetadata>(&output.stdout)?.workspace_root)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -10,7 +10,7 @@ use std::{env, fs, io::Write, path::Path};
|
||||
pub fn build() {
|
||||
override_msvcrt_lib();
|
||||
|
||||
// Disable conflicting libraries that aren't hard coded by Rust.
|
||||
// Disable conflicting libraries that aren't hard coded by Rust
|
||||
println!("cargo:rustc-link-arg=/NODEFAULTLIB:libvcruntimed.lib");
|
||||
println!("cargo:rustc-link-arg=/NODEFAULTLIB:vcruntime.lib");
|
||||
println!("cargo:rustc-link-arg=/NODEFAULTLIB:vcruntimed.lib");
|
||||
@@ -48,11 +48,11 @@ fn override_msvcrt_lib() {
|
||||
let f = fs::OpenOptions::new()
|
||||
.write(true)
|
||||
.create_new(true)
|
||||
.open(&path);
|
||||
.open(path);
|
||||
if let Ok(mut f) = f {
|
||||
f.write_all(machine).unwrap();
|
||||
f.write_all(bytes).unwrap();
|
||||
}
|
||||
// Add the output directory to the native library path.
|
||||
println!("cargo:rustc-link-search=native={}", out_dir);
|
||||
println!("cargo:rustc-link-search=native={out_dir}");
|
||||
}
|
||||
|
||||
14
core/tauri-build/src/window-app-manifest.xml
Normal file
14
core/tauri-build/src/window-app-manifest.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
</assembly>
|
||||
@@ -1,5 +1,90 @@
|
||||
# Changelog
|
||||
|
||||
## \[1.4.4]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `tauri-utils@1.6.0`
|
||||
|
||||
## \[1.4.3]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `tauri-utils@1.5.4`
|
||||
|
||||
## \[1.4.2]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `tauri-utils@1.5.2`
|
||||
|
||||
## \[1.4.1]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `tauri-utils@1.5.0`
|
||||
|
||||
## \[1.4.0]
|
||||
|
||||
### Enhancements
|
||||
|
||||
- [`17d5a4f5`](https://www.github.com/tauri-apps/tauri/commit/17d5a4f51f244d3ff42014b5d1b075fad7c636a5)([#6706](https://www.github.com/tauri-apps/tauri/pull/6706)) Early panic if the PNG icon is not RGBA.
|
||||
- [`d2710e9d`](https://www.github.com/tauri-apps/tauri/commit/d2710e9d2e8fd93975ef6494512370faa8cb3b7e)([#6944](https://www.github.com/tauri-apps/tauri/pull/6944)) Unpin `time`, `ignore`, and `winnow` crate versions. Developers now have to pin crates if needed themselves. A list of crates that need pinning to adhere to Tauri's MSRV will be visible in Tauri's GitHub workflow: https://github.com/tauri-apps/tauri/blob/dev/.github/workflows/test-core.yml#L85.
|
||||
|
||||
## \[1.3.0]
|
||||
|
||||
- Bump minimum supported Rust version to 1.60.
|
||||
- [5fdc616d](https://www.github.com/tauri-apps/tauri/commit/5fdc616df9bea633810dcb814ac615911d77222c) feat: Use the zbus-backed of notify-rust ([#6332](https://www.github.com/tauri-apps/tauri/pull/6332)) on 2023-03-31
|
||||
- Pin `time` to `0.3.15`.
|
||||
- [3d16461b](https://www.github.com/tauri-apps/tauri/commit/3d16461b68583ba7db037fbc217786e79b46ddf2) fix(core): pin time to 0.3.15 ([#6312](https://www.github.com/tauri-apps/tauri/pull/6312)) on 2023-02-19
|
||||
|
||||
## \[1.2.1]
|
||||
|
||||
- Fix `allowlist > app > show/hide` always disabled when `allowlist > app > all: false`.
|
||||
- Bumped due to a bump in tauri-utils.
|
||||
- [bb251087](https://www.github.com/tauri-apps/tauri/commit/bb2510876d0bdff736d36bf3a465cdbe4ad2b90c) fix(core): extend allowlist with `app`'s allowlist, closes [#5650](https://www.github.com/tauri-apps/tauri/pull/5650) ([#5652](https://www.github.com/tauri-apps/tauri/pull/5652)) on 2022-11-18
|
||||
|
||||
## \[1.2.0]
|
||||
|
||||
- Properly serialize HTML template tags.
|
||||
- [aec5537d](https://www.github.com/tauri-apps/tauri/commit/aec5537de0205f62b2ae5c89da04d21930a6fc2e) fix(codegen): serialize template tags, closes [#4410](https://www.github.com/tauri-apps/tauri/pull/4410) ([#5247](https://www.github.com/tauri-apps/tauri/pull/5247)) on 2022-09-28
|
||||
- - [7d9aa398](https://www.github.com/tauri-apps/tauri/commit/7d9aa3987efce2d697179ffc33646d086c68030c) feat: bump MSRV to 1.59 ([#5296](https://www.github.com/tauri-apps/tauri/pull/5296)) on 2022-09-28
|
||||
|
||||
## \[1.1.1]
|
||||
|
||||
- Add missing allowlist config for `set_cursor_grab`, `set_cursor_visible`, `set_cursor_icon` and `set_cursor_position` APIs.
|
||||
- Bumped due to a bump in tauri-utils.
|
||||
- [c764408d](https://www.github.com/tauri-apps/tauri/commit/c764408da7fae123edd41115bda42fa75a4731d2) fix: Add missing allowlist config for cursor apis, closes [#5207](https://www.github.com/tauri-apps/tauri/pull/5207) ([#5211](https://www.github.com/tauri-apps/tauri/pull/5211)) on 2022-09-16
|
||||
|
||||
## \[1.1.0]
|
||||
|
||||
- Use `TARGET` environment variable for code generation inside build scripts.
|
||||
- [6ba99689](https://www.github.com/tauri-apps/tauri/commit/6ba99689aa7ed0ffa9072a1c8ab5db12c9bf95af) feat(codegen): use TARGET environment variable if set ([#4921](https://www.github.com/tauri-apps/tauri/pull/4921)) on 2022-08-12
|
||||
- Added support to configuration files in TOML format (Tauri.toml file).
|
||||
- [ae83d008](https://www.github.com/tauri-apps/tauri/commit/ae83d008f9e1b89bfc8dddaca42aa5c1fbc36f6d) feat: add support to TOML config file `Tauri.toml`, closes [#4806](https://www.github.com/tauri-apps/tauri/pull/4806) ([#4813](https://www.github.com/tauri-apps/tauri/pull/4813)) on 2022-08-02
|
||||
- Improve tray icon read error message.
|
||||
- [52f0c8bb](https://www.github.com/tauri-apps/tauri/commit/52f0c8bb836c6d50b7ce2393161394f4ce78f5ae) feat(core): improve tray icon read error messages ([#4850](https://www.github.com/tauri-apps/tauri/pull/4850)) on 2022-08-03
|
||||
- Fix relative paths in `version` field of `tauri.config.json` not being correctly parsed by `generate_context!()`.
|
||||
- [accbc5e8](https://www.github.com/tauri-apps/tauri/commit/accbc5e8806a32efc555d019634fc2fa14d17f0a) fix(codegen): fix relative paths in `version` field of `tauri.config.json`, closes [#4723](https://www.github.com/tauri-apps/tauri/pull/4723) ([#4725](https://www.github.com/tauri-apps/tauri/pull/4725)) on 2022-07-24
|
||||
- Only rewrite temporary icon files when the content change, avoid needless rebuilds.
|
||||
- [f957cbb5](https://www.github.com/tauri-apps/tauri/commit/f957cbb56ccbd8d1c047a978b4579946252a6fd2) fix(codegen): write output file when contents change ([#4889](https://www.github.com/tauri-apps/tauri/pull/4889)) on 2022-08-09
|
||||
|
||||
## \[1.0.4]
|
||||
|
||||
- Validate `__TAURI_ISOLATION_HOOK__` being set by a file in the isolation application.
|
||||
- [3b4ed970](https://www.github.com/tauri-apps/tauri/commit/3b4ed970e663f5bffbfe0358610f9c3f157c513f) feat(codegen): validate `__TAURI_ISOLATION_HOOK__` is referenced ([#4631](https://www.github.com/tauri-apps/tauri/pull/4631)) on 2022-07-11
|
||||
|
||||
## \[1.0.3]
|
||||
|
||||
- The `TAURI_CONFIG` environment variable now represents the configuration to be merged instead of the entire JSON.
|
||||
- [fa028ebf](https://www.github.com/tauri-apps/tauri/commit/fa028ebf3c8ca7b43a70d283a01dbea86217594f) refactor: do not pass entire config from CLI to core, send patch instead ([#4598](https://www.github.com/tauri-apps/tauri/pull/4598)) on 2022-07-06
|
||||
|
||||
## \[1.0.2]
|
||||
|
||||
- Expose `platform::windows_version` function.
|
||||
- Bumped due to a bump in tauri-utils.
|
||||
- [bf764e83](https://www.github.com/tauri-apps/tauri/commit/bf764e83e01e7443e6cc54572001e1c98c357465) feat(utils): expose `windows_version` function ([#4534](https://www.github.com/tauri-apps/tauri/pull/4534)) on 2022-06-30
|
||||
|
||||
## \[1.0.1]
|
||||
|
||||
- Set the bundle name and app metadata in the Info.plist file in development mode.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-codegen"
|
||||
version = "1.0.1"
|
||||
version = "1.4.4"
|
||||
authors = [ "Tauri Programme within The Commons Conservancy" ]
|
||||
categories = [ "gui", "web-programming" ]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
@@ -8,26 +8,27 @@ homepage = "https://tauri.app"
|
||||
repository = "https://github.com/tauri-apps/tauri/tree/dev/core/tauri-codegen"
|
||||
description = "code generation meant to be consumed inside of `tauri` through `tauri-build` or `tauri-macros`"
|
||||
edition = "2021"
|
||||
rust-version = "1.57"
|
||||
exclude = [ ".license_template", "CHANGELOG.md", "/target" ]
|
||||
rust-version = "1.60"
|
||||
exclude = [ "CHANGELOG.md", "/target" ]
|
||||
readme = "README.md"
|
||||
|
||||
[dependencies]
|
||||
sha2 = "0.10"
|
||||
base64 = "0.13"
|
||||
base64 = "0.21"
|
||||
proc-macro2 = "1"
|
||||
quote = "1"
|
||||
serde = { version = "1", features = [ "derive" ] }
|
||||
serde_json = "1"
|
||||
tauri-utils = { version = "1.0.1", path = "../tauri-utils", features = [ "build" ] }
|
||||
tauri-utils = { version = "1.6.0", path = "../tauri-utils", features = [ "build" ] }
|
||||
thiserror = "1"
|
||||
walkdir = "2"
|
||||
brotli = { version = "3", optional = true, default-features = false, features = [ "std" ] }
|
||||
regex = { version = "1.5.6", optional = true }
|
||||
regex = { version = "1", optional = true }
|
||||
uuid = { version = "1", features = [ "v4" ] }
|
||||
semver = "1"
|
||||
ico = "0.1"
|
||||
ico = "0.3"
|
||||
png = "0.17"
|
||||
json-patch = "1.2"
|
||||
|
||||
[target."cfg(target_os = \"macos\")".dependencies]
|
||||
plist = "1"
|
||||
@@ -39,3 +40,4 @@ compression = [ "brotli", "tauri-utils/compression" ]
|
||||
isolation = [ "tauri-utils/isolation" ]
|
||||
shell-scope = [ "regex" ]
|
||||
config-json5 = [ "tauri-utils/config-json5" ]
|
||||
config-toml = [ "tauri-utils/config-toml" ]
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
[](https://discord.gg/SpmNs4S)
|
||||
[](https://dev.to/tauri)
|
||||
|
||||

|
||||
[](https://github.com/tauri-apps/tauri/actions/workflows/test-core.yml)
|
||||
[](https://tauri.app)
|
||||
|
||||
[](https://good-labs.github.io/greater-good-affirmation)
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::{ffi::OsStr, str::FromStr};
|
||||
|
||||
use base64::Engine;
|
||||
use proc_macro2::TokenStream;
|
||||
use quote::quote;
|
||||
use sha2::{Digest, Sha256};
|
||||
|
||||
use tauri_utils::assets::AssetKey;
|
||||
use tauri_utils::config::{AppUrl, Config, PatternKind, WindowUrl};
|
||||
use tauri_utils::html::{inject_nonce_token, parse as parse_html};
|
||||
use tauri_utils::html::{
|
||||
inject_nonce_token, parse as parse_html, serialize_node as serialize_html_node,
|
||||
};
|
||||
|
||||
#[cfg(feature = "shell-scope")]
|
||||
use tauri_utils::config::{ShellAllowedArg, ShellAllowedArgs, ShellAllowlistScope};
|
||||
@@ -28,6 +31,7 @@ pub struct ContextData {
|
||||
|
||||
fn map_core_assets(
|
||||
options: &AssetOptions,
|
||||
target: Target,
|
||||
) -> impl Fn(&AssetKey, &Path, &mut Vec<u8>, &mut CspHashes) -> Result<(), EmbeddedAssetsError> {
|
||||
#[cfg(feature = "isolation")]
|
||||
let pattern = tauri_utils::html::PatternObject::from(&options.pattern);
|
||||
@@ -36,12 +40,13 @@ fn map_core_assets(
|
||||
options.dangerous_disable_asset_csp_modification.clone();
|
||||
move |key, path, input, csp_hashes| {
|
||||
if path.extension() == Some(OsStr::new("html")) {
|
||||
let mut document = parse_html(String::from_utf8_lossy(input).into_owned());
|
||||
|
||||
#[allow(clippy::collapsible_if)]
|
||||
if csp {
|
||||
#[cfg(target_os = "linux")]
|
||||
::tauri_utils::html::inject_csp_token(&mut document);
|
||||
let mut document = parse_html(String::from_utf8_lossy(input).into_owned());
|
||||
|
||||
if target == Target::Linux {
|
||||
::tauri_utils::html::inject_csp_token(&mut document);
|
||||
}
|
||||
|
||||
inject_nonce_token(&mut document, &dangerous_disable_asset_csp_modification);
|
||||
|
||||
@@ -53,7 +58,10 @@ fn map_core_assets(
|
||||
let mut hasher = Sha256::new();
|
||||
hasher.update(&script);
|
||||
let hash = hasher.finalize();
|
||||
scripts.push(format!("'sha256-{}'", base64::encode(&hash)));
|
||||
scripts.push(format!(
|
||||
"'sha256-{}'",
|
||||
base64::engine::general_purpose::STANDARD.encode(hash)
|
||||
));
|
||||
}
|
||||
csp_hashes
|
||||
.inline_scripts
|
||||
@@ -70,14 +78,15 @@ fn map_core_assets(
|
||||
let mut hasher = Sha256::new();
|
||||
hasher.update(tauri_utils::pattern::isolation::IFRAME_STYLE);
|
||||
let hash = hasher.finalize();
|
||||
csp_hashes
|
||||
.styles
|
||||
.push(format!("'sha256-{}'", base64::encode(&hash)));
|
||||
csp_hashes.styles.push(format!(
|
||||
"'sha256-{}'",
|
||||
base64::engine::general_purpose::STANDARD.encode(hash)
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*input = document.to_string().as_bytes().to_vec();
|
||||
*input = serialize_html_node(&document);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -106,6 +115,16 @@ fn map_isolation(
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
enum Target {
|
||||
Linux,
|
||||
Windows,
|
||||
Darwin,
|
||||
Android,
|
||||
// iOS.
|
||||
Ios,
|
||||
}
|
||||
|
||||
/// Build a `tauri::Context` for including in application code.
|
||||
pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsError> {
|
||||
let ContextData {
|
||||
@@ -115,6 +134,34 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
|
||||
root,
|
||||
} = data;
|
||||
|
||||
let target = if let Ok(target) = std::env::var("TARGET") {
|
||||
if target.contains("unknown-linux") {
|
||||
Target::Linux
|
||||
} else if target.contains("pc-windows") {
|
||||
Target::Windows
|
||||
} else if target.contains("apple-darwin") {
|
||||
Target::Darwin
|
||||
} else if target.contains("android") {
|
||||
Target::Android
|
||||
} else if target.contains("apple-ios") {
|
||||
Target::Ios
|
||||
} else {
|
||||
panic!("unknown codegen target {target}");
|
||||
}
|
||||
} else if cfg!(target_os = "linux") {
|
||||
Target::Linux
|
||||
} else if cfg!(windows) {
|
||||
Target::Windows
|
||||
} else if cfg!(target_os = "macos") {
|
||||
Target::Darwin
|
||||
} else if cfg!(target_os = "android") {
|
||||
Target::Android
|
||||
} else if cfg!(target_os = "ios") {
|
||||
Target::Ios
|
||||
} else {
|
||||
panic!("unknown codegen target");
|
||||
};
|
||||
|
||||
let mut options = AssetOptions::new(config.tauri.pattern.clone())
|
||||
.freeze_prototype(config.tauri.security.freeze_prototype)
|
||||
.dangerous_disable_asset_csp_modification(
|
||||
@@ -129,10 +176,10 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
|
||||
.tauri
|
||||
.security
|
||||
.dev_csp
|
||||
.clone()
|
||||
.or_else(|| config.tauri.security.csp.clone())
|
||||
.as_ref()
|
||||
.or(config.tauri.security.csp.as_ref())
|
||||
} else {
|
||||
config.tauri.security.csp.clone()
|
||||
config.tauri.security.csp.as_ref()
|
||||
};
|
||||
if csp.is_some() {
|
||||
options = options.with_csp();
|
||||
@@ -162,7 +209,7 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
|
||||
path
|
||||
)
|
||||
}
|
||||
EmbeddedAssets::new(assets_path, &options, map_core_assets(&options))?
|
||||
EmbeddedAssets::new(assets_path, &options, map_core_assets(&options, target))?
|
||||
}
|
||||
_ => unimplemented!(),
|
||||
},
|
||||
@@ -172,7 +219,7 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
|
||||
.map(|p| config_parent.join(p))
|
||||
.collect::<Vec<_>>(),
|
||||
&options,
|
||||
map_core_assets(&options),
|
||||
map_core_assets(&options, target),
|
||||
)?,
|
||||
_ => unimplemented!(),
|
||||
};
|
||||
@@ -189,18 +236,28 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
|
||||
out_dir
|
||||
};
|
||||
|
||||
// handle default window icons for Windows targets
|
||||
#[cfg(windows)]
|
||||
let default_window_icon = {
|
||||
let icon_path = find_icon(
|
||||
&config,
|
||||
&config_parent,
|
||||
|i| i.ends_with(".ico"),
|
||||
"icons/icon.ico",
|
||||
);
|
||||
if icon_path.exists() {
|
||||
ico_icon(&root, &out_dir, icon_path)?
|
||||
} else {
|
||||
if target == Target::Windows {
|
||||
// handle default window icons for Windows targets
|
||||
let icon_path = find_icon(
|
||||
&config,
|
||||
&config_parent,
|
||||
|i| i.ends_with(".ico"),
|
||||
"icons/icon.ico",
|
||||
);
|
||||
if icon_path.exists() {
|
||||
ico_icon(&root, &out_dir, icon_path)?
|
||||
} else {
|
||||
let icon_path = find_icon(
|
||||
&config,
|
||||
&config_parent,
|
||||
|i| i.ends_with(".png"),
|
||||
"icons/icon.png",
|
||||
);
|
||||
png_icon(&root, &out_dir, icon_path)?
|
||||
}
|
||||
} else if target == Target::Linux {
|
||||
// handle default window icons for Linux targets
|
||||
let icon_path = find_icon(
|
||||
&config,
|
||||
&config_parent,
|
||||
@@ -208,23 +265,12 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
|
||||
"icons/icon.png",
|
||||
);
|
||||
png_icon(&root, &out_dir, icon_path)?
|
||||
} else {
|
||||
quote!(None)
|
||||
}
|
||||
};
|
||||
#[cfg(target_os = "linux")]
|
||||
let default_window_icon = {
|
||||
let icon_path = find_icon(
|
||||
&config,
|
||||
&config_parent,
|
||||
|i| i.ends_with(".png"),
|
||||
"icons/icon.png",
|
||||
);
|
||||
png_icon(&root, &out_dir, icon_path)?
|
||||
};
|
||||
#[cfg(not(any(windows, target_os = "linux")))]
|
||||
let default_window_icon = quote!(None);
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
let app_icon = if dev {
|
||||
let app_icon = if target == Target::Darwin && dev {
|
||||
let mut icon_path = find_icon(
|
||||
&config,
|
||||
&config_parent,
|
||||
@@ -243,8 +289,6 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
|
||||
} else {
|
||||
quote!(None)
|
||||
};
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
let app_icon = quote!(None);
|
||||
|
||||
let package_name = if let Some(product_name) = &config.package.product_name {
|
||||
quote!(#product_name.to_string())
|
||||
@@ -283,60 +327,71 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
|
||||
};
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
let info_plist = {
|
||||
if dev {
|
||||
let info_plist_path = config_parent.join("Info.plist");
|
||||
let mut info_plist = if info_plist_path.exists() {
|
||||
plist::Value::from_file(&info_plist_path)
|
||||
.unwrap_or_else(|e| panic!("failed to read plist {}: {}", info_plist_path.display(), e))
|
||||
} else {
|
||||
plist::Value::Dictionary(Default::default())
|
||||
};
|
||||
|
||||
if let Some(plist) = info_plist.as_dictionary_mut() {
|
||||
if let Some(product_name) = &config.package.product_name {
|
||||
plist.insert("CFBundleName".into(), product_name.clone().into());
|
||||
}
|
||||
if let Some(version) = &config.package.version {
|
||||
plist.insert("CFBundleShortVersionString".into(), version.clone().into());
|
||||
}
|
||||
let format =
|
||||
time::format_description::parse("[year][month][day].[hour][minute][second]").unwrap();
|
||||
if let Ok(build_number) = time::OffsetDateTime::now_utc().format(&format) {
|
||||
plist.insert("CFBundleVersion".into(), build_number.into());
|
||||
}
|
||||
}
|
||||
|
||||
let out_path = out_dir.join("Info.plist");
|
||||
info_plist
|
||||
.to_file_xml(&out_path)
|
||||
.expect("failed to write Info.plist");
|
||||
|
||||
let info_plist_path = out_path.display().to_string();
|
||||
quote!({
|
||||
tauri::embed_plist::embed_info_plist!(#info_plist_path);
|
||||
})
|
||||
let info_plist = if target == Target::Darwin && dev {
|
||||
let info_plist_path = config_parent.join("Info.plist");
|
||||
let mut info_plist = if info_plist_path.exists() {
|
||||
plist::Value::from_file(&info_plist_path)
|
||||
.unwrap_or_else(|e| panic!("failed to read plist {}: {}", info_plist_path.display(), e))
|
||||
} else {
|
||||
quote!(())
|
||||
plist::Value::Dictionary(Default::default())
|
||||
};
|
||||
|
||||
if let Some(plist) = info_plist.as_dictionary_mut() {
|
||||
if let Some(product_name) = &config.package.product_name {
|
||||
plist.insert("CFBundleName".into(), product_name.clone().into());
|
||||
}
|
||||
if let Some(version) = &config.package.version {
|
||||
plist.insert("CFBundleShortVersionString".into(), version.clone().into());
|
||||
}
|
||||
let format =
|
||||
time::format_description::parse("[year][month][day].[hour][minute][second]").unwrap();
|
||||
if let Ok(build_number) = time::OffsetDateTime::now_utc().format(&format) {
|
||||
plist.insert("CFBundleVersion".into(), build_number.into());
|
||||
}
|
||||
}
|
||||
|
||||
info_plist
|
||||
.to_file_xml(out_dir.join("Info.plist"))
|
||||
.expect("failed to write Info.plist");
|
||||
quote!({
|
||||
tauri::embed_plist::embed_info_plist!(concat!(std::env!("OUT_DIR"), "/Info.plist"));
|
||||
})
|
||||
} else {
|
||||
quote!(())
|
||||
};
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
let info_plist = quote!(());
|
||||
|
||||
let pattern = match &options.pattern {
|
||||
PatternKind::Brownfield => quote!(#root::Pattern::Brownfield(std::marker::PhantomData)),
|
||||
#[cfg(not(feature = "isolation"))]
|
||||
PatternKind::Isolation { dir: _ } => {
|
||||
quote!(#root::Pattern::Brownfield(std::marker::PhantomData))
|
||||
}
|
||||
#[cfg(feature = "isolation")]
|
||||
PatternKind::Isolation { dir } => {
|
||||
let dir = config_parent.join(dir);
|
||||
if !dir.exists() {
|
||||
panic!(
|
||||
"The isolation dir configuration is set to `{:?}` but this path doesn't exist",
|
||||
dir
|
||||
)
|
||||
panic!("The isolation application path is set to `{dir:?}` but it does not exist")
|
||||
}
|
||||
|
||||
let mut sets_isolation_hook = false;
|
||||
|
||||
let key = uuid::Uuid::new_v4().to_string();
|
||||
let assets = EmbeddedAssets::new(dir.clone(), &options, map_isolation(&options, dir))?;
|
||||
let map_isolation = map_isolation(&options, dir.clone());
|
||||
let assets = EmbeddedAssets::new(dir, &options, |key, path, input, csp_hashes| {
|
||||
// we check if `__TAURI_ISOLATION_HOOK__` exists in the isolation code
|
||||
// before modifying the files since we inject our own `__TAURI_ISOLATION_HOOK__` reference in HTML files
|
||||
if String::from_utf8_lossy(input).contains("__TAURI_ISOLATION_HOOK__") {
|
||||
sets_isolation_hook = true;
|
||||
}
|
||||
map_isolation(key, path, input, csp_hashes)
|
||||
})?;
|
||||
|
||||
if !sets_isolation_hook {
|
||||
panic!("The isolation application does not contain a file setting the `window.__TAURI_ISOLATION_HOOK__` value.");
|
||||
}
|
||||
|
||||
let schema = options.isolation_schema;
|
||||
|
||||
quote!(#root::Pattern::Isolation {
|
||||
@@ -358,7 +413,7 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
|
||||
let shell_scope_open = match &config.tauri.allowlist.shell.open {
|
||||
ShellAllowlistOpen::Flag(false) => quote!(::std::option::Option::None),
|
||||
ShellAllowlistOpen::Flag(true) => {
|
||||
quote!(::std::option::Option::Some(#root::regex::Regex::new("^https?://").unwrap()))
|
||||
quote!(::std::option::Option::Some(#root::regex::Regex::new(r#"^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+"#).unwrap()))
|
||||
}
|
||||
ShellAllowlistOpen::Validate(regex) => match Regex::new(regex) {
|
||||
Ok(_) => quote!(::std::option::Option::Some(#root::regex::Regex::new(#regex).unwrap())),
|
||||
@@ -400,69 +455,54 @@ fn ico_icon<P: AsRef<Path>>(
|
||||
out_dir: &Path,
|
||||
path: P,
|
||||
) -> Result<TokenStream, EmbeddedAssetsError> {
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
|
||||
let path = path.as_ref();
|
||||
let bytes = std::fs::read(&path)
|
||||
.unwrap_or_else(|_| panic!("failed to read icon {}", path.display()))
|
||||
let bytes = std::fs::read(path)
|
||||
.unwrap_or_else(|e| panic!("failed to read icon {}: {}", path.display(), e))
|
||||
.to_vec();
|
||||
let icon_dir = ico::IconDir::read(std::io::Cursor::new(bytes))
|
||||
.unwrap_or_else(|_| panic!("failed to parse icon {}", path.display()));
|
||||
.unwrap_or_else(|e| panic!("failed to parse icon {}: {}", path.display(), e));
|
||||
let entry = &icon_dir.entries()[0];
|
||||
let rgba = entry
|
||||
.decode()
|
||||
.unwrap_or_else(|_| panic!("failed to decode icon {}", path.display()))
|
||||
.unwrap_or_else(|e| panic!("failed to decode icon {}: {}", path.display(), e))
|
||||
.rgba_data()
|
||||
.to_vec();
|
||||
let width = entry.width();
|
||||
let height = entry.height();
|
||||
|
||||
let out_path = out_dir.join(path.file_name().unwrap());
|
||||
let mut out_file = File::create(&out_path).map_err(|error| EmbeddedAssetsError::AssetWrite {
|
||||
path: out_path.clone(),
|
||||
let icon_file_name = path.file_name().unwrap();
|
||||
let out_path = out_dir.join(icon_file_name);
|
||||
write_if_changed(&out_path, &rgba).map_err(|error| EmbeddedAssetsError::AssetWrite {
|
||||
path: path.to_owned(),
|
||||
error,
|
||||
})?;
|
||||
|
||||
out_file
|
||||
.write_all(&rgba)
|
||||
.map_err(|error| EmbeddedAssetsError::AssetWrite {
|
||||
path: path.to_owned(),
|
||||
error,
|
||||
})?;
|
||||
|
||||
let out_path = out_path.display().to_string();
|
||||
|
||||
let icon = quote!(Some(#root::Icon::Rgba { rgba: include_bytes!(#out_path).to_vec(), width: #width, height: #height }));
|
||||
let icon_file_name = icon_file_name.to_str().unwrap();
|
||||
let icon = quote!(Some(
|
||||
#root::Icon::Rgba {
|
||||
rgba: include_bytes!(concat!(std::env!("OUT_DIR"), "/", #icon_file_name)).to_vec(),
|
||||
width: #width,
|
||||
height: #height
|
||||
}));
|
||||
Ok(icon)
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
fn raw_icon<P: AsRef<Path>>(out_dir: &Path, path: P) -> Result<TokenStream, EmbeddedAssetsError> {
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
|
||||
let path = path.as_ref();
|
||||
let bytes = std::fs::read(&path)
|
||||
.unwrap_or_else(|_| panic!("failed to read icon {}", path.display()))
|
||||
let bytes = std::fs::read(path)
|
||||
.unwrap_or_else(|e| panic!("failed to read icon {}: {}", path.display(), e))
|
||||
.to_vec();
|
||||
|
||||
let out_path = out_dir.join(path.file_name().unwrap());
|
||||
let mut out_file = File::create(&out_path).map_err(|error| EmbeddedAssetsError::AssetWrite {
|
||||
path: out_path.clone(),
|
||||
write_if_changed(&out_path, &bytes).map_err(|error| EmbeddedAssetsError::AssetWrite {
|
||||
path: path.to_owned(),
|
||||
error,
|
||||
})?;
|
||||
|
||||
out_file
|
||||
.write_all(&bytes)
|
||||
.map_err(|error| EmbeddedAssetsError::AssetWrite {
|
||||
path: path.to_owned(),
|
||||
error,
|
||||
})?;
|
||||
|
||||
let out_path = out_path.display().to_string();
|
||||
|
||||
let icon = quote!(Some(include_bytes!(#out_path).to_vec()));
|
||||
let icon_path = path.file_name().unwrap().to_str().unwrap().to_string();
|
||||
let icon = quote!(::std::option::Option::Some(
|
||||
include_bytes!(concat!(std::env!("OUT_DIR"), "/", #icon_path)).to_vec()
|
||||
));
|
||||
Ok(icon)
|
||||
}
|
||||
|
||||
@@ -471,17 +511,21 @@ fn png_icon<P: AsRef<Path>>(
|
||||
out_dir: &Path,
|
||||
path: P,
|
||||
) -> Result<TokenStream, EmbeddedAssetsError> {
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
|
||||
let path = path.as_ref();
|
||||
let bytes = std::fs::read(&path)
|
||||
.unwrap_or_else(|_| panic!("failed to read icon {}", path.display()))
|
||||
let bytes = std::fs::read(path)
|
||||
.unwrap_or_else(|e| panic!("failed to read icon {}: {}", path.display(), e))
|
||||
.to_vec();
|
||||
let decoder = png::Decoder::new(std::io::Cursor::new(bytes));
|
||||
let mut reader = decoder
|
||||
.read_info()
|
||||
.unwrap_or_else(|_| panic!("failed to read icon {}", path.display()));
|
||||
.unwrap_or_else(|e| panic!("failed to read icon {}: {}", path.display(), e));
|
||||
|
||||
let (color_type, _) = reader.output_color_type();
|
||||
|
||||
if color_type != png::ColorType::Rgba {
|
||||
panic!("icon {} is not RGBA", path.display());
|
||||
}
|
||||
|
||||
let mut buffer: Vec<u8> = Vec::new();
|
||||
while let Ok(Some(row)) = reader.next_row() {
|
||||
buffer.extend(row.data());
|
||||
@@ -489,25 +533,38 @@ fn png_icon<P: AsRef<Path>>(
|
||||
let width = reader.info().width;
|
||||
let height = reader.info().height;
|
||||
|
||||
let out_path = out_dir.join(path.file_name().unwrap());
|
||||
let mut out_file = File::create(&out_path).map_err(|error| EmbeddedAssetsError::AssetWrite {
|
||||
path: out_path.clone(),
|
||||
let icon_file_name = path.file_name().unwrap();
|
||||
let out_path = out_dir.join(icon_file_name);
|
||||
write_if_changed(&out_path, &buffer).map_err(|error| EmbeddedAssetsError::AssetWrite {
|
||||
path: path.to_owned(),
|
||||
error,
|
||||
})?;
|
||||
|
||||
out_file
|
||||
.write_all(&buffer)
|
||||
.map_err(|error| EmbeddedAssetsError::AssetWrite {
|
||||
path: path.to_owned(),
|
||||
error,
|
||||
})?;
|
||||
|
||||
let out_path = out_path.display().to_string();
|
||||
|
||||
let icon = quote!(Some(#root::Icon::Rgba { rgba: include_bytes!(#out_path).to_vec(), width: #width, height: #height }));
|
||||
let icon_file_name = icon_file_name.to_str().unwrap();
|
||||
let icon = quote!(Some(
|
||||
#root::Icon::Rgba {
|
||||
rgba: include_bytes!(concat!(std::env!("OUT_DIR"), "/", #icon_file_name)).to_vec(),
|
||||
width: #width,
|
||||
height: #height,
|
||||
}
|
||||
));
|
||||
Ok(icon)
|
||||
}
|
||||
|
||||
fn write_if_changed(out_path: &Path, data: &[u8]) -> std::io::Result<()> {
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
|
||||
if let Ok(curr) = std::fs::read(out_path) {
|
||||
if curr == data {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
let mut out_file = File::create(out_path)?;
|
||||
out_file.write_all(data)
|
||||
}
|
||||
|
||||
fn find_icon<F: Fn(&&String) -> bool>(
|
||||
config: &Config,
|
||||
config_parent: &Path,
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use base64::Engine;
|
||||
use proc_macro2::TokenStream;
|
||||
use quote::{quote, ToTokens, TokenStreamExt};
|
||||
use sha2::{Digest, Sha256};
|
||||
@@ -181,9 +182,10 @@ impl CspHashes {
|
||||
})?,
|
||||
);
|
||||
let hash = hasher.finalize();
|
||||
self
|
||||
.scripts
|
||||
.push(format!("'sha256-{}'", base64::encode(hash)));
|
||||
self.scripts.push(format!(
|
||||
"'sha256-{}'",
|
||||
base64::engine::general_purpose::STANDARD.encode(hash)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,7 +248,12 @@ impl EmbeddedAssets {
|
||||
pub fn new(
|
||||
input: impl Into<EmbeddedAssetsInput>,
|
||||
options: &AssetOptions,
|
||||
map: impl Fn(&AssetKey, &Path, &mut Vec<u8>, &mut CspHashes) -> Result<(), EmbeddedAssetsError>,
|
||||
mut map: impl FnMut(
|
||||
&AssetKey,
|
||||
&Path,
|
||||
&mut Vec<u8>,
|
||||
&mut CspHashes,
|
||||
) -> Result<(), EmbeddedAssetsError>,
|
||||
) -> Result<Self, EmbeddedAssetsError> {
|
||||
// we need to pre-compute all files now, so that we can inject data from all files into a few
|
||||
let RawEmbeddedAssets { paths, csp_hashes } = RawEmbeddedAssets::new(input.into(), options)?;
|
||||
@@ -262,7 +269,8 @@ impl EmbeddedAssets {
|
||||
assets: HashMap::new(),
|
||||
},
|
||||
move |mut state, (prefix, entry)| {
|
||||
let (key, asset) = Self::compress_file(&prefix, entry.path(), &map, &mut state.csp_hashes)?;
|
||||
let (key, asset) =
|
||||
Self::compress_file(&prefix, entry.path(), &mut map, &mut state.csp_hashes)?;
|
||||
state.assets.insert(key, asset);
|
||||
Result::<_, EmbeddedAssetsError>::Ok(state)
|
||||
},
|
||||
@@ -292,7 +300,12 @@ impl EmbeddedAssets {
|
||||
fn compress_file(
|
||||
prefix: &Path,
|
||||
path: &Path,
|
||||
map: &impl Fn(&AssetKey, &Path, &mut Vec<u8>, &mut CspHashes) -> Result<(), EmbeddedAssetsError>,
|
||||
map: &mut impl FnMut(
|
||||
&AssetKey,
|
||||
&Path,
|
||||
&mut Vec<u8>,
|
||||
&mut CspHashes,
|
||||
) -> Result<(), EmbeddedAssetsError>,
|
||||
csp_hashes: &mut CspHashes,
|
||||
) -> Result<Asset, EmbeddedAssetsError> {
|
||||
let mut input = std::fs::read(path).map_err(|error| EmbeddedAssetsError::AssetRead {
|
||||
@@ -332,14 +345,14 @@ impl EmbeddedAssets {
|
||||
|
||||
let mut hex = String::with_capacity(2 * bytes.len());
|
||||
for b in bytes {
|
||||
write!(hex, "{:02x}", b).map_err(EmbeddedAssetsError::Hex)?;
|
||||
write!(hex, "{b:02x}").map_err(EmbeddedAssetsError::Hex)?;
|
||||
}
|
||||
hex
|
||||
};
|
||||
|
||||
// use the content hash to determine filename, keep extensions that exist
|
||||
let out_path = if let Some(ext) = path.extension().and_then(|e| e.to_str()) {
|
||||
out_dir.join(format!("{}.{}", hash, ext))
|
||||
out_dir.join(format!("{hash}.{ext}"))
|
||||
} else {
|
||||
out_dir.join(hash)
|
||||
};
|
||||
@@ -420,6 +433,7 @@ impl ToTokens for EmbeddedAssets {
|
||||
|
||||
// we expect phf related items to be in path when generating the path code
|
||||
tokens.append_all(quote! {{
|
||||
#[allow(unused)]
|
||||
use ::tauri::utils::assets::{CspHash, EmbeddedAssets, phf, phf::phf_map};
|
||||
EmbeddedAssets::new(phf_map! { #assets }, &[#global_hashes], phf_map! { #html_hashes })
|
||||
}});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -57,11 +57,21 @@ pub fn get_config(path: &Path) -> Result<(Config, PathBuf), CodegenConfigError>
|
||||
// it is impossible for the content of two separate configs to get mixed up. The chances are
|
||||
// already unlikely unless the developer goes out of their way to run the cli on a different
|
||||
// project than the target crate.
|
||||
let config = if let Ok(env) = std::env::var("TAURI_CONFIG") {
|
||||
serde_json::from_str(&env).map_err(CodegenConfigError::FormatInline)?
|
||||
} else {
|
||||
serde_json::from_value(tauri_utils::config::parse::read_from(parent.clone())?)?
|
||||
};
|
||||
let mut config = serde_json::from_value(tauri_utils::config::parse::read_from(parent.clone())?)?;
|
||||
if let Ok(env) = std::env::var("TAURI_CONFIG") {
|
||||
let merge_config: serde_json::Value =
|
||||
serde_json::from_str(&env).map_err(CodegenConfigError::FormatInline)?;
|
||||
json_patch::merge(&mut config, &merge_config);
|
||||
}
|
||||
|
||||
let old_cwd = std::env::current_dir().map_err(CodegenConfigError::CurrentDir)?;
|
||||
// Set working directory to where `tauri.config.json` is, so that relative paths in it are parsed correctly.
|
||||
std::env::set_current_dir(parent.clone()).map_err(CodegenConfigError::CurrentDir)?;
|
||||
|
||||
let config = serde_json::from_value(config)?;
|
||||
|
||||
// Reset working directory.
|
||||
std::env::set_current_dir(old_cwd).map_err(CodegenConfigError::CurrentDir)?;
|
||||
|
||||
Ok((config, parent))
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
2
core/tauri-codegen/src/vendor/mod.rs
vendored
2
core/tauri-codegen/src/vendor/mod.rs
vendored
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
14
core/tauri-config-schema/Cargo.toml
Normal file
14
core/tauri-config-schema/Cargo.toml
Normal file
@@ -0,0 +1,14 @@
|
||||
[package]
|
||||
name = "tauri-config-schema"
|
||||
version = "0.0.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
[build-dependencies]
|
||||
tauri-utils = { version = "1.0.0", features = [
|
||||
"schema",
|
||||
], path = "../tauri-utils" }
|
||||
schemars = { version = "0.8.18", features = ["url", "preserve_order"] }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
url = { version = "2.3", features = ["serde"] }
|
||||
25
core/tauri-config-schema/build.rs
Normal file
25
core/tauri-config-schema/build.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use std::{
|
||||
error::Error,
|
||||
fs::File,
|
||||
io::{BufWriter, Write},
|
||||
path::PathBuf,
|
||||
};
|
||||
|
||||
pub fn main() -> Result<(), Box<dyn Error>> {
|
||||
let schema = schemars::schema_for!(tauri_utils::config::Config);
|
||||
let schema_str = serde_json::to_string_pretty(&schema).unwrap();
|
||||
let crate_dir = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR")?);
|
||||
for file in [
|
||||
crate_dir.join("schema.json"),
|
||||
crate_dir.join("../../tooling/cli/schema.json"),
|
||||
] {
|
||||
let mut schema_file = BufWriter::new(File::create(file)?);
|
||||
write!(schema_file, "{schema_str}")?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
3478
core/tauri-config-schema/schema.json
Normal file
3478
core/tauri-config-schema/schema.json
Normal file
File diff suppressed because it is too large
Load Diff
5
core/tauri-config-schema/src/main.rs
Normal file
5
core/tauri-config-schema/src/main.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
fn main() {}
|
||||
@@ -1,5 +1,89 @@
|
||||
# Changelog
|
||||
|
||||
## \[1.4.5]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `tauri-utils@1.6.0`
|
||||
- Upgraded to `tauri-codegen@1.4.4`
|
||||
|
||||
## \[1.4.4]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `tauri-utils@1.5.4`
|
||||
- Upgraded to `tauri-codegen@1.4.3`
|
||||
|
||||
## \[1.4.3]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `tauri-utils@1.5.2`
|
||||
- Upgraded to `tauri-codegen@1.4.2`
|
||||
|
||||
## \[1.4.2]
|
||||
|
||||
### Enhancements
|
||||
|
||||
- [`5e05236b`](https://www.github.com/tauri-apps/tauri/commit/5e05236b4987346697c7caae0567d3c50714c198)([#8289](https://www.github.com/tauri-apps/tauri/pull/8289)) Added tracing for window startup, plugins, `Window::eval`, events, IPC, updater and custom protocol request handlers behind the `tracing` feature flag.
|
||||
|
||||
## \[1.4.1]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `tauri-utils@1.5.0`
|
||||
- Upgraded to `tauri-codegen@1.4.1`
|
||||
|
||||
## \[1.4.0]
|
||||
|
||||
### Enhancements
|
||||
|
||||
- [`d68a25e3`](https://www.github.com/tauri-apps/tauri/commit/d68a25e32e012e57a9e5225b589b9ecbea70a887)([#6124](https://www.github.com/tauri-apps/tauri/pull/6124)) Improve compiler error message when generating an async command that has a reference input and don't return a Result.
|
||||
|
||||
## \[1.3.0]
|
||||
|
||||
- Bump minimum supported Rust version to 1.60.
|
||||
- [5fdc616d](https://www.github.com/tauri-apps/tauri/commit/5fdc616df9bea633810dcb814ac615911d77222c) feat: Use the zbus-backed of notify-rust ([#6332](https://www.github.com/tauri-apps/tauri/pull/6332)) on 2023-03-31
|
||||
|
||||
## \[1.2.1]
|
||||
|
||||
- Fix `allowlist > app > show/hide` always disabled when `allowlist > app > all: false`.
|
||||
- Bumped due to a bump in tauri-utils.
|
||||
- [bb251087](https://www.github.com/tauri-apps/tauri/commit/bb2510876d0bdff736d36bf3a465cdbe4ad2b90c) fix(core): extend allowlist with `app`'s allowlist, closes [#5650](https://www.github.com/tauri-apps/tauri/pull/5650) ([#5652](https://www.github.com/tauri-apps/tauri/pull/5652)) on 2022-11-18
|
||||
|
||||
## \[1.2.0]
|
||||
|
||||
- - [7d9aa398](https://www.github.com/tauri-apps/tauri/commit/7d9aa3987efce2d697179ffc33646d086c68030c) feat: bump MSRV to 1.59 ([#5296](https://www.github.com/tauri-apps/tauri/pull/5296)) on 2022-09-28
|
||||
|
||||
## \[1.1.1]
|
||||
|
||||
- Add missing allowlist config for `set_cursor_grab`, `set_cursor_visible`, `set_cursor_icon` and `set_cursor_position` APIs.
|
||||
- Bumped due to a bump in tauri-utils.
|
||||
- [c764408d](https://www.github.com/tauri-apps/tauri/commit/c764408da7fae123edd41115bda42fa75a4731d2) fix: Add missing allowlist config for cursor apis, closes [#5207](https://www.github.com/tauri-apps/tauri/pull/5207) ([#5211](https://www.github.com/tauri-apps/tauri/pull/5211)) on 2022-09-16
|
||||
|
||||
## \[1.1.0]
|
||||
|
||||
- Added support to configuration files in TOML format (Tauri.toml file).
|
||||
- [ae83d008](https://www.github.com/tauri-apps/tauri/commit/ae83d008f9e1b89bfc8dddaca42aa5c1fbc36f6d) feat: add support to TOML config file `Tauri.toml`, closes [#4806](https://www.github.com/tauri-apps/tauri/pull/4806) ([#4813](https://www.github.com/tauri-apps/tauri/pull/4813)) on 2022-08-02
|
||||
|
||||
## \[1.0.4]
|
||||
|
||||
- Adjust command imports to fix `items_after_statements` Clippy warning.
|
||||
- [d3e19e34](https://www.github.com/tauri-apps/tauri/commit/d3e19e3420a023cddc46173a2d1f1e6c5a390a1b) fix(macros): `items_after_statements` Clippy warning, closes [#4639](https://www.github.com/tauri-apps/tauri/pull/4639) on 2022-07-11
|
||||
- Remove raw identifier (`r#`) prefix from command arguments.
|
||||
- [ac72800f](https://www.github.com/tauri-apps/tauri/commit/ac72800fb630738e2502569935ecdc83e3e78055) fix(macros): strip `r#` from command arguments, closes [#4654](https://www.github.com/tauri-apps/tauri/pull/4654) ([#4657](https://www.github.com/tauri-apps/tauri/pull/4657)) on 2022-07-12
|
||||
|
||||
## \[1.0.3]
|
||||
|
||||
- Add `#[doc(hidden)]` attribute to the `#[command]` generated macro.
|
||||
- [d4cdf807](https://www.github.com/tauri-apps/tauri/commit/d4cdf80781a7955ac620fe6d394e82d067178c4d) feat(macros): hide command macro from docs, closes [#4550](https://www.github.com/tauri-apps/tauri/pull/4550) ([#4556](https://www.github.com/tauri-apps/tauri/pull/4556)) on 2022-07-01
|
||||
|
||||
## \[1.0.2]
|
||||
|
||||
- Expose `platform::windows_version` function.
|
||||
- Bumped due to a bump in tauri-utils.
|
||||
- [bf764e83](https://www.github.com/tauri-apps/tauri/commit/bf764e83e01e7443e6cc54572001e1c98c357465) feat(utils): expose `windows_version` function ([#4534](https://www.github.com/tauri-apps/tauri/pull/4534)) on 2022-06-30
|
||||
|
||||
## \[1.0.1]
|
||||
|
||||
- Set the bundle name and app metadata in the Info.plist file in development mode.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-macros"
|
||||
version = "1.0.1"
|
||||
version = "1.4.5"
|
||||
authors = [ "Tauri Programme within The Commons Conservancy" ]
|
||||
categories = [ "gui", "os", "filesystem", "web-programming" ]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
@@ -8,20 +8,20 @@ homepage = "https://tauri.app"
|
||||
repository = "https://github.com/tauri-apps/tauri"
|
||||
description = "Macros for the tauri crate."
|
||||
edition = "2021"
|
||||
rust-version = "1.57"
|
||||
exclude = [ ".license_template", "CHANGELOG.md", "/target" ]
|
||||
rust-version = "1.60"
|
||||
exclude = [ "CHANGELOG.md", "/target" ]
|
||||
readme = "README.md"
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
proc-macro2 = "1"
|
||||
proc-macro2 = { version = "1", features = [ "span-locations" ] }
|
||||
quote = "1"
|
||||
syn = { version = "1", features = [ "full" ] }
|
||||
heck = "0.4"
|
||||
tauri-codegen = { version = "1.0.1", default-features = false, path = "../tauri-codegen" }
|
||||
tauri-utils = { version = "1.0.1", path = "../tauri-utils" }
|
||||
heck = "0.5"
|
||||
tauri-codegen = { version = "1.4.4", default-features = false, path = "../tauri-codegen" }
|
||||
tauri-utils = { version = "1.6.0", path = "../tauri-utils" }
|
||||
|
||||
[features]
|
||||
custom-protocol = [ ]
|
||||
@@ -29,3 +29,5 @@ compression = [ "tauri-codegen/compression" ]
|
||||
isolation = [ "tauri-codegen/isolation" ]
|
||||
shell-scope = [ "tauri-codegen/shell-scope" ]
|
||||
config-json5 = [ "tauri-codegen/config-json5", "tauri-utils/config-json5" ]
|
||||
config-toml = [ "tauri-codegen/config-toml", "tauri-utils/config-toml" ]
|
||||
tracing = [ ]
|
||||
|
||||
@@ -2,15 +2,14 @@
|
||||
|
||||
<img align="right" src="https://github.com/tauri-apps/tauri/raw/dev/app-icon.png" height="128" width="128">
|
||||
|
||||
[](https://github.com/tauri-apps/tauri)
|
||||
[](https://discord.gg/SpmNs4S)
|
||||
[](https://dev.to/tauri)
|
||||
|
||||

|
||||
[](https://tauri.app)
|
||||
|
||||
[](https://github.com/tauri-apps/tauri/tree/dev)
|
||||
[](https://opencollective.com/tauri)
|
||||
[](https://github.com/tauri-apps/tauri/actions/workflows/test-core.yml)
|
||||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri?ref=badge_shield)
|
||||
[](https://discord.gg/SpmNs4S)
|
||||
[](https://tauri.app)
|
||||
[](https://good-labs.github.io/greater-good-affirmation)
|
||||
[](https://opencollective.com/tauri)
|
||||
[](https://opencollective.com/tauri)
|
||||
|
||||
| Component | Version |
|
||||
| ------------ | ------------------------------------------------------------------------------------------------------------ |
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
@@ -1,39 +1,83 @@
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use heck::{ToLowerCamelCase, ToSnakeCase};
|
||||
use proc_macro::TokenStream;
|
||||
use proc_macro2::TokenStream as TokenStream2;
|
||||
use quote::{format_ident, quote};
|
||||
use quote::{format_ident, quote, quote_spanned};
|
||||
use syn::{
|
||||
parse::{Parse, ParseBuffer},
|
||||
ext::IdentExt,
|
||||
parse::{Parse, ParseStream},
|
||||
parse_macro_input,
|
||||
spanned::Spanned,
|
||||
FnArg, Ident, ItemFn, Pat, Token, Visibility,
|
||||
FnArg, Ident, ItemFn, Lit, Meta, Pat, Token, Visibility,
|
||||
};
|
||||
|
||||
struct WrapperAttributes {
|
||||
execution_context: ExecutionContext,
|
||||
argument_case: ArgumentCase,
|
||||
}
|
||||
|
||||
impl Parse for WrapperAttributes {
|
||||
fn parse(input: ParseStream) -> syn::Result<Self> {
|
||||
let mut wrapper_attributes = WrapperAttributes {
|
||||
execution_context: ExecutionContext::Blocking,
|
||||
argument_case: ArgumentCase::Camel,
|
||||
};
|
||||
|
||||
loop {
|
||||
match input.parse::<Meta>() {
|
||||
Ok(Meta::List(_)) => {}
|
||||
Ok(Meta::NameValue(v)) => {
|
||||
if v.path.is_ident("rename_all") {
|
||||
if let Lit::Str(s) = v.lit {
|
||||
wrapper_attributes.argument_case = match s.value().as_str() {
|
||||
"snake_case" => ArgumentCase::Snake,
|
||||
"camelCase" => ArgumentCase::Camel,
|
||||
_ => {
|
||||
return Err(syn::Error::new(
|
||||
s.span(),
|
||||
"expected \"camelCase\" or \"snake_case\"",
|
||||
))
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(Meta::Path(p)) => {
|
||||
if p.is_ident("async") {
|
||||
wrapper_attributes.execution_context = ExecutionContext::Async;
|
||||
} else {
|
||||
return Err(syn::Error::new(p.span(), "expected `async`"));
|
||||
}
|
||||
}
|
||||
Err(_e) => {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
let lookahead = input.lookahead1();
|
||||
if lookahead.peek(Token![,]) {
|
||||
input.parse::<Token![,]>()?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(wrapper_attributes)
|
||||
}
|
||||
}
|
||||
|
||||
/// The execution context of the command.
|
||||
enum ExecutionContext {
|
||||
Async,
|
||||
Blocking,
|
||||
}
|
||||
|
||||
impl Parse for ExecutionContext {
|
||||
fn parse(input: &ParseBuffer<'_>) -> syn::Result<Self> {
|
||||
if input.is_empty() {
|
||||
return Ok(Self::Blocking);
|
||||
}
|
||||
|
||||
input
|
||||
.parse::<Token![async]>()
|
||||
.map(|_| Self::Async)
|
||||
.map_err(|_| {
|
||||
syn::Error::new(
|
||||
input.span(),
|
||||
"only a single item `async` is currently allowed",
|
||||
)
|
||||
})
|
||||
}
|
||||
/// The case of each argument name.
|
||||
#[derive(Copy, Clone)]
|
||||
enum ArgumentCase {
|
||||
Snake,
|
||||
Camel,
|
||||
}
|
||||
|
||||
/// The bindings we attach to `tauri::Invoke`.
|
||||
@@ -59,32 +103,128 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream {
|
||||
resolver: format_ident!("__tauri_resolver__"),
|
||||
};
|
||||
|
||||
// Tauri currently doesn't support async commands that take a reference as input and don't return
|
||||
// a result. See: https://github.com/tauri-apps/tauri/issues/2533
|
||||
//
|
||||
// For now, we provide an informative error message to the user in that case. Once #2533 is
|
||||
// resolved, this check can be removed.
|
||||
let mut async_command_check = TokenStream2::new();
|
||||
if function.sig.asyncness.is_some() {
|
||||
// This check won't catch all possible problems but it should catch the most common ones.
|
||||
let mut ref_argument_span = None;
|
||||
|
||||
for arg in &function.sig.inputs {
|
||||
if let syn::FnArg::Typed(pat) = arg {
|
||||
match &*pat.ty {
|
||||
syn::Type::Reference(_) => {
|
||||
ref_argument_span = Some(pat.span());
|
||||
}
|
||||
syn::Type::Path(path) => {
|
||||
// Check if the type contains a lifetime argument
|
||||
let last = path.path.segments.last().unwrap();
|
||||
if let syn::PathArguments::AngleBracketed(args) = &last.arguments {
|
||||
if args
|
||||
.args
|
||||
.iter()
|
||||
.any(|arg| matches!(arg, syn::GenericArgument::Lifetime(_)))
|
||||
{
|
||||
ref_argument_span = Some(pat.span());
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
if let Some(span) = ref_argument_span {
|
||||
if let syn::ReturnType::Type(_, return_type) = &function.sig.output {
|
||||
// To check if the return type is `Result` we require it to check a trait that is
|
||||
// only implemented by `Result`. That way we don't exclude renamed result types
|
||||
// which we wouldn't otherwise be able to detect purely from the token stream.
|
||||
// The "error message" displayed to the user is simply the trait name.
|
||||
async_command_check = quote_spanned! {return_type.span() =>
|
||||
#[allow(unreachable_code, clippy::diverging_sub_expression)]
|
||||
const _: () = if false {
|
||||
trait AsyncCommandMustReturnResult {}
|
||||
impl<A, B> AsyncCommandMustReturnResult for ::std::result::Result<A, B> {}
|
||||
let _check: #return_type = unreachable!();
|
||||
let _: &dyn AsyncCommandMustReturnResult = &_check;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
return quote_spanned! {
|
||||
span => compile_error!("async commands that contain references as inputs must return a `Result`");
|
||||
}.into();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// body to the command wrapper or a `compile_error!` of an error occurred while parsing it.
|
||||
let body = syn::parse::<ExecutionContext>(attributes)
|
||||
.map(|context| match function.sig.asyncness {
|
||||
Some(_) => ExecutionContext::Async,
|
||||
None => context,
|
||||
let (body, attributes) = syn::parse::<WrapperAttributes>(attributes)
|
||||
.map(|mut attrs| {
|
||||
if function.sig.asyncness.is_some() {
|
||||
attrs.execution_context = ExecutionContext::Async;
|
||||
}
|
||||
attrs
|
||||
})
|
||||
.and_then(|context| match context {
|
||||
ExecutionContext::Async => body_async(&function, &invoke),
|
||||
ExecutionContext::Blocking => body_blocking(&function, &invoke),
|
||||
.and_then(|attrs| {
|
||||
let body = match attrs.execution_context {
|
||||
ExecutionContext::Async => body_async(&function, &invoke, attrs.argument_case),
|
||||
ExecutionContext::Blocking => body_blocking(&function, &invoke, attrs.argument_case),
|
||||
};
|
||||
body.map(|b| (b, Some(attrs)))
|
||||
})
|
||||
.unwrap_or_else(syn::Error::into_compile_error);
|
||||
.unwrap_or_else(|e| (syn::Error::into_compile_error(e), None));
|
||||
|
||||
let Invoke { message, resolver } = invoke;
|
||||
|
||||
let kind = match attributes.as_ref().map(|a| &a.execution_context) {
|
||||
Some(ExecutionContext::Async) if function.sig.asyncness.is_none() => "sync_threadpool",
|
||||
Some(ExecutionContext::Async) => "async",
|
||||
Some(ExecutionContext::Blocking) => "sync",
|
||||
_ => "sync",
|
||||
};
|
||||
|
||||
let loc = function.span().start();
|
||||
let line = loc.line;
|
||||
let col = loc.column;
|
||||
|
||||
let maybe_span = if cfg!(feature = "tracing") {
|
||||
quote!({
|
||||
let _span = tracing::debug_span!(
|
||||
"ipc::request::handler",
|
||||
cmd = #message.command(),
|
||||
kind = #kind,
|
||||
loc.line = #line,
|
||||
loc.col = #col,
|
||||
is_internal = false,
|
||||
)
|
||||
.entered();
|
||||
})
|
||||
} else {
|
||||
quote!()
|
||||
};
|
||||
|
||||
// Rely on rust 2018 edition to allow importing a macro from a path.
|
||||
quote!(
|
||||
#async_command_check
|
||||
|
||||
#function
|
||||
|
||||
#maybe_macro_export
|
||||
#[doc(hidden)]
|
||||
macro_rules! #wrapper {
|
||||
// double braces because the item is expected to be a block expression
|
||||
($path:path, $invoke:ident) => {{
|
||||
#[allow(unused_imports)]
|
||||
use ::tauri::command::private::*;
|
||||
// prevent warnings when the body is a `compile_error!` or if the command has no arguments
|
||||
#[allow(unused_variables)]
|
||||
let ::tauri::Invoke { message: #message, resolver: #resolver } = $invoke;
|
||||
|
||||
#maybe_span
|
||||
|
||||
#body
|
||||
}};
|
||||
}
|
||||
@@ -101,13 +241,24 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream {
|
||||
/// See the [`tauri::command`] module for all the items and traits that make this possible.
|
||||
///
|
||||
/// [`tauri::command`]: https://docs.rs/tauri/*/tauri/runtime/index.html
|
||||
fn body_async(function: &ItemFn, invoke: &Invoke) -> syn::Result<TokenStream2> {
|
||||
fn body_async(function: &ItemFn, invoke: &Invoke, case: ArgumentCase) -> syn::Result<TokenStream2> {
|
||||
let Invoke { message, resolver } = invoke;
|
||||
parse_args(function, message).map(|args| {
|
||||
parse_args(function, message, case).map(|args| {
|
||||
#[cfg(feature = "tracing")]
|
||||
quote! {
|
||||
#[allow(unused_imports)]
|
||||
use ::tauri::command::private::*;
|
||||
use tracing::Instrument;
|
||||
|
||||
let span = tracing::debug_span!("ipc::request::run");
|
||||
#resolver.respond_async_serialized(async move {
|
||||
let result = $path(#(#args?),*);
|
||||
let kind = (&result).async_kind();
|
||||
kind.future(result).await
|
||||
}
|
||||
.instrument(span));
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "tracing"))]
|
||||
quote! {
|
||||
#resolver.respond_async_serialized(async move {
|
||||
let result = $path(#(#args?),*);
|
||||
let kind = (&result).async_kind();
|
||||
@@ -122,9 +273,13 @@ fn body_async(function: &ItemFn, invoke: &Invoke) -> syn::Result<TokenStream2> {
|
||||
/// See the [`tauri::command`] module for all the items and traits that make this possible.
|
||||
///
|
||||
/// [`tauri::command`]: https://docs.rs/tauri/*/tauri/runtime/index.html
|
||||
fn body_blocking(function: &ItemFn, invoke: &Invoke) -> syn::Result<TokenStream2> {
|
||||
fn body_blocking(
|
||||
function: &ItemFn,
|
||||
invoke: &Invoke,
|
||||
case: ArgumentCase,
|
||||
) -> syn::Result<TokenStream2> {
|
||||
let Invoke { message, resolver } = invoke;
|
||||
let args = parse_args(function, message)?;
|
||||
let args = parse_args(function, message, case)?;
|
||||
|
||||
// the body of a `match` to early return any argument that wasn't successful in parsing.
|
||||
let match_body = quote!({
|
||||
@@ -132,10 +287,14 @@ fn body_blocking(function: &ItemFn, invoke: &Invoke) -> syn::Result<TokenStream2
|
||||
Err(err) => return #resolver.invoke_error(err),
|
||||
});
|
||||
|
||||
Ok(quote! {
|
||||
#[allow(unused_imports)]
|
||||
use ::tauri::command::private::*;
|
||||
let maybe_span = if cfg!(feature = "tracing") {
|
||||
quote!(let _span = tracing::debug_span!("ipc::request::run").entered();)
|
||||
} else {
|
||||
quote!()
|
||||
};
|
||||
|
||||
Ok(quote! {
|
||||
#maybe_span
|
||||
let result = $path(#(match #args #match_body),*);
|
||||
let kind = (&result).blocking_kind();
|
||||
kind.block(result, #resolver);
|
||||
@@ -143,17 +302,26 @@ fn body_blocking(function: &ItemFn, invoke: &Invoke) -> syn::Result<TokenStream2
|
||||
}
|
||||
|
||||
/// Parse all arguments for the command wrapper to use from the signature of the command function.
|
||||
fn parse_args(function: &ItemFn, message: &Ident) -> syn::Result<Vec<TokenStream2>> {
|
||||
fn parse_args(
|
||||
function: &ItemFn,
|
||||
message: &Ident,
|
||||
case: ArgumentCase,
|
||||
) -> syn::Result<Vec<TokenStream2>> {
|
||||
function
|
||||
.sig
|
||||
.inputs
|
||||
.iter()
|
||||
.map(|arg| parse_arg(&function.sig.ident, arg, message))
|
||||
.map(|arg| parse_arg(&function.sig.ident, arg, message, case))
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Transform a [`FnArg`] into a command argument.
|
||||
fn parse_arg(command: &Ident, arg: &FnArg, message: &Ident) -> syn::Result<TokenStream2> {
|
||||
fn parse_arg(
|
||||
command: &Ident,
|
||||
arg: &FnArg,
|
||||
message: &Ident,
|
||||
case: ArgumentCase,
|
||||
) -> syn::Result<TokenStream2> {
|
||||
// we have no use for self arguments
|
||||
let mut arg = match arg {
|
||||
FnArg::Typed(arg) => arg.pat.as_ref().clone(),
|
||||
@@ -167,7 +335,7 @@ fn parse_arg(command: &Ident, arg: &FnArg, message: &Ident) -> syn::Result<Token
|
||||
|
||||
// we only support patterns that allow us to extract some sort of keyed identifier
|
||||
let mut key = match &mut arg {
|
||||
Pat::Ident(arg) => arg.ident.to_string(),
|
||||
Pat::Ident(arg) => arg.ident.unraw().to_string(),
|
||||
Pat::Wild(_) => "".into(), // we always convert to camelCase, so "_" will end up empty anyways
|
||||
Pat::Struct(s) => super::path_to_command(&mut s.path).ident.to_string(),
|
||||
Pat::TupleStruct(s) => super::path_to_command(&mut s.path).ident.to_string(),
|
||||
@@ -187,9 +355,13 @@ fn parse_arg(command: &Ident, arg: &FnArg, message: &Ident) -> syn::Result<Token
|
||||
));
|
||||
}
|
||||
|
||||
// snake_case -> camelCase
|
||||
if key.as_str().contains('_') {
|
||||
key = snake_case_to_camel_case(key.as_str());
|
||||
match case {
|
||||
ArgumentCase::Camel => {
|
||||
key = key.to_lower_camel_case();
|
||||
}
|
||||
ArgumentCase::Snake => {
|
||||
key = key.to_snake_case();
|
||||
}
|
||||
}
|
||||
|
||||
Ok(quote!(::tauri::command::CommandArg::from_command(
|
||||
@@ -200,19 +372,3 @@ fn parse_arg(command: &Ident, arg: &FnArg, message: &Ident) -> syn::Result<Token
|
||||
}
|
||||
)))
|
||||
}
|
||||
|
||||
/// Convert a snake_case string into camelCase, no underscores will be left.
|
||||
fn snake_case_to_camel_case(key: &str) -> String {
|
||||
let mut camel = String::with_capacity(key.len());
|
||||
let mut to_upper = false;
|
||||
|
||||
for c in key.chars() {
|
||||
match c {
|
||||
'_' => to_upper = true,
|
||||
c if std::mem::take(&mut to_upper) => camel.push(c.to_ascii_uppercase()),
|
||||
c => camel.push(c),
|
||||
}
|
||||
}
|
||||
|
||||
camel
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -272,12 +272,12 @@ pub fn command_handler(attributes: HandlerAttributes, function: ItemFn) -> Token
|
||||
pub fn command_test(attributes: HandlerTestAttributes, function: ItemFn) -> TokenStream2 {
|
||||
let allowlist = attributes.allowlist;
|
||||
let error_message = attributes.error_message.as_str();
|
||||
let signature = function.sig.clone();
|
||||
let signature = &function.sig;
|
||||
|
||||
let enum_variant_name = function.sig.ident.to_string().to_lower_camel_case();
|
||||
let response = match attributes.allowlist_check_kind {
|
||||
AllowlistCheckKind::Runtime => {
|
||||
let test_name = function.sig.ident.clone();
|
||||
let test_name = &signature.ident;
|
||||
quote!(super::Cmd::#test_name(crate::test::mock_invoke_context()))
|
||||
}
|
||||
AllowlistCheckKind::Serde => quote! {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -11,7 +11,7 @@ use syn::{
|
||||
LitStr, PathArguments, PathSegment, Token,
|
||||
};
|
||||
use tauri_codegen::{context_codegen, get_config, ContextData};
|
||||
use tauri_utils::config::parse::does_supported_extension_exist;
|
||||
use tauri_utils::config::parse::does_supported_file_name_exist;
|
||||
|
||||
pub(crate) struct ContextItems {
|
||||
config_file: PathBuf,
|
||||
@@ -36,7 +36,7 @@ impl Parse for ContextItems {
|
||||
VarError::NotUnicode(_) => "CARGO_MANIFEST_DIR env var contained invalid utf8".into(),
|
||||
})
|
||||
.and_then(|path| {
|
||||
if does_supported_extension_exist(&path) {
|
||||
if does_supported_file_name_exist(&path) {
|
||||
Ok(path)
|
||||
} else {
|
||||
Err(format!(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -88,7 +88,7 @@ pub fn derive_command_module(input: TokenStream) -> TokenStream {
|
||||
/// The `run` method takes a `tauri::endpoints::InvokeContext`
|
||||
/// and returns a `tauri::Result<tauri::endpoints::InvokeResponse>`.
|
||||
/// It matches on each enum variant and call a method with name equal to the variant name, lowercased and snake_cased,
|
||||
/// passing the the context and the variant's fields as arguments.
|
||||
/// passing the context and the variant's fields as arguments.
|
||||
/// That function must also return the same `Result<InvokeResponse>`.
|
||||
#[doc(hidden)]
|
||||
#[proc_macro_attribute]
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user