Compare commits
1057 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
3a96c7717d | ||
|
c01dcd2338 | ||
|
83a58bb9d6 | ||
|
30b697d3fe | ||
|
11721f487d | ||
|
6570e43a83 | ||
|
6628873c2a | ||
|
edf91b245d | ||
|
a4c339264a | ||
|
9a50bd7d61 | ||
|
1b3ddbbf4a | ||
|
24d2782ad3 | ||
|
f216c84175 | ||
|
b5d105132e | ||
|
0aec0a1ac4 | ||
|
506027925d | ||
|
0294373929 | ||
|
23e58ebaf5 | ||
|
3e3c4f09f9 | ||
|
cd7390e093 | ||
|
d63f078fd4 | ||
|
75322f2bcb | ||
|
b8a0240aaf | ||
|
8c8235cfcf | ||
|
f3e9b6bfb0 | ||
|
ca4cf852aa | ||
|
2d19f45c86 | ||
|
2d408acbab | ||
|
3792d72462 | ||
|
36e491754f | ||
|
a2832f4d55 | ||
|
8a07ffe6c8 | ||
|
4fc1657f2c | ||
|
5e74e20a4d | ||
|
1ab0c7b493 | ||
|
9a0ba05d13 | ||
|
186f4d318d | ||
|
f2b4e42ca2 | ||
|
3fb698c08b | ||
|
6f31ea8e03 | ||
|
974473aa99 | ||
|
13e2b5ee73 | ||
|
6db81656ac | ||
|
e53d1ee28a | ||
|
a97dbecb49 | ||
|
9e1b14cd9e | ||
|
3b088c3383 | ||
|
149849d22b | ||
|
e769dd97d8 | ||
|
e409bfb43a | ||
|
82096a1465 | ||
|
af89315fd4 | ||
|
104646d8ca | ||
|
aa812d0e48 | ||
|
0a6a581936 | ||
|
0cb4a49d38 | ||
|
172bd0a88e | ||
|
420f0016c6 | ||
|
a1fbbc6070 | ||
|
b8126cdc6c | ||
|
54d78926ce | ||
|
3a69a040c4 | ||
|
1712b38282 | ||
|
44ea3c1555 | ||
|
19aed1d63e | ||
|
70153cc16c | ||
|
f3633a256b | ||
|
d8dec0f85a | ||
|
080d16cabf | ||
|
3156cb207f | ||
|
f32d37a3d5 | ||
|
893b3e3957 | ||
|
215f0a9d6d | ||
|
c1a5219b03 | ||
|
26a7f72124 | ||
|
4692e97ba0 | ||
|
fc6485b8cd | ||
|
36406ce17c | ||
|
c878ceeabd | ||
|
01c0c4ed3b | ||
|
fc68765314 | ||
|
292bbc43d6 | ||
|
b15894b70a | ||
|
85ff2f06c2 | ||
|
7afddfd204 | ||
|
3138a438af | ||
|
88f1f3cab9 | ||
|
19e15a4455 | ||
|
5fd3240f85 | ||
|
e255cdd562 | ||
|
d06f7b989e | ||
|
3782644b32 | ||
|
b17f08ed49 | ||
|
c09405d58c | ||
|
3f9f0f3ceb | ||
|
92e83193c4 | ||
|
13eacf8858 | ||
|
220d2582c9 | ||
|
ed6223c0c0 | ||
|
ba38a2c784 | ||
|
996267dbcb | ||
|
4266409934 | ||
|
483e399158 | ||
|
5496554cbf | ||
|
9e1bcd8557 | ||
|
cac197f5a6 | ||
|
65c57d6a01 | ||
|
83c6997f29 | ||
|
53872e2521 | ||
|
53a8842abb | ||
|
83cef5b12f | ||
|
9808358e08 | ||
|
7e96b65790 | ||
|
627255c0e4 | ||
|
c3291912b3 | ||
|
2359ccde78 | ||
|
9fe1e77274 | ||
|
cfc3696013 | ||
|
b0b255072c | ||
|
b842a9e1d9 | ||
|
98e25ea1ee | ||
|
045e6bc16d | ||
|
fb4917c03c | ||
|
287c48f7e3 | ||
|
1813748eaa | ||
|
8035456330 | ||
|
08eaae7223 | ||
|
894142d589 | ||
|
2f9959da26 | ||
|
ba27f9d1ec | ||
|
35f3335efc | ||
|
811b46ae63 | ||
|
5498d3ad61 | ||
|
707115ee7e | ||
|
49af711502 | ||
|
a1f4d2b8ed | ||
|
3614c8d82b | ||
|
eea87c3abc | ||
|
5a257aac85 | ||
|
efefc1eb7f | ||
|
8166c81135 | ||
|
40db73d1a8 | ||
|
ab6f3e1c60 | ||
|
5dd33acc91 | ||
|
e6a79d5c73 | ||
|
e9184c793e | ||
|
c2a0ccf0d4 | ||
|
8e29e7c1e1 | ||
|
f992e63ac5 | ||
|
582533dbc6 | ||
|
05dd228317 | ||
|
1daed063f3 | ||
|
260e60b4b1 | ||
|
efdcfec88f | ||
|
48cbf3802e | ||
|
94885d41f1 | ||
|
a1ce49534d | ||
|
c96564d23d | ||
|
276de5c122 | ||
|
585df10ee8 | ||
|
7a6f667bf1 | ||
|
0a6a184fed | ||
|
68c038579c | ||
|
e1b401ca36 | ||
|
ec0a829110 | ||
|
d16e918c52 | ||
|
7f854ec13e | ||
|
272eb940f1 | ||
|
bc4c8f9fd9 | ||
|
0faefad0c1 | ||
|
29c2151d8d | ||
|
572f525734 | ||
|
80c89a48a1 | ||
|
7986ca97a3 | ||
|
4ca1bfeff6 | ||
|
40c600434e | ||
|
29bb669adf | ||
|
206bf414ec | ||
|
5a18ccdbe2 | ||
|
fd180de774 | ||
|
7d37b2e84b | ||
|
97c8bbde12 | ||
|
fbf7a6feb5 | ||
|
64f865a639 | ||
|
c5a8f447b1 | ||
|
a9a21d0aa6 | ||
![]() |
88c9b046ed | ||
![]() |
22eb898e8c | ||
|
bfcd15e4a9 | ||
|
4d089ecc79 | ||
|
2e1fa58ea5 | ||
|
f174de70af | ||
|
44d8da2520 | ||
|
b4d144a546 | ||
|
fba952d5ec | ||
|
4d4918cdaf | ||
|
477fedd1b6 | ||
|
bd95b3d243 | ||
|
acbffc8485 | ||
|
8123124c80 | ||
|
b6c71ae58b | ||
|
a6a2209902 | ||
|
ef490a9921 | ||
|
cfe21e1a60 | ||
|
8a95fbe878 | ||
|
5c3837f5f3 | ||
|
578d197dd6 | ||
|
e5acf77eea | ||
|
f03129728f | ||
|
8a65d8b6dc | ||
|
0fcef77d7b | ||
|
e3a59aa50e | ||
|
13e079e8f3 | ||
|
508f4eacdf | ||
|
a999150c19 | ||
|
cbf6495d66 | ||
|
07eaeea7a4 | ||
|
638690255c | ||
|
6c2ba945be | ||
|
db6be5286e | ||
|
67b6c24d7b | ||
|
b2095801ba | ||
|
e87f429703 | ||
|
41384fab7b | ||
|
342aebe1d7 | ||
|
1745c23a12 | ||
|
ccdea0f31b | ||
|
c1a28f3f54 | ||
|
0429704d5e | ||
|
36e70c9ca0 | ||
|
de36e85004 | ||
|
651c527e94 | ||
|
2cb46cf3e2 | ||
|
584dfe961e | ||
|
a38ec3d7a4 | ||
|
b043669972 | ||
|
e65b1ef654 | ||
|
07eac0c6e2 | ||
|
64e2459427 | ||
|
f350c7a58e | ||
|
e0ae96368c | ||
|
e1c9d8800e | ||
|
084d5935e6 | ||
|
fc88b2f774 | ||
|
5ac5624e3f | ||
|
16f676eccf | ||
|
0767f4d105 | ||
|
a93e5d63c9 | ||
|
d74a1069a0 | ||
|
633cdc9088 | ||
|
ede65bbce4 | ||
|
4135420cba | ||
|
07c0d539bd | ||
|
ac7c85c0a6 | ||
|
83b27417ae | ||
|
884f147742 | ||
|
a96a36ef59 | ||
|
1bd4123df1 | ||
|
92b76447b7 | ||
|
e637cf2d72 | ||
|
9b96a5362a | ||
|
e5743e851b | ||
|
f7bc0ad248 | ||
|
8c53c2dcca | ||
|
be51bc44a4 | ||
|
5eba2d42bd | ||
|
2049c85a6c | ||
|
ecd7790dd8 | ||
|
0f08aa53da | ||
|
5bf93e81ba | ||
|
4f1231f411 | ||
|
b280a19b0a | ||
|
63a463d011 | ||
|
adb87e347f | ||
|
2d52b5a873 | ||
|
6c61cd5f05 | ||
|
bfc3b2f86f | ||
|
a1278cee05 | ||
|
e983c4a5ef | ||
|
7f97e8b232 | ||
|
089095f532 | ||
|
ac8eb111a9 | ||
|
073f49d0d0 | ||
|
67915b5905 | ||
|
015df9c512 | ||
|
f7f134274c | ||
|
aeb9549af7 | ||
|
f3498a2959 | ||
|
9d2ca758fa | ||
|
9650c1903d | ||
|
f4840a0148 | ||
|
198e99d30c | ||
|
cd0191c247 | ||
|
7ec0ef8470 | ||
|
b88cf7ff67 | ||
|
20fe53b254 | ||
|
f99da09716 | ||
|
5960dd888d | ||
|
b0a0007d6e | ||
|
73a4a6d29f | ||
|
0be0e9fc01 | ||
|
ddf748a99d | ||
|
4d16ee4ed4 | ||
|
b72efaaaca | ||
|
6327893b9b | ||
|
8c3ee81d6e | ||
|
fb07dcff40 | ||
|
27f42c90db | ||
|
688bd4ef72 | ||
|
42bba10894 | ||
|
495d8da596 | ||
|
869a33eb13 | ||
|
050893f15a | ||
|
8aa67abdb2 | ||
|
2e321fc69f | ||
|
aa2610c2dd | ||
|
293b657aef | ||
|
d6591439d1 | ||
|
2ef674edd3 | ||
|
22a60e82b0 | ||
|
34739ec652 | ||
|
b9b0217a07 | ||
|
7c2683fe52 | ||
|
ee73f556b4 | ||
|
34b68cf1d2 | ||
|
8975019269 | ||
|
6e6b1369ac | ||
|
25b8c94788 | ||
|
3fce27c48c | ||
|
32a973ebd1 | ||
|
c37f5956e4 | ||
|
0875b6b542 | ||
|
b29e144649 | ||
|
f00116c3a6 | ||
|
f1baf8336b | ||
|
36eae205e1 | ||
|
ad5b3410f0 | ||
|
e2dbff0ca6 | ||
|
96eb94afd0 | ||
|
9100019c0a | ||
|
21f814b2a6 | ||
|
499d28d021 | ||
|
d697bbe0a5 | ||
|
67a3841164 | ||
|
6ac38d188c | ||
|
8216c54b05 | ||
|
968c075e39 | ||
|
26dbe8b4ff | ||
|
a5c2f7f27a | ||
|
10811e1a94 | ||
|
10f4bceac0 | ||
|
47717324d4 | ||
|
1043c35f2b | ||
|
fde89b056d | ||
|
a08a57b33c | ||
|
31de91bbac | ||
|
e6e224ce48 | ||
|
a04a6b5e8f | ||
|
442d84ccfc | ||
|
4a2ccc658e | ||
|
58622fa747 | ||
|
90cded3819 | ||
|
d1e188341b | ||
|
0f2350308e | ||
|
9b120eded9 | ||
|
a218880216 | ||
|
1a2802028b | ||
|
a37b286bae | ||
|
dcfdb955b3 | ||
|
72cefead02 | ||
|
884e064a99 | ||
|
3ed9bec05c | ||
|
dadf0473b7 | ||
|
947230958d | ||
|
095c991b85 | ||
|
825da1e868 | ||
|
5a25805cb5 | ||
|
adff8d96dd | ||
|
8c270e68cc | ||
|
a2aa1b7fca | ||
|
ae956f06fb | ||
|
8c0eed3c75 | ||
|
4e4ef06de1 | ||
|
a53c14dc75 | ||
|
c99fc9c4da | ||
|
2fb857d73d | ||
|
e6dfe04388 | ||
|
5e40e4b682 | ||
|
7c891db9af | ||
|
6d916ab063 | ||
|
59d680f4e9 | ||
|
be305b5d0f | ||
|
d676d917e3 | ||
|
838fc3f019 | ||
|
296982a29e | ||
|
1d0668692b | ||
|
39e512f691 | ||
|
0f250490d4 | ||
|
eeae39d707 | ||
|
ce517689ff | ||
|
9c82ba783f | ||
|
1c8e8d3aec | ||
|
cc27d85110 | ||
|
cd5324378d | ||
|
c6ae314202 | ||
|
73224c62b5 | ||
|
2c6a4485f5 | ||
|
cf005df828 | ||
|
f539d68049 | ||
|
39996512fc | ||
|
2dc5a16d1f | ||
|
d667ebd66e | ||
|
2b8217ce8d | ||
|
9dac56e824 | ||
|
a7e8aec3d9 | ||
|
6b5bf570c8 | ||
|
a130ac2f9c | ||
|
19fd066507 | ||
|
204e849218 | ||
|
8ff13c922a | ||
|
af219f8836 | ||
|
e33123f955 | ||
|
755fa07b39 | ||
|
2701d80078 | ||
|
c393ed1381 | ||
|
a4bdd9cd9b | ||
|
4a4325afb6 | ||
|
586eb6102a | ||
|
b1e6793460 | ||
|
8b17459254 | ||
|
195c166efe | ||
|
0908d3a173 | ||
|
f304990656 | ||
|
cea3865c74 | ||
|
b74c0d4766 | ||
|
54e863cef2 | ||
|
1938792517 | ||
|
aa71dbb5bd | ||
|
8dc46c0a87 | ||
|
1180afed9c | ||
|
1562bce9b4 | ||
|
a9514513a7 | ||
|
cf809b8e8b | ||
|
d7ff5c0689 | ||
|
e3156279fc | ||
|
0ce42d83e0 | ||
|
afc1108659 | ||
|
a15bf6e701 | ||
|
74fc37efc8 | ||
|
5824dbda66 | ||
|
e96a09e5ff | ||
|
9e20dfeea1 | ||
|
6e04631862 | ||
|
88b23ebb3d | ||
|
018916403e | ||
|
af38fd31f8 | ||
|
1e0ebdae2f | ||
|
1adbafe950 | ||
|
e51ca95713 | ||
|
a803421739 | ||
|
011c1964a0 | ||
|
05d205cf89 | ||
|
0a4f7bd558 | ||
|
cea862a6bf | ||
|
cc02a20c9e | ||
|
98fda9c587 | ||
|
2eed95f3e4 | ||
|
e5d3baca81 | ||
|
dee93017f7 | ||
|
e167642672 | ||
|
e9bb1efb03 | ||
|
3f7d03b443 | ||
|
ffce716557 | ||
|
fcfb19e9cf | ||
|
c5f105a7b6 | ||
|
b062d23947 | ||
|
7fc6fcb38c | ||
|
bc7e504b29 | ||
|
3d8afa9e90 | ||
|
a1e47e37ae | ||
|
e0bc0ebe29 | ||
|
498c0ff4bf | ||
|
d42d43e90f | ||
|
bfc6319daa | ||
|
74ce5afd9e | ||
|
c11faf2d56 | ||
|
5fad8008ab | ||
|
948ade4b1c | ||
|
b1a7f2b4d9 | ||
|
d44a6d936f | ||
|
1fc8472d35 | ||
|
c235301b52 | ||
|
2fb81500c1 | ||
|
68d9209dd9 | ||
|
e91569cdad | ||
|
f31917aa01 | ||
|
74202aecff | ||
|
9c2108c69e | ||
|
3d2836a947 | ||
|
e4856a2264 | ||
|
a2ee0f65bd | ||
|
85352c4e45 | ||
|
7d7b7b9e18 | ||
|
62d8a911ff | ||
|
ca46c67e9e | ||
|
5bb2265083 | ||
|
ab3bf40c7d | ||
|
f273e80c77 | ||
|
1471be54e3 | ||
|
f039835249 | ||
|
f793ba2d6b | ||
|
9f72ad05ce | ||
|
14f3827491 | ||
|
0d96098fd9 | ||
|
42e3b78f04 | ||
|
3ad49d27d9 | ||
|
3331a9e480 | ||
|
7890672ecc | ||
|
d7bfbf3646 | ||
|
6d271c05f6 | ||
|
a9bddf87ff | ||
|
88994129ae | ||
|
888892885e | ||
|
de79f2a1d4 | ||
|
6368416178 | ||
|
a935a222b5 | ||
|
7c4da0a341 | ||
|
b047af25ca | ||
|
2abd9dd91b | ||
|
afadc5cf6b | ||
|
8823cc357a | ||
|
8b8d9a05b7 | ||
|
15668aceb6 | ||
|
e25fe994b3 | ||
|
47abe1c482 | ||
|
95169c3150 | ||
|
7331de78bd | ||
|
05f36a835a | ||
|
dcd9438488 | ||
|
d38db1292c | ||
|
4463fe0856 | ||
|
2156de5fb5 | ||
|
b1c749075d | ||
|
367a93de88 | ||
|
2643b96589 | ||
|
016a10df26 | ||
|
cbcf07f08a | ||
|
59bcac3289 | ||
|
bd90192df9 | ||
|
e7fcf1ee65 | ||
|
f86c74ce7e | ||
|
d5ad51bccc | ||
|
0bdf36f5d1 | ||
|
1b9053bc5d | ||
|
446101a168 | ||
|
f0324035bf | ||
|
a2f94cbf9a | ||
|
d21fa68033 | ||
|
5a6d84abc9 | ||
|
61ae484316 | ||
|
42657017bd | ||
|
9b9a344934 | ||
|
5f92ba49a7 | ||
|
2e564c21cd | ||
|
ca7d4d1633 | ||
|
3645f43cea | ||
|
9378a7a439 | ||
|
d3e02b15fa | ||
|
80d527814e | ||
|
5121fef5d8 | ||
|
0d026bd1a0 | ||
|
719fa3cca3 | ||
|
307cf09434 | ||
|
8691cdaed6 | ||
|
4a6b1e19b8 | ||
|
31ce3ab866 | ||
|
0846439c8e | ||
|
000d1436b4 | ||
|
1bc97a5e48 | ||
|
68f7001ed4 | ||
|
59446294b3 | ||
|
460370b7d3 | ||
|
cbea5d44b8 | ||
|
b4b009c2d8 | ||
|
74dd627495 | ||
|
58f0cca7c7 | ||
|
3de3575ac4 | ||
|
390fade8c0 | ||
|
96dfe068ee | ||
|
e0eb37fce0 | ||
|
79355ab72d | ||
|
5a9f29debb | ||
|
8b8932811e | ||
|
604a9a98a9 | ||
|
71321f763a | ||
|
7fa0816d81 | ||
|
4840495d3f | ||
|
866bf101b2 | ||
|
3467308874 | ||
|
ef2c693b05 | ||
|
efac22a508 | ||
|
4b97375524 | ||
|
ab9d06abf5 | ||
|
5ee32fbefc | ||
|
899664dddd | ||
|
b66642cb86 | ||
|
b9ae948ce9 | ||
|
138521ccc2 | ||
|
5514722ce2 | ||
|
56e133ab4c | ||
|
f6415889ca | ||
|
885b4cbdfb | ||
|
8461aeaef0 | ||
|
3df41aefdb | ||
|
8bc89651d6 | ||
|
c5f2444048 | ||
|
130a9a2aa2 | ||
|
dd97fcc968 | ||
|
4f51871fa8 | ||
|
e96d14395c | ||
|
852db1d885 | ||
|
3f79439718 | ||
|
96d93f2982 | ||
|
236bcc1a39 | ||
|
4b5ae211da | ||
|
aaa018bbea | ||
|
6bdd39d0ed | ||
|
da678ef971 | ||
|
e9078374c9 | ||
|
f23a669ed0 | ||
|
9ddda3c630 | ||
|
8ab01fde6e | ||
|
440c719190 | ||
|
e522b2dee4 | ||
|
b26e637c81 | ||
|
6b7f6980f9 | ||
|
4248fd9d4c | ||
|
5a65261a55 | ||
|
5719132f58 | ||
|
10b316f315 | ||
|
b6498987fa | ||
|
9680ae98a6 | ||
|
59755d2874 | ||
|
64c37767c2 | ||
|
50ec35575f | ||
|
ed3b54b603 | ||
|
ed5c5a799f | ||
|
d19da9e528 | ||
|
0962c5220c | ||
|
b9972cee6e | ||
|
98c1c180af | ||
|
6f6e0ce339 | ||
|
bdae838516 | ||
|
6d8ee77791 | ||
|
9725d5b21b | ||
|
8e48edaa0b | ||
|
89394a2dd6 | ||
|
02a2309b2a | ||
|
8f181c7259 | ||
|
339c5574b8 | ||
|
8d5bbecd3d | ||
|
dd12907632 | ||
|
7d7d9a7ef0 | ||
|
63570613d3 | ||
|
4e2011c381 | ||
|
7a60399b2b | ||
|
a0b3586fb3 | ||
|
a2ef8978cd | ||
|
d02f4a94de | ||
|
b7890fa2a8 | ||
|
1e4d0abc66 | ||
|
eb2aeb3adb | ||
|
fad2ee1a64 | ||
|
ba9bd4eae3 | ||
|
e12b78f99b | ||
|
5d1cee2bf0 | ||
|
5c711a7076 | ||
|
838ef47847 | ||
|
786ccddd7b | ||
|
b747286c1d | ||
|
bb3c2b2498 | ||
|
36e732aabd | ||
|
d6517ae288 | ||
|
93d327acfb | ||
|
01c6c79efb | ||
|
357ca78f9f | ||
|
6e46eec58f | ||
|
554d8cdf76 | ||
|
328ec7dc4d | ||
|
2e66f8d828 | ||
|
e224a29d1c | ||
|
238d7ba98f | ||
|
d6ba8326d1 | ||
|
f7df575746 | ||
|
2b52c73d70 | ||
|
7a45fb39bf | ||
|
1080cf22e3 | ||
|
1d09227374 | ||
|
85031baaf2 | ||
|
7f71cac3b0 | ||
|
48a8f883ba | ||
|
6132a59772 | ||
|
8309cfc976 | ||
|
abc9fdb37c | ||
|
b872751d68 | ||
|
8368338c93 | ||
|
45c44d293c | ||
|
b4a889553c | ||
|
78cdf3cadc | ||
|
be78bfbd8c | ||
|
c5d4485db3 | ||
|
71f1d99494 | ||
|
0e99980206 | ||
|
292bfed102 | ||
|
78d6988461 | ||
|
3499e2e0ef | ||
|
b1821ab4cd | ||
|
006f6460a9 | ||
|
db5bc092aa | ||
|
9fe20fd2fc | ||
|
7b87ded288 | ||
|
eaaf0fdfe2 | ||
|
4caed8feb5 | ||
|
4be229059c | ||
|
389f2fd85d | ||
|
f95e3b49e9 | ||
|
f172d5d41c | ||
|
7be9fd1a79 | ||
|
5e1796505d | ||
|
51a4601e18 | ||
|
0bc4d23e2e | ||
|
4c47dcbd0f | ||
|
c1a9f6120a | ||
|
1b32c4f054 | ||
|
896cfbdfde | ||
|
910aa77c01 | ||
|
2562c029b1 | ||
|
0b1780a081 | ||
|
e9e2ae28e0 | ||
|
4ed3dd4b82 | ||
|
a7f430a5ef | ||
|
89ba4f282d | ||
|
b6231ee0ed | ||
|
e384002878 | ||
|
9ceed4b601 | ||
|
765bb85d1e | ||
|
6548dddec3 | ||
|
966f5ece4a | ||
|
ede2888326 | ||
|
2eda444bbf | ||
|
7c4319181b | ||
|
f4d29e6f11 | ||
|
77ea79490f | ||
|
46c96ee2cb | ||
|
a67c555320 | ||
|
cdb1ee21a0 | ||
|
2ce219ef42 | ||
|
c5f826de83 | ||
|
526ca42d04 | ||
|
b47f0ce41a | ||
|
eb7cb11ffd | ||
|
f9df990177 | ||
|
684dccb7b9 | ||
|
6c51eb4f72 | ||
|
ca485dfb50 | ||
|
50e3714b21 | ||
|
c52c7cdd1e | ||
|
11200f3d75 | ||
|
5dbe3c128b | ||
|
3564ccf6e4 | ||
|
e1c19cecad | ||
|
8e4f3a3084 | ||
|
9b8323ff38 | ||
|
5b7adda620 | ||
|
ba2a3b8c91 | ||
|
eb15939c23 | ||
|
b9fa60fd74 | ||
|
d397aa04d7 | ||
|
adb1b11055 | ||
|
2e234473ca | ||
|
6b08db68bb | ||
|
9550126f76 | ||
|
bad262b961 | ||
|
3c6c10075a | ||
|
6a77a6939e | ||
|
b725a4a140 | ||
|
2b714a5b5d | ||
|
572546088f | ||
|
5b109578d3 | ||
|
77b720f9a5 | ||
|
de954eb9cc | ||
|
3e322e60e4 | ||
|
a3642541d0 | ||
|
bb139d3f91 | ||
|
08743a42e2 | ||
|
cb6e76973d | ||
|
4b760fa9bc | ||
|
5730be093e | ||
|
d85e2ee9c3 | ||
|
fe433b012f | ||
|
5e3ffb39a2 | ||
|
f0edefdbb7 | ||
|
17901ea5c2 | ||
|
187fc54596 | ||
|
c951ad7c7b | ||
|
9785975f77 | ||
|
79281049f2 | ||
|
7d2b84aab6 | ||
|
cda328fa7e | ||
|
5d7b75a47a | ||
|
ae86824636 | ||
|
0dde40ce0b | ||
|
369c9ad12a | ||
|
cfb9eeca20 | ||
|
3dfb68887d | ||
|
d567885070 | ||
|
877c275a13 | ||
|
8aadae8ce4 | ||
|
2232d7603a | ||
|
b3f8851bc2 | ||
|
47ad3f63cf | ||
|
c75adb0671 | ||
|
178b8f5f64 | ||
|
a874992e7c | ||
|
31fc287d35 | ||
|
892913a69d | ||
|
99026e42a9 | ||
|
3a82d2b1a8 | ||
|
b28292e454 | ||
|
2ff18bc948 | ||
|
d0bee487e0 | ||
|
419e29c5a6 | ||
|
295d111f0e | ||
|
da5eb2db67 | ||
|
3408e4d4fa | ||
|
6d7eca8e42 | ||
|
5726a71b62 | ||
|
f73b5057ac | ||
|
51051aad7f | ||
|
91d3c08248 | ||
|
52f2cf319a | ||
|
bbdb62e654 | ||
|
e024943c4b | ||
|
7f44ec512e | ||
|
a2b6ddb7b1 | ||
|
bdc37b0797 | ||
|
82aaebfea2 | ||
|
48d82224ee | ||
|
100afcfdb0 | ||
|
b3436d5eba | ||
|
c5371aca64 | ||
|
269619a419 | ||
|
9b3104577c | ||
|
a1697d2307 | ||
|
056b75858c | ||
|
c84ed90272 | ||
|
b21dd9891a | ||
|
bba81781af | ||
|
0c74a72fac | ||
|
1822bc5eaf | ||
|
01ffe10c2f | ||
|
7f99a547f5 | ||
|
0e5651fb80 | ||
|
0ca44f3001 | ||
|
3f85763797 | ||
|
b318c4c5c9 | ||
|
ae9703712a | ||
|
d617ab6662 | ||
|
4c3eebd3e5 | ||
|
10061af491 | ||
|
91621641e6 | ||
|
35c6931ade | ||
|
44622912a2 | ||
|
aac40cf89b | ||
|
d4b20f5793 | ||
|
89df2d9475 | ||
|
79fa6f8d58 | ||
|
69242938f7 | ||
|
1b66b5d941 | ||
|
fb30f7ddcb | ||
|
747c2a4208 | ||
|
43fda26275 | ||
|
b1222bf83e | ||
|
3ec41b656f | ||
|
740ef6cd9e | ||
|
8c5cbf698b | ||
|
5f2cf6623f | ||
|
4b7efb73d7 | ||
|
a6b7e34187 | ||
|
e50308e823 | ||
|
b6a13ce43a | ||
|
96a87a811d | ||
|
025ee03cb1 | ||
|
c06ee92251 | ||
|
3aca5965dc | ||
|
cac77e5ffa | ||
|
49f1d7b5f6 | ||
|
82e44dbf04 | ||
|
9b501dd9eb | ||
|
8ba663f6f4 | ||
|
8f35484262 | ||
|
1e3143656d | ||
|
699b1f5012 | ||
|
9c877a621e | ||
|
a3144150e0 | ||
|
c830083df3 | ||
|
9eb03b1bcd | ||
|
7e3136c347 | ||
|
c3de8016c0 | ||
|
af45863f8e | ||
|
08d7d1673e | ||
|
e7c56ccd1e | ||
|
de8cab8e60 | ||
|
9e0f751464 | ||
|
951a429ac5 | ||
|
e43bb9da19 | ||
|
b08bd572ef | ||
|
402ee11273 | ||
|
6e38a26f32 | ||
|
d66239bea8 | ||
|
7eb8df2777 | ||
|
75473fd924 | ||
|
c94ade8ffd | ||
|
61afbd43c9 | ||
|
64f6ea37bd | ||
|
dc0609d153 | ||
|
bd46344a4e | ||
|
7199902316 | ||
|
250873abf2 | ||
|
1e775ecb83 | ||
|
9718c517d9 | ||
|
afc215aa66 | ||
|
5df8157863 | ||
|
802fe6bb29 | ||
|
27d2ad198e | ||
|
63be3ff84c | ||
|
66045bd13d | ||
|
f5f8105b57 | ||
|
4f92ae46ef | ||
|
80f8aa3c7e | ||
|
42778f687b | ||
|
7b27a58b97 | ||
|
a40ba9d350 | ||
|
9ecdff14fa | ||
|
288adc49c9 | ||
|
b8c2428b31 | ||
|
92bfcbafc0 | ||
|
130b5beca2 | ||
|
adb2e0fdd6 | ||
|
0a04bd7f2f | ||
|
9d6af5b314 | ||
|
6efb4b90d4 | ||
|
5806f1728c | ||
|
a9dd527748 | ||
|
db3d20b7b7 | ||
|
acd4e01aaf | ||
|
b217f23ba5 | ||
|
76875af207 | ||
|
f2ba14c309 | ||
|
a65b79a944 | ||
|
681b580fd8 | ||
|
b985b6c377 | ||
|
92eda21e78 | ||
|
0cfdb50477 | ||
|
1eb9a5edd9 | ||
|
383b881748 | ||
|
47543c8fba | ||
|
dc6ed89bfa | ||
|
348dd368b5 | ||
|
40eeefd4f7 | ||
|
47892c17ce | ||
|
f2a369fb73 | ||
|
61dc10ef66 | ||
|
7d01f4d8b1 | ||
|
c7a5e1e290 | ||
|
fbd332dee8 | ||
|
dbf6a12134 | ||
|
dbc47ae383 | ||
|
f22cfd52e0 | ||
|
2a10337344 | ||
|
836eaa62df | ||
|
a01c7adcfb | ||
|
5133faa1ad | ||
|
6a8c2960ad | ||
|
0c98e89fdb | ||
|
5f78181911 | ||
|
03dd1d23fa | ||
|
91683be798 | ||
|
109cb1a562 | ||
|
ad1240e276 | ||
|
2e468d9c8c | ||
|
6caa94b779 | ||
|
429a7eeee3 | ||
|
dec1172f38 | ||
|
afaafb4126 | ||
|
e566fcca08 | ||
|
c7f7ba250c | ||
|
7e3be21811 | ||
|
5e39f1a57c | ||
|
5aa0f44a9b | ||
|
55c767ba7f | ||
|
5502a97f7f | ||
|
8ab1d81917 | ||
|
942543f6a5 | ||
|
a69545a6ae | ||
|
0b13a0c168 | ||
|
d8341ca3b0 | ||
|
34ac314101 | ||
|
02c00f2711 | ||
|
15231c3304 | ||
|
d98e5aef97 | ||
|
5b0dfa471f | ||
|
26481a6553 | ||
|
64e08aa98b | ||
|
0c3168f150 | ||
|
40861c699e | ||
|
d8fee24778 | ||
|
5c617a5947 | ||
|
ff0a3f39d9 | ||
|
bfb4dabf0c | ||
|
58d14ee557 | ||
|
c5182c4bf5 | ||
|
132b016bae | ||
|
4785e95a0c | ||
|
be94a5ef8d | ||
|
208b70a93c | ||
|
6c3155ae3b | ||
|
32f071c2ad | ||
|
fdd1dbe3a9 | ||
|
1ca5bb694d | ||
|
b4cfaa916c | ||
|
fc6c85996e | ||
|
969f055f47 | ||
|
58328d01ef | ||
|
d90914f3dc | ||
|
3a0a86788e | ||
|
a77aa9a41e | ||
|
7217471427 | ||
|
bcc36cc1b2 | ||
|
16052085d0 | ||
|
c20f2864ab | ||
|
4185a44393 | ||
|
c79c5e3c9d | ||
|
35a9f33abb | ||
|
32f128640b | ||
|
18d19af7ec | ||
|
2ee2dd439f | ||
|
5edfb679e7 | ||
|
f45059e1e6 | ||
|
c9384762ee | ||
|
7ea50439ce | ||
|
154e67adbc | ||
|
570a193b7e | ||
|
79e294c927 | ||
|
5d75c7c4c8 | ||
|
7c688cea68 | ||
|
7640cd667f |
@@ -1,9 +0,0 @@
|
|||||||
[cxx]
|
|
||||||
gtest_dep = //lib/gtest:gtest
|
|
||||||
[android]
|
|
||||||
target = android-23
|
|
||||||
[ndk]
|
|
||||||
ndk_version = 13.1.3345770
|
|
||||||
compiler = clang
|
|
||||||
app_platform = android-21
|
|
||||||
cpu_abis = arm64, armv7, x86, x86_64
|
|
168
.clang-format
Normal file
168
.clang-format
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
Language: Cpp
|
||||||
|
AccessModifierOffset: -2
|
||||||
|
AlignAfterOpenBracket: AlwaysBreak
|
||||||
|
AlignConsecutiveAssignments: false
|
||||||
|
AlignConsecutiveDeclarations: false
|
||||||
|
AlignEscapedNewlines: Left
|
||||||
|
AlignOperands: false
|
||||||
|
AlignTrailingComments: false
|
||||||
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
|
AllowShortBlocksOnASingleLine: false
|
||||||
|
AllowShortCaseLabelsOnASingleLine: false
|
||||||
|
AllowShortFunctionsOnASingleLine: Inline
|
||||||
|
AllowShortIfStatementsOnASingleLine: false
|
||||||
|
AllowShortLoopsOnASingleLine: true
|
||||||
|
AlwaysBreakAfterReturnType: None
|
||||||
|
AlwaysBreakBeforeMultilineStrings: true
|
||||||
|
AlwaysBreakTemplateDeclarations: Yes
|
||||||
|
BinPackArguments: false
|
||||||
|
BinPackParameters: false
|
||||||
|
BreakBeforeBinaryOperators: false
|
||||||
|
BreakBeforeBraces: Attach
|
||||||
|
BreakBeforeTernaryOperators: true
|
||||||
|
BreakConstructorInitializers: BeforeColon
|
||||||
|
BreakInheritanceList: BeforeColon
|
||||||
|
BreakStringLiterals: true
|
||||||
|
ColumnLimit: 80
|
||||||
|
CompactNamespaces: false
|
||||||
|
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||||
|
ConstructorInitializerIndentWidth: 4
|
||||||
|
ContinuationIndentWidth: 4
|
||||||
|
Cpp11BracedListStyle: true
|
||||||
|
DerivePointerAlignment: false
|
||||||
|
FixNamespaceComments: true
|
||||||
|
IndentCaseLabels: true
|
||||||
|
IndentPPDirectives: None
|
||||||
|
IndentWidth: 2
|
||||||
|
IndentWrappedFunctionNames: false
|
||||||
|
MaxEmptyLinesToKeep: 1
|
||||||
|
NamespaceIndentation: None
|
||||||
|
PenaltyReturnTypeOnItsOwnLine: 2000
|
||||||
|
PointerAlignment: Left
|
||||||
|
ReflowComments: true
|
||||||
|
SortIncludes: false
|
||||||
|
SortUsingDeclarations: true
|
||||||
|
SpaceAfterCStyleCast: true
|
||||||
|
SpaceAfterTemplateKeyword: true
|
||||||
|
SpaceBeforeAssignmentOperators: true
|
||||||
|
SpaceBeforeCpp11BracedList: false
|
||||||
|
SpaceBeforeCtorInitializerColon: true
|
||||||
|
SpaceBeforeInheritanceColon: true
|
||||||
|
SpaceBeforeParens: ControlStatements
|
||||||
|
SpaceBeforeRangeBasedForLoopColon: true
|
||||||
|
SpaceInEmptyParentheses: false
|
||||||
|
SpacesBeforeTrailingComments: 1
|
||||||
|
Standard: Cpp11
|
||||||
|
UseTab: Never
|
||||||
|
---
|
||||||
|
Language: ObjC
|
||||||
|
AccessModifierOffset: -1
|
||||||
|
AlignAfterOpenBracket: AlwaysBreak
|
||||||
|
AlignConsecutiveMacros: false
|
||||||
|
AlignConsecutiveAssignments: false
|
||||||
|
AlignConsecutiveBitFields: false
|
||||||
|
AlignConsecutiveDeclarations: false
|
||||||
|
AlignEscapedNewlines: Left
|
||||||
|
AlignOperands: DontAlign
|
||||||
|
AlignTrailingComments: false
|
||||||
|
AllowAllArgumentsOnNextLine: true
|
||||||
|
AllowAllConstructorInitializersOnNextLine: true
|
||||||
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
|
AllowShortEnumsOnASingleLine: true
|
||||||
|
AllowShortBlocksOnASingleLine: Never
|
||||||
|
AllowShortCaseLabelsOnASingleLine: false
|
||||||
|
AllowShortFunctionsOnASingleLine: Empty
|
||||||
|
AllowShortLambdasOnASingleLine: All
|
||||||
|
AllowShortIfStatementsOnASingleLine: Never
|
||||||
|
AllowShortLoopsOnASingleLine: false
|
||||||
|
AlwaysBreakAfterReturnType: None
|
||||||
|
AlwaysBreakBeforeMultilineStrings: true
|
||||||
|
AlwaysBreakTemplateDeclarations: Yes
|
||||||
|
BinPackArguments: false
|
||||||
|
BinPackParameters: false
|
||||||
|
BreakBeforeBinaryOperators: None
|
||||||
|
BreakBeforeBraces: Attach
|
||||||
|
BreakInheritanceList: BeforeColon
|
||||||
|
BreakBeforeTernaryOperators: true
|
||||||
|
BreakConstructorInitializers: BeforeColon
|
||||||
|
BreakAfterJavaFieldAnnotations: false
|
||||||
|
BreakStringLiterals: false
|
||||||
|
ColumnLimit: 80
|
||||||
|
CommentPragmas: '^ IWYU pragma:'
|
||||||
|
CompactNamespaces: false
|
||||||
|
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||||
|
ConstructorInitializerIndentWidth: 4
|
||||||
|
ContinuationIndentWidth: 4
|
||||||
|
Cpp11BracedListStyle: true
|
||||||
|
DeriveLineEnding: true
|
||||||
|
DerivePointerAlignment: false
|
||||||
|
DisableFormat: false
|
||||||
|
FixNamespaceComments: true
|
||||||
|
ForEachMacros:
|
||||||
|
- FOR_EACH
|
||||||
|
- FOR_EACH_R
|
||||||
|
- FOR_EACH_RANGE
|
||||||
|
IncludeBlocks: Preserve
|
||||||
|
IncludeCategories:
|
||||||
|
- Regex: '^<.*\.h(pp)?>'
|
||||||
|
Priority: 1
|
||||||
|
- Regex: '^<.*'
|
||||||
|
Priority: 2
|
||||||
|
- Regex: '.*'
|
||||||
|
Priority: 3
|
||||||
|
IndentCaseLabels: true
|
||||||
|
IndentCaseBlocks: false
|
||||||
|
IndentGotoLabels: true
|
||||||
|
IndentPPDirectives: None
|
||||||
|
IndentExternBlock: AfterExternBlock
|
||||||
|
IndentWidth: 2
|
||||||
|
IndentWrappedFunctionNames: false
|
||||||
|
InsertTrailingCommas: None
|
||||||
|
JavaScriptQuotes: Leave
|
||||||
|
JavaScriptWrapImports: true
|
||||||
|
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||||
|
MacroBlockBegin: ''
|
||||||
|
MacroBlockEnd: ''
|
||||||
|
MaxEmptyLinesToKeep: 1
|
||||||
|
NamespaceIndentation: None
|
||||||
|
ObjCBinPackProtocolList: Auto
|
||||||
|
ObjCBlockIndentWidth: 2
|
||||||
|
ObjCBreakBeforeNestedBlockParam: true
|
||||||
|
ObjCSpaceAfterProperty: false
|
||||||
|
ObjCSpaceBeforeProtocolList: false
|
||||||
|
PenaltyBreakAssignment: 2
|
||||||
|
PenaltyBreakBeforeFirstCallParameter: 1
|
||||||
|
PenaltyBreakComment: 300
|
||||||
|
PenaltyBreakFirstLessLess: 120
|
||||||
|
PenaltyBreakString: 1000
|
||||||
|
PenaltyBreakTemplateDeclaration: 10
|
||||||
|
PenaltyExcessCharacter: 1000000
|
||||||
|
PenaltyReturnTypeOnItsOwnLine: 200
|
||||||
|
PointerAlignment: Left
|
||||||
|
ReflowComments: true
|
||||||
|
SortIncludes: true
|
||||||
|
SortUsingDeclarations: true
|
||||||
|
SpaceAfterCStyleCast: false
|
||||||
|
SpaceAfterLogicalNot: false
|
||||||
|
SpaceAfterTemplateKeyword: true
|
||||||
|
SpaceBeforeAssignmentOperators: true
|
||||||
|
SpaceBeforeCpp11BracedList: false
|
||||||
|
SpaceBeforeCtorInitializerColon: true
|
||||||
|
SpaceBeforeInheritanceColon: true
|
||||||
|
SpaceBeforeParens: ControlStatements
|
||||||
|
SpaceBeforeRangeBasedForLoopColon: true
|
||||||
|
SpaceInEmptyBlock: false
|
||||||
|
SpaceInEmptyParentheses: false
|
||||||
|
SpacesBeforeTrailingComments: 1
|
||||||
|
SpacesInAngles: false
|
||||||
|
SpacesInConditionalStatement: false
|
||||||
|
SpacesInContainerLiterals: true
|
||||||
|
SpacesInCStyleCastParentheses: false
|
||||||
|
SpacesInParentheses: false
|
||||||
|
SpacesInSquareBrackets: false
|
||||||
|
SpaceBeforeSquareBrackets: false
|
||||||
|
Standard: Latest
|
||||||
|
TabWidth: 8
|
||||||
|
UseCRLF: false
|
||||||
|
UseTab: Never
|
||||||
|
...
|
1
.clang-format-ignore
Normal file
1
.clang-format-ignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
^lib/.*
|
25
.github/actions/black/action.yml
vendored
Normal file
25
.github/actions/black/action.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
name: Black Formatter
|
||||||
|
inputs:
|
||||||
|
directory:
|
||||||
|
description: Directory to Lint
|
||||||
|
required: true
|
||||||
|
version:
|
||||||
|
description: pypi version of "black" to use
|
||||||
|
required: false
|
||||||
|
default: 22.3.0
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Ensure supported Python selected
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '>=3.6.2'
|
||||||
|
|
||||||
|
- name: pip install
|
||||||
|
shell: bash
|
||||||
|
run: pip install black==${{ inputs.version }}
|
||||||
|
|
||||||
|
- name: black
|
||||||
|
shell: bash
|
||||||
|
run: black --check ${{ inputs.directory }}
|
23
.github/actions/clang-format/action.yml
vendored
Normal file
23
.github/actions/clang-format/action.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: Clang Format
|
||||||
|
inputs:
|
||||||
|
directory:
|
||||||
|
description: Directory to Lint
|
||||||
|
required: true
|
||||||
|
version:
|
||||||
|
description: LLVM version to use # Should be kept roughly in sync with arcanist
|
||||||
|
required: false
|
||||||
|
default: 12
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install
|
||||||
|
shell: bash
|
||||||
|
run: sudo apt-get install -y clang-format-${{ inputs.version }}
|
||||||
|
|
||||||
|
- name: clang-format
|
||||||
|
working-directory: ${{ inputs.directory }}
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
BASHOPTS: extglob:nullglob
|
||||||
|
run: clang-format-${{ inputs.version }} --dry-run --Werror **/*.{h,hh,hpp,c,cpp,cc,m,mm}
|
23
.github/actions/install-emsdk/action.yml
vendored
Normal file
23
.github/actions/install-emsdk/action.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: Install emsdk (including emcc)
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: EMCC Version to install
|
||||||
|
required: false
|
||||||
|
default: 3.1.28
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Clone emsdk repo
|
||||||
|
working-directory: ${{ runner.temp }}
|
||||||
|
shell: bash
|
||||||
|
run: git clone https://github.com/emscripten-core/emsdk.git
|
||||||
|
|
||||||
|
- name: emdsk install
|
||||||
|
working-directory: ${{ runner.temp }}/emsdk
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
./emsdk install ${{ inputs.version }}
|
||||||
|
./emsdk activate ${{ inputs.version }}
|
||||||
|
echo $RUNNER_TEMP/emsdk >> $GITHUB_PATH
|
||||||
|
echo $RUNNER_TEMP/emsdk/upstream/emscripten >> $GITHUB_PATH
|
14
.github/actions/install-ninja/action.yml
vendored
Normal file
14
.github/actions/install-ninja/action.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
name: Install Ninja
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install ninja (Linux)
|
||||||
|
if: ${{ runner.os == 'Linux' }}
|
||||||
|
shell: bash
|
||||||
|
run: sudo apt-get install -y ninja-build
|
||||||
|
|
||||||
|
- name: Install ninja (Windows)
|
||||||
|
if: ${{ runner.os == 'Windows' }}
|
||||||
|
shell: powershell
|
||||||
|
run: choco install ninja
|
12
.github/actions/setup-android/action.yml
vendored
Normal file
12
.github/actions/setup-android/action.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
name: Setup Android environment
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Select Java Version
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
distribution: zulu
|
||||||
|
java-version: 17
|
||||||
|
- name: Configure Gradle Caches
|
||||||
|
uses: gradle/gradle-build-action@v2
|
9
.github/actions/setup-apple/action.yml
vendored
Normal file
9
.github/actions/setup-apple/action.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
name: Setup Apple envirionment
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
# TODO: This and Ruby should be versioned
|
||||||
|
- name: Install Cocoapods
|
||||||
|
shell: bash
|
||||||
|
run: sudo gem install cocoapods
|
12
.github/actions/setup-cpp/action.yml
vendored
Normal file
12
.github/actions/setup-cpp/action.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
name: Setup C++ envirionment
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install Ninja
|
||||||
|
if: ${{ runner.os != 'Windows' }}
|
||||||
|
uses: ./.github/actions/install-ninja
|
||||||
|
|
||||||
|
- name: Setup VS Developer Command Prompt
|
||||||
|
if: ${{ runner.os == 'Windows' }}
|
||||||
|
uses: ilammy/msvc-dev-cmd@v1
|
20
.github/actions/setup-js/action.yml
vendored
Normal file
20
.github/actions/setup-js/action.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
name: Setup JavaScript envirionment
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install Node
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 18.x
|
||||||
|
|
||||||
|
- name: Install emsdk
|
||||||
|
uses: ./.github/actions/install-emsdk
|
||||||
|
|
||||||
|
- name: Install Ninja
|
||||||
|
uses: ./.github/actions/install-ninja
|
||||||
|
|
||||||
|
- name: yarn install
|
||||||
|
shell: bash
|
||||||
|
run: yarn install --frozen-lockfile
|
||||||
|
working-directory: javascript
|
18
.github/actions/setup-website/action.yml
vendored
Normal file
18
.github/actions/setup-website/action.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
name: Setup Website envirionment
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
# TODO: Update to latest when website is moved to the workspace version of
|
||||||
|
# yoga-layout
|
||||||
|
- name: Install Node
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 12.x
|
||||||
|
|
||||||
|
# TODO: the website should be in a yarn workspace with the library, but the
|
||||||
|
# current version of gatsby is incompatible with hoisting.
|
||||||
|
- name: yarn install
|
||||||
|
shell: bash
|
||||||
|
run: yarn install --frozen-lockfile
|
||||||
|
working-directory: website
|
38
.github/workflows/publish-android-release.yml
vendored
Normal file
38
.github/workflows/publish-android-release.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
name: Publish Android Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
name: Publish to Maven Central
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-android
|
||||||
|
|
||||||
|
- name: Publish to Maven Local
|
||||||
|
run: ./gradlew publishToMavenLocal
|
||||||
|
env:
|
||||||
|
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
|
||||||
|
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
|
||||||
|
|
||||||
|
- name: Upload Build Artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: 'snapshot-artifacts'
|
||||||
|
path: '~/.m2/repository/'
|
||||||
|
|
||||||
|
- name: Publish to the Maven Central
|
||||||
|
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
|
||||||
|
env:
|
||||||
|
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
|
||||||
|
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
|
||||||
|
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
|
||||||
|
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
|
36
.github/workflows/publish-android-snashot.yml
vendored
Normal file
36
.github/workflows/publish-android-snashot.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
name: Publish Android Snapshot
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
name: Publish Snapshot
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-android
|
||||||
|
|
||||||
|
- name: Publish to Maven Local
|
||||||
|
run: ./gradlew publishToMavenLocal
|
||||||
|
env:
|
||||||
|
ORG_GRADLE_PROJECT_USE_SNAPSHOT: true
|
||||||
|
|
||||||
|
- name: Upload Build Artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: 'snapshot-artifacts'
|
||||||
|
path: '~/.m2/repository/'
|
||||||
|
|
||||||
|
- name: Publish to the Snapshot Repository
|
||||||
|
run: ./gradlew publishToSonatype
|
||||||
|
env:
|
||||||
|
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
|
||||||
|
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
|
||||||
|
ORG_GRADLE_PROJECT_USE_SNAPSHOT: true
|
29
.github/workflows/publish-cocoapods-release.yml
vendored
Normal file
29
.github/workflows/publish-cocoapods-release.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Publish CocoaPods Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
name: Publish to CocoaPods trunk
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-apple
|
||||||
|
|
||||||
|
- name: Publish Yoga
|
||||||
|
run: pod trunk push Yoga.podspec
|
||||||
|
env:
|
||||||
|
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
|
||||||
|
|
||||||
|
- name: Publish YogaKit
|
||||||
|
# Must run with --synchronous since YogaKit may depend on the just published version of Yoga
|
||||||
|
run: pod trunk push YogaKit.podspec --synchronous
|
||||||
|
env:
|
||||||
|
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
|
25
.github/workflows/publish-npm-release.yml
vendored
Normal file
25
.github/workflows/publish-npm-release.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
name: Publish NPM Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
name: Publish to npmjs registry
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-js
|
||||||
|
|
||||||
|
- name: Store auth token in config file
|
||||||
|
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
|
||||||
|
|
||||||
|
- name: yarn publish
|
||||||
|
run: yarn publish
|
||||||
|
working-directory: javascript
|
32
.github/workflows/publish-website.yml
vendored
Normal file
32
.github/workflows/publish-website.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
name: Website
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
name: Publish to GitHub Pages
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-website
|
||||||
|
|
||||||
|
- name: yarn build
|
||||||
|
run: yarn build
|
||||||
|
working-directory: website
|
||||||
|
|
||||||
|
- uses: peaceiris/actions-gh-pages@v3
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
publish_branch: gh-pages
|
||||||
|
publish_dir: website/public
|
||||||
|
cname: yogalayout.com
|
||||||
|
keep_files: true
|
||||||
|
user_name: 'Yoga-bot'
|
||||||
|
user_email: 'yogabot@fb.com'
|
26
.github/workflows/validate-android.yml
vendored
Normal file
26
.github/workflows/validate-android.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
name: Android
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build [${{ matrix.os }}][${{ matrix.mode }}]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
mode: [Debug, Release]
|
||||||
|
os: [ubuntu-latest, windows-latest]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-android
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: ./gradlew assemble${{ matrix.mode }} --stacktrace
|
55
.github/workflows/validate-apple.yml
vendored
Normal file
55
.github/workflows/validate-apple.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
name: Apple
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint-pods:
|
||||||
|
name: Lint pod
|
||||||
|
runs-on: macos-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-apple
|
||||||
|
|
||||||
|
- name: pod lib lint
|
||||||
|
run: pod lib lint --verbose --include-podspecs=**/*.podspec
|
||||||
|
|
||||||
|
build-sample:
|
||||||
|
name: Build sample [${{ matrix.mode }}]
|
||||||
|
runs-on: macos-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
mode: [Debug, Release]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-apple
|
||||||
|
|
||||||
|
- name: pod install
|
||||||
|
run: pod install
|
||||||
|
working-directory: ./YogaKit/YogaKitSample
|
||||||
|
|
||||||
|
- name: xcodebuild YogaKitSample.xcworkspace
|
||||||
|
run: xcodebuild -workspace YogaKitSample.xcworkspace -scheme YogaKitSample
|
||||||
|
working-directory: ./YogaKit/YogaKitSample
|
||||||
|
|
||||||
|
clang-format:
|
||||||
|
name: Format
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: clang-format
|
||||||
|
uses: ./.github/actions/clang-format
|
||||||
|
with:
|
||||||
|
directory: ./YogaKit
|
64
.github/workflows/validate-cpp.yml
vendored
Normal file
64
.github/workflows/validate-cpp.yml
vendored
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
name: C++
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
GTEST_COLOR: 1
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Build and Test [${{ matrix.os }}][${{ matrix.mode }}]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
mode: [Debug, Release]
|
||||||
|
os: [ubuntu-latest] # TODO: fix issues building GTest Binary with MSVC in GitHub Actions
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-cpp
|
||||||
|
|
||||||
|
- name: Unit tests
|
||||||
|
run: ./unit_tests ${{ matrix.mode }}
|
||||||
|
|
||||||
|
benchmark:
|
||||||
|
name: Benchmark [${{ matrix.os }}]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-cpp
|
||||||
|
|
||||||
|
- name: Build benchmark
|
||||||
|
run: |
|
||||||
|
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release
|
||||||
|
cmake --build build
|
||||||
|
working-directory: benchmark
|
||||||
|
|
||||||
|
- name: Run benchmark
|
||||||
|
run: ./build/benchmark
|
||||||
|
working-directory: benchmark
|
||||||
|
|
||||||
|
clang-format:
|
||||||
|
name: Format
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: clang-format
|
||||||
|
uses: ./.github/actions/clang-format
|
||||||
|
with:
|
||||||
|
directory: ./yoga
|
92
.github/workflows/validate-js.yml
vendored
Normal file
92
.github/workflows/validate-js.yml
vendored
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
name: JavaScript
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_COLOR: 3
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
benchmark:
|
||||||
|
name: Benchmark [${{ matrix.os }}]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-js
|
||||||
|
|
||||||
|
- name: yarn benchmark
|
||||||
|
run: yarn benchmark
|
||||||
|
working-directory: javascript
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: Build [${{ matrix.os }}]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-js
|
||||||
|
|
||||||
|
- name: yarn build
|
||||||
|
run: yarn build
|
||||||
|
working-directory: javascript
|
||||||
|
|
||||||
|
test:
|
||||||
|
name: Test [${{ matrix.os }}]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-js
|
||||||
|
|
||||||
|
- name: yarn test
|
||||||
|
run: yarn test
|
||||||
|
working-directory: javascript
|
||||||
|
|
||||||
|
lint:
|
||||||
|
name: Lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: yarn install
|
||||||
|
run: yarn install --frozen-lockfile
|
||||||
|
working-directory: javascript
|
||||||
|
|
||||||
|
- name: yarn lint
|
||||||
|
run: yarn lint
|
||||||
|
working-directory: javascript
|
||||||
|
|
||||||
|
pack:
|
||||||
|
name: Pack
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-js
|
||||||
|
|
||||||
|
- name: yarn pack
|
||||||
|
run: yarn pack --filename yoga-layout.tar.gz
|
||||||
|
working-directory: javascript
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: npm-package
|
||||||
|
path: javascript/yoga-layout.tar.gz
|
21
.github/workflows/validate-python.yml
vendored
Normal file
21
.github/workflows/validate-python.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
name: Python
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
format:
|
||||||
|
name: Format
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: black --check
|
||||||
|
uses: ./.github/actions/black
|
||||||
|
with:
|
||||||
|
directory: ${{ github.workspace }}
|
23
.github/workflows/validate-website.yml
vendored
Normal file
23
.github/workflows/validate-website.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: Website
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-website
|
||||||
|
|
||||||
|
- name: yarn build
|
||||||
|
run: yarn build
|
||||||
|
working-directory: website
|
11
.gitignore
vendored
11
.gitignore
vendored
@@ -5,14 +5,15 @@
|
|||||||
/.buckconfig.local
|
/.buckconfig.local
|
||||||
/.buckd
|
/.buckd
|
||||||
/gentest/test.html
|
/gentest/test.html
|
||||||
.buckversion
|
.buck-java11
|
||||||
|
|
||||||
# Jekyll
|
# Jekyll
|
||||||
/.sass-cache/
|
/.sass-cache/
|
||||||
/_site/
|
/_site/
|
||||||
|
|
||||||
# Visual studio code
|
# Visual studio code
|
||||||
.vscode
|
!.vscode
|
||||||
|
|
||||||
*.pdb
|
*.pdb
|
||||||
*.tlog
|
*.tlog
|
||||||
*.obj
|
*.obj
|
||||||
@@ -63,5 +64,11 @@ Carthage/Build
|
|||||||
|
|
||||||
# Gradle
|
# Gradle
|
||||||
.gradle
|
.gradle
|
||||||
|
local.properties
|
||||||
|
|
||||||
# NDK/CMake
|
# NDK/CMake
|
||||||
|
.cxx
|
||||||
.externalNativeBuild
|
.externalNativeBuild
|
||||||
|
|
||||||
|
# Docusarus build
|
||||||
|
.docusaurus
|
||||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +0,0 @@
|
|||||||
[submodule "lib/gtest/googletest"]
|
|
||||||
path = lib/gtest/googletest
|
|
||||||
url = https://github.com/google/googletest.git
|
|
@@ -1 +0,0 @@
|
|||||||
3.0
|
|
132
.travis.yml
132
.travis.yml
@@ -1,132 +0,0 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# This source code is licensed under the BSD-style license found in the
|
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
os: osx
|
|
||||||
osx_image: xcode8.2
|
|
||||||
language: cpp
|
|
||||||
compiler: clang
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- $HOME/Library/Caches/Homebrew
|
|
||||||
|
|
||||||
env:
|
|
||||||
- TARGET=c
|
|
||||||
- TARGET=java
|
|
||||||
- TARGET=net
|
|
||||||
- TARGET=ios
|
|
||||||
- TARGET=js
|
|
||||||
- TARGET=android
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- |
|
|
||||||
if [[ -n "$encrypted_d27e803291ff_iv" ]]; then
|
|
||||||
openssl aes-256-cbc -K $encrypted_d27e803291ff_key -iv $encrypted_d27e803291ff_iv -in scripts/setup-keys.enc -d >> gradle.properties;
|
|
||||||
fi
|
|
||||||
|
|
||||||
- brew update > /dev/null
|
|
||||||
- brew install --HEAD facebook/fb/buck
|
|
||||||
|
|
||||||
# Java
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "java" ]]; then
|
|
||||||
brew cask install java &&
|
|
||||||
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) &&
|
|
||||||
export PATH=$JAVA_HOME/bin:$PATH
|
|
||||||
fi
|
|
||||||
|
|
||||||
# .NET
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "net" ]]; then
|
|
||||||
brew install mono
|
|
||||||
fi
|
|
||||||
|
|
||||||
# iOS
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "ios" ]]; then
|
|
||||||
brew outdated xctool || brew upgrade xctool;
|
|
||||||
gem install xcpretty --no-document --quiet;
|
|
||||||
gem install cocoapods --pre --no-document --quiet;
|
|
||||||
pod repo update --silent;
|
|
||||||
pod install --project-directory=YogaKit/YogaKitSample/;
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Emscripten (used for js tests)
|
|
||||||
# Note: cannot be ran on Linux (because it will compile Clang from its sources :|)
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "js" ]]; then
|
|
||||||
wget -O /tmp/emsdk-portable.tar.gz https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz &&
|
|
||||||
tar xf /tmp/emsdk-portable.tar.gz -C /tmp/ &&
|
|
||||||
/tmp/emsdk-portable/emsdk install latest 2>&1 | grep -v '^x ' &&
|
|
||||||
/tmp/emsdk-portable/emsdk activate latest
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Android
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "android" ]]; then
|
|
||||||
brew cask install java;
|
|
||||||
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8);
|
|
||||||
export PATH=$JAVA_HOME/bin:$PATH;
|
|
||||||
export TERMINAL=dumb;
|
|
||||||
source scripts/android-setup.sh && installAndroidSDK
|
|
||||||
export ANDROID_SDK=$ANDROID_HOME
|
|
||||||
fi
|
|
||||||
|
|
||||||
# JavaScript
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "js" ]]; then (
|
|
||||||
cd javascript &&
|
|
||||||
npm install &&
|
|
||||||
unset CC && unset CXX && unset LINK &&
|
|
||||||
source /tmp/emsdk-portable/emsdk_env.sh &&
|
|
||||||
npm run build:browser
|
|
||||||
) fi
|
|
||||||
|
|
||||||
script:
|
|
||||||
# C
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "c" ]]; then
|
|
||||||
buck test --verbose 0 //:yoga &&
|
|
||||||
buck run --verbose 0 //benchmark:benchmark &&
|
|
||||||
git checkout HEAD^ &&
|
|
||||||
buck run --verbose 0 //benchmark:benchmark
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Java
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "java" ]]; then
|
|
||||||
buck test --verbose 0 //java:java
|
|
||||||
fi
|
|
||||||
|
|
||||||
# .NET
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "net" ]]; then
|
|
||||||
sh csharp/tests/Facebook.Yoga/test_macos.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
# iOS
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "ios" ]]; then
|
|
||||||
buck test --verbose 0 //YogaKit:YogaKitTests --config cxx.default_platform=iphonesimulator-x86_64 &&
|
|
||||||
set -o pipefail &&
|
|
||||||
xcodebuild build -workspace YogaKit/YogaKitSample/YogaKitSample.xcworkspace -scheme YogaKitSample -sdk iphonesimulator | xcpretty -c
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Android
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "android" ]]; then
|
|
||||||
buck build --verbose 0 //android/sample:sample &&
|
|
||||||
./gradlew testDebugUnit &&
|
|
||||||
scripts/publish-snapshot.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
# JavaScript
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "js" ]]; then (
|
|
||||||
cd javascript &&
|
|
||||||
npm run test:all &&
|
|
||||||
npm run bench
|
|
||||||
) fi
|
|
7
.vscode/extensions.json
vendored
Normal file
7
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"ms-vscode.cpptools",
|
||||||
|
"EditorConfig.EditorConfig",
|
||||||
|
"dbaeumer.vscode-eslint",
|
||||||
|
]
|
||||||
|
}
|
25
.vscode/launch.json
vendored
Normal file
25
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Debug C++ Unit tests (lldb)",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"MIMode": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/tests/build/yogatests",
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"preLaunchTask": "Build Unit Tests"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Debug C++ Unit tests (vsdbg)",
|
||||||
|
"type": "cppvsdbg",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/tests/build/yogatests",
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"preLaunchTask": "Build Unit Tests"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
20
.vscode/settings.json
vendored
Normal file
20
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.eslint": true
|
||||||
|
},
|
||||||
|
"eslint.format.enable": true,
|
||||||
|
"eslint.packageManager": "yarn",
|
||||||
|
"eslint.enable": true,
|
||||||
|
"eslint.validate": [
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact"
|
||||||
|
],
|
||||||
|
"eslint.workingDirectories": [
|
||||||
|
{
|
||||||
|
"mode": "auto"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}
|
23
.vscode/tasks.json
vendored
Normal file
23
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Build Unit Tests",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "(which ninja && cmake -B build -S . -D CMAKE_BUILD_TYPE=Debug -G Ninja || cmake -B build -S . -D CMAKE_BUILD_TYPE=Debug) && cmake --build build",
|
||||||
|
"windows": {
|
||||||
|
"command": "(where ninja && cmake -B build -S . -D CMAKE_BUILD_TYPE=Debug -G Ninja || cmake -B build -S . -D CMAKE_BUILD_TYPE=Debug) && cmake --build build",
|
||||||
|
},
|
||||||
|
"group": "build",
|
||||||
|
"options": {
|
||||||
|
"cwd": "tests"
|
||||||
|
},
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "new"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
45
BUCK
45
BUCK
@@ -1,45 +0,0 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# This source code is licensed under the BSD-style license found in the
|
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
|
||||||
|
|
||||||
GMOCK_OVERRIDE_FLAGS = [
|
|
||||||
# gmock does not mark mocked methods as override, ignore the warnings in tests
|
|
||||||
"-Wno-inconsistent-missing-override",
|
|
||||||
]
|
|
||||||
|
|
||||||
COMPILER_FLAGS = LIBRARY_COMPILER_FLAGS + [
|
|
||||||
"-std=c11",
|
|
||||||
]
|
|
||||||
|
|
||||||
TEST_COMPILER_FLAGS = BASE_COMPILER_FLAGS + GMOCK_OVERRIDE_FLAGS + ["-std=c++11"]
|
|
||||||
|
|
||||||
cxx_library(
|
|
||||||
name = "yoga",
|
|
||||||
srcs = glob(["yoga/*.c"]),
|
|
||||||
compiler_flags = COMPILER_FLAGS,
|
|
||||||
exported_headers = subdir_glob([("", "yoga/*.h")]),
|
|
||||||
header_namespace = "",
|
|
||||||
soname = "libyogacore.$(ext)",
|
|
||||||
tests = [":YogaTests"],
|
|
||||||
visibility = ["PUBLIC"],
|
|
||||||
deps = [] if THIS_IS_FBOBJC else [
|
|
||||||
yoga_dep("lib/fb:ndklog"),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
cxx_test(
|
|
||||||
name = "YogaTests",
|
|
||||||
srcs = glob(["tests/*.cpp"]),
|
|
||||||
compiler_flags = TEST_COMPILER_FLAGS,
|
|
||||||
contacts = ["emilsj@fb.com"],
|
|
||||||
visibility = ["PUBLIC"],
|
|
||||||
deps = [
|
|
||||||
":yoga",
|
|
||||||
GTEST_TARGET,
|
|
||||||
],
|
|
||||||
)
|
|
@@ -1,17 +1,52 @@
|
|||||||
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# This source code is licensed under the MIT license found in the
|
||||||
# All rights reserved.
|
# LICENSE file in the root directory of this source tree.
|
||||||
#
|
|
||||||
# This source code is licensed under the BSD-style license found in the
|
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
#
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.4.1)
|
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.13...3.26)
|
||||||
|
project(yoga-all)
|
||||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||||
|
|
||||||
file(GLOB yogacore_SRC yoga/*.c)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/project-defaults.cmake)
|
||||||
add_library(yogacore STATIC ${yogacore_SRC})
|
|
||||||
|
|
||||||
target_link_libraries(yogacore android log)
|
add_subdirectory(yoga)
|
||||||
|
add_subdirectory(tests)
|
||||||
|
|
||||||
|
# cmake install config
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
include(CMakePackageConfigHelpers)
|
||||||
|
|
||||||
|
# declare target to install
|
||||||
|
install(TARGETS yogacore EXPORT yoga-targets
|
||||||
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
# install header files
|
||||||
|
install(DIRECTORY
|
||||||
|
"${CMAKE_CURRENT_LIST_DIR}/yoga"
|
||||||
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||||
|
FILES_MATCHING PATTERN "*.h"
|
||||||
|
)
|
||||||
|
|
||||||
|
# install target config
|
||||||
|
install(EXPORT yoga-targets
|
||||||
|
FILE yogaTargets.cmake
|
||||||
|
NAMESPACE yoga::
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/yoga
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# generate config file
|
||||||
|
configure_package_config_file(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/yoga-config.cmake.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/yogaConfig.cmake
|
||||||
|
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/yoga
|
||||||
|
)
|
||||||
|
|
||||||
|
# install config file
|
||||||
|
install(FILES
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/yogaConfig.cmake
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/yoga
|
||||||
|
)
|
||||||
|
76
CODE_OF_CONDUCT.md
Normal file
76
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
# Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
In the interest of fostering an open and welcoming environment, we as
|
||||||
|
contributors and maintainers pledge to make participation in our project and
|
||||||
|
our community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||||
|
level of experience, education, socio-economic status, nationality, personal
|
||||||
|
appearance, race, religion, or sexual identity and orientation.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to creating a positive environment
|
||||||
|
include:
|
||||||
|
|
||||||
|
* Using welcoming and inclusive language
|
||||||
|
* Being respectful of differing viewpoints and experiences
|
||||||
|
* Gracefully accepting constructive criticism
|
||||||
|
* Focusing on what is best for the community
|
||||||
|
* Showing empathy towards other community members
|
||||||
|
|
||||||
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||||
|
advances
|
||||||
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or electronic
|
||||||
|
address, without explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Our Responsibilities
|
||||||
|
|
||||||
|
Project maintainers are responsible for clarifying the standards of acceptable
|
||||||
|
behavior and are expected to take appropriate and fair corrective action in
|
||||||
|
response to any instances of unacceptable behavior.
|
||||||
|
|
||||||
|
Project maintainers have the right and responsibility to remove, edit, or
|
||||||
|
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||||
|
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||||
|
permanently any contributor for other behaviors that they deem inappropriate,
|
||||||
|
threatening, offensive, or harmful.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies within all project spaces, and it also applies when
|
||||||
|
an individual is representing the project or its community in public spaces.
|
||||||
|
Examples of representing a project or community include using an official
|
||||||
|
project e-mail address, posting via an official social media account, or acting
|
||||||
|
as an appointed representative at an online or offline event. Representation of
|
||||||
|
a project may be further defined and clarified by project maintainers.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported by contacting the project team at <opensource-conduct@fb.com>. All
|
||||||
|
complaints will be reviewed and investigated and will result in a response that
|
||||||
|
is deemed necessary and appropriate to the circumstances. The project team is
|
||||||
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||||
|
Further details of specific enforcement policies may be posted separately.
|
||||||
|
|
||||||
|
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||||
|
faith may face temporary or permanent repercussions as determined by other
|
||||||
|
members of the project's leadership.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||||
|
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
|
||||||
|
For answers to common questions about this code of conduct, see
|
||||||
|
https://www.contributor-covenant.org/faq
|
@@ -2,9 +2,13 @@
|
|||||||
We want to make contributing to this project as easy and transparent as
|
We want to make contributing to this project as easy and transparent as
|
||||||
possible.
|
possible.
|
||||||
|
|
||||||
|
## Code of Conduct
|
||||||
|
|
||||||
|
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://code.fb.com/codeofconduct/) so that you can understand what actions will and will not be tolerated.
|
||||||
|
|
||||||
## Pull Requests
|
## Pull Requests
|
||||||
We actively welcome your pull requests.
|
We actively welcome your pull requests.
|
||||||
1. Fork the repo and create your branch from `master`.
|
1. Fork the repo and create your branch from `main`.
|
||||||
2. If you've added code that should be tested, add tests
|
2. If you've added code that should be tested, add tests
|
||||||
3. If you've changed APIs, update the documentation.
|
3. If you've changed APIs, update the documentation.
|
||||||
4. Ensure the test suite passes.
|
4. Ensure the test suite passes.
|
||||||
@@ -25,9 +29,6 @@ Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
|
|||||||
disclosure of security bugs. In those cases, please go through the process
|
disclosure of security bugs. In those cases, please go through the process
|
||||||
outlined on that page and do not file a public issue.
|
outlined on that page and do not file a public issue.
|
||||||
|
|
||||||
## Coding Style
|
|
||||||
* format.sh
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
By contributing to yoga, you agree that your contributions will be licensed
|
By contributing to yoga, you agree that your contributions will be licensed
|
||||||
under its BSD license.
|
under its MIT license.
|
||||||
|
43
LICENSE
43
LICENSE
@@ -1,30 +1,21 @@
|
|||||||
BSD License
|
MIT License
|
||||||
|
|
||||||
For yoga software
|
Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
|
||||||
Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
The above copyright notice and this permission notice shall be included in all
|
||||||
are permitted provided that the following conditions are met:
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice, this
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
list of conditions and the following disclaimer.
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
* Redistributions in binary form must reproduce the above copyright notice,
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
this list of conditions and the following disclaimer in the documentation
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
and/or other materials provided with the distribution.
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
* Neither the name Facebook nor the names of its contributors may be used to
|
|
||||||
endorse or promote products derived from this software without specific
|
|
||||||
prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
||||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
||||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
33
PATENTS
33
PATENTS
@@ -1,33 +0,0 @@
|
|||||||
Additional Grant of Patent Rights Version 2
|
|
||||||
|
|
||||||
"Software" means the yoga software distributed by Facebook, Inc.
|
|
||||||
|
|
||||||
Facebook, Inc. (“Facebook”) hereby grants to each recipient of the Software
|
|
||||||
(“you”) a perpetual, worldwide, royalty-free, non-exclusive, irrevocable
|
|
||||||
(subject to the termination provision below) license under any Necessary
|
|
||||||
Claims, to make, have made, use, sell, offer to sell, import, and otherwise
|
|
||||||
transfer the Software. For avoidance of doubt, no license is granted under
|
|
||||||
Facebook's rights in any patent claims that are infringed by (i) modifications
|
|
||||||
to the Software made by you or any third party or (ii) the Software in
|
|
||||||
combination with any software or other technology.
|
|
||||||
|
|
||||||
The license granted hereunder will terminate, automatically and without notice,
|
|
||||||
if you (or any of your subsidiaries, corporate affiliates or agents) initiate
|
|
||||||
directly or indirectly, or take a direct financial interest in, any Patent
|
|
||||||
Assertion: (i) against Facebook or any of its subsidiaries or corporate
|
|
||||||
affiliates, (ii) against any party if such Patent Assertion arises in whole or
|
|
||||||
in part from any software, technology, product or service of Facebook or any of
|
|
||||||
its subsidiaries or corporate affiliates, or (iii) against any party relating
|
|
||||||
to the Software. Notwithstanding the foregoing, if Facebook or any of its
|
|
||||||
subsidiaries or corporate affiliates files a lawsuit alleging patent
|
|
||||||
infringement against you in the first instance, and you respond by filing a
|
|
||||||
patent infringement counterclaim in that lawsuit against that party that is
|
|
||||||
unrelated to the Software, the license granted hereunder will not terminate
|
|
||||||
under section (i) of this paragraph due to such counterclaim.
|
|
||||||
|
|
||||||
A "Necessary Claim" is a claim of a patent owned by Facebook that is
|
|
||||||
necessarily infringed by the Software standing alone.
|
|
||||||
|
|
||||||
A "Patent Assertion" is any lawsuit or other action alleging direct, indirect,
|
|
||||||
or contributory infringement or inducement to infringe any patent, including a
|
|
||||||
cross-claim or counterclaim.
|
|
67
README.md
67
README.md
@@ -1,24 +1,24 @@
|
|||||||
# Yoga [](http://cocoapods.org/pods/YogaKit) [](https://www.npmjs.com/package/yoga-layout) [](https://bintray.com/facebook/maven/com.facebook.yoga%3Ayoga/_latestVersion) [](https://www.nuget.org/packages/Facebook.Yoga)
|
# Yoga [](https://opensource.fb.com/support-ukraine) [](http://cocoapods.org/pods/YogaKit) [](https://www.npmjs.com/package/yoga-layout) [](https://search.maven.org/artifact/com.facebook.yoga/yoga)
|
||||||
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
Yoga is an embeddable and performant flexbox layout engine with bindings for multiple languages.
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
|
|
||||||
[]()
|
|
||||||
[]()
|
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
Yoga builds with [buck](https://buckbuild.com). Make sure you install buck before contributing to Yoga. Yoga's main implementation is in C, with bindings to supported languages and frameworks. When making changes to Yoga please ensure the changes are also propagated to these bindings when applicable.
|
Yoga's main implementation targets C++ 14 with accompanying build logic in CMake. A wrapper is provided to build the main library and run unit tests.
|
||||||
|
|
||||||
## Testing
|
```sh
|
||||||
For testing we rely on [gtest](https://github.com/google/googletest) as a submodule. After cloning Yoga run `git submodule init` followed by `git submodule update`.
|
./unit_tests <Debug|Release>
|
||||||
|
```
|
||||||
|
|
||||||
For any changes you make you should ensure that all the tests are passing. In case you make any fixes or additions to the library please also add tests for that change to ensure we don't break anything in the future. Tests are located in the `tests` directory. Run the tests by executing `buck test //:yoga`.
|
While not required, this script will use [ninja](https://ninja-build.org/) if it is installed for faster builds.
|
||||||
|
|
||||||
Instead of manually writing a test which ensures parity with web implementations of Flexbox you can run `gentest/gentest.rb` to generated a test for you. You can write html which you want to verify in Yoga, in `gentest/fixtures` folder, such as the following.
|
Yoga is additionally part of the [vcpkg](https://github.com/Microsoft/vcpkg/) collection of ports maintained by Microsoft and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Adding Tests
|
||||||
|
|
||||||
|
Many of Yoga's tests are automatically generated, using HTML fixtures describing node structure. These are rendered in Chrome to generate an expected layout result for the tree. New fixtures can be added to `gentest/fixtures`.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div id="my_test" style="width: 100px; height: 100px; align-items: center;">
|
<div id="my_test" style="width: 100px; height: 100px; align-items: center;">
|
||||||
@@ -26,38 +26,11 @@ Instead of manually writing a test which ensures parity with web implementations
|
|||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
Run `gentest/gentest.rb` to generate test code and re-run `buck test //:yoga` to validate the behavior. One test case will be generated for every root `div` in the input html.
|
To generate new tests from added fixtures:
|
||||||
|
1. Run `bundle install` in the `gentest` directory to install dependencies of the test generator.
|
||||||
You may need to install the latest watir-webdriver gem (`gem install watir-webdriver`) and [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/) to run `gentest/gentest.rb` Ruby script.
|
2. Run `ruby gentest.rb` in the `gentest` directory.
|
||||||
|
|
||||||
### .NET
|
|
||||||
.NET testing is not integrated in buck yet, you might need to set up .NET testing environment. We have a script which to launch C# test on macOS, `csharp/tests/Facebook.Yoga/test_macos.sh`.
|
|
||||||
|
|
||||||
## Code style
|
|
||||||
For the main C implementation of Yoga clang-format is used to ensure a consistent code style. Please run `bash format.sh` before submitting a pull request. For other languages just try to follow the current code style.
|
|
||||||
|
|
||||||
## Benchmarks
|
|
||||||
Benchmarks are located in `benchmark/YGBenchmark.c` and can be run with `buck run //benchmark:benchmark`. If you think your change has affected performance please run this before and after your change to validate that nothing has regressed. Benchmarks are run on every commit in CI.
|
|
||||||
|
|
||||||
### JavaScript
|
|
||||||
Installing through NPM
|
|
||||||
```sh
|
|
||||||
npm install yoga-layout
|
|
||||||
```
|
|
||||||
By default this will install the library and try to build for all platforms (node, browser asm, and standalone webpack). You may receive errors if you do not have the required platform development tools already installed. To preset the platform you'd like to build for you can set a .npmrc property first.
|
|
||||||
```sh
|
|
||||||
npm config set yoga-layout:platform standalone
|
|
||||||
```
|
|
||||||
This will now only run the standalone webpack build upon install.
|
|
||||||
|
|
||||||
## Build Platforms
|
|
||||||
|
|
||||||
| name | description |
|
|
||||||
|----------------|-------------------------------------------------|
|
|
||||||
| all (default) | Builds all of these platforms. |
|
|
||||||
| browser | Builds asm js browser version. |
|
|
||||||
| node | Builds node js version. |
|
|
||||||
| standalone | Runs webpack. |
|
|
||||||
| none | Does nothing. You can use the prepackaged libs. |
|
|
||||||
|
|
||||||
|
|
||||||
|
## Debugging
|
||||||
|
|
||||||
|
Yoga provides a VSCode "launch.json" configuration which allows debugging unit tests. Simply add your breakpoints, and run "Debug C++ Unit tests (lldb)" (or "Debug C++ Unit tests (vsdbg)" on Windows).
|
||||||
|
47
YOGA_DEFS
47
YOGA_DEFS
@@ -1,47 +0,0 @@
|
|||||||
|
|
||||||
YOGA_ROOTS = ['//...']
|
|
||||||
JAVA_TARGET = '//java:java'
|
|
||||||
INFER_ANNOTATIONS_TARGET = '//lib/infer-annotations:infer-annotations'
|
|
||||||
JSR_305_TARGET = '//lib/jsr-305:jsr-305'
|
|
||||||
JUNIT_TARGET = '//lib/junit:junit'
|
|
||||||
PROGRUARD_ANNOTATIONS_TARGET = '//java/proguard-annotations/src/main/java/com/facebook/proguard/annotations:annotations'
|
|
||||||
SOLOADER_TARGET = '//lib/soloader:soloader'
|
|
||||||
GTEST_TARGET = '//lib/gtest:gtest'
|
|
||||||
JNI_TARGET = '//lib/jni:jni'
|
|
||||||
FBJNI_TARGET = '//lib/fb:fbjni'
|
|
||||||
FBJNI_JAVA_TARGET = '//lib/fb/src/main/java/com/facebook/jni:jni'
|
|
||||||
APPCOMPAT_TARGET = '//lib/appcompat:appcompat'
|
|
||||||
ANDROID_SUPPORT_TARGET = '//lib/android-support:android-support'
|
|
||||||
ANDROID_TARGET = '//android:android'
|
|
||||||
ANDROID_JAVA_TARGET = '//android/src/main/java/com/facebook/yoga/android:android'
|
|
||||||
ANDROID_RES_TARGET = '//android:res'
|
|
||||||
ANDROID_SAMPLE_JAVA_TARGET = '//android/sample/java/com/facebook/samples/yoga:yoga'
|
|
||||||
ANDROID_SAMPLE_RES_TARGET = '//android/sample:res'
|
|
||||||
|
|
||||||
THIS_IS_FBOBJC = False
|
|
||||||
|
|
||||||
CXX_LIBRARY_WHITELIST = [
|
|
||||||
'//:yoga',
|
|
||||||
'//lib/fb:fbjni',
|
|
||||||
'//java:jni',
|
|
||||||
]
|
|
||||||
|
|
||||||
BASE_COMPILER_FLAGS = [
|
|
||||||
'-fno-omit-frame-pointer',
|
|
||||||
'-fexceptions',
|
|
||||||
'-Wall',
|
|
||||||
'-Werror',
|
|
||||||
'-O3',
|
|
||||||
]
|
|
||||||
|
|
||||||
LIBRARY_COMPILER_FLAGS = BASE_COMPILER_FLAGS + [
|
|
||||||
'-fPIC',
|
|
||||||
]
|
|
||||||
|
|
||||||
def yoga_dep(dep):
|
|
||||||
return '//' + dep
|
|
||||||
|
|
||||||
with allow_unsafe_import():
|
|
||||||
import os.path
|
|
||||||
def isdir(filename):
|
|
||||||
return os.path.isdir(filename)
|
|
33
Yoga.podspec
33
Yoga.podspec
@@ -1,28 +1,41 @@
|
|||||||
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the MIT license found in the
|
||||||
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
|
|
||||||
Pod::Spec.new do |spec|
|
Pod::Spec.new do |spec|
|
||||||
spec.name = 'Yoga'
|
spec.name = 'Yoga'
|
||||||
spec.version = '1.5.0'
|
spec.version = '2.0.1'
|
||||||
spec.license = { :type => 'BSD', :file => "LICENSE" }
|
spec.license = { :type => 'MIT', :file => "LICENSE" }
|
||||||
spec.homepage = 'https://facebook.github.io/yoga/'
|
spec.homepage = 'https://yogalayout.com/'
|
||||||
spec.documentation_url = 'https://facebook.github.io/yoga/docs/api/c/'
|
spec.documentation_url = 'https://yogalayout.com/docs'
|
||||||
|
|
||||||
spec.summary = 'Yoga is a cross-platform layout engine which implements Flexbox.'
|
spec.summary = 'An embeddable and performant flexbox layout engine with bindings for multiple languages'
|
||||||
spec.description = 'Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.'
|
|
||||||
|
|
||||||
spec.authors = 'Facebook'
|
spec.authors = {'Meta Open Source' => 'opensource@meta.com'}
|
||||||
spec.source = {
|
spec.source = {
|
||||||
:git => 'https://github.com/facebook/yoga.git',
|
:git => 'https://github.com/facebook/yoga.git',
|
||||||
:tag => '1.5.0',
|
:tag => "v#{spec.version.to_s}",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spec.ios.deployment_target = "13.4"
|
||||||
|
|
||||||
spec.module_name = 'yoga'
|
spec.module_name = 'yoga'
|
||||||
spec.requires_arc = false
|
spec.requires_arc = false
|
||||||
|
spec.pod_target_xcconfig = {
|
||||||
|
'DEFINES_MODULE' => 'YES'
|
||||||
|
}
|
||||||
spec.compiler_flags = [
|
spec.compiler_flags = [
|
||||||
'-fno-omit-frame-pointer',
|
'-fno-omit-frame-pointer',
|
||||||
'-fexceptions',
|
'-fexceptions',
|
||||||
'-Wall',
|
'-Wall',
|
||||||
'-Werror',
|
'-Werror',
|
||||||
'-std=c11',
|
'-Wextra',
|
||||||
|
'-std=c++14',
|
||||||
'-fPIC'
|
'-fPIC'
|
||||||
]
|
]
|
||||||
spec.source_files = 'yoga/**/*.{c,h}'
|
spec.source_files = 'yoga/**/*.{h,cpp}'
|
||||||
|
spec.public_header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGValue}.h'
|
||||||
|
spec.swift_version = '5.1'
|
||||||
end
|
end
|
||||||
|
@@ -1,27 +1,32 @@
|
|||||||
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the MIT license found in the
|
||||||
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
podspec = Pod::Spec.new do |spec|
|
podspec = Pod::Spec.new do |spec|
|
||||||
spec.name = 'YogaKit'
|
spec.name = 'YogaKit'
|
||||||
spec.version = '1.5.0'
|
spec.version = '2.0.1'
|
||||||
spec.license = { :type => 'BSD', :file => "LICENSE" }
|
spec.license = { :type => 'MIT', :file => "LICENSE" }
|
||||||
spec.homepage = 'https://facebook.github.io/yoga/'
|
spec.homepage = 'https://yogalayout.com/'
|
||||||
spec.documentation_url = 'https://facebook.github.io/yoga/docs/api/yogakit/'
|
spec.documentation_url = 'https://yogalayout.com/docs'
|
||||||
|
spec.deprecated = true
|
||||||
|
|
||||||
spec.summary = 'Yoga is a cross-platform layout engine which implements Flexbox.'
|
spec.summary = 'YogaKit allows using the Yoga layout engine in combination with UIKit'
|
||||||
spec.description = 'Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.'
|
|
||||||
|
|
||||||
spec.authors = 'Facebook'
|
spec.authors = {'Meta Open Source' => 'opensource@meta.com'}
|
||||||
spec.source = {
|
spec.source = {
|
||||||
:git => 'https://github.com/facebook/yoga.git',
|
:git => 'https://github.com/facebook/yoga.git',
|
||||||
:tag => '1.5.0',
|
:tag => "v#{spec.version.to_s}",
|
||||||
}
|
}
|
||||||
|
|
||||||
spec.platform = :ios
|
spec.platforms = { :ios => "13.4" }
|
||||||
spec.ios.deployment_target = '8.0'
|
|
||||||
spec.ios.frameworks = 'UIKit'
|
spec.ios.frameworks = 'UIKit'
|
||||||
|
spec.module_name = 'YogaKit'
|
||||||
spec.dependency 'Yoga', '~> 1.5'
|
spec.dependency 'Yoga', "~> #{spec.version.to_s}"
|
||||||
spec.source_files = 'YogaKit/Source/*.{h,m,swift}'
|
spec.source_files = 'YogaKit/Source/*.{h,m,swift}'
|
||||||
spec.public_header_files = 'YogaKit/Source/{YGLayout,UIView+Yoga}.h'
|
spec.public_header_files = 'YogaKit/Source/{YGLayout,UIView+Yoga}.h'
|
||||||
spec.private_header_files = 'YogaKit/Source/YGLayout+Private.h'
|
spec.private_header_files = 'YogaKit/Source/YGLayout+Private.h'
|
||||||
|
spec.swift_version = '5.1'
|
||||||
end
|
end
|
||||||
|
|
||||||
# See https://github.com/facebook/yoga/pull/366
|
# See https://github.com/facebook/yoga/pull/366
|
||||||
|
@@ -1 +0,0 @@
|
|||||||
3.0.2
|
|
58
YogaKit/BUCK
58
YogaKit/BUCK
@@ -1,58 +0,0 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# This source code is licensed under the BSD-style license found in the
|
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
|
||||||
|
|
||||||
COMPILER_FLAGS = [
|
|
||||||
"-fobjc-arc",
|
|
||||||
"-Wconditional-uninitialized",
|
|
||||||
"-Wdangling-else",
|
|
||||||
"-Wdeprecated-declarations",
|
|
||||||
"-Wimplicit-retain-self",
|
|
||||||
"-Wincomplete-implementation",
|
|
||||||
"-Wobjc-method-access",
|
|
||||||
"-Wobjc-missing-super-calls",
|
|
||||||
"-Wmismatched-return-types",
|
|
||||||
"-Wreturn-type",
|
|
||||||
"-Wno-global-constructors",
|
|
||||||
"-Wno-shadow",
|
|
||||||
"-Wunused-const-variable",
|
|
||||||
"-Wunused-function",
|
|
||||||
"-Wunused-property-ivar",
|
|
||||||
"-Wunused-result",
|
|
||||||
"-Wunused-value",
|
|
||||||
]
|
|
||||||
|
|
||||||
apple_library(
|
|
||||||
name = "YogaKit",
|
|
||||||
srcs = glob(["Source/**/*.m"]),
|
|
||||||
compiler_flags = COMPILER_FLAGS,
|
|
||||||
exported_headers = glob(["Source/**/*.h"]),
|
|
||||||
frameworks = [
|
|
||||||
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
|
|
||||||
"$SDKROOT/System/Library/Frameworks/UIKit.framework",
|
|
||||||
],
|
|
||||||
visibility = ["PUBLIC"],
|
|
||||||
deps = [
|
|
||||||
yoga_dep(":yoga"),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
apple_test(
|
|
||||||
name = "YogaKitTests",
|
|
||||||
srcs = glob(["Tests/**/*.m"]),
|
|
||||||
compiler_flags = COMPILER_FLAGS,
|
|
||||||
frameworks = [
|
|
||||||
"$PLATFORM_DIR/Developer/Library/Frameworks/XCTest.framework",
|
|
||||||
"$SDKROOT/System/Library/Frameworks/CoreGraphics.framework",
|
|
||||||
],
|
|
||||||
info_plist = "Tests/Info.plist",
|
|
||||||
visibility = ["PUBLIC"],
|
|
||||||
deps = [
|
|
||||||
":YogaKit",
|
|
||||||
],
|
|
||||||
)
|
|
@@ -8,15 +8,14 @@
|
|||||||
YogaKit is available to install via [CocoaPods](https://cocoapods.org/).
|
YogaKit is available to install via [CocoaPods](https://cocoapods.org/).
|
||||||
|
|
||||||
```
|
```
|
||||||
pod 'YogaKit', '~> 1.5'
|
pod 'YogaKit', '~> 1.7'
|
||||||
```
|
```
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
Checkout the docs [here](https://facebook.github.io/yoga/docs/api/yogakit/).
|
|
||||||
|
|
||||||
We also have a sample project. To try it out, clone this repo and open `YogaKitSample.xcodeproj` in the [YogaKitSample](https://github.com/facebook/yoga/tree/master/YogaKit/YogaKitSample) directory.
|
We have a sample project. To try it out, clone this repo and open `YogaKitSample.xcodeproj` in the [YogaKitSample](https://github.com/facebook/yoga/tree/main/YogaKit/YogaKitSample) directory.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
We welcome all pull-requests! At Facebook we sync the open source version of `YogaKit` daily, so we're always testing the latest changes.
|
We welcome all pull-requests! At Facebook we sync the open source version of `YogaKit` daily, so we're always testing the latest changes.
|
||||||
|
|
||||||
See the [CONTRIBUTING.md](https://github.com/facebook/yoga/blob/master/CONTRIBUTING.md) file for how to help out.
|
See the [CONTRIBUTING.md](https://github.com/facebook/yoga/blob/main/CONTRIBUTING.md) file for how to help out.
|
||||||
|
@@ -1,30 +1,33 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "YGLayout.h"
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
#import "YGLayout.h"
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
typedef void (^YGLayoutConfigurationBlock)(YGLayout *);
|
typedef void (^YGLayoutConfigurationBlock)(YGLayout* layout);
|
||||||
|
|
||||||
@interface UIView (Yoga)
|
@interface UIView (Yoga)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The YGLayout that is attached to this view. It is lazily created.
|
The YGLayout that is attached to this view. It is lazily created.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readonly, strong) YGLayout *yoga;
|
@property(nonatomic, readonly, strong) YGLayout* yoga;
|
||||||
|
/**
|
||||||
|
Indicates whether or not Yoga is enabled
|
||||||
|
*/
|
||||||
|
@property(nonatomic, readonly, assign) BOOL isYogaEnabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
In ObjC land, every time you access `view.yoga.*` you are adding another `objc_msgSend`
|
In ObjC land, every time you access `view.yoga.*` you are adding another
|
||||||
to your code. If you plan on making multiple changes to YGLayout, it's more performant
|
`objc_msgSend` to your code. If you plan on making multiple changes to
|
||||||
to use this method, which uses a single objc_msgSend call.
|
YGLayout, it's more performant to use this method, which uses a single
|
||||||
|
objc_msgSend call.
|
||||||
*/
|
*/
|
||||||
- (void)configureLayoutWithBlock:(YGLayoutConfigurationBlock)block
|
- (void)configureLayoutWithBlock:(YGLayoutConfigurationBlock)block
|
||||||
NS_SWIFT_NAME(configureLayout(block:));
|
NS_SWIFT_NAME(configureLayout(block:));
|
||||||
|
@@ -1,33 +1,34 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#import <objc/runtime.h>
|
||||||
#import "UIView+Yoga.h"
|
#import "UIView+Yoga.h"
|
||||||
#import "YGLayout+Private.h"
|
#import "YGLayout+Private.h"
|
||||||
#import <objc/runtime.h>
|
|
||||||
|
|
||||||
static const void *kYGYogaAssociatedKey = &kYGYogaAssociatedKey;
|
static const void* kYGYogaAssociatedKey = &kYGYogaAssociatedKey;
|
||||||
|
|
||||||
@implementation UIView (YogaKit)
|
@implementation UIView (YogaKit)
|
||||||
|
|
||||||
- (YGLayout *)yoga
|
- (YGLayout*)yoga {
|
||||||
{
|
YGLayout* yoga = objc_getAssociatedObject(self, kYGYogaAssociatedKey);
|
||||||
YGLayout *yoga = objc_getAssociatedObject(self, kYGYogaAssociatedKey);
|
|
||||||
if (!yoga) {
|
if (!yoga) {
|
||||||
yoga = [[YGLayout alloc] initWithView:self];
|
yoga = [[YGLayout alloc] initWithView:self];
|
||||||
objc_setAssociatedObject(self, kYGYogaAssociatedKey, yoga, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
objc_setAssociatedObject(
|
||||||
|
self, kYGYogaAssociatedKey, yoga, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
return yoga;
|
return yoga;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)configureLayoutWithBlock:(YGLayoutConfigurationBlock)block
|
- (BOOL)isYogaEnabled {
|
||||||
{
|
return objc_getAssociatedObject(self, kYGYogaAssociatedKey) != nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)configureLayoutWithBlock:(YGLayoutConfigurationBlock)block {
|
||||||
if (block != nil) {
|
if (block != nil) {
|
||||||
block(self.yoga);
|
block(self.yoga);
|
||||||
}
|
}
|
||||||
|
@@ -1,19 +1,17 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "YGLayout.h"
|
|
||||||
#import <yoga/Yoga.h>
|
#import <yoga/Yoga.h>
|
||||||
|
#import "YGLayout.h"
|
||||||
|
|
||||||
@interface YGLayout ()
|
@interface YGLayout ()
|
||||||
|
|
||||||
@property (nonatomic, assign, readonly) YGNodeRef node;
|
@property(nonatomic, assign, readonly) YGNodeRef node;
|
||||||
|
|
||||||
- (instancetype)initWithView:(UIView *)view;
|
- (instancetype)initWithView:(UIView*)view;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -1,132 +1,150 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
#import <yoga/YGEnums.h>
|
#import <yoga/YGEnums.h>
|
||||||
#import <yoga/Yoga.h>
|
|
||||||
#import <yoga/YGMacros.h>
|
#import <yoga/YGMacros.h>
|
||||||
|
#import <yoga/Yoga.h>
|
||||||
|
|
||||||
YG_EXTERN_C_BEGIN
|
YG_EXTERN_C_BEGIN
|
||||||
|
|
||||||
extern YGValue YGPointValue(CGFloat value)
|
extern YGValue YGPointValue(CGFloat value) NS_SWIFT_UNAVAILABLE(
|
||||||
NS_SWIFT_UNAVAILABLE("Use the swift Int and FloatingPoint extensions instead");
|
"Use the swift Int and FloatingPoint extensions instead");
|
||||||
extern YGValue YGPercentValue(CGFloat value)
|
extern YGValue YGPercentValue(CGFloat value) NS_SWIFT_UNAVAILABLE(
|
||||||
NS_SWIFT_UNAVAILABLE("Use the swift Int and FloatingPoint extensions instead");
|
"Use the swift Int and FloatingPoint extensions instead");
|
||||||
|
|
||||||
YG_EXTERN_C_END
|
YG_EXTERN_C_END
|
||||||
|
|
||||||
typedef NS_OPTIONS(NSInteger, YGDimensionFlexibility) {
|
typedef NS_OPTIONS(NSInteger, YGDimensionFlexibility) {
|
||||||
YGDimensionFlexibilityFlexibleWidth = 1 << 0,
|
YGDimensionFlexibilityFlexibleWidth = 1 << 0,
|
||||||
YGDimensionFlexibilityFlexibleHeigth = 1 << 1,
|
YGDimensionFlexibilityFlexibleHeight = 1 << 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
@interface YGLayout : NSObject
|
@interface YGLayout : NSObject
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The property that decides if we should include this view when calculating layout. Defaults to YES.
|
Make default init unavailable, as it will not initialise YGNode which is
|
||||||
*/
|
required for the setters and getters of YGLayout's properties to work properly.
|
||||||
@property (nonatomic, readwrite, assign, setter=setIncludedInLayout:) BOOL isIncludedInLayout;
|
*/
|
||||||
|
- (instancetype)init
|
||||||
|
__attribute__((unavailable("you are not meant to initialise YGLayout")));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The property that decides during layout/sizing whether or not styling properties should be applied.
|
Make default init unavailable, as it will not initialise YGNode which is
|
||||||
Defaults to NO.
|
required for the setters and getters of YGLayout's properties to work properly.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readwrite, assign, setter=setEnabled:) BOOL isEnabled;
|
+ (instancetype)new
|
||||||
|
__attribute__((unavailable("you are not meant to initialise YGLayout")));
|
||||||
|
|
||||||
@property (nonatomic, readwrite, assign) YGDirection direction;
|
/**
|
||||||
@property (nonatomic, readwrite, assign) YGFlexDirection flexDirection;
|
The property that decides if we should include this view when calculating
|
||||||
@property (nonatomic, readwrite, assign) YGJustify justifyContent;
|
layout. Defaults to YES.
|
||||||
@property (nonatomic, readwrite, assign) YGAlign alignContent;
|
*/
|
||||||
@property (nonatomic, readwrite, assign) YGAlign alignItems;
|
@property(nonatomic, readwrite, assign, setter=setIncludedInLayout:)
|
||||||
@property (nonatomic, readwrite, assign) YGAlign alignSelf;
|
BOOL isIncludedInLayout;
|
||||||
@property (nonatomic, readwrite, assign) YGPositionType position;
|
|
||||||
@property (nonatomic, readwrite, assign) YGWrap flexWrap;
|
|
||||||
@property (nonatomic, readwrite, assign) YGOverflow overflow;
|
|
||||||
@property (nonatomic, readwrite, assign) YGDisplay display;
|
|
||||||
|
|
||||||
@property (nonatomic, readwrite, assign) CGFloat flexGrow;
|
/**
|
||||||
@property (nonatomic, readwrite, assign) CGFloat flexShrink;
|
The property that decides during layout/sizing whether or not styling
|
||||||
@property (nonatomic, readwrite, assign) YGValue flexBasis;
|
properties should be applied. Defaults to NO.
|
||||||
|
*/
|
||||||
|
@property(nonatomic, readwrite, assign, setter=setEnabled:) BOOL isEnabled;
|
||||||
|
|
||||||
@property (nonatomic, readwrite, assign) YGValue left;
|
@property(nonatomic, readwrite, assign) YGDirection direction;
|
||||||
@property (nonatomic, readwrite, assign) YGValue top;
|
@property(nonatomic, readwrite, assign) YGFlexDirection flexDirection;
|
||||||
@property (nonatomic, readwrite, assign) YGValue right;
|
@property(nonatomic, readwrite, assign) YGJustify justifyContent;
|
||||||
@property (nonatomic, readwrite, assign) YGValue bottom;
|
@property(nonatomic, readwrite, assign) YGAlign alignContent;
|
||||||
@property (nonatomic, readwrite, assign) YGValue start;
|
@property(nonatomic, readwrite, assign) YGAlign alignItems;
|
||||||
@property (nonatomic, readwrite, assign) YGValue end;
|
@property(nonatomic, readwrite, assign) YGAlign alignSelf;
|
||||||
|
@property(nonatomic, readwrite, assign) YGPositionType position;
|
||||||
|
@property(nonatomic, readwrite, assign) YGWrap flexWrap;
|
||||||
|
@property(nonatomic, readwrite, assign) YGOverflow overflow;
|
||||||
|
@property(nonatomic, readwrite, assign) YGDisplay display;
|
||||||
|
|
||||||
@property (nonatomic, readwrite, assign) YGValue marginLeft;
|
@property(nonatomic, readwrite, assign) CGFloat flex;
|
||||||
@property (nonatomic, readwrite, assign) YGValue marginTop;
|
@property(nonatomic, readwrite, assign) CGFloat flexGrow;
|
||||||
@property (nonatomic, readwrite, assign) YGValue marginRight;
|
@property(nonatomic, readwrite, assign) CGFloat flexShrink;
|
||||||
@property (nonatomic, readwrite, assign) YGValue marginBottom;
|
@property(nonatomic, readwrite, assign) YGValue flexBasis;
|
||||||
@property (nonatomic, readwrite, assign) YGValue marginStart;
|
|
||||||
@property (nonatomic, readwrite, assign) YGValue marginEnd;
|
|
||||||
@property (nonatomic, readwrite, assign) YGValue marginHorizontal;
|
|
||||||
@property (nonatomic, readwrite, assign) YGValue marginVertical;
|
|
||||||
@property (nonatomic, readwrite, assign) YGValue margin;
|
|
||||||
|
|
||||||
@property (nonatomic, readwrite, assign) YGValue paddingLeft;
|
@property(nonatomic, readwrite, assign) YGValue left;
|
||||||
@property (nonatomic, readwrite, assign) YGValue paddingTop;
|
@property(nonatomic, readwrite, assign) YGValue top;
|
||||||
@property (nonatomic, readwrite, assign) YGValue paddingRight;
|
@property(nonatomic, readwrite, assign) YGValue right;
|
||||||
@property (nonatomic, readwrite, assign) YGValue paddingBottom;
|
@property(nonatomic, readwrite, assign) YGValue bottom;
|
||||||
@property (nonatomic, readwrite, assign) YGValue paddingStart;
|
@property(nonatomic, readwrite, assign) YGValue start;
|
||||||
@property (nonatomic, readwrite, assign) YGValue paddingEnd;
|
@property(nonatomic, readwrite, assign) YGValue end;
|
||||||
@property (nonatomic, readwrite, assign) YGValue paddingHorizontal;
|
|
||||||
@property (nonatomic, readwrite, assign) YGValue paddingVertical;
|
|
||||||
@property (nonatomic, readwrite, assign) YGValue padding;
|
|
||||||
|
|
||||||
@property (nonatomic, readwrite, assign) CGFloat borderLeftWidth;
|
@property(nonatomic, readwrite, assign) YGValue marginLeft;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat borderTopWidth;
|
@property(nonatomic, readwrite, assign) YGValue marginTop;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat borderRightWidth;
|
@property(nonatomic, readwrite, assign) YGValue marginRight;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat borderBottomWidth;
|
@property(nonatomic, readwrite, assign) YGValue marginBottom;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat borderStartWidth;
|
@property(nonatomic, readwrite, assign) YGValue marginStart;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat borderEndWidth;
|
@property(nonatomic, readwrite, assign) YGValue marginEnd;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat borderWidth;
|
@property(nonatomic, readwrite, assign) YGValue marginHorizontal;
|
||||||
|
@property(nonatomic, readwrite, assign) YGValue marginVertical;
|
||||||
|
@property(nonatomic, readwrite, assign) YGValue margin;
|
||||||
|
|
||||||
@property (nonatomic, readwrite, assign) YGValue width;
|
@property(nonatomic, readwrite, assign) YGValue paddingLeft;
|
||||||
@property (nonatomic, readwrite, assign) YGValue height;
|
@property(nonatomic, readwrite, assign) YGValue paddingTop;
|
||||||
@property (nonatomic, readwrite, assign) YGValue minWidth;
|
@property(nonatomic, readwrite, assign) YGValue paddingRight;
|
||||||
@property (nonatomic, readwrite, assign) YGValue minHeight;
|
@property(nonatomic, readwrite, assign) YGValue paddingBottom;
|
||||||
@property (nonatomic, readwrite, assign) YGValue maxWidth;
|
@property(nonatomic, readwrite, assign) YGValue paddingStart;
|
||||||
@property (nonatomic, readwrite, assign) YGValue maxHeight;
|
@property(nonatomic, readwrite, assign) YGValue paddingEnd;
|
||||||
|
@property(nonatomic, readwrite, assign) YGValue paddingHorizontal;
|
||||||
|
@property(nonatomic, readwrite, assign) YGValue paddingVertical;
|
||||||
|
@property(nonatomic, readwrite, assign) YGValue padding;
|
||||||
|
|
||||||
|
@property(nonatomic, readwrite, assign) CGFloat borderLeftWidth;
|
||||||
|
@property(nonatomic, readwrite, assign) CGFloat borderTopWidth;
|
||||||
|
@property(nonatomic, readwrite, assign) CGFloat borderRightWidth;
|
||||||
|
@property(nonatomic, readwrite, assign) CGFloat borderBottomWidth;
|
||||||
|
@property(nonatomic, readwrite, assign) CGFloat borderStartWidth;
|
||||||
|
@property(nonatomic, readwrite, assign) CGFloat borderEndWidth;
|
||||||
|
@property(nonatomic, readwrite, assign) CGFloat borderWidth;
|
||||||
|
|
||||||
|
@property(nonatomic, readwrite, assign) YGValue width;
|
||||||
|
@property(nonatomic, readwrite, assign) YGValue height;
|
||||||
|
@property(nonatomic, readwrite, assign) YGValue minWidth;
|
||||||
|
@property(nonatomic, readwrite, assign) YGValue minHeight;
|
||||||
|
@property(nonatomic, readwrite, assign) YGValue maxWidth;
|
||||||
|
@property(nonatomic, readwrite, assign) YGValue maxHeight;
|
||||||
|
|
||||||
// Yoga specific properties, not compatible with flexbox specification
|
// Yoga specific properties, not compatible with flexbox specification
|
||||||
@property (nonatomic, readwrite, assign) CGFloat aspectRatio;
|
@property(nonatomic, readwrite, assign) CGFloat aspectRatio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get the resolved direction of this node. This won't be YGDirectionInherit
|
Get the resolved direction of this node. This won't be YGDirectionInherit
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readonly, assign) YGDirection resolvedDirection;
|
@property(nonatomic, readonly, assign) YGDirection resolvedDirection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Perform a layout calculation and update the frames of the views in the hierarchy with the results.
|
Perform a layout calculation and update the frames of the views in the
|
||||||
If the origin is not preserved, the root view's layout results will applied from {0,0}.
|
hierarchy with the results. If the origin is not preserved, the root view's
|
||||||
|
layout results will applied from {0,0}.
|
||||||
*/
|
*/
|
||||||
- (void)applyLayoutPreservingOrigin:(BOOL)preserveOrigin
|
- (void)applyLayoutPreservingOrigin:(BOOL)preserveOrigin
|
||||||
NS_SWIFT_NAME(applyLayout(preservingOrigin:));
|
NS_SWIFT_NAME(applyLayout(preservingOrigin:));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Perform a layout calculation and update the frames of the views in the hierarchy with the results.
|
Perform a layout calculation and update the frames of the views in the
|
||||||
If the origin is not preserved, the root view's layout results will applied from {0,0}.
|
hierarchy with the results. If the origin is not preserved, the root view's
|
||||||
|
layout results will applied from {0,0}.
|
||||||
*/
|
*/
|
||||||
- (void)applyLayoutPreservingOrigin:(BOOL)preserveOrigin
|
- (void)applyLayoutPreservingOrigin:(BOOL)preserveOrigin
|
||||||
dimensionFlexibility:(YGDimensionFlexibility)dimensionFlexibility
|
dimensionFlexibility:(YGDimensionFlexibility)dimensionFlexibility
|
||||||
NS_SWIFT_NAME(applyLayout(preservingOrigin:dimensionFlexibility:));
|
NS_SWIFT_NAME(applyLayout(preservingOrigin:dimensionFlexibility:));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the size of the view if no constraints were given. This could equivalent to calling [self
|
Returns the size of the view if no constraints were given. This could
|
||||||
sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)];
|
equivalent to calling [self sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)];
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readonly, assign) CGSize intrinsicSize;
|
@property(nonatomic, readonly, assign) CGSize intrinsicSize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the size of the view based on provided constraints. Pass NaN for an unconstrained dimension.
|
Returns the size of the view based on provided constraints. Pass NaN for an
|
||||||
|
unconstrained dimension.
|
||||||
*/
|
*/
|
||||||
- (CGSize)calculateLayoutWithSize:(CGSize)size
|
- (CGSize)calculateLayoutWithSize:(CGSize)size
|
||||||
NS_SWIFT_NAME(calculateLayout(with:));
|
NS_SWIFT_NAME(calculateLayout(with:));
|
||||||
@@ -134,19 +152,19 @@ typedef NS_OPTIONS(NSInteger, YGDimensionFlexibility) {
|
|||||||
/**
|
/**
|
||||||
Returns the number of children that are using Flexbox.
|
Returns the number of children that are using Flexbox.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readonly, assign) NSUInteger numberOfChildren;
|
@property(nonatomic, readonly, assign) NSUInteger numberOfChildren;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Return a BOOL indiciating whether or not we this node contains any subviews that are included in
|
Return a BOOL indiciating whether or not we this node contains any subviews
|
||||||
Yoga's layout.
|
that are included in Yoga's layout.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readonly, assign) BOOL isLeaf;
|
@property(nonatomic, readonly, assign) BOOL isLeaf;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Return's a BOOL indicating if a view is dirty. When a node is dirty
|
Return's a BOOL indicating if a view is dirty. When a node is dirty
|
||||||
it usually indicates that it will be remeasured on the next layout pass.
|
it usually indicates that it will be remeasured on the next layout pass.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readonly, assign) BOOL isDirty;
|
@property(nonatomic, readonly, assign) BOOL isDirty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Mark that a view's layout needs to be recalculated. Only works for leaf views.
|
Mark that a view's layout needs to be recalculated. Only works for leaf views.
|
||||||
|
@@ -1,148 +1,206 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "YGLayout+Private.h"
|
|
||||||
#import "UIView+Yoga.h"
|
#import "UIView+Yoga.h"
|
||||||
|
#import "YGLayout+Private.h"
|
||||||
|
|
||||||
#define YG_PROPERTY(type, lowercased_name, capitalized_name) \
|
#define YG_PROPERTY(type, lowercased_name, capitalized_name) \
|
||||||
- (type)lowercased_name \
|
-(type)lowercased_name { \
|
||||||
{ \
|
|
||||||
return YGNodeStyleGet##capitalized_name(self.node); \
|
return YGNodeStyleGet##capitalized_name(self.node); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
- (void)set##capitalized_name:(type)lowercased_name \
|
-(void)set##capitalized_name : (type)lowercased_name { \
|
||||||
{ \
|
|
||||||
YGNodeStyleSet##capitalized_name(self.node, lowercased_name); \
|
YGNodeStyleSet##capitalized_name(self.node, lowercased_name); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define YG_VALUE_PROPERTY(lowercased_name, capitalized_name) \
|
#define YG_VALUE_PROPERTY(lowercased_name, capitalized_name) \
|
||||||
- (YGValue)lowercased_name \
|
-(YGValue)lowercased_name { \
|
||||||
{ \
|
|
||||||
return YGNodeStyleGet##capitalized_name(self.node); \
|
return YGNodeStyleGet##capitalized_name(self.node); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
- (void)set##capitalized_name:(YGValue)lowercased_name \
|
-(void)set##capitalized_name : (YGValue)lowercased_name { \
|
||||||
{ \
|
switch (lowercased_name.unit) { \
|
||||||
|
case YGUnitUndefined: \
|
||||||
|
YGNodeStyleSet##capitalized_name(self.node, lowercased_name.value); \
|
||||||
|
break; \
|
||||||
|
case YGUnitPoint: \
|
||||||
|
YGNodeStyleSet##capitalized_name(self.node, lowercased_name.value); \
|
||||||
|
break; \
|
||||||
|
case YGUnitPercent: \
|
||||||
|
YGNodeStyleSet##capitalized_name##Percent( \
|
||||||
|
self.node, lowercased_name.value); \
|
||||||
|
break; \
|
||||||
|
default: \
|
||||||
|
NSAssert(NO, @"Not implemented"); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define YG_AUTO_VALUE_PROPERTY(lowercased_name, capitalized_name) \
|
||||||
|
-(YGValue)lowercased_name { \
|
||||||
|
return YGNodeStyleGet##capitalized_name(self.node); \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
-(void)set##capitalized_name : (YGValue)lowercased_name { \
|
||||||
switch (lowercased_name.unit) { \
|
switch (lowercased_name.unit) { \
|
||||||
case YGUnitPoint: \
|
case YGUnitPoint: \
|
||||||
YGNodeStyleSet##capitalized_name(self.node, lowercased_name.value); \
|
YGNodeStyleSet##capitalized_name(self.node, lowercased_name.value); \
|
||||||
break; \
|
break; \
|
||||||
case YGUnitPercent: \
|
case YGUnitPercent: \
|
||||||
YGNodeStyleSet##capitalized_name##Percent(self.node, lowercased_name.value); \
|
YGNodeStyleSet##capitalized_name##Percent( \
|
||||||
|
self.node, lowercased_name.value); \
|
||||||
|
break; \
|
||||||
|
case YGUnitAuto: \
|
||||||
|
YGNodeStyleSet##capitalized_name##Auto(self.node); \
|
||||||
break; \
|
break; \
|
||||||
default: \
|
default: \
|
||||||
NSAssert(NO, @"Not implemented"); \
|
NSAssert(NO, @"Not implemented"); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define YG_EDGE_PROPERTY_GETTER(type, lowercased_name, capitalized_name, property, edge) \
|
#define YG_EDGE_PROPERTY_GETTER( \
|
||||||
- (type)lowercased_name \
|
type, lowercased_name, capitalized_name, property, edge) \
|
||||||
{ \
|
-(type)lowercased_name { \
|
||||||
return YGNodeStyleGet##property(self.node, edge); \
|
return YGNodeStyleGet##property(self.node, edge); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define YG_EDGE_PROPERTY_SETTER(lowercased_name, capitalized_name, property, edge) \
|
#define YG_EDGE_PROPERTY_SETTER( \
|
||||||
- (void)set##capitalized_name:(CGFloat)lowercased_name \
|
lowercased_name, capitalized_name, property, edge) \
|
||||||
{ \
|
-(void)set##capitalized_name : (CGFloat)lowercased_name { \
|
||||||
YGNodeStyleSet##property(self.node, edge, lowercased_name); \
|
YGNodeStyleSet##property(self.node, edge, lowercased_name); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define YG_EDGE_PROPERTY(lowercased_name, capitalized_name, property, edge) \
|
#define YG_EDGE_PROPERTY(lowercased_name, capitalized_name, property, edge) \
|
||||||
YG_EDGE_PROPERTY_GETTER(CGFloat, lowercased_name, capitalized_name, property, edge) \
|
YG_EDGE_PROPERTY_GETTER( \
|
||||||
YG_EDGE_PROPERTY_SETTER(lowercased_name, capitalized_name, property, edge)
|
CGFloat, lowercased_name, capitalized_name, property, edge) \
|
||||||
|
YG_EDGE_PROPERTY_SETTER(lowercased_name, capitalized_name, property, edge)
|
||||||
|
|
||||||
#define YG_VALUE_EDGE_PROPERTY_SETTER(objc_lowercased_name, objc_capitalized_name, c_name, edge) \
|
#define YG_VALUE_EDGE_PROPERTY_SETTER( \
|
||||||
- (void)set##objc_capitalized_name:(YGValue)objc_lowercased_name \
|
objc_lowercased_name, objc_capitalized_name, c_name, edge) \
|
||||||
{ \
|
-(void)set##objc_capitalized_name : (YGValue)objc_lowercased_name { \
|
||||||
switch (objc_lowercased_name.unit) { \
|
switch (objc_lowercased_name.unit) { \
|
||||||
|
case YGUnitUndefined: \
|
||||||
|
YGNodeStyleSet##c_name(self.node, edge, objc_lowercased_name.value); \
|
||||||
|
break; \
|
||||||
case YGUnitPoint: \
|
case YGUnitPoint: \
|
||||||
YGNodeStyleSet##c_name(self.node, edge, objc_lowercased_name.value); \
|
YGNodeStyleSet##c_name(self.node, edge, objc_lowercased_name.value); \
|
||||||
break; \
|
break; \
|
||||||
case YGUnitPercent: \
|
case YGUnitPercent: \
|
||||||
YGNodeStyleSet##c_name##Percent(self.node, edge, objc_lowercased_name.value); \
|
YGNodeStyleSet##c_name##Percent( \
|
||||||
|
self.node, edge, objc_lowercased_name.value); \
|
||||||
break; \
|
break; \
|
||||||
default: \
|
default: \
|
||||||
NSAssert(NO, @"Not implemented"); \
|
NSAssert(NO, @"Not implemented"); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define YG_VALUE_EDGE_PROPERTY(lowercased_name, capitalized_name, property, edge) \
|
#define YG_VALUE_EDGE_PROPERTY( \
|
||||||
YG_EDGE_PROPERTY_GETTER(YGValue, lowercased_name, capitalized_name, property, edge) \
|
lowercased_name, capitalized_name, property, edge) \
|
||||||
YG_VALUE_EDGE_PROPERTY_SETTER(lowercased_name, capitalized_name, property, edge)
|
YG_EDGE_PROPERTY_GETTER( \
|
||||||
|
YGValue, lowercased_name, capitalized_name, property, edge) \
|
||||||
|
YG_VALUE_EDGE_PROPERTY_SETTER( \
|
||||||
|
lowercased_name, capitalized_name, property, edge)
|
||||||
|
|
||||||
#define YG_VALUE_EDGES_PROPERTIES(lowercased_name, capitalized_name) \
|
#define YG_VALUE_EDGES_PROPERTIES(lowercased_name, capitalized_name) \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Left, capitalized_name##Left, capitalized_name, YGEdgeLeft) \
|
YG_VALUE_EDGE_PROPERTY( \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Top, capitalized_name##Top, capitalized_name, YGEdgeTop) \
|
lowercased_name##Left, \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Right, capitalized_name##Right, capitalized_name, YGEdgeRight) \
|
capitalized_name##Left, \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Bottom, capitalized_name##Bottom, capitalized_name, YGEdgeBottom) \
|
capitalized_name, \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Start, capitalized_name##Start, capitalized_name, YGEdgeStart) \
|
YGEdgeLeft) \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##End, capitalized_name##End, capitalized_name, YGEdgeEnd) \
|
YG_VALUE_EDGE_PROPERTY( \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Horizontal, capitalized_name##Horizontal, capitalized_name, YGEdgeHorizontal) \
|
lowercased_name##Top, \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Vertical, capitalized_name##Vertical, capitalized_name, YGEdgeVertical) \
|
capitalized_name##Top, \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name, capitalized_name, capitalized_name, YGEdgeAll)
|
capitalized_name, \
|
||||||
|
YGEdgeTop) \
|
||||||
|
YG_VALUE_EDGE_PROPERTY( \
|
||||||
|
lowercased_name##Right, \
|
||||||
|
capitalized_name##Right, \
|
||||||
|
capitalized_name, \
|
||||||
|
YGEdgeRight) \
|
||||||
|
YG_VALUE_EDGE_PROPERTY( \
|
||||||
|
lowercased_name##Bottom, \
|
||||||
|
capitalized_name##Bottom, \
|
||||||
|
capitalized_name, \
|
||||||
|
YGEdgeBottom) \
|
||||||
|
YG_VALUE_EDGE_PROPERTY( \
|
||||||
|
lowercased_name##Start, \
|
||||||
|
capitalized_name##Start, \
|
||||||
|
capitalized_name, \
|
||||||
|
YGEdgeStart) \
|
||||||
|
YG_VALUE_EDGE_PROPERTY( \
|
||||||
|
lowercased_name##End, \
|
||||||
|
capitalized_name##End, \
|
||||||
|
capitalized_name, \
|
||||||
|
YGEdgeEnd) \
|
||||||
|
YG_VALUE_EDGE_PROPERTY( \
|
||||||
|
lowercased_name##Horizontal, \
|
||||||
|
capitalized_name##Horizontal, \
|
||||||
|
capitalized_name, \
|
||||||
|
YGEdgeHorizontal) \
|
||||||
|
YG_VALUE_EDGE_PROPERTY( \
|
||||||
|
lowercased_name##Vertical, \
|
||||||
|
capitalized_name##Vertical, \
|
||||||
|
capitalized_name, \
|
||||||
|
YGEdgeVertical) \
|
||||||
|
YG_VALUE_EDGE_PROPERTY( \
|
||||||
|
lowercased_name, capitalized_name, capitalized_name, YGEdgeAll)
|
||||||
|
|
||||||
YGValue YGPointValue(CGFloat value)
|
YGValue YGPointValue(CGFloat value) {
|
||||||
{
|
return (YGValue){.value = value, .unit = YGUnitPoint};
|
||||||
return (YGValue) { .value = value, .unit = YGUnitPoint };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
YGValue YGPercentValue(CGFloat value)
|
YGValue YGPercentValue(CGFloat value) {
|
||||||
{
|
return (YGValue){.value = value, .unit = YGUnitPercent};
|
||||||
return (YGValue) { .value = value, .unit = YGUnitPercent };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static YGConfigRef globalConfig;
|
static YGConfigRef globalConfig;
|
||||||
|
|
||||||
@interface YGLayout ()
|
@interface YGLayout ()
|
||||||
|
|
||||||
@property (nonatomic, weak, readonly) UIView *view;
|
@property(nonatomic, weak, readonly) UIView* view;
|
||||||
|
@property(nonatomic, assign, readonly) BOOL isUIView;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation YGLayout
|
@implementation YGLayout
|
||||||
|
|
||||||
@synthesize isEnabled=_isEnabled;
|
@synthesize isEnabled = _isEnabled;
|
||||||
@synthesize isIncludedInLayout=_isIncludedInLayout;
|
@synthesize isIncludedInLayout = _isIncludedInLayout;
|
||||||
@synthesize node=_node;
|
@synthesize node = _node;
|
||||||
|
|
||||||
+ (void)initialize
|
+ (void)initialize {
|
||||||
{
|
|
||||||
globalConfig = YGConfigNew();
|
globalConfig = YGConfigNew();
|
||||||
YGConfigSetExperimentalFeatureEnabled(globalConfig, YGExperimentalFeatureWebFlexBasis, true);
|
YGConfigSetExperimentalFeatureEnabled(
|
||||||
|
globalConfig, YGExperimentalFeatureWebFlexBasis, true);
|
||||||
|
YGConfigSetErrata(globalConfig, YGErrataClassic);
|
||||||
YGConfigSetPointScaleFactor(globalConfig, [UIScreen mainScreen].scale);
|
YGConfigSetPointScaleFactor(globalConfig, [UIScreen mainScreen].scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithView:(UIView*)view
|
- (instancetype)initWithView:(UIView*)view {
|
||||||
{
|
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
_view = view;
|
_view = view;
|
||||||
_node = YGNodeNewWithConfig(globalConfig);
|
_node = YGNodeNewWithConfig(globalConfig);
|
||||||
YGNodeSetContext(_node, (__bridge void *) view);
|
YGNodeSetContext(_node, (__bridge void*)view);
|
||||||
_isEnabled = NO;
|
_isEnabled = NO;
|
||||||
_isIncludedInLayout = YES;
|
_isIncludedInLayout = YES;
|
||||||
|
_isUIView = [view isMemberOfClass:[UIView class]];
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc {
|
||||||
{
|
|
||||||
YGNodeFree(self.node);
|
YGNodeFree(self.node);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)isDirty
|
- (BOOL)isDirty {
|
||||||
{
|
|
||||||
return YGNodeIsDirty(self.node);
|
return YGNodeIsDirty(self.node);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)markDirty
|
- (void)markDirty {
|
||||||
{
|
|
||||||
if (self.isDirty || !self.isLeaf) {
|
if (self.isDirty || !self.isLeaf) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -151,24 +209,24 @@ static YGConfigRef globalConfig;
|
|||||||
// the measure function. Since we already know that this is a leaf,
|
// the measure function. Since we already know that this is a leaf,
|
||||||
// this *should* be fine. Forgive me Hack Gods.
|
// this *should* be fine. Forgive me Hack Gods.
|
||||||
const YGNodeRef node = self.node;
|
const YGNodeRef node = self.node;
|
||||||
if (YGNodeGetMeasureFunc(node) == NULL) {
|
if (!YGNodeHasMeasureFunc(node)) {
|
||||||
YGNodeSetMeasureFunc(node, YGMeasureView);
|
YGNodeSetMeasureFunc(node, YGMeasureView);
|
||||||
}
|
}
|
||||||
|
|
||||||
YGNodeMarkDirty(node);
|
YGNodeMarkDirty(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSUInteger)numberOfChildren
|
- (NSUInteger)numberOfChildren {
|
||||||
{
|
|
||||||
return YGNodeGetChildCount(self.node);
|
return YGNodeGetChildCount(self.node);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)isLeaf
|
- (BOOL)isLeaf {
|
||||||
{
|
NSAssert(
|
||||||
NSAssert([NSThread isMainThread], @"This method must be called on the main thread.");
|
[NSThread isMainThread],
|
||||||
|
@"This method must be called on the main thread.");
|
||||||
if (self.isEnabled) {
|
if (self.isEnabled) {
|
||||||
for (UIView *subview in self.view.subviews) {
|
for (UIView* subview in self.view.subviews) {
|
||||||
YGLayout *const yoga = subview.yoga;
|
YGLayout* const yoga = subview.yoga;
|
||||||
if (yoga.isEnabled && yoga.isIncludedInLayout) {
|
if (yoga.isEnabled && yoga.isIncludedInLayout) {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
@@ -180,13 +238,11 @@ static YGConfigRef globalConfig;
|
|||||||
|
|
||||||
#pragma mark - Style
|
#pragma mark - Style
|
||||||
|
|
||||||
- (YGPositionType)position
|
- (YGPositionType)position {
|
||||||
{
|
|
||||||
return YGNodeStyleGetPositionType(self.node);
|
return YGNodeStyleGetPositionType(self.node);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setPosition:(YGPositionType)position
|
- (void)setPosition:(YGPositionType)position {
|
||||||
{
|
|
||||||
YGNodeStyleSetPositionType(self.node, position);
|
YGNodeStyleSetPositionType(self.node, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,9 +256,10 @@ YG_PROPERTY(YGWrap, flexWrap, FlexWrap)
|
|||||||
YG_PROPERTY(YGOverflow, overflow, Overflow)
|
YG_PROPERTY(YGOverflow, overflow, Overflow)
|
||||||
YG_PROPERTY(YGDisplay, display, Display)
|
YG_PROPERTY(YGDisplay, display, Display)
|
||||||
|
|
||||||
|
YG_PROPERTY(CGFloat, flex, Flex)
|
||||||
YG_PROPERTY(CGFloat, flexGrow, FlexGrow)
|
YG_PROPERTY(CGFloat, flexGrow, FlexGrow)
|
||||||
YG_PROPERTY(CGFloat, flexShrink, FlexShrink)
|
YG_PROPERTY(CGFloat, flexShrink, FlexShrink)
|
||||||
YG_VALUE_PROPERTY(flexBasis, FlexBasis)
|
YG_AUTO_VALUE_PROPERTY(flexBasis, FlexBasis)
|
||||||
|
|
||||||
YG_VALUE_EDGE_PROPERTY(left, Left, Position, YGEdgeLeft)
|
YG_VALUE_EDGE_PROPERTY(left, Left, Position, YGEdgeLeft)
|
||||||
YG_VALUE_EDGE_PROPERTY(top, Top, Position, YGEdgeTop)
|
YG_VALUE_EDGE_PROPERTY(top, Top, Position, YGEdgeTop)
|
||||||
@@ -221,49 +278,49 @@ YG_EDGE_PROPERTY(borderStartWidth, BorderStartWidth, Border, YGEdgeStart)
|
|||||||
YG_EDGE_PROPERTY(borderEndWidth, BorderEndWidth, Border, YGEdgeEnd)
|
YG_EDGE_PROPERTY(borderEndWidth, BorderEndWidth, Border, YGEdgeEnd)
|
||||||
YG_EDGE_PROPERTY(borderWidth, BorderWidth, Border, YGEdgeAll)
|
YG_EDGE_PROPERTY(borderWidth, BorderWidth, Border, YGEdgeAll)
|
||||||
|
|
||||||
YG_VALUE_PROPERTY(width, Width)
|
YG_AUTO_VALUE_PROPERTY(width, Width)
|
||||||
YG_VALUE_PROPERTY(height, Height)
|
YG_AUTO_VALUE_PROPERTY(height, Height)
|
||||||
YG_VALUE_PROPERTY(minWidth, MinWidth)
|
YG_VALUE_PROPERTY(minWidth, MinWidth)
|
||||||
YG_VALUE_PROPERTY(minHeight, MinHeight)
|
YG_VALUE_PROPERTY(minHeight, MinHeight)
|
||||||
YG_VALUE_PROPERTY(maxWidth, MaxWidth)
|
YG_VALUE_PROPERTY(maxWidth, MaxWidth)
|
||||||
YG_VALUE_PROPERTY(maxHeight, MaxHeight)
|
YG_VALUE_PROPERTY(maxHeight, MaxHeight)
|
||||||
YG_PROPERTY(CGFloat, aspectRatio, AspectRatio)
|
YG_PROPERTY(CGFloat, aspectRatio, AspectRatio)
|
||||||
|
|
||||||
|
YG_EDGE_PROPERTY(columnGap, ColumnGap, Gap, YGGutterColumn)
|
||||||
|
YG_EDGE_PROPERTY(rowGap, RowGap, Gap, YGGutterRow)
|
||||||
|
YG_EDGE_PROPERTY(gap, Gap, Gap, YGGutterAll)
|
||||||
|
|
||||||
#pragma mark - Layout and Sizing
|
#pragma mark - Layout and Sizing
|
||||||
|
|
||||||
- (YGDirection)resolvedDirection
|
- (YGDirection)resolvedDirection {
|
||||||
{
|
|
||||||
return YGNodeLayoutGetDirection(self.node);
|
return YGNodeLayoutGetDirection(self.node);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applyLayout
|
- (void)applyLayout {
|
||||||
{
|
|
||||||
[self calculateLayoutWithSize:self.view.bounds.size];
|
[self calculateLayoutWithSize:self.view.bounds.size];
|
||||||
YGApplyLayoutToViewHierarchy(self.view, NO);
|
YGApplyLayoutToViewHierarchy(self.view, NO);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applyLayoutPreservingOrigin:(BOOL)preserveOrigin
|
- (void)applyLayoutPreservingOrigin:(BOOL)preserveOrigin {
|
||||||
{
|
|
||||||
[self calculateLayoutWithSize:self.view.bounds.size];
|
[self calculateLayoutWithSize:self.view.bounds.size];
|
||||||
YGApplyLayoutToViewHierarchy(self.view, preserveOrigin);
|
YGApplyLayoutToViewHierarchy(self.view, preserveOrigin);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applyLayoutPreservingOrigin:(BOOL)preserveOrigin dimensionFlexibility:(YGDimensionFlexibility)dimensionFlexibility
|
- (void)applyLayoutPreservingOrigin:(BOOL)preserveOrigin
|
||||||
{
|
dimensionFlexibility:
|
||||||
|
(YGDimensionFlexibility)dimensionFlexibility {
|
||||||
CGSize size = self.view.bounds.size;
|
CGSize size = self.view.bounds.size;
|
||||||
if (dimensionFlexibility & YGDimensionFlexibilityFlexibleWidth) {
|
if (dimensionFlexibility & YGDimensionFlexibilityFlexibleWidth) {
|
||||||
size.width = YGUndefined;
|
size.width = YGUndefined;
|
||||||
}
|
}
|
||||||
if (dimensionFlexibility & YGDimensionFlexibilityFlexibleHeigth) {
|
if (dimensionFlexibility & YGDimensionFlexibilityFlexibleHeight) {
|
||||||
size.height = YGUndefined;
|
size.height = YGUndefined;
|
||||||
}
|
}
|
||||||
[self calculateLayoutWithSize:size];
|
[self calculateLayoutWithSize:size];
|
||||||
YGApplyLayoutToViewHierarchy(self.view, preserveOrigin);
|
YGApplyLayoutToViewHierarchy(self.view, preserveOrigin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (CGSize)intrinsicSize {
|
||||||
- (CGSize)intrinsicSize
|
|
||||||
{
|
|
||||||
const CGSize constrainedSize = {
|
const CGSize constrainedSize = {
|
||||||
.width = YGUndefined,
|
.width = YGUndefined,
|
||||||
.height = YGUndefined,
|
.height = YGUndefined,
|
||||||
@@ -271,8 +328,7 @@ YG_PROPERTY(CGFloat, aspectRatio, AspectRatio)
|
|||||||
return [self calculateLayoutWithSize:constrainedSize];
|
return [self calculateLayoutWithSize:constrainedSize];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (CGSize)calculateLayoutWithSize:(CGSize)size
|
- (CGSize)calculateLayoutWithSize:(CGSize)size {
|
||||||
{
|
|
||||||
NSAssert([NSThread isMainThread], @"Yoga calculation must be done on main.");
|
NSAssert([NSThread isMainThread], @"Yoga calculation must be done on main.");
|
||||||
NSAssert(self.isEnabled, @"Yoga is not enabled for this view.");
|
NSAssert(self.isEnabled, @"Yoga is not enabled for this view.");
|
||||||
|
|
||||||
@@ -280,12 +336,9 @@ YG_PROPERTY(CGFloat, aspectRatio, AspectRatio)
|
|||||||
|
|
||||||
const YGNodeRef node = self.node;
|
const YGNodeRef node = self.node;
|
||||||
YGNodeCalculateLayout(
|
YGNodeCalculateLayout(
|
||||||
node,
|
node, size.width, size.height, YGNodeStyleGetDirection(node));
|
||||||
size.width,
|
|
||||||
size.height,
|
|
||||||
YGNodeStyleGetDirection(node));
|
|
||||||
|
|
||||||
return (CGSize) {
|
return (CGSize){
|
||||||
.width = YGNodeLayoutGetWidth(node),
|
.width = YGNodeLayoutGetWidth(node),
|
||||||
.height = YGNodeLayoutGetHeight(node),
|
.height = YGNodeLayoutGetHeight(node),
|
||||||
};
|
};
|
||||||
@@ -298,28 +351,40 @@ static YGSize YGMeasureView(
|
|||||||
float width,
|
float width,
|
||||||
YGMeasureMode widthMode,
|
YGMeasureMode widthMode,
|
||||||
float height,
|
float height,
|
||||||
YGMeasureMode heightMode)
|
YGMeasureMode heightMode) {
|
||||||
{
|
const CGFloat constrainedWidth =
|
||||||
const CGFloat constrainedWidth = (widthMode == YGMeasureModeUndefined) ? CGFLOAT_MAX : width;
|
(widthMode == YGMeasureModeUndefined) ? CGFLOAT_MAX : width;
|
||||||
const CGFloat constrainedHeight = (heightMode == YGMeasureModeUndefined) ? CGFLOAT_MAX: height;
|
const CGFloat constrainedHeight =
|
||||||
|
(heightMode == YGMeasureModeUndefined) ? CGFLOAT_MAX : height;
|
||||||
|
|
||||||
UIView *view = (__bridge UIView*) YGNodeGetContext(node);
|
UIView* view = (__bridge UIView*)YGNodeGetContext(node);
|
||||||
const CGSize sizeThatFits = [view sizeThatFits:(CGSize) {
|
CGSize sizeThatFits = CGSizeZero;
|
||||||
|
|
||||||
|
// The default implementation of sizeThatFits: returns the existing size of
|
||||||
|
// the view. That means that if we want to layout an empty UIView, which
|
||||||
|
// already has got a frame set, its measured size should be CGSizeZero, but
|
||||||
|
// UIKit returns the existing size.
|
||||||
|
//
|
||||||
|
// See https://github.com/facebook/yoga/issues/606 for more information.
|
||||||
|
if (!view.yoga.isUIView || [view.subviews count] > 0) {
|
||||||
|
sizeThatFits = [view sizeThatFits:(CGSize){
|
||||||
.width = constrainedWidth,
|
.width = constrainedWidth,
|
||||||
.height = constrainedHeight,
|
.height = constrainedHeight,
|
||||||
}];
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
return (YGSize) {
|
return (YGSize){
|
||||||
.width = YGSanitizeMeasurement(constrainedWidth, sizeThatFits.width, widthMode),
|
.width = YGSanitizeMeasurement(
|
||||||
.height = YGSanitizeMeasurement(constrainedHeight, sizeThatFits.height, heightMode),
|
constrainedWidth, sizeThatFits.width, widthMode),
|
||||||
|
.height = YGSanitizeMeasurement(
|
||||||
|
constrainedHeight, sizeThatFits.height, heightMode),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static CGFloat YGSanitizeMeasurement(
|
static CGFloat YGSanitizeMeasurement(
|
||||||
CGFloat constrainedSize,
|
CGFloat constrainedSize,
|
||||||
CGFloat measuredSize,
|
CGFloat measuredSize,
|
||||||
YGMeasureMode measureMode)
|
YGMeasureMode measureMode) {
|
||||||
{
|
|
||||||
CGFloat result;
|
CGFloat result;
|
||||||
if (measureMode == YGMeasureModeExactly) {
|
if (measureMode == YGMeasureModeExactly) {
|
||||||
result = constrainedSize;
|
result = constrainedSize;
|
||||||
@@ -332,13 +397,14 @@ static CGFloat YGSanitizeMeasurement(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL YGNodeHasExactSameChildren(const YGNodeRef node, NSArray<UIView *> *subviews)
|
static BOOL YGNodeHasExactSameChildren(
|
||||||
{
|
const YGNodeRef node,
|
||||||
|
NSArray<UIView*>* subviews) {
|
||||||
if (YGNodeGetChildCount(node) != subviews.count) {
|
if (YGNodeGetChildCount(node) != subviews.count) {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<subviews.count; i++) {
|
for (int i = 0; i < subviews.count; i++) {
|
||||||
if (YGNodeGetChild(node, i) != subviews[i].yoga.node) {
|
if (YGNodeGetChild(node, i) != subviews[i].yoga.node) {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
@@ -347,9 +413,8 @@ static BOOL YGNodeHasExactSameChildren(const YGNodeRef node, NSArray<UIView *> *
|
|||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void YGAttachNodesFromViewHierachy(UIView *const view)
|
static void YGAttachNodesFromViewHierachy(UIView* const view) {
|
||||||
{
|
YGLayout* const yoga = view.yoga;
|
||||||
YGLayout *const yoga = view.yoga;
|
|
||||||
const YGNodeRef node = yoga.node;
|
const YGNodeRef node = yoga.node;
|
||||||
|
|
||||||
// Only leaf nodes should have a measure function
|
// Only leaf nodes should have a measure function
|
||||||
@@ -359,53 +424,51 @@ static void YGAttachNodesFromViewHierachy(UIView *const view)
|
|||||||
} else {
|
} else {
|
||||||
YGNodeSetMeasureFunc(node, NULL);
|
YGNodeSetMeasureFunc(node, NULL);
|
||||||
|
|
||||||
NSMutableArray<UIView *> *subviewsToInclude = [[NSMutableArray alloc] initWithCapacity:view.subviews.count];
|
NSMutableArray<UIView*>* subviewsToInclude =
|
||||||
for (UIView *subview in view.subviews) {
|
[[NSMutableArray alloc] initWithCapacity:view.subviews.count];
|
||||||
if (subview.yoga.isIncludedInLayout) {
|
for (UIView* subview in view.subviews) {
|
||||||
|
if (subview.yoga.isEnabled && subview.yoga.isIncludedInLayout) {
|
||||||
[subviewsToInclude addObject:subview];
|
[subviewsToInclude addObject:subview];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!YGNodeHasExactSameChildren(node, subviewsToInclude)) {
|
if (!YGNodeHasExactSameChildren(node, subviewsToInclude)) {
|
||||||
YGRemoveAllChildren(node);
|
YGRemoveAllChildren(node);
|
||||||
for (int i=0; i<subviewsToInclude.count; i++) {
|
for (int i = 0; i < subviewsToInclude.count; i++) {
|
||||||
YGNodeInsertChild(node, subviewsToInclude[i].yoga.node, i);
|
YGNodeInsertChild(node, subviewsToInclude[i].yoga.node, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (UIView *const subview in subviewsToInclude) {
|
for (UIView* const subview in subviewsToInclude) {
|
||||||
YGAttachNodesFromViewHierachy(subview);
|
YGAttachNodesFromViewHierachy(subview);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void YGRemoveAllChildren(const YGNodeRef node)
|
static void YGRemoveAllChildren(const YGNodeRef node) {
|
||||||
{
|
|
||||||
if (node == NULL) {
|
if (node == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (YGNodeGetChildCount(node) > 0) {
|
YGNodeRemoveAllChildren(node);
|
||||||
YGNodeRemoveChild(node, YGNodeGetChild(node, YGNodeGetChildCount(node) - 1));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static CGFloat YGRoundPixelValue(CGFloat value)
|
static CGFloat YGRoundPixelValue(CGFloat value) {
|
||||||
{
|
|
||||||
static CGFloat scale;
|
static CGFloat scale;
|
||||||
static dispatch_once_t onceToken;
|
static dispatch_once_t onceToken;
|
||||||
dispatch_once(&onceToken, ^(){
|
dispatch_once(&onceToken, ^() {
|
||||||
scale = [UIScreen mainScreen].scale;
|
scale = [UIScreen mainScreen].scale;
|
||||||
});
|
});
|
||||||
|
|
||||||
return roundf(value * scale) / scale;
|
return roundf(value * scale) / scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void YGApplyLayoutToViewHierarchy(UIView *view, BOOL preserveOrigin)
|
static void YGApplyLayoutToViewHierarchy(UIView* view, BOOL preserveOrigin) {
|
||||||
{
|
NSCAssert(
|
||||||
NSCAssert([NSThread isMainThread], @"Framesetting should only be done on the main thread.");
|
[NSThread isMainThread],
|
||||||
|
@"Framesetting should only be done on the main thread.");
|
||||||
|
|
||||||
const YGLayout *yoga = view.yoga;
|
const YGLayout* yoga = view.yoga;
|
||||||
|
|
||||||
if (!yoga.isIncludedInLayout) {
|
if (!yoga.isIncludedInLayout) {
|
||||||
return;
|
return;
|
||||||
@@ -423,19 +486,23 @@ static void YGApplyLayoutToViewHierarchy(UIView *view, BOOL preserveOrigin)
|
|||||||
};
|
};
|
||||||
|
|
||||||
const CGPoint origin = preserveOrigin ? view.frame.origin : CGPointZero;
|
const CGPoint origin = preserveOrigin ? view.frame.origin : CGPointZero;
|
||||||
view.frame = (CGRect) {
|
view.frame = (CGRect){
|
||||||
.origin = {
|
.origin =
|
||||||
|
{
|
||||||
.x = YGRoundPixelValue(topLeft.x + origin.x),
|
.x = YGRoundPixelValue(topLeft.x + origin.x),
|
||||||
.y = YGRoundPixelValue(topLeft.y + origin.y),
|
.y = YGRoundPixelValue(topLeft.y + origin.y),
|
||||||
},
|
},
|
||||||
.size = {
|
.size =
|
||||||
.width = YGRoundPixelValue(bottomRight.x) - YGRoundPixelValue(topLeft.x),
|
{
|
||||||
.height = YGRoundPixelValue(bottomRight.y) - YGRoundPixelValue(topLeft.y),
|
.width = YGRoundPixelValue(bottomRight.x) -
|
||||||
|
YGRoundPixelValue(topLeft.x),
|
||||||
|
.height = YGRoundPixelValue(bottomRight.y) -
|
||||||
|
YGRoundPixelValue(topLeft.y),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!yoga.isLeaf) {
|
if (!yoga.isLeaf) {
|
||||||
for (NSUInteger i=0; i<view.subviews.count; i++) {
|
for (NSUInteger i = 0; i < view.subviews.count; i++) {
|
||||||
YGApplyLayoutToViewHierarchy(view.subviews[i], NO);
|
YGApplyLayoutToViewHierarchy(view.subviews[i], NO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,12 +1,11 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import yoga;
|
||||||
postfix operator %
|
postfix operator %
|
||||||
|
|
||||||
extension Int {
|
extension Int {
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <XCTest/XCTest.h>
|
#import <XCTest/XCTest.h>
|
||||||
@@ -18,17 +16,15 @@
|
|||||||
|
|
||||||
@implementation YogaKitTests
|
@implementation YogaKitTests
|
||||||
|
|
||||||
- (void)testConfigureLayoutIsNoOpWithNilBlock
|
- (void)testConfigureLayoutIsNoOpWithNilBlock {
|
||||||
{
|
UIView* view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
|
||||||
id block = nil;
|
id block = nil;
|
||||||
XCTAssertNoThrow([view configureLayoutWithBlock:block]);
|
XCTAssertNoThrow([view configureLayoutWithBlock:block]);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testConfigureLayoutBlockWorksWithValidBlock
|
- (void)testConfigureLayoutBlockWorksWithValidBlock {
|
||||||
{
|
UIView* view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
[view configureLayoutWithBlock:^(YGLayout* layout) {
|
||||||
[view configureLayoutWithBlock:^(YGLayout *layout){
|
|
||||||
XCTAssertNotNil(layout);
|
XCTAssertNotNil(layout);
|
||||||
layout.isEnabled = YES;
|
layout.isEnabled = YES;
|
||||||
layout.width = YGPointValue(25);
|
layout.width = YGPointValue(25);
|
||||||
@@ -38,12 +34,11 @@
|
|||||||
XCTAssertEqual(view.yoga.width.value, 25);
|
XCTAssertEqual(view.yoga.width.value, 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testNodesAreDeallocedWithSingleView
|
- (void)testNodesAreDeallocedWithSingleView {
|
||||||
{
|
__weak YGLayout* layoutRef = nil;
|
||||||
__weak YGLayout *layoutRef = nil;
|
|
||||||
|
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
view.yoga.flexBasis = YGPointValue(1);
|
view.yoga.flexBasis = YGPointValue(1);
|
||||||
|
|
||||||
layoutRef = view.yoga;
|
layoutRef = view.yoga;
|
||||||
@@ -55,17 +50,16 @@
|
|||||||
XCTAssertNil(layoutRef);
|
XCTAssertNil(layoutRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testNodesAreDeallocedCascade
|
- (void)testNodesAreDeallocedCascade {
|
||||||
{
|
__weak YGLayout* topLayout = nil;
|
||||||
__weak YGLayout *topLayout = nil;
|
__weak YGLayout* subviewLayout = nil;
|
||||||
__weak YGLayout *subviewLayout = nil;
|
|
||||||
|
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
topLayout = view.yoga;
|
topLayout = view.yoga;
|
||||||
topLayout.flexBasis = YGPointValue(1);
|
topLayout.flexBasis = YGPointValue(1);
|
||||||
|
|
||||||
UIView *subview = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subviewLayout = subview.yoga;
|
subviewLayout = subview.yoga;
|
||||||
subviewLayout.flexBasis = YGPointValue(1);
|
subviewLayout.flexBasis = YGPointValue(1);
|
||||||
|
|
||||||
@@ -76,9 +70,8 @@
|
|||||||
XCTAssertNil(subviewLayout);
|
XCTAssertNil(subviewLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testIsEnabled
|
- (void)testIsEnabled {
|
||||||
{
|
UIView* view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
|
||||||
XCTAssertFalse(view.yoga.isEnabled);
|
XCTAssertFalse(view.yoga.isEnabled);
|
||||||
|
|
||||||
view.yoga.isEnabled = YES;
|
view.yoga.isEnabled = YES;
|
||||||
@@ -88,30 +81,31 @@
|
|||||||
XCTAssertFalse(view.yoga.isEnabled);
|
XCTAssertFalse(view.yoga.isEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testSizeThatFitsAsserts
|
- (void)testSizeThatFitsAsserts {
|
||||||
{
|
UIView* view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
dispatch_sync(
|
||||||
dispatch_sync(dispatch_queue_create("com.facebook.Yoga.testing", DISPATCH_QUEUE_SERIAL), ^(void){
|
dispatch_queue_create("com.facebook.Yoga.testing", DISPATCH_QUEUE_SERIAL),
|
||||||
|
^(void) {
|
||||||
XCTAssertThrows(view.yoga.intrinsicSize);
|
XCTAssertThrows(view.yoga.intrinsicSize);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testSizeThatFitsSmoke
|
- (void)testSizeThatFitsSmoke {
|
||||||
{
|
UIView* container = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectZero];
|
|
||||||
container.yoga.isEnabled = YES;
|
container.yoga.isEnabled = YES;
|
||||||
container.yoga.flexDirection = YGFlexDirectionRow;
|
container.yoga.flexDirection = YGFlexDirectionRow;
|
||||||
container.yoga.alignItems = YGAlignFlexStart;
|
container.yoga.alignItems = YGAlignFlexStart;
|
||||||
|
|
||||||
UILabel *longTextLabel = [[UILabel alloc] initWithFrame:CGRectZero];
|
UILabel* longTextLabel = [[UILabel alloc] initWithFrame:CGRectZero];
|
||||||
longTextLabel.text = @"This is a very very very very very very very very long piece of text.";
|
longTextLabel.text =
|
||||||
|
@"This is a very very very very very very very very long piece of text.";
|
||||||
longTextLabel.lineBreakMode = NSLineBreakByTruncatingTail;
|
longTextLabel.lineBreakMode = NSLineBreakByTruncatingTail;
|
||||||
longTextLabel.numberOfLines = 1;
|
longTextLabel.numberOfLines = 1;
|
||||||
longTextLabel.yoga.isEnabled = YES;
|
longTextLabel.yoga.isEnabled = YES;
|
||||||
longTextLabel.yoga.flexShrink = 1;
|
longTextLabel.yoga.flexShrink = 1;
|
||||||
[container addSubview:longTextLabel];
|
[container addSubview:longTextLabel];
|
||||||
|
|
||||||
UIView *textBadgeView = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* textBadgeView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
textBadgeView.yoga.isEnabled = YES;
|
textBadgeView.yoga.isEnabled = YES;
|
||||||
textBadgeView.yoga.margin = YGPointValue(0);
|
textBadgeView.yoga.margin = YGPointValue(0);
|
||||||
textBadgeView.yoga.width = YGPointValue(10);
|
textBadgeView.yoga.width = YGPointValue(10);
|
||||||
@@ -126,21 +120,31 @@
|
|||||||
const CGSize longTextLabelSize = longTextLabel.yoga.intrinsicSize;
|
const CGSize longTextLabelSize = longTextLabel.yoga.intrinsicSize;
|
||||||
|
|
||||||
XCTAssertEqual(longTextLabelSize.height, containerSize.height);
|
XCTAssertEqual(longTextLabelSize.height, containerSize.height);
|
||||||
XCTAssertEqual(longTextLabelSize.width + textBadgeView.yoga.intrinsicSize.width, containerSize.width);
|
XCTAssertEqual(
|
||||||
|
longTextLabelSize.width + textBadgeView.yoga.intrinsicSize.width,
|
||||||
|
containerSize.width);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testPreservingOrigin
|
- (void)testSizeThatFitsEmptyView {
|
||||||
{
|
UIView* view = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 200, 200)];
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0,0,50,75)];
|
view.yoga.isEnabled = YES;
|
||||||
|
|
||||||
|
const CGSize viewSize = view.yoga.intrinsicSize;
|
||||||
|
XCTAssertEqual(viewSize.height, 0);
|
||||||
|
XCTAssertEqual(viewSize.width, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)testPreservingOrigin {
|
||||||
|
UIView* container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 75)];
|
||||||
container.yoga.isEnabled = YES;
|
container.yoga.isEnabled = YES;
|
||||||
|
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
view.yoga.isEnabled = YES;
|
view.yoga.isEnabled = YES;
|
||||||
view.yoga.flexBasis = YGPointValue(0);
|
view.yoga.flexBasis = YGPointValue(0);
|
||||||
view.yoga.flexGrow = 1;
|
view.yoga.flexGrow = 1;
|
||||||
[container addSubview:view];
|
[container addSubview:view];
|
||||||
|
|
||||||
UIView *view2 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* view2 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
view2.yoga.isEnabled = YES;
|
view2.yoga.isEnabled = YES;
|
||||||
view2.yoga.marginTop = YGPointValue(25);
|
view2.yoga.marginTop = YGPointValue(25);
|
||||||
view2.yoga.flexBasis = YGPointValue(0);
|
view2.yoga.flexBasis = YGPointValue(0);
|
||||||
@@ -154,60 +158,63 @@
|
|||||||
XCTAssertEqual(25, view2.frame.origin.y);
|
XCTAssertEqual(25, view2.frame.origin.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testContainerWithFlexibleWidthGetsCorrectlySized
|
- (void)testContainerWithFlexibleWidthGetsCorrectlySized {
|
||||||
{
|
UIView* container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0,0,200,200)];
|
|
||||||
container.yoga.isEnabled = YES;
|
container.yoga.isEnabled = YES;
|
||||||
|
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
|
UIView* view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
|
||||||
view.yoga.isEnabled = YES;
|
view.yoga.isEnabled = YES;
|
||||||
view.yoga.width = YGPointValue(100);
|
view.yoga.width = YGPointValue(100);
|
||||||
view.yoga.height = YGPointValue(100);
|
view.yoga.height = YGPointValue(100);
|
||||||
[container addSubview:view];
|
[container addSubview:view];
|
||||||
|
|
||||||
[container.yoga applyLayoutPreservingOrigin:YES dimensionFlexibility:YGDimensionFlexibilityFlexibleWidth];
|
[container.yoga
|
||||||
|
applyLayoutPreservingOrigin:YES
|
||||||
|
dimensionFlexibility:YGDimensionFlexibilityFlexibleWidth];
|
||||||
XCTAssertEqual(100, container.frame.size.width);
|
XCTAssertEqual(100, container.frame.size.width);
|
||||||
XCTAssertEqual(200, container.frame.size.height);
|
XCTAssertEqual(200, container.frame.size.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testContainerWithFlexibleHeightGetsCorrectlySized
|
- (void)testContainerWithFlexibleHeightGetsCorrectlySized {
|
||||||
{
|
UIView* container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0,0,200,200)];
|
|
||||||
container.yoga.isEnabled = YES;
|
container.yoga.isEnabled = YES;
|
||||||
|
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
|
UIView* view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
|
||||||
view.yoga.isEnabled = YES;
|
view.yoga.isEnabled = YES;
|
||||||
view.yoga.width = YGPointValue(100);
|
view.yoga.width = YGPointValue(100);
|
||||||
view.yoga.height = YGPointValue(100);
|
view.yoga.height = YGPointValue(100);
|
||||||
[container addSubview:view];
|
[container addSubview:view];
|
||||||
|
|
||||||
[container.yoga applyLayoutPreservingOrigin:YES dimensionFlexibility:YGDimensionFlexibilityFlexibleHeigth];
|
[container.yoga
|
||||||
|
applyLayoutPreservingOrigin:YES
|
||||||
|
dimensionFlexibility:YGDimensionFlexibilityFlexibleHeight];
|
||||||
XCTAssertEqual(200, container.frame.size.width);
|
XCTAssertEqual(200, container.frame.size.width);
|
||||||
XCTAssertEqual(100, container.frame.size.height);
|
XCTAssertEqual(100, container.frame.size.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testContainerWithFlexibleWidthAndHeightGetsCorrectlySized
|
- (void)testContainerWithFlexibleWidthAndHeightGetsCorrectlySized {
|
||||||
{
|
UIView* container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0,0,200,200)];
|
|
||||||
container.yoga.isEnabled = YES;
|
container.yoga.isEnabled = YES;
|
||||||
|
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
|
UIView* view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
|
||||||
view.yoga.isEnabled = YES;
|
view.yoga.isEnabled = YES;
|
||||||
view.yoga.width = YGPointValue(100);
|
view.yoga.width = YGPointValue(100);
|
||||||
view.yoga.height = YGPointValue(100);
|
view.yoga.height = YGPointValue(100);
|
||||||
[container addSubview:view];
|
[container addSubview:view];
|
||||||
|
|
||||||
[container.yoga applyLayoutPreservingOrigin:YES dimensionFlexibility:YGDimensionFlexibilityFlexibleWidth | YGDimensionFlexibilityFlexibleHeigth];
|
[container.yoga
|
||||||
|
applyLayoutPreservingOrigin:YES
|
||||||
|
dimensionFlexibility:YGDimensionFlexibilityFlexibleWidth |
|
||||||
|
YGDimensionFlexibilityFlexibleHeight];
|
||||||
XCTAssertEqual(100, container.frame.size.width);
|
XCTAssertEqual(100, container.frame.size.width);
|
||||||
XCTAssertEqual(100, container.frame.size.height);
|
XCTAssertEqual(100, container.frame.size.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testMarkingDirtyOnlyWorksOnLeafNodes
|
- (void)testMarkingDirtyOnlyWorksOnLeafNodes {
|
||||||
{
|
UIView* container = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectZero];
|
|
||||||
container.yoga.isEnabled = YES;
|
container.yoga.isEnabled = YES;
|
||||||
|
|
||||||
UIView *subview = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview.yoga.isEnabled = YES;
|
subview.yoga.isEnabled = YES;
|
||||||
[container addSubview:subview];
|
[container addSubview:subview];
|
||||||
|
|
||||||
@@ -220,14 +227,13 @@
|
|||||||
XCTAssertTrue(subview.yoga.isDirty);
|
XCTAssertTrue(subview.yoga.isDirty);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testThatMarkingLeafsAsDirtyWillTriggerASizeRecalculation
|
- (void)testThatMarkingLeafsAsDirtyWillTriggerASizeRecalculation {
|
||||||
{
|
UIView* container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 500, 50)];
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 500, 50)];
|
|
||||||
container.yoga.isEnabled = YES;
|
container.yoga.isEnabled = YES;
|
||||||
container.yoga.flexDirection = YGFlexDirectionRow;
|
container.yoga.flexDirection = YGFlexDirectionRow;
|
||||||
container.yoga.alignItems = YGAlignFlexStart;
|
container.yoga.alignItems = YGAlignFlexStart;
|
||||||
|
|
||||||
UILabel *view = [[UILabel alloc] initWithFrame:CGRectZero];
|
UILabel* view = [[UILabel alloc] initWithFrame:CGRectZero];
|
||||||
view.text = @"This is a short text.";
|
view.text = @"This is a short text.";
|
||||||
view.numberOfLines = 1;
|
view.numberOfLines = 1;
|
||||||
view.yoga.isEnabled = YES;
|
view.yoga.isEnabled = YES;
|
||||||
@@ -245,61 +251,74 @@
|
|||||||
XCTAssertFalse(CGSizeEqualToSize(view.frame.size, viewSizeAfterFirstPass));
|
XCTAssertFalse(CGSizeEqualToSize(view.frame.size, viewSizeAfterFirstPass));
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testFrameAndOriginPlacement
|
- (void)testFrameAndOriginPlacement {
|
||||||
{
|
// https://www.internalfb.com/intern/test/562950017690956
|
||||||
|
XCTSkip(
|
||||||
|
@"TODO: this test fails with actual dimensions off by 1px from expected");
|
||||||
|
|
||||||
const CGSize containerSize = CGSizeMake(320, 50);
|
const CGSize containerSize = CGSizeMake(320, 50);
|
||||||
|
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, containerSize.width, containerSize.height)];
|
UIView* container = [[UIView alloc]
|
||||||
|
initWithFrame:CGRectMake(
|
||||||
|
0, 0, containerSize.width, containerSize.height)];
|
||||||
container.yoga.isEnabled = YES;
|
container.yoga.isEnabled = YES;
|
||||||
container.yoga.flexDirection = YGFlexDirectionRow;
|
container.yoga.flexDirection = YGFlexDirectionRow;
|
||||||
|
|
||||||
UIView *subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview1.yoga.isEnabled = YES;
|
subview1.yoga.isEnabled = YES;
|
||||||
subview1.yoga.flexGrow = 1;
|
subview1.yoga.flexGrow = 1;
|
||||||
[container addSubview:subview1];
|
[container addSubview:subview1];
|
||||||
|
|
||||||
UIView *subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview2.yoga.isEnabled = YES;
|
subview2.yoga.isEnabled = YES;
|
||||||
subview2.yoga.flexGrow = 1;
|
subview2.yoga.flexGrow = 1;
|
||||||
[container addSubview:subview2];
|
[container addSubview:subview2];
|
||||||
|
|
||||||
UIView *subview3 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview3 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview3.yoga.isEnabled = YES;
|
subview3.yoga.isEnabled = YES;
|
||||||
subview3.yoga.flexGrow = 1;
|
subview3.yoga.flexGrow = 1;
|
||||||
[container addSubview:subview3];
|
[container addSubview:subview3];
|
||||||
|
|
||||||
[container.yoga applyLayoutPreservingOrigin:YES];
|
[container.yoga applyLayoutPreservingOrigin:YES];
|
||||||
|
|
||||||
XCTAssertEqualWithAccuracy(subview2.frame.origin.x, CGRectGetMaxX(subview1.frame), FLT_EPSILON);
|
XCTAssertEqualWithAccuracy(
|
||||||
XCTAssertEqualWithAccuracy(subview3.frame.origin.x, CGRectGetMaxX(subview2.frame), FLT_EPSILON);
|
subview2.frame.origin.x, CGRectGetMaxX(subview1.frame), FLT_EPSILON);
|
||||||
|
XCTAssertEqualWithAccuracy(
|
||||||
|
subview3.frame.origin.x, CGRectGetMaxX(subview2.frame), FLT_EPSILON);
|
||||||
|
|
||||||
CGFloat totalWidth = 0;
|
CGFloat totalWidth = 0;
|
||||||
for (UIView *view in container.subviews) {
|
for (UIView* view in container.subviews) {
|
||||||
totalWidth += view.bounds.size.width;
|
totalWidth += view.bounds.size.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
XCTAssertEqual(containerSize.width, totalWidth, @"The container's width is %.6f, the subviews take up %.6f", containerSize.width, totalWidth);
|
XCTAssertEqual(
|
||||||
|
containerSize.width,
|
||||||
|
totalWidth,
|
||||||
|
@"The container's width is %.6f, the subviews take up %.6f",
|
||||||
|
containerSize.width,
|
||||||
|
totalWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testThatLayoutIsCorrectWhenWeSwapViewOrder
|
- (void)testThatLayoutIsCorrectWhenWeSwapViewOrder {
|
||||||
{
|
|
||||||
const CGSize containerSize = CGSizeMake(300, 50);
|
const CGSize containerSize = CGSizeMake(300, 50);
|
||||||
|
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, containerSize.width, containerSize.height)];
|
UIView* container = [[UIView alloc]
|
||||||
|
initWithFrame:CGRectMake(
|
||||||
|
0, 0, containerSize.width, containerSize.height)];
|
||||||
container.yoga.isEnabled = YES;
|
container.yoga.isEnabled = YES;
|
||||||
container.yoga.flexDirection = YGFlexDirectionRow;
|
container.yoga.flexDirection = YGFlexDirectionRow;
|
||||||
|
|
||||||
UIView *subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview1.yoga.isEnabled = YES;
|
subview1.yoga.isEnabled = YES;
|
||||||
subview1.yoga.flexGrow = 1;
|
subview1.yoga.flexGrow = 1;
|
||||||
[container addSubview:subview1];
|
[container addSubview:subview1];
|
||||||
|
|
||||||
UIView *subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview2.yoga.isEnabled = YES;
|
subview2.yoga.isEnabled = YES;
|
||||||
subview2.yoga.flexGrow = 1;
|
subview2.yoga.flexGrow = 1;
|
||||||
[container addSubview:subview2];
|
[container addSubview:subview2];
|
||||||
|
|
||||||
UIView *subview3 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview3 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview3.yoga.isEnabled = YES;
|
subview3.yoga.isEnabled = YES;
|
||||||
subview3.yoga.flexGrow = 1;
|
subview3.yoga.flexGrow = 1;
|
||||||
[container addSubview:subview3];
|
[container addSubview:subview3];
|
||||||
@@ -321,32 +340,33 @@
|
|||||||
XCTAssertTrue(CGRectEqualToRect(subview2.frame, CGRectMake(100, 0, 100, 50)));
|
XCTAssertTrue(CGRectEqualToRect(subview2.frame, CGRectMake(100, 0, 100, 50)));
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testThatWeRespectIncludeInLayoutFlag
|
- (void)testThatWeRespectIncludeInLayoutFlag {
|
||||||
{
|
|
||||||
const CGSize containerSize = CGSizeMake(300, 50);
|
const CGSize containerSize = CGSizeMake(300, 50);
|
||||||
|
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, containerSize.width, containerSize.height)];
|
UIView* container = [[UIView alloc]
|
||||||
|
initWithFrame:CGRectMake(
|
||||||
|
0, 0, containerSize.width, containerSize.height)];
|
||||||
container.yoga.isEnabled = YES;
|
container.yoga.isEnabled = YES;
|
||||||
container.yoga.flexDirection = YGFlexDirectionRow;
|
container.yoga.flexDirection = YGFlexDirectionRow;
|
||||||
|
|
||||||
UIView *subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview1.yoga.isEnabled = YES;
|
subview1.yoga.isEnabled = YES;
|
||||||
subview1.yoga.flexGrow = 1;
|
subview1.yoga.flexGrow = 1;
|
||||||
[container addSubview:subview1];
|
[container addSubview:subview1];
|
||||||
|
|
||||||
UIView *subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview2.yoga.isEnabled = YES;
|
subview2.yoga.isEnabled = YES;
|
||||||
subview2.yoga.flexGrow = 1;
|
subview2.yoga.flexGrow = 1;
|
||||||
[container addSubview:subview2];
|
[container addSubview:subview2];
|
||||||
|
|
||||||
UIView *subview3 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview3 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview3.yoga.isEnabled = YES;
|
subview3.yoga.isEnabled = YES;
|
||||||
subview3.yoga.flexGrow = 1;
|
subview3.yoga.flexGrow = 1;
|
||||||
[container addSubview:subview3];
|
[container addSubview:subview3];
|
||||||
|
|
||||||
[container.yoga applyLayoutPreservingOrigin:YES];
|
[container.yoga applyLayoutPreservingOrigin:YES];
|
||||||
|
|
||||||
for (UIView *subview in container.subviews) {
|
for (UIView* subview in container.subviews) {
|
||||||
XCTAssertEqual(subview.bounds.size.width, 100);
|
XCTAssertEqual(subview.bounds.size.width, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,27 +376,27 @@
|
|||||||
XCTAssertEqual(subview1.bounds.size.width, 150);
|
XCTAssertEqual(subview1.bounds.size.width, 150);
|
||||||
XCTAssertEqual(subview2.bounds.size.width, 150);
|
XCTAssertEqual(subview2.bounds.size.width, 150);
|
||||||
|
|
||||||
// We don't set the frame to zero, so, it should be set to what it was previously at.
|
// We don't set the frame to zero, so, it should be set to what it was
|
||||||
|
// previously at.
|
||||||
XCTAssertEqual(subview3.bounds.size.width, 100);
|
XCTAssertEqual(subview3.bounds.size.width, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testThatNumberOfChildrenIsCorrectWhenWeIgnoreSubviews
|
- (void)testThatNumberOfChildrenIsCorrectWhenWeIgnoreSubviews {
|
||||||
{
|
UIView* container = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectZero];
|
|
||||||
container.yoga.isEnabled = YES;
|
container.yoga.isEnabled = YES;
|
||||||
container.yoga.flexDirection = YGFlexDirectionRow;
|
container.yoga.flexDirection = YGFlexDirectionRow;
|
||||||
|
|
||||||
UIView *subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview1.yoga.isEnabled = YES;
|
subview1.yoga.isEnabled = YES;
|
||||||
subview1.yoga.isIncludedInLayout = NO;
|
subview1.yoga.isIncludedInLayout = NO;
|
||||||
[container addSubview:subview1];
|
[container addSubview:subview1];
|
||||||
|
|
||||||
UIView *subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview2.yoga.isEnabled = YES;
|
subview2.yoga.isEnabled = YES;
|
||||||
subview2.yoga.isIncludedInLayout = NO;
|
subview2.yoga.isIncludedInLayout = NO;
|
||||||
[container addSubview:subview2];
|
[container addSubview:subview2];
|
||||||
|
|
||||||
UIView *subview3 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview3 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview3.yoga.isEnabled = YES;
|
subview3.yoga.isEnabled = YES;
|
||||||
subview3.yoga.isIncludedInLayout = YES;
|
subview3.yoga.isIncludedInLayout = YES;
|
||||||
[container addSubview:subview3];
|
[container addSubview:subview3];
|
||||||
@@ -389,23 +409,22 @@
|
|||||||
XCTAssertEqual(container.yoga.numberOfChildren, 2);
|
XCTAssertEqual(container.yoga.numberOfChildren, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testThatViewNotIncludedInFirstLayoutPassAreIncludedInSecond
|
- (void)testThatViewNotIncludedInFirstLayoutPassAreIncludedInSecond {
|
||||||
{
|
UIView* container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 50)];
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 50)];
|
|
||||||
container.yoga.isEnabled = YES;
|
container.yoga.isEnabled = YES;
|
||||||
container.yoga.flexDirection = YGFlexDirectionRow;
|
container.yoga.flexDirection = YGFlexDirectionRow;
|
||||||
|
|
||||||
UIView *subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview1.yoga.isEnabled = YES;
|
subview1.yoga.isEnabled = YES;
|
||||||
subview1.yoga.flexGrow = 1;
|
subview1.yoga.flexGrow = 1;
|
||||||
[container addSubview:subview1];
|
[container addSubview:subview1];
|
||||||
|
|
||||||
UIView *subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview2.yoga.isEnabled = YES;
|
subview2.yoga.isEnabled = YES;
|
||||||
subview2.yoga.flexGrow = 1;
|
subview2.yoga.flexGrow = 1;
|
||||||
[container addSubview:subview2];
|
[container addSubview:subview2];
|
||||||
|
|
||||||
UIView *subview3 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview3 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview3.yoga.isEnabled = YES;
|
subview3.yoga.isEnabled = YES;
|
||||||
subview3.yoga.flexGrow = 1;
|
subview3.yoga.flexGrow = 1;
|
||||||
subview3.yoga.isIncludedInLayout = NO;
|
subview3.yoga.isIncludedInLayout = NO;
|
||||||
@@ -425,13 +444,12 @@
|
|||||||
XCTAssertEqual(subview3.bounds.size.width, 100);
|
XCTAssertEqual(subview3.bounds.size.width, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testIsLeafFlag
|
- (void)testIsLeafFlag {
|
||||||
{
|
UIView* view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
|
||||||
XCTAssertTrue(view.yoga.isLeaf);
|
XCTAssertTrue(view.yoga.isLeaf);
|
||||||
|
|
||||||
for (int i=0; i<10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
UIView *subview = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
[view addSubview:subview];
|
[view addSubview:subview];
|
||||||
}
|
}
|
||||||
XCTAssertTrue(view.yoga.isLeaf);
|
XCTAssertTrue(view.yoga.isLeaf);
|
||||||
@@ -440,34 +458,33 @@
|
|||||||
view.yoga.width = YGPointValue(50);
|
view.yoga.width = YGPointValue(50);
|
||||||
XCTAssertTrue(view.yoga.isLeaf);
|
XCTAssertTrue(view.yoga.isLeaf);
|
||||||
|
|
||||||
UIView *const subview = view.subviews[0];
|
UIView* const subview = view.subviews[0];
|
||||||
subview.yoga.isEnabled = YES;
|
subview.yoga.isEnabled = YES;
|
||||||
subview.yoga.width = YGPointValue(50);
|
subview.yoga.width = YGPointValue(50);
|
||||||
XCTAssertFalse(view.yoga.isLeaf);
|
XCTAssertFalse(view.yoga.isLeaf);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testThatWeCorrectlyAttachNestedViews
|
- (void)testThatWeCorrectlyAttachNestedViews {
|
||||||
{
|
UIView* container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 50)];
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 50)];
|
|
||||||
container.yoga.isEnabled = YES;
|
container.yoga.isEnabled = YES;
|
||||||
container.yoga.flexDirection = YGFlexDirectionColumn;
|
container.yoga.flexDirection = YGFlexDirectionColumn;
|
||||||
|
|
||||||
UIView *subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview1.yoga.isEnabled = YES;
|
subview1.yoga.isEnabled = YES;
|
||||||
subview1.yoga.width = YGPointValue(100);
|
subview1.yoga.width = YGPointValue(100);
|
||||||
subview1.yoga.flexGrow = 1;
|
subview1.yoga.flexGrow = 1;
|
||||||
subview1.yoga.flexDirection = YGFlexDirectionColumn;
|
subview1.yoga.flexDirection = YGFlexDirectionColumn;
|
||||||
[container addSubview:subview1];
|
[container addSubview:subview1];
|
||||||
|
|
||||||
UIView *subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview2.yoga.isEnabled = YES;
|
subview2.yoga.isEnabled = YES;
|
||||||
subview2.yoga.width = YGPointValue(150);
|
subview2.yoga.width = YGPointValue(150);
|
||||||
subview2.yoga.flexGrow = 1;
|
subview2.yoga.flexGrow = 1;
|
||||||
subview2.yoga.flexDirection = YGFlexDirectionColumn;
|
subview2.yoga.flexDirection = YGFlexDirectionColumn;
|
||||||
[container addSubview:subview2];
|
[container addSubview:subview2];
|
||||||
|
|
||||||
for (UIView *view in @[subview1, subview2]) {
|
for (UIView* view in @[ subview1, subview2 ]) {
|
||||||
UIView *someView = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* someView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
someView.yoga.isEnabled = YES;
|
someView.yoga.isEnabled = YES;
|
||||||
someView.yoga.flexGrow = 1;
|
someView.yoga.flexGrow = 1;
|
||||||
[view addSubview:someView];
|
[view addSubview:someView];
|
||||||
@@ -475,8 +492,8 @@
|
|||||||
[container.yoga applyLayoutPreservingOrigin:YES];
|
[container.yoga applyLayoutPreservingOrigin:YES];
|
||||||
|
|
||||||
// Add the same amount of new views, reapply layout.
|
// Add the same amount of new views, reapply layout.
|
||||||
for (UIView *view in @[subview1, subview2]) {
|
for (UIView* view in @[ subview1, subview2 ]) {
|
||||||
UIView *someView = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* someView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
someView.yoga.isEnabled = YES;
|
someView.yoga.isEnabled = YES;
|
||||||
someView.yoga.flexGrow = 1;
|
someView.yoga.flexGrow = 1;
|
||||||
[view addSubview:someView];
|
[view addSubview:someView];
|
||||||
@@ -485,7 +502,7 @@
|
|||||||
|
|
||||||
XCTAssertEqual(subview1.bounds.size.width, 100);
|
XCTAssertEqual(subview1.bounds.size.width, 100);
|
||||||
XCTAssertEqual(subview1.bounds.size.height, 25);
|
XCTAssertEqual(subview1.bounds.size.height, 25);
|
||||||
for (UIView *subview in subview1.subviews) {
|
for (UIView* subview in subview1.subviews) {
|
||||||
const CGSize subviewSize = subview.bounds.size;
|
const CGSize subviewSize = subview.bounds.size;
|
||||||
XCTAssertNotEqual(subviewSize.width, 0);
|
XCTAssertNotEqual(subviewSize.width, 0);
|
||||||
XCTAssertNotEqual(subviewSize.height, 0);
|
XCTAssertNotEqual(subviewSize.height, 0);
|
||||||
@@ -495,7 +512,7 @@
|
|||||||
|
|
||||||
XCTAssertEqual(subview2.bounds.size.width, 150);
|
XCTAssertEqual(subview2.bounds.size.width, 150);
|
||||||
XCTAssertEqual(subview2.bounds.size.height, 25);
|
XCTAssertEqual(subview2.bounds.size.height, 25);
|
||||||
for (UIView *subview in subview2.subviews) {
|
for (UIView* subview in subview2.subviews) {
|
||||||
const CGSize subviewSize = subview.bounds.size;
|
const CGSize subviewSize = subview.bounds.size;
|
||||||
XCTAssertNotEqual(subviewSize.width, 0);
|
XCTAssertNotEqual(subviewSize.width, 0);
|
||||||
XCTAssertNotEqual(subviewSize.height, 0);
|
XCTAssertNotEqual(subviewSize.height, 0);
|
||||||
@@ -504,16 +521,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testThatANonLeafNodeCanBecomeALeafNode
|
- (void)testThatANonLeafNodeCanBecomeALeafNode {
|
||||||
{
|
UIView* container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 50)];
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 50)];
|
|
||||||
container.yoga.isEnabled = YES;
|
container.yoga.isEnabled = YES;
|
||||||
|
|
||||||
UIView *subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview1.yoga.isEnabled = YES;
|
subview1.yoga.isEnabled = YES;
|
||||||
[container addSubview:subview1];
|
[container addSubview:subview1];
|
||||||
|
|
||||||
UIView *subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView* subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview2.yoga.isEnabled = YES;
|
subview2.yoga.isEnabled = YES;
|
||||||
[subview1 addSubview:subview2];
|
[subview1 addSubview:subview2];
|
||||||
|
|
||||||
@@ -522,17 +538,15 @@
|
|||||||
[container.yoga applyLayoutPreservingOrigin:YES];
|
[container.yoga applyLayoutPreservingOrigin:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testPointPercent
|
- (void)testPointPercent {
|
||||||
{
|
|
||||||
XCTAssertEqual(YGPointValue(1).value, 1);
|
XCTAssertEqual(YGPointValue(1).value, 1);
|
||||||
XCTAssertEqual(YGPointValue(1).unit, YGUnitPoint);
|
XCTAssertEqual(YGPointValue(1).unit, YGUnitPoint);
|
||||||
XCTAssertEqual(YGPercentValue(2).value, 2);
|
XCTAssertEqual(YGPercentValue(2).value, 2);
|
||||||
XCTAssertEqual(YGPercentValue(2).unit, YGUnitPercent);
|
XCTAssertEqual(YGPercentValue(2).unit, YGUnitPercent);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testPositionalPropertiesWork
|
- (void)testPositionalPropertiesWork {
|
||||||
{
|
UIView* view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
|
||||||
|
|
||||||
view.yoga.left = YGPointValue(1);
|
view.yoga.left = YGPointValue(1);
|
||||||
XCTAssertEqual(view.yoga.left.value, 1);
|
XCTAssertEqual(view.yoga.left.value, 1);
|
||||||
@@ -577,9 +591,8 @@
|
|||||||
XCTAssertEqual(view.yoga.end.unit, YGUnitPercent);
|
XCTAssertEqual(view.yoga.end.unit, YGUnitPercent);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testMarginPropertiesWork
|
- (void)testMarginPropertiesWork {
|
||||||
{
|
UIView* view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
|
||||||
|
|
||||||
view.yoga.margin = YGPointValue(1);
|
view.yoga.margin = YGPointValue(1);
|
||||||
XCTAssertEqual(view.yoga.margin.value, 1);
|
XCTAssertEqual(view.yoga.margin.value, 1);
|
||||||
@@ -645,9 +658,8 @@
|
|||||||
XCTAssertEqual(view.yoga.marginEnd.unit, YGUnitPercent);
|
XCTAssertEqual(view.yoga.marginEnd.unit, YGUnitPercent);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testPaddingPropertiesWork
|
- (void)testPaddingPropertiesWork {
|
||||||
{
|
UIView* view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
|
||||||
|
|
||||||
view.yoga.padding = YGPointValue(1);
|
view.yoga.padding = YGPointValue(1);
|
||||||
XCTAssertEqual(view.yoga.padding.value, 1);
|
XCTAssertEqual(view.yoga.padding.value, 1);
|
||||||
@@ -713,9 +725,8 @@
|
|||||||
XCTAssertEqual(view.yoga.paddingEnd.unit, YGUnitPercent);
|
XCTAssertEqual(view.yoga.paddingEnd.unit, YGUnitPercent);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testBorderWidthPropertiesWork
|
- (void)testBorderWidthPropertiesWork {
|
||||||
{
|
UIView* view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
|
||||||
|
|
||||||
view.yoga.borderWidth = 1;
|
view.yoga.borderWidth = 1;
|
||||||
XCTAssertEqual(view.yoga.borderWidth, 1);
|
XCTAssertEqual(view.yoga.borderWidth, 1);
|
||||||
|
@@ -1,6 +1,17 @@
|
|||||||
use_frameworks!
|
use_frameworks!
|
||||||
|
|
||||||
|
platform :ios, "13.4"
|
||||||
|
|
||||||
target 'YogaKitSample' do
|
target 'YogaKitSample' do
|
||||||
pod 'YogaKit', :path => '../../YogaKit.podspec'
|
pod 'YogaKit', :path => '../../YogaKit.podspec'
|
||||||
pod 'IGListKit', '~> 2.1.0'
|
pod 'Yoga', :path => '../../Yoga.podspec'
|
||||||
|
pod 'IGListKit', '~> 4.0.0'
|
||||||
|
end
|
||||||
|
|
||||||
|
post_install do |installer|
|
||||||
|
installer.pods_project.targets.each do |target|
|
||||||
|
target.build_configurations.each do |config|
|
||||||
|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.4'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@@ -1,26 +1,33 @@
|
|||||||
PODS:
|
PODS:
|
||||||
- IGListKit (2.1.0):
|
- IGListDiffKit (4.0.0)
|
||||||
- IGListKit/Default (= 2.1.0)
|
- IGListKit (4.0.0):
|
||||||
- IGListKit/Default (2.1.0):
|
- IGListDiffKit (= 4.0.0)
|
||||||
- IGListKit/Diffing
|
- Yoga (2.0.0-beta.1)
|
||||||
- IGListKit/Diffing (2.1.0)
|
- YogaKit (2.0.0-beta.1):
|
||||||
- Yoga (1.5.0)
|
- Yoga (~> 2.0.0-beta.1)
|
||||||
- YogaKit (1.5.0):
|
|
||||||
- Yoga (~> 1.5)
|
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- IGListKit (~> 2.1.0)
|
- IGListKit (~> 4.0.0)
|
||||||
|
- Yoga (from `../../Yoga.podspec`)
|
||||||
- YogaKit (from `../../YogaKit.podspec`)
|
- YogaKit (from `../../YogaKit.podspec`)
|
||||||
|
|
||||||
|
SPEC REPOS:
|
||||||
|
trunk:
|
||||||
|
- IGListDiffKit
|
||||||
|
- IGListKit
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
|
Yoga:
|
||||||
|
:path: "../../Yoga.podspec"
|
||||||
YogaKit:
|
YogaKit:
|
||||||
:path: ../../YogaKit.podspec
|
:path: "../../YogaKit.podspec"
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
IGListKit: b826c68ef7a4ae1626c09d4d3e1ea7a169e6c36e
|
IGListDiffKit: 665d6cf43ce726e676013db9c7d6c4294259b6b2
|
||||||
Yoga: 2ed1d7accfef3610a67f58c0cf101a0662137f2c
|
IGListKit: fd5a5d21935298f5849fa49d426843cff97b77c7
|
||||||
YogaKit: 31576530e8fcae3175469719ec3212397403330b
|
Yoga: 090c6851e548d085d6211b5466b57ba8f4013a90
|
||||||
|
YogaKit: 5ae1939cd7516fdf6c343abb4b4aa381c9911ccf
|
||||||
|
|
||||||
PODFILE CHECKSUM: 216f8e7127767709e0e43f3711208d238fa5c404
|
PODFILE CHECKSUM: e5d9841ef739884db00a29f2d529d16bf247a4ca
|
||||||
|
|
||||||
COCOAPODS: 1.1.1
|
COCOAPODS: 1.12.1
|
||||||
|
@@ -171,7 +171,6 @@
|
|||||||
13687D401DF8748300E7C260 /* Frameworks */,
|
13687D401DF8748300E7C260 /* Frameworks */,
|
||||||
13687D411DF8748300E7C260 /* Resources */,
|
13687D411DF8748300E7C260 /* Resources */,
|
||||||
FA2FB9DD6471BDD3FBCE503B /* [CP] Embed Pods Frameworks */,
|
FA2FB9DD6471BDD3FBCE503B /* [CP] Embed Pods Frameworks */,
|
||||||
6E01EB987F1564F3D71EBE5A /* [CP] Copy Pods Resources */,
|
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -265,28 +264,16 @@
|
|||||||
files = (
|
files = (
|
||||||
);
|
);
|
||||||
inputPaths = (
|
inputPaths = (
|
||||||
|
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||||
|
"${PODS_ROOT}/Manifest.lock",
|
||||||
);
|
);
|
||||||
name = "[CP] Check Pods Manifest.lock";
|
name = "[CP] Check Pods Manifest.lock";
|
||||||
outputPaths = (
|
outputPaths = (
|
||||||
|
"$(DERIVED_FILE_DIR)/Pods-YogaKitSample-checkManifestLockResult.txt",
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
|
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
6E01EB987F1564F3D71EBE5A /* [CP] Copy Pods Resources */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
);
|
|
||||||
name = "[CP] Copy Pods Resources";
|
|
||||||
outputPaths = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-YogaKitSample/Pods-YogaKitSample-resources.sh\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
showEnvVarsInLog = 0;
|
||||||
};
|
};
|
||||||
FA2FB9DD6471BDD3FBCE503B /* [CP] Embed Pods Frameworks */ = {
|
FA2FB9DD6471BDD3FBCE503B /* [CP] Embed Pods Frameworks */ = {
|
||||||
@@ -295,13 +282,22 @@
|
|||||||
files = (
|
files = (
|
||||||
);
|
);
|
||||||
inputPaths = (
|
inputPaths = (
|
||||||
|
"${PODS_ROOT}/Target Support Files/Pods-YogaKitSample/Pods-YogaKitSample-frameworks.sh",
|
||||||
|
"${BUILT_PRODUCTS_DIR}/IGListDiffKit/IGListDiffKit.framework",
|
||||||
|
"${BUILT_PRODUCTS_DIR}/IGListKit/IGListKit.framework",
|
||||||
|
"${BUILT_PRODUCTS_DIR}/Yoga/yoga.framework",
|
||||||
|
"${BUILT_PRODUCTS_DIR}/YogaKit/YogaKit.framework",
|
||||||
);
|
);
|
||||||
name = "[CP] Embed Pods Frameworks";
|
name = "[CP] Embed Pods Frameworks";
|
||||||
outputPaths = (
|
outputPaths = (
|
||||||
|
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/IGListDiffKit.framework",
|
||||||
|
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/IGListKit.framework",
|
||||||
|
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/yoga.framework",
|
||||||
|
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YogaKit.framework",
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-YogaKitSample/Pods-YogaKitSample-frameworks.sh\"\n";
|
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-YogaKitSample/Pods-YogaKitSample-frameworks.sh\"\n";
|
||||||
showEnvVarsInLog = 0;
|
showEnvVarsInLog = 0;
|
||||||
};
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
@@ -359,7 +355,7 @@
|
|||||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
CODE_SIGNING_ALLOWED = NO;
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
@@ -378,7 +374,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 10.1;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
|
||||||
MTL_ENABLE_DEBUG_INFO = YES;
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
@@ -407,7 +403,7 @@
|
|||||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
CODE_SIGNING_ALLOWED = NO;
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
ENABLE_NS_ASSERTIONS = NO;
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
@@ -420,7 +416,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 10.1;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
@@ -439,7 +435,7 @@
|
|||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_INSTALL_OBJC_HEADER = NO;
|
SWIFT_INSTALL_OBJC_HEADER = NO;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
SWIFT_VERSION = 3.0;
|
SWIFT_VERSION = 5.1;
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
@@ -454,7 +450,7 @@
|
|||||||
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitSample;
|
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitSample;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_INSTALL_OBJC_HEADER = NO;
|
SWIFT_INSTALL_OBJC_HEADER = NO;
|
||||||
SWIFT_VERSION = 3.0;
|
SWIFT_VERSION = 5.1;
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
@@ -464,7 +460,7 @@
|
|||||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
INFOPLIST_FILE = YogaKitSampleTests/Info.plist;
|
INFOPLIST_FILE = YogaKitSampleTests/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitSampleTests;
|
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitSampleTests;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
@@ -478,7 +474,7 @@
|
|||||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
INFOPLIST_FILE = YogaKitSampleTests/Info.plist;
|
INFOPLIST_FILE = YogaKitSampleTests/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitSampleTests;
|
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitSampleTests;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
@@ -19,12 +18,12 @@ private final class ExampleModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ExampleModel: IGListDiffable {
|
extension ExampleModel: ListDiffable {
|
||||||
fileprivate func diffIdentifier() -> NSObjectProtocol {
|
fileprivate func diffIdentifier() -> NSObjectProtocol {
|
||||||
return title as NSString
|
return title as NSString
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate func isEqual(toDiffableObject object: IGListDiffable?) -> Bool {
|
fileprivate func isEqual(toDiffableObject object: ListDiffable?) -> Bool {
|
||||||
guard let otherObj = object as? ExampleModel else { return false }
|
guard let otherObj = object as? ExampleModel else { return false }
|
||||||
|
|
||||||
return (title == otherObj.title) &&
|
return (title == otherObj.title) &&
|
||||||
@@ -32,12 +31,16 @@ extension ExampleModel: IGListDiffable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final class ExamplesViewController: UIViewController, IGListAdapterDataSource, IGListSingleSectionControllerDelegate {
|
final class ExamplesViewController: UIViewController, ListAdapterDataSource, ListSingleSectionControllerDelegate {
|
||||||
private lazy var adapter: IGListAdapter = {
|
|
||||||
return IGListAdapter(updater: IGListAdapterUpdater(), viewController: self, workingRangeSize: 0)
|
|
||||||
}()
|
|
||||||
private let collectionView = IGListCollectionView(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout())
|
|
||||||
|
|
||||||
|
private lazy var adapter: ListAdapter = {
|
||||||
|
return ListAdapter(updater: ListAdapterUpdater(), viewController: self, workingRangeSize: 0)
|
||||||
|
}()
|
||||||
|
private lazy var collectionView: UICollectionView = {
|
||||||
|
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout())
|
||||||
|
collectionView.backgroundColor = UIColor.systemBackground
|
||||||
|
return collectionView
|
||||||
|
}()
|
||||||
|
|
||||||
// Update this to array to create more examples.
|
// Update this to array to create more examples.
|
||||||
private let models: [ExampleModel] = [ExampleModel(title: "Basic Layout", controllerClass: BasicViewController.self),
|
private let models: [ExampleModel] = [ExampleModel(title: "Basic Layout", controllerClass: BasicViewController.self),
|
||||||
@@ -60,16 +63,16 @@ final class ExamplesViewController: UIViewController, IGListAdapterDataSource, I
|
|||||||
|
|
||||||
//MARK: IGListAdapterDataSource
|
//MARK: IGListAdapterDataSource
|
||||||
|
|
||||||
func objects(for listAdapter: IGListAdapter) -> [IGListDiffable] {
|
func objects(for listAdapter: ListAdapter) -> [ListDiffable] {
|
||||||
return models as [IGListDiffable]
|
return models as [ListDiffable]
|
||||||
}
|
}
|
||||||
|
|
||||||
func listAdapter(_ listAdapter: IGListAdapter, sectionControllerFor object: Any) -> IGListSectionController {
|
func listAdapter(_ listAdapter: ListAdapter, sectionControllerFor object: Any) -> ListSectionController {
|
||||||
let sizeBlock: IGListSingleSectionCellSizeBlock = { (model, context) in
|
let sizeBlock: ListSingleSectionCellSizeBlock = { (model, context) in
|
||||||
return CGSize(width: (context?.containerSize.width)!, height: 75.0)
|
return CGSize(width: (context?.containerSize.width)!, height: 75.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
let configureBlock: IGListSingleSectionCellConfigureBlock = { (model, cell) in
|
let configureBlock: ListSingleSectionCellConfigureBlock = { (model, cell) in
|
||||||
guard let m = model as? ExampleModel, let c = cell as? SingleLabelCollectionCell else {
|
guard let m = model as? ExampleModel, let c = cell as? SingleLabelCollectionCell else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -77,18 +80,17 @@ final class ExamplesViewController: UIViewController, IGListAdapterDataSource, I
|
|||||||
c.label.text = m.title
|
c.label.text = m.title
|
||||||
}
|
}
|
||||||
|
|
||||||
let sectionController = IGListSingleSectionController(cellClass: SingleLabelCollectionCell.self,
|
let sectionController = ListSingleSectionController(cellClass: SingleLabelCollectionCell.self,
|
||||||
configureBlock: configureBlock,
|
configureBlock: configureBlock,
|
||||||
sizeBlock: sizeBlock)
|
sizeBlock: sizeBlock)
|
||||||
sectionController.selectionDelegate = self
|
sectionController.selectionDelegate = self
|
||||||
return sectionController
|
return sectionController
|
||||||
}
|
}
|
||||||
|
|
||||||
func emptyView(for listAdapter: IGListAdapter) -> UIView? { return nil }
|
func emptyView(for listAdapter: ListAdapter) -> UIView? { return nil }
|
||||||
|
|
||||||
//MARK: IGListSingleSectionControllerDelegate
|
//MARK: IGListSingleSectionControllerDelegate
|
||||||
|
func didSelect(_ sectionController: ListSingleSectionController, with object: Any) {
|
||||||
func didSelect(_ sectionController: IGListSingleSectionController) {
|
|
||||||
let section = adapter.section(for: sectionController)
|
let section = adapter.section(for: sectionController)
|
||||||
let model = models[section]
|
let model = models[section]
|
||||||
|
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ViewController.h"
|
#import "ViewController.h"
|
||||||
@@ -12,9 +11,8 @@
|
|||||||
|
|
||||||
@implementation ViewController
|
@implementation ViewController
|
||||||
|
|
||||||
- (void)viewDidLoad
|
- (void)viewDidLoad {
|
||||||
{
|
UIView* root = self.view;
|
||||||
UIView *root = self.view;
|
|
||||||
root.backgroundColor = [UIColor redColor];
|
root.backgroundColor = [UIColor redColor];
|
||||||
root.yoga.isEnabled = YES;
|
root.yoga.isEnabled = YES;
|
||||||
root.yoga.width = YGPointValue(self.view.bounds.size.width);
|
root.yoga.width = YGPointValue(self.view.bounds.size.width);
|
||||||
@@ -22,29 +20,27 @@
|
|||||||
root.yoga.alignItems = YGAlignCenter;
|
root.yoga.alignItems = YGAlignCenter;
|
||||||
root.yoga.justifyContent = YGJustifyCenter;
|
root.yoga.justifyContent = YGJustifyCenter;
|
||||||
|
|
||||||
UIView *child1 = [UIView new];
|
UIView* child1 = [UIView new];
|
||||||
child1.backgroundColor = [UIColor blueColor];
|
child1.backgroundColor = [UIColor blueColor];
|
||||||
child1.yoga.isEnabled = YES;
|
child1.yoga.isEnabled = YES;
|
||||||
child1.yoga.width = YGPointValue(100);
|
child1.yoga.width = YGPointValue(100);
|
||||||
child1.yoga.height = YGPointValue(100);
|
child1.yoga.height = YGPointValue(100);
|
||||||
|
|
||||||
UIView *child2 = [UIView new];
|
UIView* child2 = [UIView new];
|
||||||
child2.backgroundColor = [UIColor greenColor];
|
child2.backgroundColor = [UIColor greenColor];
|
||||||
child2.frame = (CGRect) {
|
child2.frame = (CGRect){
|
||||||
.size = {
|
.size = {
|
||||||
.width = 200,
|
.width = 200,
|
||||||
.height = 100,
|
.height = 100,
|
||||||
}
|
}};
|
||||||
};
|
|
||||||
|
|
||||||
UIView *child3 = [UIView new];
|
UIView* child3 = [UIView new];
|
||||||
child3.backgroundColor = [UIColor yellowColor];
|
child3.backgroundColor = [UIColor yellowColor];
|
||||||
child3.frame = (CGRect) {
|
child3.frame = (CGRect){
|
||||||
.size = {
|
.size = {
|
||||||
.width = 100,
|
.width = 100,
|
||||||
.height = 100,
|
.height = 100,
|
||||||
}
|
}};
|
||||||
};
|
|
||||||
|
|
||||||
[child2 addSubview:child3];
|
[child2 addSubview:child3];
|
||||||
[root addSubview:child1];
|
[root addSubview:child1];
|
||||||
@@ -52,5 +48,4 @@
|
|||||||
[root.yoga applyLayoutPreservingOrigin:NO];
|
[root.yoga applyLayoutPreservingOrigin:NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
@@ -11,11 +10,11 @@ import YogaKit
|
|||||||
|
|
||||||
final class BasicViewController: UIViewController {
|
final class BasicViewController: UIViewController {
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
|
super.viewDidLoad()
|
||||||
let containerSize = self.view.bounds.size
|
let containerSize = self.view.bounds.size
|
||||||
|
|
||||||
let root = self.view!
|
view.backgroundColor = UIColor.systemBackground
|
||||||
root.backgroundColor = .white
|
view.configureLayout { (layout) in
|
||||||
root.configureLayout { (layout) in
|
|
||||||
layout.isEnabled = true
|
layout.isEnabled = true
|
||||||
layout.width = YGValue(containerSize.width)
|
layout.width = YGValue(containerSize.width)
|
||||||
layout.height = YGValue(containerSize.height)
|
layout.height = YGValue(containerSize.height)
|
||||||
@@ -31,24 +30,29 @@ final class BasicViewController: UIViewController {
|
|||||||
layout.height = 10
|
layout.height = 10
|
||||||
layout.marginBottom = 25
|
layout.marginBottom = 25
|
||||||
}
|
}
|
||||||
root.addSubview(child1)
|
view.addSubview(child1)
|
||||||
|
|
||||||
let child2 = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
|
let child2 = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
|
||||||
child2.backgroundColor = .green
|
child2.backgroundColor = .green
|
||||||
child2.configureLayout { (layout) in
|
child2.configureLayout { (layout) in
|
||||||
layout.isEnabled = true
|
layout.isEnabled = true
|
||||||
layout.alignSelf = .flexEnd
|
layout.alignSelf = .flexEnd
|
||||||
|
layout.width = 200
|
||||||
|
layout.height = 200
|
||||||
}
|
}
|
||||||
root.addSubview(child2)
|
view.addSubview(child2)
|
||||||
|
|
||||||
let child3 = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
|
let child3 = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
|
||||||
child3.backgroundColor = .yellow
|
child3.backgroundColor = .yellow
|
||||||
child3.configureLayout { (layout) in
|
child3.configureLayout { (layout) in
|
||||||
layout.isEnabled = true
|
layout.isEnabled = true
|
||||||
layout.alignSelf = .flexStart
|
layout.alignSelf = .flexStart
|
||||||
}
|
layout.width = 100
|
||||||
root.addSubview(child3)
|
layout.height = 100
|
||||||
|
|
||||||
root.yoga.applyLayout(preservingOrigin: true)
|
}
|
||||||
|
view.addSubview(child3)
|
||||||
|
|
||||||
|
view.yoga.applyLayout(preservingOrigin: true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
@@ -15,6 +14,7 @@ final class LayoutInclusionViewController: UIViewController {
|
|||||||
private let contentView: UIView = UIView(frame: .zero)
|
private let contentView: UIView = UIView(frame: .zero)
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
|
super.viewDidLoad()
|
||||||
let root = self.view!
|
let root = self.view!
|
||||||
root.backgroundColor = .white
|
root.backgroundColor = .white
|
||||||
root.configureLayout { (layout) in
|
root.configureLayout { (layout) in
|
||||||
@@ -52,9 +52,9 @@ final class LayoutInclusionViewController: UIViewController {
|
|||||||
}
|
}
|
||||||
contentView.addSubview(disappearingView)
|
contentView.addSubview(disappearingView)
|
||||||
|
|
||||||
button.setTitle("Add Blue View", for: UIControlState.selected)
|
button.setTitle("Add Blue View", for: .selected)
|
||||||
button.setTitle("Remove Blue View", for: UIControlState.normal)
|
button.setTitle("Remove Blue View", for: .normal)
|
||||||
button.addTarget(self, action: #selector(buttonWasTapped), for: UIControlEvents.touchUpInside)
|
button.addTarget(self, action: #selector(buttonWasTapped), for: .touchUpInside)
|
||||||
button.configureLayout { (layout) in
|
button.configureLayout { (layout) in
|
||||||
layout.isEnabled = true
|
layout.isEnabled = true
|
||||||
layout.height = 300
|
layout.height = 300
|
||||||
@@ -67,7 +67,7 @@ final class LayoutInclusionViewController: UIViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MARK - UIButton Action
|
// MARK - UIButton Action
|
||||||
func buttonWasTapped() {
|
@objc func buttonWasTapped() {
|
||||||
button.isSelected = !button.isSelected
|
button.isSelected = !button.isSelected
|
||||||
|
|
||||||
button.isUserInteractionEnabled = false
|
button.isUserInteractionEnabled = false
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
32
android/BUCK
32
android/BUCK
@@ -1,32 +0,0 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# This source code is licensed under the BSD-style license found in the
|
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
|
||||||
|
|
||||||
android_aar(
|
|
||||||
name = "android",
|
|
||||||
manifest_skeleton = "src/main/AndroidManifest.xml",
|
|
||||||
visibility = [
|
|
||||||
"PUBLIC",
|
|
||||||
],
|
|
||||||
deps = [
|
|
||||||
ANDROID_JAVA_TARGET,
|
|
||||||
ANDROID_RES_TARGET,
|
|
||||||
INFER_ANNOTATIONS_TARGET,
|
|
||||||
JAVA_TARGET,
|
|
||||||
PROGRUARD_ANNOTATIONS_TARGET,
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
android_resource(
|
|
||||||
name = "res",
|
|
||||||
package = "com.facebook.yoga.android",
|
|
||||||
res = "src/main/res",
|
|
||||||
visibility = [
|
|
||||||
"PUBLIC",
|
|
||||||
],
|
|
||||||
)
|
|
@@ -4,11 +4,11 @@
|
|||||||
|
|
||||||
YogaLayout is available via jcenter:
|
YogaLayout is available via jcenter:
|
||||||
|
|
||||||
compile 'com.facebook.yoga.android:yoga-layout:1.2.0'
|
implementation 'com.facebook.yoga.android:yoga-layout:1.16.0'
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
Check out the docs [here](https://facebook.github.io/yoga/docs/api/android/).
|
Check out the docs [here](https://yogalayout.com/getting-started/standalone/).
|
||||||
|
|
||||||
We also have a sample project. To try it, clone the repo and run (with a device attached)
|
We also have a sample project. To try it, clone the repo and run (with a device attached)
|
||||||
|
|
||||||
|
@@ -1,14 +1,21 @@
|
|||||||
apply plugin: 'com.jfrog.bintray'
|
/*
|
||||||
apply plugin: 'com.android.library'
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
apply plugin: 'com.github.dcendents.android-maven'
|
*
|
||||||
apply plugin: 'maven-publish'
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
version = VERSION_NAME
|
plugins {
|
||||||
group = GROUP
|
id("com.android.library")
|
||||||
|
id("publish")
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
namespace 'com.facebook.yoga.android'
|
||||||
|
|
||||||
compileSdkVersion rootProject.compileSdkVersion
|
compileSdkVersion rootProject.compileSdkVersion
|
||||||
buildToolsVersion rootProject.buildToolsVersion
|
buildToolsVersion rootProject.buildToolsVersion
|
||||||
|
ndkVersion rootProject.ndkVersion
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion rootProject.minSdkVersion
|
minSdkVersion rootProject.minSdkVersion
|
||||||
@@ -19,27 +26,16 @@ android {
|
|||||||
targetCompatibility rootProject.targetCompatibilityVersion
|
targetCompatibility rootProject.targetCompatibilityVersion
|
||||||
sourceCompatibility rootProject.sourceCompatibilityVersion
|
sourceCompatibility rootProject.sourceCompatibilityVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
multipleVariants {
|
||||||
|
withSourcesJar()
|
||||||
|
withJavadocJar()
|
||||||
|
includeBuildTypeValues('debug', 'release')
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':yoga')
|
api project(':yoga')
|
||||||
}
|
}
|
||||||
|
|
||||||
task sourcesJar(type: Jar) {
|
|
||||||
classifier = 'source'
|
|
||||||
from android.sourceSets.main.java.srcDirs
|
|
||||||
}
|
|
||||||
|
|
||||||
task javadoc(type: Javadoc) {
|
|
||||||
failOnError false
|
|
||||||
source = android.sourceSets.main.java.sourceFiles
|
|
||||||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
|
|
||||||
classpath += configurations.compile
|
|
||||||
}
|
|
||||||
|
|
||||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
||||||
classifier = 'javadoc'
|
|
||||||
from javadoc.destinationDir
|
|
||||||
}
|
|
||||||
|
|
||||||
apply from: rootProject.file('gradle/release.gradle')
|
|
||||||
|
@@ -1,5 +0,0 @@
|
|||||||
GROUP=com.facebook.yoga.android
|
|
||||||
POM_NAME=YogaLayout
|
|
||||||
POM_DESCRIPTION=YogaLayout
|
|
||||||
POM_ARTIFACT_ID=yoga-layout
|
|
||||||
POM_PACKAGING=aar
|
|
@@ -1,54 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Copyright 2014-present, Facebook, Inc.
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
This source code is licensed under the license found in the
|
|
||||||
LICENSE-examples file in the root directory of this source tree.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.facebook.samples.yoga"
|
|
||||||
android:versionCode="1"
|
|
||||||
android:versionName="1.0"
|
|
||||||
>
|
|
||||||
|
|
||||||
<variable name="applicationId" value="com.facebook.yoga"/>
|
|
||||||
<variable name="app_label" value="Yoga Sample App"/>
|
|
||||||
|
|
||||||
<uses-sdk
|
|
||||||
android:minSdkVersion="15"
|
|
||||||
android:targetSdkVersion="19"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
|
||||||
|
|
||||||
<application
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:icon="@drawable/ic_launcher"
|
|
||||||
android:allowBackup="false"
|
|
||||||
android:theme="@style/NoTitleBarWhiteBG"
|
|
||||||
android:supportsRtl="true"
|
|
||||||
>
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".MainActivity"
|
|
||||||
android:exported="true"
|
|
||||||
>
|
|
||||||
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".BenchmarkActivity"
|
|
||||||
android:exported="false"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</application>
|
|
||||||
|
|
||||||
</manifest>
|
|
@@ -1,35 +0,0 @@
|
|||||||
# Copyright 2014-present, Facebook, Inc.
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# This source code is licensed under the license found in the
|
|
||||||
# LICENSE-examples file in the root directory of this source tree.
|
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
|
||||||
|
|
||||||
android_binary(
|
|
||||||
name = "sample",
|
|
||||||
keystore = ":debug_keystore",
|
|
||||||
manifest = "AndroidManifest.xml",
|
|
||||||
deps = [
|
|
||||||
ANDROID_SAMPLE_JAVA_TARGET,
|
|
||||||
ANDROID_SAMPLE_RES_TARGET,
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
android_resource(
|
|
||||||
name = "res",
|
|
||||||
package = "com.facebook.samples.yoga",
|
|
||||||
res = "res",
|
|
||||||
visibility = [
|
|
||||||
"PUBLIC",
|
|
||||||
],
|
|
||||||
deps = [
|
|
||||||
ANDROID_RES_TARGET,
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
keystore(
|
|
||||||
name = "debug_keystore",
|
|
||||||
properties = "debug.keystore.properties",
|
|
||||||
store = "debug.keystore",
|
|
||||||
)
|
|
Binary file not shown.
@@ -1,3 +0,0 @@
|
|||||||
key.alias=androiddebugkey
|
|
||||||
key.store.password=android
|
|
||||||
key.alias.password=android
|
|
@@ -1,23 +0,0 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# This source code is licensed under the BSD-style license found in the
|
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
|
||||||
|
|
||||||
android_library(
|
|
||||||
name = "yoga",
|
|
||||||
srcs = glob(["**/*.java"]),
|
|
||||||
visibility = [
|
|
||||||
"PUBLIC",
|
|
||||||
],
|
|
||||||
deps = [
|
|
||||||
ANDROID_JAVA_TARGET,
|
|
||||||
ANDROID_SAMPLE_RES_TARGET,
|
|
||||||
ANDROID_SUPPORT_TARGET,
|
|
||||||
APPCOMPAT_TARGET,
|
|
||||||
SOLOADER_TARGET,
|
|
||||||
],
|
|
||||||
)
|
|
@@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Copyright 2014-present, Facebook, Inc.
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
This source code is licensed under the license found in the
|
|
||||||
LICENSE-examples file in the root directory of this source tree.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<menu
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
>
|
|
||||||
<item
|
|
||||||
android:id="@+id/action_home"
|
|
||||||
android:title="Home"
|
|
||||||
android:showAsAction="always"
|
|
||||||
/>
|
|
||||||
</menu>
|
|
@@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Copyright 2014-present, Facebook, Inc.
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
This source code is licensed under the license found in the
|
|
||||||
LICENSE-examples file in the root directory of this source tree.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<menu
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
>
|
|
||||||
<item
|
|
||||||
android:id="@+id/action_benchmark"
|
|
||||||
android:title="Benchmark"
|
|
||||||
android:showAsAction="always"
|
|
||||||
/>
|
|
||||||
</menu>
|
|
@@ -1,24 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Copyright (c) 2014-present, Facebook, Inc.
|
Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
This source code is licensed under the BSD-style license found in the
|
This source code is licensed under the MIT license found in the
|
||||||
LICENSE file in the root directory of this source tree. An additional grant
|
LICENSE file in the root directory of this source tree.
|
||||||
of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
package="com.facebook.yoga.android"
|
|
||||||
android:versionCode="1"
|
|
||||||
android:versionName="1.0"
|
|
||||||
>
|
|
||||||
|
|
||||||
<uses-sdk
|
|
||||||
android:minSdkVersion="15"
|
|
||||||
android:targetSdkVersion="21"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<application/>
|
<application/>
|
||||||
|
|
||||||
|
@@ -1,23 +0,0 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# This source code is licensed under the BSD-style license found in the
|
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
|
||||||
|
|
||||||
android_library(
|
|
||||||
name = "android",
|
|
||||||
srcs = glob(["**/*.java"]),
|
|
||||||
visibility = [
|
|
||||||
"PUBLIC",
|
|
||||||
],
|
|
||||||
deps = [
|
|
||||||
ANDROID_RES_TARGET,
|
|
||||||
INFER_ANNOTATIONS_TARGET,
|
|
||||||
JAVA_TARGET,
|
|
||||||
JSR_305_TARGET,
|
|
||||||
SOLOADER_TARGET,
|
|
||||||
],
|
|
||||||
)
|
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.facebook.yoga.android;
|
package com.facebook.yoga.android;
|
||||||
@@ -20,6 +18,7 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import com.facebook.yoga.YogaNode;
|
import com.facebook.yoga.YogaNode;
|
||||||
|
import com.facebook.yoga.YogaNodeFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Much like a {@link YogaLayout}, except this class does not render itself (the container) to the
|
* Much like a {@link YogaLayout}, except this class does not render itself (the container) to the
|
||||||
@@ -35,7 +34,7 @@ public class VirtualYogaLayout extends ViewGroup {
|
|||||||
|
|
||||||
final private List<View> mChildren = new LinkedList<>();
|
final private List<View> mChildren = new LinkedList<>();
|
||||||
final private Map<View, YogaNode> mYogaNodes = new HashMap<>();
|
final private Map<View, YogaNode> mYogaNodes = new HashMap<>();
|
||||||
final private YogaNode mYogaNode = new YogaNode();
|
final private YogaNode mYogaNode = YogaNodeFactory.create();
|
||||||
|
|
||||||
public VirtualYogaLayout(Context context) {
|
public VirtualYogaLayout(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
@@ -75,7 +74,7 @@ public class VirtualYogaLayout extends ViewGroup {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
YogaNode node = new YogaNode();
|
YogaNode node = YogaNodeFactory.create();
|
||||||
YogaLayout.LayoutParams lp = new YogaLayout.LayoutParams(params);
|
YogaLayout.LayoutParams lp = new YogaLayout.LayoutParams(params);
|
||||||
YogaLayout.applyLayoutParams(lp, node, child);
|
YogaLayout.applyLayoutParams(lp, node, child);
|
||||||
node.setData(child);
|
node.setData(child);
|
||||||
|
@@ -1,17 +1,12 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.facebook.yoga.android;
|
package com.facebook.yoga.android;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
@@ -23,9 +18,6 @@ import android.util.SparseArray;
|
|||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import com.facebook.yoga.android.R;
|
|
||||||
import com.facebook.yoga.YogaAlign;
|
import com.facebook.yoga.YogaAlign;
|
||||||
import com.facebook.yoga.YogaConstants;
|
import com.facebook.yoga.YogaConstants;
|
||||||
import com.facebook.yoga.YogaDirection;
|
import com.facebook.yoga.YogaDirection;
|
||||||
@@ -37,10 +29,12 @@ import com.facebook.yoga.YogaMeasureFunction;
|
|||||||
import com.facebook.yoga.YogaMeasureMode;
|
import com.facebook.yoga.YogaMeasureMode;
|
||||||
import com.facebook.yoga.YogaMeasureOutput;
|
import com.facebook.yoga.YogaMeasureOutput;
|
||||||
import com.facebook.yoga.YogaNode;
|
import com.facebook.yoga.YogaNode;
|
||||||
import com.facebook.yoga.YogaNode;
|
import com.facebook.yoga.YogaNodeFactory;
|
||||||
import com.facebook.yoga.YogaOverflow;
|
import com.facebook.yoga.YogaOverflow;
|
||||||
import com.facebook.yoga.YogaPositionType;
|
import com.facebook.yoga.YogaPositionType;
|
||||||
import com.facebook.yoga.YogaWrap;
|
import com.facebook.yoga.YogaWrap;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@code ViewGroup} based on the Yoga layout engine.
|
* A {@code ViewGroup} based on the Yoga layout engine.
|
||||||
@@ -53,14 +47,14 @@ import com.facebook.yoga.YogaWrap;
|
|||||||
* <YogaLayout
|
* <YogaLayout
|
||||||
* xmlns:android="http://schemas.android.com/apk/res/android"
|
* xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
* xmlns:yoga="http://schemas.android.com/apk/com.facebook.yoga.android"
|
* xmlns:yoga="http://schemas.android.com/apk/com.facebook.yoga.android"
|
||||||
* android:layout_width="match_parent"
|
* android:layout_width="match_owner"
|
||||||
* android:layout_height="match_parent"
|
* android:layout_height="match_owner"
|
||||||
* yoga:flex_direction="row"
|
* yoga:flex_direction="row"
|
||||||
* yoga:padding_all="10dp"
|
* yoga:padding_all="10dp"
|
||||||
* >
|
* >
|
||||||
* <TextView
|
* <TextView
|
||||||
* android:layout_width="match_parent"
|
* android:layout_width="match_owner"
|
||||||
* android:layout_height="match_parent"
|
* android:layout_height="match_owner"
|
||||||
* android:text="Hello, World!"
|
* android:text="Hello, World!"
|
||||||
* yoga:flex="1"
|
* yoga:flex="1"
|
||||||
* />
|
* />
|
||||||
@@ -85,7 +79,7 @@ public class YogaLayout extends ViewGroup {
|
|||||||
public YogaLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
public YogaLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
super(context, attrs, defStyleAttr);
|
super(context, attrs, defStyleAttr);
|
||||||
|
|
||||||
mYogaNode = new YogaNode();
|
mYogaNode = YogaNodeFactory.create();
|
||||||
mYogaNodes = new HashMap<>();
|
mYogaNodes = new HashMap<>();
|
||||||
|
|
||||||
mYogaNode.setData(this);
|
mYogaNode.setData(this);
|
||||||
@@ -162,7 +156,7 @@ public class YogaLayout extends ViewGroup {
|
|||||||
if(mYogaNodes.containsKey(child)) {
|
if(mYogaNodes.containsKey(child)) {
|
||||||
childNode = mYogaNodes.get(child);
|
childNode = mYogaNodes.get(child);
|
||||||
} else {
|
} else {
|
||||||
childNode = new YogaNode();
|
childNode = YogaNodeFactory.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
childNode.setData(child);
|
childNode.setData(child);
|
||||||
@@ -269,11 +263,11 @@ public class YogaLayout extends ViewGroup {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final YogaNode parent = node.getParent();
|
final YogaNode owner = node.getOwner();
|
||||||
|
|
||||||
for (int i = 0; i < parent.getChildCount(); i++) {
|
for (int i = 0; i < owner.getChildCount(); i++) {
|
||||||
if (parent.getChildAt(i).equals(node)) {
|
if (owner.getChildAt(i).equals(node)) {
|
||||||
parent.removeChildAt(i);
|
owner.removeChildAt(i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -293,6 +287,8 @@ public class YogaLayout extends ViewGroup {
|
|||||||
if (view.getVisibility() == GONE) {
|
if (view.getVisibility() == GONE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
int left = Math.round(xOffset + node.getLayoutX());
|
||||||
|
int top = Math.round(yOffset + node.getLayoutY());
|
||||||
view.measure(
|
view.measure(
|
||||||
View.MeasureSpec.makeMeasureSpec(
|
View.MeasureSpec.makeMeasureSpec(
|
||||||
Math.round(node.getLayoutWidth()),
|
Math.round(node.getLayoutWidth()),
|
||||||
@@ -300,11 +296,7 @@ public class YogaLayout extends ViewGroup {
|
|||||||
View.MeasureSpec.makeMeasureSpec(
|
View.MeasureSpec.makeMeasureSpec(
|
||||||
Math.round(node.getLayoutHeight()),
|
Math.round(node.getLayoutHeight()),
|
||||||
View.MeasureSpec.EXACTLY));
|
View.MeasureSpec.EXACTLY));
|
||||||
view.layout(
|
view.layout(left, top, left + view.getMeasuredWidth(), top + view.getMeasuredHeight());
|
||||||
Math.round(xOffset + node.getLayoutX()),
|
|
||||||
Math.round(yOffset + node.getLayoutY()),
|
|
||||||
Math.round(xOffset + node.getLayoutX() + node.getLayoutWidth()),
|
|
||||||
Math.round(yOffset + node.getLayoutY() + node.getLayoutHeight()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final int childrenCount = node.getChildCount();
|
final int childrenCount = node.getChildCount();
|
||||||
@@ -324,7 +316,7 @@ public class YogaLayout extends ViewGroup {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||||
// Either we are a root of a tree, or this function is called by our parent's onLayout, in which
|
// Either we are a root of a tree, or this function is called by our owner's onLayout, in which
|
||||||
// case our r-l and b-t are the size of our node.
|
// case our r-l and b-t are the size of our node.
|
||||||
if (!(getParent() instanceof YogaLayout)) {
|
if (!(getParent() instanceof YogaLayout)) {
|
||||||
createLayout(
|
createLayout(
|
||||||
@@ -708,7 +700,7 @@ public class YogaLayout extends ViewGroup {
|
|||||||
/**
|
/**
|
||||||
* Constructs a set of layout params, given width and height specs. In this case, we can set
|
* Constructs a set of layout params, given width and height specs. In this case, we can set
|
||||||
* the {@code yoga:width} and {@code yoga:height} if we are given them explicitly. If other
|
* the {@code yoga:width} and {@code yoga:height} if we are given them explicitly. If other
|
||||||
* options (such as {@code match_parent} or {@code wrap_content} are given, then the parent
|
* options (such as {@code match_owner} or {@code wrap_content} are given, then the owner
|
||||||
* LayoutParams will store them, and we deal with them during layout. (see
|
* LayoutParams will store them, and we deal with them during layout. (see
|
||||||
* {@link YogaLayout#createLayout})
|
* {@link YogaLayout#createLayout})
|
||||||
*
|
*
|
||||||
@@ -782,9 +774,9 @@ public class YogaLayout extends ViewGroup {
|
|||||||
* {@code View}'s measure function.
|
* {@code View}'s measure function.
|
||||||
*
|
*
|
||||||
* @param node The yoga node to measure
|
* @param node The yoga node to measure
|
||||||
* @param width The suggested width from the parent
|
* @param width The suggested width from the owner
|
||||||
* @param widthMode The type of suggestion for the width
|
* @param widthMode The type of suggestion for the width
|
||||||
* @param height The suggested height from the parent
|
* @param height The suggested height from the owner
|
||||||
* @param heightMode The type of suggestion for the height
|
* @param heightMode The type of suggestion for the height
|
||||||
* @return A measurement output ({@code YogaMeasureOutput}) for the node
|
* @return A measurement output ({@code YogaMeasureOutput}) for the node
|
||||||
*/
|
*/
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.facebook.yoga.android;
|
package com.facebook.yoga.android;
|
||||||
|
@@ -1,12 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Copyright (c) 2014-present, Facebook, Inc.
|
Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
This source code is licensed under the BSD-style license found in the
|
This source code is licensed under the MIT license found in the
|
||||||
LICENSE file in the root directory of this source tree. An additional grant
|
LICENSE file in the root directory of this source tree.
|
||||||
of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
@@ -132,8 +130,14 @@
|
|||||||
<attr name="yg_positionAll" format="dimension|string"/>
|
<attr name="yg_positionAll" format="dimension|string"/>
|
||||||
|
|
||||||
<attr name="yg_positionType" format="enum">
|
<attr name="yg_positionType" format="enum">
|
||||||
<enum name="relative" value="0"/>
|
<!-- "static" is a reserved keyword
|
||||||
<enum name="absolute" value="1"/>
|
<enum name="static" value="0"/>
|
||||||
|
-->
|
||||||
|
<enum name="relative" value="1"/>
|
||||||
|
<enum name="absolute" value="2"/>
|
||||||
|
<enum name="position_static" value="0"/>
|
||||||
|
<enum name="position_relative" value="1"/>
|
||||||
|
<enum name="position_absolute" value="2"/>
|
||||||
</attr>
|
</attr>
|
||||||
|
|
||||||
<attr name="yg_width" format="dimension|string"/>
|
<attr name="yg_width" format="dimension|string"/>
|
||||||
|
@@ -1,27 +0,0 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# This source code is licensed under the BSD-style license found in the
|
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
|
||||||
|
|
||||||
cxx_binary(
|
|
||||||
name = "benchmark",
|
|
||||||
srcs = glob(["*.c"]),
|
|
||||||
compiler_flags = [
|
|
||||||
"-fno-omit-frame-pointer",
|
|
||||||
"-fexceptions",
|
|
||||||
"-Wall",
|
|
||||||
"-Werror",
|
|
||||||
"-O3",
|
|
||||||
"-std=c11",
|
|
||||||
],
|
|
||||||
header_namespace = "",
|
|
||||||
headers = subdir_glob([("", "*.h")]),
|
|
||||||
visibility = ["PUBLIC"],
|
|
||||||
deps = [
|
|
||||||
yoga_dep(":yoga"),
|
|
||||||
],
|
|
||||||
)
|
|
19
benchmark/CMakeLists.txt
Normal file
19
benchmark/CMakeLists.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the MIT license found in the
|
||||||
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.13...3.26)
|
||||||
|
project(benchmark)
|
||||||
|
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||||
|
|
||||||
|
set(YOGA_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||||
|
include(${YOGA_ROOT}/cmake/project-defaults.cmake)
|
||||||
|
|
||||||
|
add_subdirectory(${YOGA_ROOT}/yoga ${CMAKE_CURRENT_BINARY_DIR}/yoga)
|
||||||
|
|
||||||
|
file(GLOB SOURCES CONFIGURE_DEPENDS
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/*.c)
|
||||||
|
add_executable(benchmark ${SOURCES})
|
||||||
|
target_link_libraries(benchmark yogacore)
|
@@ -1,29 +1,93 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "YGBenchmark.h"
|
#include <math.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include <yoga/Yoga.h>
|
#include <yoga/Yoga.h>
|
||||||
|
|
||||||
static YGSize _measure(YGNodeRef node,
|
#define NUM_REPETITIONS 1000
|
||||||
|
|
||||||
|
#define YGBENCHMARKS(BLOCK) \
|
||||||
|
int main(int argc, char const* argv[]) { \
|
||||||
|
(void) argc; \
|
||||||
|
(void) argv; \
|
||||||
|
clock_t __start; \
|
||||||
|
clock_t __endTimes[NUM_REPETITIONS]; \
|
||||||
|
{ BLOCK } \
|
||||||
|
return 0; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define YGBENCHMARK(NAME, BLOCK) \
|
||||||
|
__start = clock(); \
|
||||||
|
for (uint32_t __i = 0; __i < NUM_REPETITIONS; __i++) { \
|
||||||
|
{BLOCK} __endTimes[__i] = clock(); \
|
||||||
|
} \
|
||||||
|
__printBenchmarkResult(NAME, __start, __endTimes);
|
||||||
|
|
||||||
|
static int __compareDoubles(const void* a, const void* b) {
|
||||||
|
double arg1 = *(const double*) a;
|
||||||
|
double arg2 = *(const double*) b;
|
||||||
|
|
||||||
|
if (arg1 < arg2) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arg1 > arg2) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __printBenchmarkResult(
|
||||||
|
char* name,
|
||||||
|
clock_t start,
|
||||||
|
clock_t* endTimes) {
|
||||||
|
double timesInMs[NUM_REPETITIONS];
|
||||||
|
double mean = 0;
|
||||||
|
clock_t lastEnd = start;
|
||||||
|
for (uint32_t i = 0; i < NUM_REPETITIONS; i++) {
|
||||||
|
timesInMs[i] = (endTimes[i] - lastEnd) / (double) CLOCKS_PER_SEC * 1000;
|
||||||
|
lastEnd = endTimes[i];
|
||||||
|
mean += timesInMs[i];
|
||||||
|
}
|
||||||
|
mean /= NUM_REPETITIONS;
|
||||||
|
|
||||||
|
qsort(timesInMs, NUM_REPETITIONS, sizeof(double), __compareDoubles);
|
||||||
|
double median = timesInMs[NUM_REPETITIONS / 2];
|
||||||
|
|
||||||
|
double variance = 0;
|
||||||
|
for (uint32_t i = 0; i < NUM_REPETITIONS; i++) {
|
||||||
|
variance += pow(timesInMs[i] - mean, 2);
|
||||||
|
}
|
||||||
|
variance /= NUM_REPETITIONS;
|
||||||
|
double stddev = sqrt(variance);
|
||||||
|
|
||||||
|
printf("%s: median: %lf ms, stddev: %lf ms\n", name, median, stddev);
|
||||||
|
}
|
||||||
|
|
||||||
|
static YGSize _measure(
|
||||||
|
YGNodeRef node,
|
||||||
float width,
|
float width,
|
||||||
YGMeasureMode widthMode,
|
YGMeasureMode widthMode,
|
||||||
float height,
|
float height,
|
||||||
YGMeasureMode heightMode) {
|
YGMeasureMode heightMode) {
|
||||||
|
(void) node;
|
||||||
return (YGSize){
|
return (YGSize){
|
||||||
.width = widthMode == YGMeasureModeUndefined ? 10 : width,
|
.width = widthMode == YGMeasureModeUndefined ? 10 : width,
|
||||||
.height = heightMode == YGMeasureModeUndefined ? 10 : width,
|
.height = heightMode == YGMeasureModeUndefined ? 10 : height,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
YGBENCHMARKS({
|
YGBENCHMARKS({
|
||||||
|
|
||||||
YGBENCHMARK("Stack with flex", {
|
YGBENCHMARK("Stack with flex", {
|
||||||
const YGNodeRef root = YGNodeNew();
|
const YGNodeRef root = YGNodeNew();
|
||||||
YGNodeStyleSetWidth(root, 100);
|
YGNodeStyleSetWidth(root, 100);
|
||||||
@@ -99,9 +163,10 @@ YGBENCHMARKS({
|
|||||||
YGNodeStyleSetHeight(grandGrandChild, 10);
|
YGNodeStyleSetHeight(grandGrandChild, 10);
|
||||||
YGNodeInsertChild(grandChild, grandGrandChild, 0);
|
YGNodeInsertChild(grandChild, grandGrandChild, 0);
|
||||||
|
|
||||||
for (uint32_t iii = 0; iii < 10; iii++) {
|
for (uint32_t iiii = 0; iiii < 10; iiii++) {
|
||||||
const YGNodeRef grandGrandGrandChild = YGNodeNew();
|
const YGNodeRef grandGrandGrandChild = YGNodeNew();
|
||||||
YGNodeStyleSetFlexDirection(grandGrandGrandChild, YGFlexDirectionRow);
|
YGNodeStyleSetFlexDirection(
|
||||||
|
grandGrandGrandChild, YGFlexDirectionRow);
|
||||||
YGNodeStyleSetFlexGrow(grandGrandGrandChild, 1);
|
YGNodeStyleSetFlexGrow(grandGrandGrandChild, 1);
|
||||||
YGNodeStyleSetWidth(grandGrandGrandChild, 10);
|
YGNodeStyleSetWidth(grandGrandGrandChild, 10);
|
||||||
YGNodeStyleSetHeight(grandGrandGrandChild, 10);
|
YGNodeStyleSetHeight(grandGrandGrandChild, 10);
|
||||||
@@ -114,5 +179,4 @@ YGBENCHMARKS({
|
|||||||
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
|
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
|
||||||
YGNodeFreeRecursive(root);
|
YGNodeFreeRecursive(root);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -1,73 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the BSD-style license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
#define NUM_REPETITIONS 1000
|
|
||||||
|
|
||||||
#define YGBENCHMARKS(BLOCK) \
|
|
||||||
int main(int argc, char const *argv[]) { \
|
|
||||||
clock_t __start; \
|
|
||||||
clock_t __endTimes[NUM_REPETITIONS]; \
|
|
||||||
{ BLOCK } \
|
|
||||||
return 0; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define YGBENCHMARK(NAME, BLOCK) \
|
|
||||||
__start = clock(); \
|
|
||||||
for (uint32_t __i = 0; __i < NUM_REPETITIONS; __i++) { \
|
|
||||||
{ BLOCK } \
|
|
||||||
__endTimes[__i] = clock(); \
|
|
||||||
} \
|
|
||||||
__printBenchmarkResult(NAME, __start, __endTimes);
|
|
||||||
|
|
||||||
int __compareDoubles(const void *a, const void *b) {
|
|
||||||
double arg1 = *(const double *) a;
|
|
||||||
double arg2 = *(const double *) b;
|
|
||||||
|
|
||||||
if (arg1 < arg2) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (arg1 > arg2) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void __printBenchmarkResult(char *name, clock_t start, clock_t *endTimes) {
|
|
||||||
double timesInMs[NUM_REPETITIONS];
|
|
||||||
double mean = 0;
|
|
||||||
clock_t lastEnd = start;
|
|
||||||
for (uint32_t i = 0; i < NUM_REPETITIONS; i++) {
|
|
||||||
timesInMs[i] = (endTimes[i] - lastEnd) / (double) CLOCKS_PER_SEC * 1000;
|
|
||||||
lastEnd = endTimes[i];
|
|
||||||
mean += timesInMs[i];
|
|
||||||
}
|
|
||||||
mean /= NUM_REPETITIONS;
|
|
||||||
|
|
||||||
qsort(timesInMs, NUM_REPETITIONS, sizeof(double), __compareDoubles);
|
|
||||||
double median = timesInMs[NUM_REPETITIONS / 2];
|
|
||||||
|
|
||||||
double variance = 0;
|
|
||||||
for (uint32_t i = 0; i < NUM_REPETITIONS; i++) {
|
|
||||||
variance += pow(timesInMs[i] - mean, 2);
|
|
||||||
}
|
|
||||||
variance /= NUM_REPETITIONS;
|
|
||||||
double stddev = sqrt(variance);
|
|
||||||
|
|
||||||
printf("%s: median: %lf ms, stddev: %lf ms\n", name, median, stddev);
|
|
||||||
}
|
|
13
build-logic/build.gradle.kts
Normal file
13
build-logic/build.gradle.kts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
plugins { `kotlin-dsl` }
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
gradlePluginPortal()
|
||||||
|
}
|
76
build-logic/src/main/kotlin/publish.gradle.kts
Normal file
76
build-logic/src/main/kotlin/publish.gradle.kts
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id("maven-publish")
|
||||||
|
id("signing")
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "com.facebook.yoga"
|
||||||
|
|
||||||
|
if ("USE_SNAPSHOT".byProperty.toBoolean()) {
|
||||||
|
version = "${"VERSION_NAME".byProperty}-SNAPSHOT"
|
||||||
|
} else {
|
||||||
|
version = "VERSION_NAME".byProperty.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
register<MavenPublication>("default") {
|
||||||
|
groupId = project.group.toString()
|
||||||
|
artifactId = project.name
|
||||||
|
version = project.version.toString()
|
||||||
|
afterEvaluate { from(components["default"]) }
|
||||||
|
pom {
|
||||||
|
description.set(
|
||||||
|
"An embeddable and performant flexbox layout engine with bindings for multiple languages")
|
||||||
|
name.set(project.name)
|
||||||
|
url.set("https://github.com/facebook/yoga.git")
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name.set("MIT License")
|
||||||
|
url.set("https://github.com/facebook/yoga/blob/main/LICENSE")
|
||||||
|
distribution.set("repo")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
id.set("Meta Open Source")
|
||||||
|
name.set("Meta Open Source")
|
||||||
|
email.set("opensource@meta.com")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scm { url.set("scm:git:git@github.com:facebook/yoga.git") }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val signingKey = "SIGNING_KEY".byProperty
|
||||||
|
val signingPwd = "SIGNING_PWD".byProperty
|
||||||
|
|
||||||
|
if (signingKey.isNullOrBlank() || signingPwd.isNullOrBlank()) {
|
||||||
|
logger.info("Signing disabled as the GPG key was not found")
|
||||||
|
} else {
|
||||||
|
logger.info("GPG Key found - Signing enabled")
|
||||||
|
}
|
||||||
|
|
||||||
|
signing {
|
||||||
|
useInMemoryPgpKeys(signingKey, signingPwd)
|
||||||
|
sign(publishing.publications)
|
||||||
|
isRequired = !(signingKey.isNullOrBlank() || signingPwd.isNullOrBlank())
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fix for https://youtrack.jetbrains.com/issue/KT-46466/
|
||||||
|
// On Gradle 8+, the signing task is not correctly wired to the publishing tasks.
|
||||||
|
// This requires a fix on KGP that is currently pending.
|
||||||
|
val signingTasks = tasks.withType<Sign>()
|
||||||
|
|
||||||
|
tasks.withType<AbstractPublishToMaven>().configureEach { dependsOn(signingTasks) }
|
||||||
|
|
||||||
|
val String.byProperty: String?
|
||||||
|
get() = providers.gradleProperty(this).orNull
|
87
build.gradle
87
build.gradle
@@ -1,60 +1,51 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
/*
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
buildscript {
|
plugins {
|
||||||
repositories {
|
id("com.android.library") version "8.0.1" apply false
|
||||||
jcenter()
|
id("com.android.application") version "8.0.1" apply false
|
||||||
}
|
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
|
||||||
dependencies {
|
|
||||||
classpath 'com.android.tools.build:gradle:2.3.3'
|
|
||||||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
|
|
||||||
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
|
|
||||||
classpath 'com.nabilhachicha:android-native-dependencies:0.1'
|
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
|
||||||
// in the individual module build.gradle files
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "com.facebook.yoga"
|
||||||
|
|
||||||
|
if (project.hasProperty("USE_SNAPSHOT") && project.property("USE_SNAPSHOT").toBoolean()) {
|
||||||
|
version = getProperty("VERSION_NAME") + "-SNAPSHOT"
|
||||||
|
} else {
|
||||||
|
version = getProperty("VERSION_NAME")
|
||||||
|
}
|
||||||
|
|
||||||
|
def sonatypeUsername = findProperty("SONATYPE_USERNAME")?.toString()
|
||||||
|
def sonatypePassword = findProperty("SONATYPE_PASSWORD")?.toString()
|
||||||
|
|
||||||
|
nexusPublishing {
|
||||||
|
repositories {
|
||||||
|
sonatype {
|
||||||
|
username.set(sonatypeUsername)
|
||||||
|
password.set(sonatypePassword)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
minSdkVersion = 14
|
buildToolsVersion = "33.0.0"
|
||||||
targetSdkVersion = 25
|
ndkVersion = "23.1.7779620"
|
||||||
compileSdkVersion = 25
|
minSdkVersion = 21
|
||||||
buildToolsVersion = '25.0.2'
|
compileSdkVersion = 33
|
||||||
sourceCompatibilityVersion = JavaVersion.VERSION_1_7
|
targetSdkVersion = 33
|
||||||
targetCompatibilityVersion = JavaVersion.VERSION_1_7
|
sourceCompatibilityVersion = JavaVersion.VERSION_1_8
|
||||||
}
|
targetCompatibilityVersion = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
// If you have an idea on how to avoid this, please get in touch or
|
|
||||||
// answer https://stackoverflow.com/questions/43867014/how-to-use-the-gradle-ndk-build-to-compile-for-the-host-machine.
|
|
||||||
task copyNativeLibs(type: Copy, dependsOn: ':buckBuildNative') {
|
|
||||||
from "${rootDir}/buck-out/gen/java/tests#default,shared-library-symlink-tree/"
|
|
||||||
include '*.so'
|
|
||||||
include '*.dylib'
|
|
||||||
into "$buildDir/jniLibs"
|
|
||||||
}
|
|
||||||
|
|
||||||
task buckBuildNative(type: Exec) {
|
|
||||||
workingDir rootDir
|
|
||||||
environment BUCKVERSION: 'last'
|
|
||||||
commandLine 'buck', 'build', '//java/...'
|
|
||||||
}
|
|
||||||
|
|
||||||
allprojects {
|
|
||||||
afterEvaluate {
|
|
||||||
tasks.withType(Test) {
|
|
||||||
dependsOn copyNativeLibs
|
|
||||||
def libDir = "${rootDir}/build/jniLibs"
|
|
||||||
systemProperty 'java.library.path', libDir
|
|
||||||
environment 'LD_LIBRARY_PATH', libDir
|
|
||||||
environment 'DYLD_LIBRARY_PATH', libDir
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task clean(type: Delete) {
|
task clean(type: Delete) {
|
||||||
|
51
cmake/project-defaults.cmake
Normal file
51
cmake/project-defaults.cmake
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the MIT license found in the
|
||||||
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
|
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
|
add_compile_definitions($<$<CONFIG:DEBUG>:DEBUG>)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
|
||||||
|
add_compile_options(
|
||||||
|
# Don't omit frame pointers (e.g. for crash dumps)
|
||||||
|
/Oy-
|
||||||
|
# "Standard C++ exception handling" (C++ stack unwinding including extern c)
|
||||||
|
/EHsc
|
||||||
|
# Enable warnings and warnings as errors
|
||||||
|
/W3
|
||||||
|
/WX
|
||||||
|
# Disable RTTI
|
||||||
|
$<$<COMPILE_LANGUAGE:CXX>:/GR->
|
||||||
|
# Use /O2 (Maximize Speed)
|
||||||
|
$<$<CONFIG:RELEASE>:/O2>)
|
||||||
|
|
||||||
|
else()
|
||||||
|
|
||||||
|
add_compile_options(
|
||||||
|
# Don't omit frame pointers (e.g. for crash dumps)
|
||||||
|
-fno-omit-frame-pointer
|
||||||
|
# Enable exception handling
|
||||||
|
-fexceptions
|
||||||
|
# Enable warnings and warnings as errors
|
||||||
|
-Wall
|
||||||
|
-Wextra
|
||||||
|
-Werror
|
||||||
|
# Disable RTTI
|
||||||
|
$<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>
|
||||||
|
# Use -O2 (prioritize speed)
|
||||||
|
$<$<CONFIG:RELEASE>:-O2>
|
||||||
|
# Enable separate sections per function/data item
|
||||||
|
$<$<CONFIG:RELEASE>:-ffunction-sections>
|
||||||
|
$<$<CONFIG:RELEASE>:-fdata-sections>)
|
||||||
|
|
||||||
|
add_link_options(
|
||||||
|
# Discard unused sections
|
||||||
|
$<$<CONFIG:RELEASE>:$<$<CXX_COMPILER_ID:Clang,GNU>:-Wl,--gc-sections>>
|
||||||
|
$<$<CONFIG:RELEASE>:$<$<CXX_COMPILER_ID:AppleClang>:-Wl,-dead_strip>>)
|
||||||
|
|
||||||
|
endif()
|
10
cmake/yoga-config.cmake.in
Normal file
10
cmake/yoga-config.cmake.in
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the MIT license found in the
|
||||||
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
|
@PACKAGE_INIT@
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/yogaTargets.cmake")
|
||||||
|
|
||||||
|
check_required_components(yoga)
|
272
csharp/.gitignore
vendored
272
csharp/.gitignore
vendored
@@ -1,272 +0,0 @@
|
|||||||
## Ignore Visual Studio temporary files, build results, and
|
|
||||||
## files generated by popular Visual Studio add-ons.
|
|
||||||
|
|
||||||
# User-specific files
|
|
||||||
*.suo
|
|
||||||
*.user
|
|
||||||
*.userosscache
|
|
||||||
*.sln.docstates
|
|
||||||
|
|
||||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
|
||||||
*.userprefs
|
|
||||||
|
|
||||||
# Build results
|
|
||||||
[Dd]ebug/
|
|
||||||
[Dd]ebugPublic/
|
|
||||||
[Rr]elease/
|
|
||||||
[Rr]eleases/
|
|
||||||
x64/
|
|
||||||
x86/
|
|
||||||
bld/
|
|
||||||
[Bb]in/
|
|
||||||
[Oo]bj/
|
|
||||||
[Ll]og/
|
|
||||||
|
|
||||||
# Visual Studio 2015 cache/options directory
|
|
||||||
.vs/
|
|
||||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
|
||||||
#wwwroot/
|
|
||||||
|
|
||||||
# MSTest test Results
|
|
||||||
[Tt]est[Rr]esult*/
|
|
||||||
[Bb]uild[Ll]og.*
|
|
||||||
|
|
||||||
# NUNIT
|
|
||||||
*.VisualState.xml
|
|
||||||
TestResult.xml
|
|
||||||
tests/Facebook.Yoga/NUnit-[0-9\.]*/
|
|
||||||
tests/Facebook.Yoga/YogaTest.dll
|
|
||||||
tests/Facebook.Yoga/YogaTest.dll.mdb
|
|
||||||
tests/Facebook.Yoga/libyoga.dylib
|
|
||||||
|
|
||||||
# Build Results of an ATL Project
|
|
||||||
[Dd]ebugPS/
|
|
||||||
[Rr]eleasePS/
|
|
||||||
dlldata.c
|
|
||||||
|
|
||||||
# DNX
|
|
||||||
project.lock.json
|
|
||||||
project.fragment.lock.json
|
|
||||||
artifacts/
|
|
||||||
|
|
||||||
*_i.c
|
|
||||||
*_p.c
|
|
||||||
*_i.h
|
|
||||||
*.ilk
|
|
||||||
*.meta
|
|
||||||
*.obj
|
|
||||||
*.pch
|
|
||||||
*.pdb
|
|
||||||
*.pgc
|
|
||||||
*.pgd
|
|
||||||
*.rsp
|
|
||||||
*.sbr
|
|
||||||
*.tlb
|
|
||||||
*.tli
|
|
||||||
*.tlh
|
|
||||||
*.tmp
|
|
||||||
*.tmp_proj
|
|
||||||
*.log
|
|
||||||
*.vspscc
|
|
||||||
*.vssscc
|
|
||||||
.builds
|
|
||||||
*.pidb
|
|
||||||
*.svclog
|
|
||||||
*.scc
|
|
||||||
|
|
||||||
# Chutzpah Test files
|
|
||||||
_Chutzpah*
|
|
||||||
|
|
||||||
# Visual C++ cache files
|
|
||||||
ipch/
|
|
||||||
*.aps
|
|
||||||
*.ncb
|
|
||||||
*.opendb
|
|
||||||
*.opensdf
|
|
||||||
*.sdf
|
|
||||||
*.cachefile
|
|
||||||
*.VC.db
|
|
||||||
*.VC.VC.opendb
|
|
||||||
|
|
||||||
# Visual Studio profiler
|
|
||||||
*.psess
|
|
||||||
*.vsp
|
|
||||||
*.vspx
|
|
||||||
*.sap
|
|
||||||
|
|
||||||
# TFS 2012 Local Workspace
|
|
||||||
$tf/
|
|
||||||
|
|
||||||
# Guidance Automation Toolkit
|
|
||||||
*.gpState
|
|
||||||
|
|
||||||
# ReSharper is a .NET coding add-in
|
|
||||||
_ReSharper*/
|
|
||||||
*.[Rr]e[Ss]harper
|
|
||||||
*.DotSettings.user
|
|
||||||
|
|
||||||
# JustCode is a .NET coding add-in
|
|
||||||
.JustCode
|
|
||||||
|
|
||||||
# TeamCity is a build add-in
|
|
||||||
_TeamCity*
|
|
||||||
|
|
||||||
# DotCover is a Code Coverage Tool
|
|
||||||
*.dotCover
|
|
||||||
|
|
||||||
# Visual Studio code coverage results
|
|
||||||
*.coverage
|
|
||||||
*.coveragexml
|
|
||||||
|
|
||||||
# NCrunch
|
|
||||||
_NCrunch_*
|
|
||||||
.*crunch*.local.xml
|
|
||||||
nCrunchTemp_*
|
|
||||||
|
|
||||||
# MightyMoose
|
|
||||||
*.mm.*
|
|
||||||
AutoTest.Net/
|
|
||||||
|
|
||||||
# Web workbench (sass)
|
|
||||||
.sass-cache/
|
|
||||||
|
|
||||||
# Installshield output folder
|
|
||||||
[Ee]xpress/
|
|
||||||
|
|
||||||
# DocProject is a documentation generator add-in
|
|
||||||
DocProject/buildhelp/
|
|
||||||
DocProject/Help/*.HxT
|
|
||||||
DocProject/Help/*.HxC
|
|
||||||
DocProject/Help/*.hhc
|
|
||||||
DocProject/Help/*.hhk
|
|
||||||
DocProject/Help/*.hhp
|
|
||||||
DocProject/Help/Html2
|
|
||||||
DocProject/Help/html
|
|
||||||
|
|
||||||
# Click-Once directory
|
|
||||||
publish/
|
|
||||||
|
|
||||||
# Publish Web Output
|
|
||||||
*.[Pp]ublish.xml
|
|
||||||
*.azurePubxml
|
|
||||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
|
||||||
# but database connection strings (with potential passwords) will be unencrypted
|
|
||||||
*.pubxml
|
|
||||||
*.publishproj
|
|
||||||
|
|
||||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
|
||||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
|
||||||
# in these scripts will be unencrypted
|
|
||||||
PublishScripts/
|
|
||||||
|
|
||||||
# NuGet Packages
|
|
||||||
*.nupkg
|
|
||||||
# The packages folder can be ignored because of Package Restore
|
|
||||||
**/packages/*
|
|
||||||
# except build/, which is used as an MSBuild target.
|
|
||||||
!**/packages/build/
|
|
||||||
# Uncomment if necessary however generally it will be regenerated when needed
|
|
||||||
#!**/packages/repositories.config
|
|
||||||
# NuGet v3's project.json files produces more ignoreable files
|
|
||||||
*.nuget.props
|
|
||||||
*.nuget.targets
|
|
||||||
|
|
||||||
# Microsoft Azure Build Output
|
|
||||||
csx/
|
|
||||||
*.build.csdef
|
|
||||||
|
|
||||||
# Microsoft Azure Emulator
|
|
||||||
ecf/
|
|
||||||
rcf/
|
|
||||||
|
|
||||||
# Windows Store app package directories and files
|
|
||||||
AppPackages/
|
|
||||||
BundleArtifacts/
|
|
||||||
Package.StoreAssociation.xml
|
|
||||||
_pkginfo.txt
|
|
||||||
|
|
||||||
# Visual Studio cache files
|
|
||||||
# files ending in .cache can be ignored
|
|
||||||
*.[Cc]ache
|
|
||||||
# but keep track of directories ending in .cache
|
|
||||||
!*.[Cc]ache/
|
|
||||||
|
|
||||||
# Others
|
|
||||||
ClientBin/
|
|
||||||
~$*
|
|
||||||
*~
|
|
||||||
*.dbmdl
|
|
||||||
*.dbproj.schemaview
|
|
||||||
*.jfm
|
|
||||||
*.pfx
|
|
||||||
*.publishsettings
|
|
||||||
node_modules/
|
|
||||||
orleans.codegen.cs
|
|
||||||
|
|
||||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
|
||||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
|
||||||
#bower_components/
|
|
||||||
|
|
||||||
# RIA/Silverlight projects
|
|
||||||
Generated_Code/
|
|
||||||
|
|
||||||
# Backup & report files from converting an old project file
|
|
||||||
# to a newer Visual Studio version. Backup files are not needed,
|
|
||||||
# because we have git ;-)
|
|
||||||
_UpgradeReport_Files/
|
|
||||||
Backup*/
|
|
||||||
UpgradeLog*.XML
|
|
||||||
UpgradeLog*.htm
|
|
||||||
|
|
||||||
# SQL Server files
|
|
||||||
*.mdf
|
|
||||||
*.ldf
|
|
||||||
|
|
||||||
# Business Intelligence projects
|
|
||||||
*.rdl.data
|
|
||||||
*.bim.layout
|
|
||||||
*.bim_*.settings
|
|
||||||
|
|
||||||
# Microsoft Fakes
|
|
||||||
FakesAssemblies/
|
|
||||||
|
|
||||||
# GhostDoc plugin setting file
|
|
||||||
*.GhostDoc.xml
|
|
||||||
|
|
||||||
# Node.js Tools for Visual Studio
|
|
||||||
.ntvs_analysis.dat
|
|
||||||
|
|
||||||
# Visual Studio 6 build log
|
|
||||||
*.plg
|
|
||||||
|
|
||||||
# Visual Studio 6 workspace options file
|
|
||||||
*.opt
|
|
||||||
|
|
||||||
# Visual Studio LightSwitch build output
|
|
||||||
**/*.HTMLClient/GeneratedArtifacts
|
|
||||||
**/*.DesktopClient/GeneratedArtifacts
|
|
||||||
**/*.DesktopClient/ModelManifest.xml
|
|
||||||
**/*.Server/GeneratedArtifacts
|
|
||||||
**/*.Server/ModelManifest.xml
|
|
||||||
_Pvt_Extensions
|
|
||||||
|
|
||||||
# Paket dependency manager
|
|
||||||
.paket/paket.exe
|
|
||||||
paket-files/
|
|
||||||
|
|
||||||
# FAKE - F# Make
|
|
||||||
.fake/
|
|
||||||
|
|
||||||
# JetBrains Rider
|
|
||||||
.idea/
|
|
||||||
*.sln.iml
|
|
||||||
|
|
||||||
# CodeRush
|
|
||||||
.cr/
|
|
||||||
|
|
||||||
# Python Tools for Visual Studio (PTVS)
|
|
||||||
__pycache__/
|
|
||||||
*.pyc
|
|
||||||
|
|
||||||
# local buck build
|
|
||||||
lib/
|
|
272
csharp/.hgignore
272
csharp/.hgignore
@@ -1,272 +0,0 @@
|
|||||||
## Ignore Visual Studio temporary files, build results, and
|
|
||||||
## files generated by popular Visual Studio add-ons.
|
|
||||||
|
|
||||||
# User-specific files
|
|
||||||
*.suo
|
|
||||||
*.user
|
|
||||||
*.userosscache
|
|
||||||
*.sln.docstates
|
|
||||||
|
|
||||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
|
||||||
*.userprefs
|
|
||||||
|
|
||||||
# Build results
|
|
||||||
[Dd]ebug/
|
|
||||||
[Dd]ebugPublic/
|
|
||||||
[Rr]elease/
|
|
||||||
[Rr]eleases/
|
|
||||||
x64/
|
|
||||||
x86/
|
|
||||||
bld/
|
|
||||||
[Bb]in/
|
|
||||||
[Oo]bj/
|
|
||||||
[Ll]og/
|
|
||||||
|
|
||||||
# Visual Studio 2015 cache/options directory
|
|
||||||
.vs/
|
|
||||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
|
||||||
#wwwroot/
|
|
||||||
|
|
||||||
# MSTest test Results
|
|
||||||
[Tt]est[Rr]esult*/
|
|
||||||
[Bb]uild[Ll]og.*
|
|
||||||
|
|
||||||
# NUNIT
|
|
||||||
*.VisualState.xml
|
|
||||||
TestResult.xml
|
|
||||||
tests/Facebook.Yoga/NUnit-[0-9\.]*/
|
|
||||||
tests/Facebook.Yoga/YogaTest.dll
|
|
||||||
tests/Facebook.Yoga/YogaTest.dll.mdb
|
|
||||||
tests/Facebook.Yoga/libyoga.dylib
|
|
||||||
|
|
||||||
# Build Results of an ATL Project
|
|
||||||
[Dd]ebugPS/
|
|
||||||
[Rr]eleasePS/
|
|
||||||
dlldata.c
|
|
||||||
|
|
||||||
# DNX
|
|
||||||
project.lock.json
|
|
||||||
project.fragment.lock.json
|
|
||||||
artifacts/
|
|
||||||
|
|
||||||
*_i.c
|
|
||||||
*_p.c
|
|
||||||
*_i.h
|
|
||||||
*.ilk
|
|
||||||
*.meta
|
|
||||||
*.obj
|
|
||||||
*.pch
|
|
||||||
*.pdb
|
|
||||||
*.pgc
|
|
||||||
*.pgd
|
|
||||||
*.rsp
|
|
||||||
*.sbr
|
|
||||||
*.tlb
|
|
||||||
*.tli
|
|
||||||
*.tlh
|
|
||||||
*.tmp
|
|
||||||
*.tmp_proj
|
|
||||||
*.log
|
|
||||||
*.vspscc
|
|
||||||
*.vssscc
|
|
||||||
.builds
|
|
||||||
*.pidb
|
|
||||||
*.svclog
|
|
||||||
*.scc
|
|
||||||
|
|
||||||
# Chutzpah Test files
|
|
||||||
_Chutzpah*
|
|
||||||
|
|
||||||
# Visual C++ cache files
|
|
||||||
ipch/
|
|
||||||
*.aps
|
|
||||||
*.ncb
|
|
||||||
*.opendb
|
|
||||||
*.opensdf
|
|
||||||
*.sdf
|
|
||||||
*.cachefile
|
|
||||||
*.VC.db
|
|
||||||
*.VC.VC.opendb
|
|
||||||
|
|
||||||
# Visual Studio profiler
|
|
||||||
*.psess
|
|
||||||
*.vsp
|
|
||||||
*.vspx
|
|
||||||
*.sap
|
|
||||||
|
|
||||||
# TFS 2012 Local Workspace
|
|
||||||
$tf/
|
|
||||||
|
|
||||||
# Guidance Automation Toolkit
|
|
||||||
*.gpState
|
|
||||||
|
|
||||||
# ReSharper is a .NET coding add-in
|
|
||||||
_ReSharper*/
|
|
||||||
*.[Rr]e[Ss]harper
|
|
||||||
*.DotSettings.user
|
|
||||||
|
|
||||||
# JustCode is a .NET coding add-in
|
|
||||||
.JustCode
|
|
||||||
|
|
||||||
# TeamCity is a build add-in
|
|
||||||
_TeamCity*
|
|
||||||
|
|
||||||
# DotCover is a Code Coverage Tool
|
|
||||||
*.dotCover
|
|
||||||
|
|
||||||
# Visual Studio code coverage results
|
|
||||||
*.coverage
|
|
||||||
*.coveragexml
|
|
||||||
|
|
||||||
# NCrunch
|
|
||||||
_NCrunch_*
|
|
||||||
.*crunch*.local.xml
|
|
||||||
nCrunchTemp_*
|
|
||||||
|
|
||||||
# MightyMoose
|
|
||||||
*.mm.*
|
|
||||||
AutoTest.Net/
|
|
||||||
|
|
||||||
# Web workbench (sass)
|
|
||||||
.sass-cache/
|
|
||||||
|
|
||||||
# Installshield output folder
|
|
||||||
[Ee]xpress/
|
|
||||||
|
|
||||||
# DocProject is a documentation generator add-in
|
|
||||||
DocProject/buildhelp/
|
|
||||||
DocProject/Help/*.HxT
|
|
||||||
DocProject/Help/*.HxC
|
|
||||||
DocProject/Help/*.hhc
|
|
||||||
DocProject/Help/*.hhk
|
|
||||||
DocProject/Help/*.hhp
|
|
||||||
DocProject/Help/Html2
|
|
||||||
DocProject/Help/html
|
|
||||||
|
|
||||||
# Click-Once directory
|
|
||||||
publish/
|
|
||||||
|
|
||||||
# Publish Web Output
|
|
||||||
*.[Pp]ublish.xml
|
|
||||||
*.azurePubxml
|
|
||||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
|
||||||
# but database connection strings (with potential passwords) will be unencrypted
|
|
||||||
*.pubxml
|
|
||||||
*.publishproj
|
|
||||||
|
|
||||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
|
||||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
|
||||||
# in these scripts will be unencrypted
|
|
||||||
PublishScripts/
|
|
||||||
|
|
||||||
# NuGet Packages
|
|
||||||
*.nupkg
|
|
||||||
# The packages folder can be ignored because of Package Restore
|
|
||||||
**/packages/*
|
|
||||||
# except build/, which is used as an MSBuild target.
|
|
||||||
!**/packages/build/
|
|
||||||
# Uncomment if necessary however generally it will be regenerated when needed
|
|
||||||
#!**/packages/repositories.config
|
|
||||||
# NuGet v3's project.json files produces more ignoreable files
|
|
||||||
*.nuget.props
|
|
||||||
*.nuget.targets
|
|
||||||
|
|
||||||
# Microsoft Azure Build Output
|
|
||||||
csx/
|
|
||||||
*.build.csdef
|
|
||||||
|
|
||||||
# Microsoft Azure Emulator
|
|
||||||
ecf/
|
|
||||||
rcf/
|
|
||||||
|
|
||||||
# Windows Store app package directories and files
|
|
||||||
AppPackages/
|
|
||||||
BundleArtifacts/
|
|
||||||
Package.StoreAssociation.xml
|
|
||||||
_pkginfo.txt
|
|
||||||
|
|
||||||
# Visual Studio cache files
|
|
||||||
# files ending in .cache can be ignored
|
|
||||||
*.[Cc]ache
|
|
||||||
# but keep track of directories ending in .cache
|
|
||||||
!*.[Cc]ache/
|
|
||||||
|
|
||||||
# Others
|
|
||||||
ClientBin/
|
|
||||||
~$*
|
|
||||||
*~
|
|
||||||
*.dbmdl
|
|
||||||
*.dbproj.schemaview
|
|
||||||
*.jfm
|
|
||||||
*.pfx
|
|
||||||
*.publishsettings
|
|
||||||
node_modules/
|
|
||||||
orleans.codegen.cs
|
|
||||||
|
|
||||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
|
||||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
|
||||||
#bower_components/
|
|
||||||
|
|
||||||
# RIA/Silverlight projects
|
|
||||||
Generated_Code/
|
|
||||||
|
|
||||||
# Backup & report files from converting an old project file
|
|
||||||
# to a newer Visual Studio version. Backup files are not needed,
|
|
||||||
# because we have git ;-)
|
|
||||||
_UpgradeReport_Files/
|
|
||||||
Backup*/
|
|
||||||
UpgradeLog*.XML
|
|
||||||
UpgradeLog*.htm
|
|
||||||
|
|
||||||
# SQL Server files
|
|
||||||
*.mdf
|
|
||||||
*.ldf
|
|
||||||
|
|
||||||
# Business Intelligence projects
|
|
||||||
*.rdl.data
|
|
||||||
*.bim.layout
|
|
||||||
*.bim_*.settings
|
|
||||||
|
|
||||||
# Microsoft Fakes
|
|
||||||
FakesAssemblies/
|
|
||||||
|
|
||||||
# GhostDoc plugin setting file
|
|
||||||
*.GhostDoc.xml
|
|
||||||
|
|
||||||
# Node.js Tools for Visual Studio
|
|
||||||
.ntvs_analysis.dat
|
|
||||||
|
|
||||||
# Visual Studio 6 build log
|
|
||||||
*.plg
|
|
||||||
|
|
||||||
# Visual Studio 6 workspace options file
|
|
||||||
*.opt
|
|
||||||
|
|
||||||
# Visual Studio LightSwitch build output
|
|
||||||
**/*.HTMLClient/GeneratedArtifacts
|
|
||||||
**/*.DesktopClient/GeneratedArtifacts
|
|
||||||
**/*.DesktopClient/ModelManifest.xml
|
|
||||||
**/*.Server/GeneratedArtifacts
|
|
||||||
**/*.Server/ModelManifest.xml
|
|
||||||
_Pvt_Extensions
|
|
||||||
|
|
||||||
# Paket dependency manager
|
|
||||||
.paket/paket.exe
|
|
||||||
paket-files/
|
|
||||||
|
|
||||||
# FAKE - F# Make
|
|
||||||
.fake/
|
|
||||||
|
|
||||||
# JetBrains Rider
|
|
||||||
.idea/
|
|
||||||
*.sln.iml
|
|
||||||
|
|
||||||
# CodeRush
|
|
||||||
.cr/
|
|
||||||
|
|
||||||
# Python Tools for Visual Studio (PTVS)
|
|
||||||
__pycache__/
|
|
||||||
*.pyc
|
|
||||||
|
|
||||||
# local buck build
|
|
||||||
lib/
|
|
1
csharp/Android/.gitignore
vendored
1
csharp/Android/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
lib/
|
|
@@ -1,63 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{2021459E-8FB1-44A4-89F1-E291769CD2C6}</ProjectGuid>
|
|
||||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<RootNamespace>Facebook.Yoga.Android.Tests</RootNamespace>
|
|
||||||
<AssemblyName>Facebook.Yoga.Android.Tests</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
|
|
||||||
<AndroidApplication>True</AndroidApplication>
|
|
||||||
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
|
||||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
|
||||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
|
||||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
|
||||||
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
|
|
||||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
|
||||||
<AndroidTlsProvider></AndroidTlsProvider>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AndroidLinkMode>None</AndroidLinkMode>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release</OutputPath>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AndroidManagedSymbols>true</AndroidManagedSymbols>
|
|
||||||
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="Mono.Android" />
|
|
||||||
<Reference Include="Xamarin.Android.NUnitLite" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="MainActivity.cs" />
|
|
||||||
<Compile Include="Resources\Resource.designer.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="Properties\AndroidManifest.xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Facebook.Yoga.Android\Facebook.Yoga.Android.csproj">
|
|
||||||
<Project>{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}</Project>
|
|
||||||
<Name>Facebook.Yoga.Android</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="..\..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.projitems" Label="Shared" Condition="Exists('..\..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.projitems')" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
|
||||||
</Project>
|
|
@@ -1,25 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the license found in the
|
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
|
||||||
*/
|
|
||||||
|
|
||||||
using System.Reflection;
|
|
||||||
using Android.App;
|
|
||||||
using Android.OS;
|
|
||||||
using Xamarin.Android.NUnitLite;
|
|
||||||
|
|
||||||
namespace Facebook.Yoga.Android.Tests
|
|
||||||
{
|
|
||||||
[Activity(Label = "Facebook.Yoga.Android.Tests", MainLauncher = true)]
|
|
||||||
public class MainActivity : TestSuiteActivity
|
|
||||||
{
|
|
||||||
protected override void OnCreate(Bundle bundle)
|
|
||||||
{
|
|
||||||
AddTest(Assembly.GetExecutingAssembly());
|
|
||||||
base.OnCreate(bundle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,14 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:versionCode="1"
|
|
||||||
android:versionName="1.0"
|
|
||||||
package="Facebook.Yoga.Android.Tests">
|
|
||||||
|
|
||||||
<uses-sdk
|
|
||||||
android:minSdkVersion="19" />
|
|
||||||
|
|
||||||
<application
|
|
||||||
android:label="Facebook.Yoga.Android.Tests">
|
|
||||||
</application>
|
|
||||||
|
|
||||||
</manifest>
|
|
@@ -1,33 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio 2012
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.Android.Tests", "Facebook.Yoga.Android.Tests\Facebook.Yoga.Android.Tests.csproj", "{2021459E-8FB1-44A4-89F1-E291769CD2C6}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.Android", "Facebook.Yoga.Android\Facebook.Yoga.Android.csproj", "{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{4804A8E6-E7B7-4F9E-A446-3DE8E73DB38A}"
|
|
||||||
EndProject
|
|
||||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared", "..\Facebook.Yoga\Facebook.Yoga.Shared.shproj", "{91C42D32-291D-4B72-90B4-551663D60B8B}"
|
|
||||||
EndProject
|
|
||||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared.Tests", "..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.shproj", "{4EDC82D9-A201-4831-8FE0-98F468F8E4AE}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(NestedProjects) = preSolution
|
|
||||||
{91C42D32-291D-4B72-90B4-551663D60B8B} = {4804A8E6-E7B7-4F9E-A446-3DE8E73DB38A}
|
|
||||||
{4EDC82D9-A201-4831-8FE0-98F468F8E4AE} = {4804A8E6-E7B7-4F9E-A446-3DE8E73DB38A}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
@@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<BuildDependsOn>NativeLibraryARMV7;NativeLibraryX86;$(BuildDependsOn)</BuildDependsOn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Target Name="NativeLibraryARMV7" Outputs="$(ProjectDir)/lib/armeabi-v7a/libyoga.so">
|
|
||||||
<Exec WorkingDirectory="$(ProjectDir)" Command="$(ProjectDir)../../build-native.sh" />
|
|
||||||
<Copy SourceFiles="$(ProjectDir)../../../buck-out/gen/csharp/yoganet#android-armv7,shared/libyoga.so" DestinationFiles="$(ProjectDir)/lib/armeabi-v7a/libyoga.so" SkipUnchangedFiles="true" />
|
|
||||||
</Target>
|
|
||||||
<!--
|
|
||||||
<Target Name="NativeLibraryARM64" Outputs="$(ProjectDir)/lib/arm64-v8a/libyoga.so">
|
|
||||||
<Exec WorkingDirectory="$(ProjectDir)" Command="$(ProjectDir)../../build-native.sh" />
|
|
||||||
<Copy SourceFiles="$(ProjectDir)../../../buck-out/gen/csharp/yoganet#android-arm64,shared/libyoga.so" DestinationFiles="$(ProjectDir)/lib/arm64-v8/libyoga.so" SkipUnchangedFiles="true" />
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
<Target Name="NativeLibraryX86" Outputs="$(ProjectDir)/lib/x86/libyoga.so">
|
|
||||||
<Exec WorkingDirectory="$(ProjectDir)" Command="$(ProjectDir)../../build-native.sh" />
|
|
||||||
<Copy SourceFiles="$(ProjectDir)../../../buck-out/gen/csharp/yoganet#android-x86,shared/libyoga.so" DestinationFiles="$(ProjectDir)/lib/x86/libyoga.so" SkipUnchangedFiles="true" />
|
|
||||||
</Target>
|
|
||||||
</Project>
|
|
@@ -1,64 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}</ProjectGuid>
|
|
||||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<RootNamespace>Facebook.Yoga.Android</RootNamespace>
|
|
||||||
<AssemblyName>Facebook.Yoga</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
|
|
||||||
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
|
||||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
|
||||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
|
||||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
|
||||||
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
|
|
||||||
<AndroidTlsProvider></AndroidTlsProvider>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AndroidLinkMode>None</AndroidLinkMode>
|
|
||||||
<AndroidSupportedAbis>arm64-v8a;armeabi;armeabi-v7a;x86</AndroidSupportedAbis>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release</OutputPath>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AndroidManagedSymbols>true</AndroidManagedSymbols>
|
|
||||||
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="Mono.Android" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="CustomBuildAction.targets" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="lib\x86\" />
|
|
||||||
<Folder Include="lib\armeabi-v7a\" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedNativeLibrary Include="lib\x86\libyoga.so">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</EmbeddedNativeLibrary>
|
|
||||||
<EmbeddedNativeLibrary Include="lib\armeabi-v7a\libyoga.so">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</EmbeddedNativeLibrary>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="..\..\Facebook.Yoga\Facebook.Yoga.Shared.projitems" Label="Shared" Condition="Exists('..\..\Facebook.Yoga\Facebook.Yoga.Shared.projitems')" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
|
||||||
<Import Project="CustomBuildAction.targets" />
|
|
||||||
</Project>
|
|
74
csharp/BUCK
74
csharp/BUCK
@@ -1,74 +0,0 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# This source code is licensed under the BSD-style license found in the
|
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
|
||||||
|
|
||||||
COMPILER_FLAGS = BASE_COMPILER_FLAGS + ["-std=c++11"]
|
|
||||||
|
|
||||||
csharp_library(
|
|
||||||
name = "yogalibnet46",
|
|
||||||
srcs = glob(["**/*.cs"]),
|
|
||||||
dll_name = "Facebook.Yoga.dll",
|
|
||||||
framework_ver = "net46",
|
|
||||||
)
|
|
||||||
|
|
||||||
csharp_library(
|
|
||||||
name = "yogalibnet45",
|
|
||||||
srcs = glob(["**/*.cs"]),
|
|
||||||
dll_name = "Facebook.Yoga.dll",
|
|
||||||
framework_ver = "net45",
|
|
||||||
)
|
|
||||||
|
|
||||||
cxx_library(
|
|
||||||
name = "yoganet",
|
|
||||||
srcs = glob(["Yoga/YGInterop.cpp"]),
|
|
||||||
compiler_flags = COMPILER_FLAGS,
|
|
||||||
link_style = "static",
|
|
||||||
link_whole = True,
|
|
||||||
soname = "libyoga.$(ext)",
|
|
||||||
visibility = ["PUBLIC"],
|
|
||||||
deps = [yoga_dep(":yoga")],
|
|
||||||
)
|
|
||||||
|
|
||||||
if isdir('/Applications/Xcode.app'):
|
|
||||||
yoganet_ios_srcs = []
|
|
||||||
for arch in [
|
|
||||||
'iphonesimulator-x86_64', 'iphonesimulator-i386', 'iphoneos-arm64', 'iphoneos-armv7'
|
|
||||||
]:
|
|
||||||
name = 'yoganet-' + arch
|
|
||||||
yoganet_ios_srcs.append(':' + name)
|
|
||||||
genrule(
|
|
||||||
name = name,
|
|
||||||
srcs = [
|
|
||||||
yoga_dep(':yoga#%s,static' % arch),
|
|
||||||
yoga_dep('YogaKit:YogaKit#%s,static' % arch),
|
|
||||||
yoga_dep('csharp:yoganet#%s,static' % arch),
|
|
||||||
],
|
|
||||||
out = 'libyoga-%s.a' % arch,
|
|
||||||
cmd = 'libtool -static -o $OUT $SRCS',
|
|
||||||
visibility = [yoga_dep('csharp:yoganet-ios')],
|
|
||||||
)
|
|
||||||
|
|
||||||
genrule(
|
|
||||||
name = 'yoganet-ios',
|
|
||||||
srcs = yoganet_ios_srcs,
|
|
||||||
out = 'libyoga.a',
|
|
||||||
cmd = 'lipo $SRCS -create -output $OUT',
|
|
||||||
visibility = ['PUBLIC'],
|
|
||||||
)
|
|
||||||
|
|
||||||
yoganet_macosx_target = 'csharp:yoganet#macosx-%s,dynamic'
|
|
||||||
genrule(
|
|
||||||
name = 'yoganet-macosx',
|
|
||||||
srcs = [
|
|
||||||
yoga_dep(yoganet_macosx_target % 'x86_64'),
|
|
||||||
yoga_dep(yoganet_macosx_target % 'i386'),
|
|
||||||
],
|
|
||||||
out = 'libyoga.dylib',
|
|
||||||
cmd = 'lipo $SRCS -create -output $OUT',
|
|
||||||
visibility = ['PUBLIC'],
|
|
||||||
)
|
|
@@ -1,130 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio 2012
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Android", "Android", "{B674A497-DC8E-4286-A889-0C004235AA18}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "iOS", "iOS", "{AC14A7DE-A180-46EC-8A88-77F60E73A099}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{09905D88-652D-4A72-8521-6CB1AF347795}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "macOS", "macOS", "{9BDE3670-188E-470F-9B89-CEC0EB042AB5}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.iOS", "iOS\Facebook.Yoga.iOS\Facebook.Yoga.iOS.csproj", "{128FB32A-C4A1-4363-BF06-0A36E700B7FA}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.iOS.Tests", "iOS\Facebook.Yoga.iOS.Tests\Facebook.Yoga.iOS.Tests.csproj", "{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}"
|
|
||||||
EndProject
|
|
||||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared", "Facebook.Yoga\Facebook.Yoga.Shared.shproj", "{91C42D32-291D-4B72-90B4-551663D60B8B}"
|
|
||||||
EndProject
|
|
||||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared.Tests", "tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.shproj", "{4EDC82D9-A201-4831-8FE0-98F468F8E4AE}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.Android", "Android\Facebook.Yoga.Android\Facebook.Yoga.Android.csproj", "{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.Android.Tests", "Android\Facebook.Yoga.Android.Tests\Facebook.Yoga.Android.Tests.csproj", "{2021459E-8FB1-44A4-89F1-E291769CD2C6}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nuspec", "nuspec", "{2C3685DB-91B9-4207-9446-1C513DB36978}"
|
|
||||||
ProjectSection(SolutionItems) = preProject
|
|
||||||
nuget\Facebook.Yoga.dll.config = nuget\Facebook.Yoga.dll.config
|
|
||||||
nuget\Facebook.Yoga.nuspec = nuget\Facebook.Yoga.nuspec
|
|
||||||
nuget\Facebook.Yoga.OSX.targets = nuget\Facebook.Yoga.OSX.targets
|
|
||||||
nuget\Facebook.Yoga.targets = nuget\Facebook.Yoga.targets
|
|
||||||
nuget\Facebook.Yoga.Universal.targets = nuget\Facebook.Yoga.Universal.targets
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.Mac", "Mac\Facebook.Yoga.Mac.csproj", "{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.Mac.Tests", "Mac\Facebook.Yoga.Mac.Tests\Facebook.Yoga.Mac.Tests.csproj", "{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
|
||||||
Release|iPhone = Release|iPhone
|
|
||||||
Release|iPhoneSimulator = Release|iPhoneSimulator
|
|
||||||
Debug|iPhone = Debug|iPhone
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
|
||||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
|
||||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Release|iPhone.ActiveCfg = Release|Any CPU
|
|
||||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Release|iPhone.Build.0 = Release|Any CPU
|
|
||||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
|
||||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
|
||||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
|
||||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Debug|iPhone.Build.0 = Debug|Any CPU
|
|
||||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
|
|
||||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
|
|
||||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Release|Any CPU.ActiveCfg = Release|iPhone
|
|
||||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Release|Any CPU.Build.0 = Release|iPhone
|
|
||||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
|
||||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
|
||||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Release|iPhone.ActiveCfg = Release|iPhone
|
|
||||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Release|iPhone.Build.0 = Release|iPhone
|
|
||||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
|
||||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
|
||||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
|
||||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Debug|iPhone.Build.0 = Debug|iPhone
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Release|iPhone.ActiveCfg = Release|Any CPU
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Release|iPhone.Build.0 = Release|Any CPU
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Debug|iPhone.Build.0 = Debug|Any CPU
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Release|iPhone.ActiveCfg = Release|Any CPU
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Release|iPhone.Build.0 = Release|Any CPU
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Debug|iPhone.Build.0 = Debug|Any CPU
|
|
||||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
|
||||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
|
||||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}.Release|iPhone.ActiveCfg = Release|Any CPU
|
|
||||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}.Release|iPhone.Build.0 = Release|Any CPU
|
|
||||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
|
||||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
|
||||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
|
||||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}.Debug|iPhone.Build.0 = Debug|Any CPU
|
|
||||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
|
||||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
|
||||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}.Release|iPhone.ActiveCfg = Release|Any CPU
|
|
||||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}.Release|iPhone.Build.0 = Release|Any CPU
|
|
||||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
|
||||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
|
||||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
|
||||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}.Debug|iPhone.Build.0 = Debug|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(NestedProjects) = preSolution
|
|
||||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA} = {AC14A7DE-A180-46EC-8A88-77F60E73A099}
|
|
||||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71} = {AC14A7DE-A180-46EC-8A88-77F60E73A099}
|
|
||||||
{91C42D32-291D-4B72-90B4-551663D60B8B} = {09905D88-652D-4A72-8521-6CB1AF347795}
|
|
||||||
{4EDC82D9-A201-4831-8FE0-98F468F8E4AE} = {09905D88-652D-4A72-8521-6CB1AF347795}
|
|
||||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363} = {B674A497-DC8E-4286-A889-0C004235AA18}
|
|
||||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6} = {B674A497-DC8E-4286-A889-0C004235AA18}
|
|
||||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71} = {9BDE3670-188E-470F-9B89-CEC0EB042AB5}
|
|
||||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77} = {9BDE3670-188E-470F-9B89-CEC0EB042AB5}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
@@ -1,13 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the BSD-style license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
|
||||||
{
|
|
||||||
public delegate float BaselineFunction(YogaNode node, float width, float height);
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user