mirror of
https://github.com/apple/pkl.git
synced 2026-05-25 16:19:20 +02:00
Compare commits
696 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4aa2cd0fc1 | |||
| e07abb7311 | |||
| d85f06be27 | |||
| d4dacd5a0f | |||
| 7b70a44272 | |||
| a33e431433 | |||
| 4058f391a3 | |||
| 7a75ab57f5 | |||
| 07c68239b9 | |||
| 9046221e03 | |||
| 2e49a319b3 | |||
| b1a5d8c915 | |||
| 1571d72111 | |||
| 2dd0e2de21 | |||
| 8103b7759f | |||
| 03a641354e | |||
| eeb0970dc4 | |||
| a8500b6b03 | |||
| 4faf35a66a | |||
| 04a9cc90d2 | |||
| 2e0b4a3a97 | |||
| 1ba54f11a9 | |||
| 2d4286ee7b | |||
| 20f403e751 | |||
| 7f173cc8e8 | |||
| 1d74e2a869 | |||
| 4620992743 | |||
| 2cfd0a0d28 | |||
| fdeb568343 | |||
| ff6f7223d3 | |||
| aca5a32f8e | |||
| 24e69fd1e2 | |||
| e793f4bd04 | |||
| 09435af54f | |||
| 99cbd07518 | |||
| 8b892f9409 | |||
| 7dedddcdb1 | |||
| 623912eca0 | |||
| dcd60b8194 | |||
| 1251843169 | |||
| 9868c11e5a | |||
| 0835c6da82 | |||
| a8c66938e6 | |||
| 8e7eb2bd96 | |||
| 58033598c7 | |||
| bc503d4d60 | |||
| 82afa8b90b | |||
| dc5504749a | |||
| a9c890e2f9 | |||
| f23c37a993 | |||
| cdc6fa8aec | |||
| 1104f12362 | |||
| cce84d7ccc | |||
| a6db476c70 | |||
| 3f3271d3b1 | |||
| 46da9cb33a | |||
| 3eda3b197e | |||
| 0e685591eb | |||
| 51bb1a5c7e | |||
| 7c5a80a584 | |||
| f9b880be85 | |||
| 7119526245 | |||
| 64ea7951db | |||
| cac3e483b5 | |||
| 4d35f18309 | |||
| 4cf2a1b42c | |||
| 3ef065b6b6 | |||
| be21c34938 | |||
| 2e4d73b957 | |||
| 28b09134d7 | |||
| 4611d181a8 | |||
| 12915f520f | |||
| 2ec0baad53 | |||
| 77395a86f4 | |||
| a5dc91f0a5 | |||
| 08712e8b26 | |||
| e07868b404 | |||
| 72a57af164 | |||
| 63a20dd453 | |||
| 60f628eb36 | |||
| 817e433a7f | |||
| 08d8c8ec7a | |||
| effa4844e6 | |||
| f0449c8330 | |||
| 7b7b51c0ae | |||
| a2bfbd72a7 | |||
| 11b65e4d7a | |||
| 73264e8fd1 | |||
| ed0cad668f | |||
| 03a7676e64 | |||
| 3cd294b62a | |||
| f6cfc82201 | |||
| fd66438828 | |||
| b4bd292511 | |||
| f1c71bc9bb | |||
| 9d385f2194 | |||
| 3595c03078 | |||
| 9b6f72d5d0 | |||
| ac4f2fd9a6 | |||
| 14d58a17b0 | |||
| 474305c7b9 | |||
| 6b9c670cfd | |||
| 4f4f03dbca | |||
| 6cd03c7f56 | |||
| 8f83885c75 | |||
| 0a4281366f | |||
| 35861240a0 | |||
| 3f4e894e43 | |||
| dcf3f24e3b | |||
| 6614cf11fb | |||
| b92c773555 | |||
| f528927797 | |||
| 41cf485ffb | |||
| cd9cfaae8f | |||
| 2578703081 | |||
| b170968e9e | |||
| 32e9087da9 | |||
| 9d41518553 | |||
| b7ccc67bd8 | |||
| 252f44728e | |||
| 139f70bb79 | |||
| 2de1d5b9d2 | |||
| 81a4e687b4 | |||
| e1559c66ad | |||
| c2d672e943 | |||
| 1d94ab5c3c | |||
| c73fc87583 | |||
| bcbe1b8995 | |||
| c5b98d6510 | |||
| db6ff394d7 | |||
| 53f3be64f3 | |||
| d1c652f736 | |||
| 6c3683c55e | |||
| cc02b6b685 | |||
| f4938dccca | |||
| 67f1ff5ab8 | |||
| ba281e8475 | |||
| bc5d675b6e | |||
| a2cc70ae37 | |||
| 0ff99d31c9 | |||
| ef9b53be98 | |||
| 0ff9125062 | |||
| f948ba2a20 | |||
| ecf2d8ba33 | |||
| 445d94ccff | |||
| 9e1303ed57 | |||
| 4c13952b64 | |||
| 4d70baba86 | |||
| 7f231cd916 | |||
| 5c944600fa | |||
| 5030061412 | |||
| 219e766003 | |||
| d29ae07e14 | |||
| 4226c21a42 | |||
| 40c88930c5 | |||
| d5beb3f331 | |||
| d8adb28dd1 | |||
| 85529c9b7e | |||
| 50541d9cda | |||
| ea778a7e7a | |||
| ffc9167bf5 | |||
| ede48d0fff | |||
| eab71229e7 | |||
| 10eccb100c | |||
| 2c18f13d08 | |||
| 9427387019 | |||
| db800d4521 | |||
| 08c414f3ac | |||
| 9469dd885d | |||
| 7df447924e | |||
| 7bf150055c | |||
| 1d6261b263 | |||
| 72874ec34a | |||
| 28c20a8652 | |||
| bbeeffdd32 | |||
| 825fcf5d1d | |||
| fbcf83aa76 | |||
| be0142d46b | |||
| ef4989aa35 | |||
| 1a25e044ac | |||
| fdb2bd8c75 | |||
| a8f76d6209 | |||
| c7680aea1f | |||
| 3223083324 | |||
| cce49a40fa | |||
| f6d3fb1228 | |||
| 6c036bf82a | |||
| c602dbb84c | |||
| bed008b3da | |||
| 80a4dc9617 | |||
| b8aad85943 | |||
| 91fec70668 | |||
| 8c5bd3b7dd | |||
| 42dcad25c6 | |||
| 3a29ea8998 | |||
| 98ab741c54 | |||
| ffa3c14fb3 | |||
| e230fcf1a9 | |||
| cf9d87373d | |||
| 55eac2088b | |||
| cecaf39aff | |||
| d03a074f63 | |||
| c585a40601 | |||
| 2e77d44877 | |||
| 5d90cf8f4e | |||
| 63f89fb679 | |||
| d1171db3d5 | |||
| f327c8e086 | |||
| 618c6243c5 | |||
| 222741dccd | |||
| fdc501a35c | |||
| 6a06ab7caa | |||
| a66ac0eb35 | |||
| bef0375285 | |||
| 44cc154501 | |||
| af7057b75f | |||
| a8806416b9 | |||
| b32039a4f1 | |||
| a779316cc2 | |||
| d9db939bdc | |||
| ae5f02b285 | |||
| 3f2f0c3a2b | |||
| 7d50aaeec9 | |||
| 78ba6bf758 | |||
| 20e7e251ec | |||
| a3cc2f0ea6 | |||
| e12c655f5c | |||
| efee9f3801 | |||
| 8e88133248 | |||
| b38b15ba71 | |||
| 1c4fbe7c1c | |||
| ae046a804b | |||
| 53f6951d81 | |||
| 7c8c4438d5 | |||
| bdf6aa6b60 | |||
| 03d8e01801 | |||
| 85e4f133a4 | |||
| 306a3b0fc2 | |||
| fe064960b4 | |||
| 6cd73227a1 | |||
| ba82c5c6d6 | |||
| decb4ea66e | |||
| 99020bb79d | |||
| fea031a138 | |||
| 48ad4386c8 | |||
| 3a35be6311 | |||
| 0973774a5d | |||
| dbf57280ba | |||
| f1388ffb2f | |||
| d6fd7e0942 | |||
| e9320557b7 | |||
| 3bd8a88506 | |||
| 0b0f3b131d | |||
| 568c6ccbc2 | |||
| dd9800c70a | |||
| 2bc9c2f424 | |||
| 4eeb61dc74 | |||
| 7d50c46c29 | |||
| a19e6bf684 | |||
| 021f43bec4 | |||
| fe2e4aa1a4 | |||
| 948a20ad0c | |||
| 919d63e51a | |||
| e4716c9e45 | |||
| 49a593f5c9 | |||
| e98b42cffd | |||
| 38c44860d4 | |||
| 854074e619 | |||
| 3119e0781b | |||
| b445713b8c | |||
| aad530b9a8 | |||
| 1cd0549bd6 | |||
| 8b7d59e4e4 | |||
| f7eaeddc78 | |||
| 18e7a7e87e | |||
| bf484b3431 | |||
| 5636fb55c4 | |||
| 5021107269 | |||
| 3baefbcfd3 | |||
| a0a64923a6 | |||
| 09166ba165 | |||
| 9ba7fa01af | |||
| 9f22c56ff5 | |||
| 06d04878f7 | |||
| d3ba0f9e47 | |||
| cc9827f032 | |||
| d1f7b639a7 | |||
| cf889246fd | |||
| fcce5c7e11 | |||
| 52a86d3f32 | |||
| 31c80e792e | |||
| 50cfb1c962 | |||
| 643c6f5a76 | |||
| 227f0637fc | |||
| baa34a6dd1 | |||
| 2ffd201172 | |||
| ee23a8c3f4 | |||
| 28b128f86f | |||
| d270829ed3 | |||
| 350b71a634 | |||
| 28df90527b | |||
| eabfcdd333 | |||
| 1a4f9ee72e | |||
| 65cf3237b7 | |||
| d00d0ba79f | |||
| f56b1bb84f | |||
| b526902bf0 | |||
| 7c3f8ad261 | |||
| 7ed710c226 | |||
| ad99e4a7f7 | |||
| e85e888f92 | |||
| 3b6fbdff15 | |||
| 9784cd7265 | |||
| aadcccd0fc | |||
| 9075ca0729 | |||
| 5e12dfb200 | |||
| 408242a44c | |||
| 8cfd2357c6 | |||
| 3fa935b390 | |||
| aa8a0f18e8 | |||
| 3815a0206b | |||
| 90df0662af | |||
| 11169d6691 | |||
| 5dc672731d | |||
| 258eda8630 | |||
| cdd6d52642 | |||
| 29049ac437 | |||
| 2a9b10097d | |||
| 257bd6f699 | |||
| 75bd21420b | |||
| 273d1219a6 | |||
| ec7d7267dc | |||
| 3096da1920 | |||
| 100dd0560e | |||
| 3296dd8a89 | |||
| 160e4a5636 | |||
| 267de3c789 | |||
| f6c74e90a8 | |||
| 467e64f98e | |||
| d9c65d484a | |||
| a014e8d1d1 | |||
| 6fd82a5bb8 | |||
| 29fb99ffea | |||
| efe1608bd6 | |||
| 6cab47067b | |||
| 17f431370a | |||
| 9982511513 | |||
| 6bd8e288ef | |||
| 01bf844a96 | |||
| 70aaa6322e | |||
| 1bc473ba54 | |||
| ad06a96a8a | |||
| 1abd174d77 | |||
| 45302c8a00 | |||
| e6c1e1411b | |||
| cc579f8fd6 | |||
| b93cb9b322 | |||
| 7c1604b264 | |||
| 0c6808566f | |||
| 51df2f3aa4 | |||
| 09bc09d058 | |||
| 16af6b7bcc | |||
| 2a7eec592d | |||
| dda457aa8e | |||
| 696a325511 | |||
| 9a27616956 | |||
| 406fa4cf40 | |||
| df38011c9e | |||
| b8d90eddec | |||
| 9faff5e551 | |||
| 3f91824dc2 | |||
| dddbb27143 | |||
| 3246a0e449 | |||
| a22a8a8127 | |||
| ff60f61cbb | |||
| 0d199892b8 | |||
| a533e53838 | |||
| 44fd680e43 | |||
| 33bffbe158 | |||
| 7eedcf1e50 | |||
| a85a173faa | |||
| b402463f3c | |||
| 6d161ce1d4 | |||
| 40a08affa6 | |||
| 4b4d81ba93 | |||
| 9692504b5f | |||
| fa25fb46fd | |||
| 3f38173ed5 | |||
| d50179827d | |||
| 03462fefae | |||
| e217cfcd6f | |||
| 66d751f093 | |||
| 1be1fe4863 | |||
| cc72f9d160 | |||
| a03827951c | |||
| 71db4d0fae | |||
| dd16f7469e | |||
| acd2222534 | |||
| 666f8c3939 | |||
| 466ae6fd4c | |||
| 08be6be059 | |||
| 8fa3acf32f | |||
| 8b0118fec5 | |||
| 93cc3253eb | |||
| 1ceb489d78 | |||
| 4b6bc7bb7c | |||
| cbbcca0d84 | |||
| 22c9a6c9f4 | |||
| 069a5d1adc | |||
| 86d870ba09 | |||
| 2040f14b07 | |||
| 730257861f | |||
| f9fe226eba | |||
| 5a654e453c | |||
| 9d10832ffc | |||
| ce25cb8ef0 | |||
| eb3891b21f | |||
| 0aa4819cea | |||
| a7cc098925 | |||
| 0ee3d37524 | |||
| 5057bb5b17 | |||
| 9abf1de7de | |||
| 84f4ec863c | |||
| d271b62543 | |||
| 62c796a257 | |||
| 9b5c5a5c98 | |||
| 2add291375 | |||
| 7ac51f1f88 | |||
| 1022cf3ff3 | |||
| 421711be10 | |||
| 475f29c896 | |||
| d00c466843 | |||
| 7f26592360 | |||
| 4854027a1a | |||
| 2961cdad19 | |||
| b76ff0f858 | |||
| bc9d526b7a | |||
| 3600582908 | |||
| 1e63c48ce4 | |||
| 9e7e42eb53 | |||
| b072794d0d | |||
| cc1e432a30 | |||
| 47f2143e0d | |||
| 7868d9d9c8 | |||
| 7001a42149 | |||
| a8f24c9f13 | |||
| e5b7e046d9 | |||
| ef0433a9ba | |||
| a9c4963a4a | |||
| e21db76efe | |||
| bbdc45656c | |||
| c445770261 | |||
| b1c2015321 | |||
| 7c4904429f | |||
| d5e86ed077 | |||
| 604b042d1b | |||
| e3133f604b | |||
| bfc2d7abbf | |||
| 0704b8cd83 | |||
| e81a47a038 | |||
| 176ede0002 | |||
| 24cc95abcc | |||
| b5e011dae1 | |||
| cdf548cad0 | |||
| 5cc2ea2d00 | |||
| 527d236ba4 | |||
| 8c1c10528f | |||
| 7a9b571f6e | |||
| 3659ad8b7a | |||
| 0d7b95d3ff | |||
| 49aaf288cc | |||
| 51d7265ec6 | |||
| 420336dc78 | |||
| 70e77347f3 | |||
| 3b786878fd | |||
| 64bfcfdc4f | |||
| 5c950d2e73 | |||
| 0ef22a73fb | |||
| 4a27ac5bda | |||
| 570c2085b3 | |||
| d55866a04b | |||
| 600939457a | |||
| e996a342cc | |||
| 00c2e00bb9 | |||
| bcee291fdc | |||
| 4a7f90157a | |||
| f15ad6ec06 | |||
| 380095c8a7 | |||
| 9c287a2e48 | |||
| 3bd9214858 | |||
| 919de4838c | |||
| d7a1778199 | |||
| b03530ed1f | |||
| a520ae7d04 | |||
| 21749f5c82 | |||
| a4c0a271b4 | |||
| 9cc9816440 | |||
| d5ba8fa736 | |||
| c0a7080287 | |||
| 207d0c78f0 | |||
| d81a12352c | |||
| a48748cb9c | |||
| 5b7123131f | |||
| 8ec06e631f | |||
| 5e4ccfd4e8 | |||
| 47f161a211 | |||
| c1949a99b0 | |||
| d0def765a2 | |||
| 5f4d475d84 | |||
| a5c13e325a | |||
| 110dc89e86 | |||
| 2d31bc5ef5 | |||
| 7da643fc8f | |||
| 21aa44cfc4 | |||
| aeb17588b3 | |||
| d28313bca8 | |||
| 27d8a030b1 | |||
| b5208a2b5b | |||
| c959888f0b | |||
| ea3e8f115b | |||
| e49a36e318 | |||
| ae69e4776f | |||
| 5feaa2aaf7 | |||
| ed1b317801 | |||
| 0d3400fb59 | |||
| fd1c294146 | |||
| c3a99f8ae6 | |||
| b433500e04 | |||
| f857223511 | |||
| c331dede3c | |||
| b9e94b94ae | |||
| e28d747418 | |||
| a7c7e51180 | |||
| 3ab9e4184e | |||
| 583dfc6927 | |||
| 3a31188cc1 | |||
| 5de90d5868 | |||
| 76f1b92039 | |||
| 81bfdb7cbd | |||
| 31917d1556 | |||
| ccf95d2af1 | |||
| 5510bf12d2 | |||
| 52ce6815d1 | |||
| 5fa598f636 | |||
| e688b4d4e1 | |||
| 2f0436ff2f | |||
| 6e2ea07986 | |||
| 90b461aa58 | |||
| f71323024c | |||
| 889e64586a | |||
| af66532377 | |||
| 033db30b04 | |||
| bba5387f17 | |||
| 309e3ff4f6 | |||
| 375b88f53e | |||
| 3c6df1fe34 | |||
| 2392a3c22f | |||
| 0f9ef53126 | |||
| 35490dc559 | |||
| d916345d2c | |||
| 57f45c80c6 | |||
| 58ed8242af | |||
| 3bd91b92ee | |||
| 28448b5512 | |||
| 759d4806c0 | |||
| c28e478d5a | |||
| 4bdfe40816 | |||
| e347b26cf6 | |||
| c9ed183891 | |||
| 11a2343a65 | |||
| deaf6983c4 | |||
| 60bcd56672 | |||
| 1a16619522 | |||
| 7584fb8d25 | |||
| dfe85b786e | |||
| 2aa60eaf1f | |||
| 7e948d317c | |||
| 46d65506d5 | |||
| 5d0d2ce7a1 | |||
| 2bf1fa215a | |||
| 4ce7a82db5 | |||
| 76f3890cff | |||
| e4ccf517fa | |||
| 1f68cf0251 | |||
| 4be03b0eaf | |||
| 6264f4b631 | |||
| 496e064caf | |||
| faa7ac69bb | |||
| 9c1ae0d683 | |||
| 014b3a8816 | |||
| 1e608b2aae | |||
| 8dc258ef7d | |||
| 9defe868c0 | |||
| 3fb1f03780 | |||
| 3f3dfdeb1e | |||
| 106743354c | |||
| 11f07d1ce8 | |||
| 4f3858aaaf | |||
| d7196e1207 | |||
| 9c3a761cfa | |||
| 0ae9e0c5c0 | |||
| 6746040362 | |||
| ddfab2a280 | |||
| b0161a4777 | |||
| 2499e2c493 | |||
| 813572f0d2 | |||
| 90dedb7837 | |||
| b7b0e65cc6 | |||
| 96c0e5fb03 | |||
| 32bc75bf50 | |||
| 7f404fff49 | |||
| 48a000aa1a | |||
| 2c54643037 | |||
| a85ffd3cab | |||
| 115e775d1b | |||
| d756dff0e7 | |||
| 9cc1796429 | |||
| eb170017f6 | |||
| 8f130d8d49 | |||
| c652bbe5cd | |||
| ca31185302 | |||
| 21e0e149ac | |||
| 1e50200969 | |||
| cb33a7cdb0 | |||
| fc0f6f1ef0 | |||
| 611ab3b55c | |||
| 1cfcc5ec38 | |||
| dd49236e00 | |||
| 6175d16d6a | |||
| 91367ed065 | |||
| ffc629f28f | |||
| 277f1e0cdb | |||
| 50a006b1b5 | |||
| bbb4d828a0 | |||
| 3b2feb45cf | |||
| 0405db8d80 | |||
| 3d1db25864 | |||
| 1c29287344 | |||
| 699cdc623e | |||
| 810a755702 | |||
| c3473cc626 | |||
| a49526649d | |||
| 1b208f852c | |||
| 1a1d2f9908 | |||
| 0b680be32b | |||
| f2470f3e85 | |||
| 7d9603afd7 | |||
| 8c254a9976 | |||
| 14dec716cf | |||
| aa98123c93 | |||
| da597d838d | |||
| b3fb5dced6 | |||
| 4bf6d3069d | |||
| 28d98b461b | |||
| 99717c61af | |||
| a28ef85698 | |||
| 6f915e5b90 | |||
| db55c527c6 | |||
| 0a3a618091 | |||
| 5ce205c2c0 | |||
| 4f1189c163 | |||
| 97f4193c15 | |||
| dddae1190f | |||
| 9dc7eb2938 | |||
| 8e6ddfb9b7 | |||
| 71fd8591ae | |||
| 20adac9919 | |||
| 77d0f5b8ca | |||
| a6e59c07ff | |||
| 52bc9612ea | |||
| 5a311d3b86 | |||
| e9df244485 | |||
| 604bb83acb | |||
| 5a8d8680c4 | |||
| 9bc7ada4ae | |||
| 0538044fee | |||
| bb3e3929ac | |||
| 9f4fd58577 | |||
| 5c541aa168 | |||
| 3f8fae4873 | |||
| f0ae1be76a | |||
| 90c60c700d | |||
| 6eb3d20b47 | |||
| b3ccdda222 | |||
| eeb9f0b86e | |||
| 58e7cc188a | |||
| ba52ac73da | |||
| d5bd21fc69 | |||
| 27ecb8c389 | |||
| 80aff3afad | |||
| 38f2e9a1cf | |||
| 6e75c4a656 | |||
| ce65290aae | |||
| 1543909566 | |||
| c31119e41f | |||
| c0959fb3e2 |
@@ -1,211 +0,0 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
|
||||||
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
// File gets rendered to .circleci/config.yml via git hook.
|
|
||||||
amends "package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.circleci@1.1.0#/PklCI.pkl"
|
|
||||||
|
|
||||||
import "jobs/BuildNativeJob.pkl"
|
|
||||||
import "jobs/GradleCheckJob.pkl"
|
|
||||||
import "jobs/DeployJob.pkl"
|
|
||||||
import "jobs/SimpleGradleJob.pkl"
|
|
||||||
|
|
||||||
local prbJobs: Listing<String> = (gradleCheckJobs.keys.toListing()) {
|
|
||||||
"check-patch-file"
|
|
||||||
}
|
|
||||||
|
|
||||||
local buildAndTestJobs = (prbJobs) {
|
|
||||||
"bench"
|
|
||||||
// "gradle-compatibility"
|
|
||||||
...buildNativeJobs.keys.filter((it) -> it.endsWith("snapshot"))
|
|
||||||
}
|
|
||||||
|
|
||||||
local releaseJobs = (prbJobs) {
|
|
||||||
"bench"
|
|
||||||
// "gradle-compatibility"
|
|
||||||
...buildNativeJobs.keys.filter((it) -> it.endsWith("release"))
|
|
||||||
}
|
|
||||||
|
|
||||||
prb {
|
|
||||||
jobs = prbJobs
|
|
||||||
}
|
|
||||||
|
|
||||||
main {
|
|
||||||
jobs {
|
|
||||||
...buildAndTestJobs
|
|
||||||
new {
|
|
||||||
["deploy-snapshot"] {
|
|
||||||
requires = buildAndTestJobs
|
|
||||||
context = "pkl-maven-release"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: remove me once policy allows these jobs without approval
|
|
||||||
circleCi {
|
|
||||||
workflows {
|
|
||||||
["release-branch"] {
|
|
||||||
jobs = new Listing<*Mapping<String, WorkflowJob>|String> {
|
|
||||||
new {
|
|
||||||
["hold"] {
|
|
||||||
type = "approval"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
new {
|
|
||||||
["pr-approval/authenticate"] {
|
|
||||||
context = "pkl-pr-approval"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (job in super.jobs) {
|
|
||||||
job |> requireApproval
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: remove me once policy allows these jobs without approval
|
|
||||||
local requireApproval = (it: String|Mapping<String, WorkflowJob>) ->
|
|
||||||
if (it is String)
|
|
||||||
new Mapping<String, WorkflowJob> {
|
|
||||||
[it] {
|
|
||||||
requires { "hold" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
(it) {
|
|
||||||
[it.keys.first] {
|
|
||||||
requires { "hold" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
release {
|
|
||||||
jobs {
|
|
||||||
...releaseJobs
|
|
||||||
// do GitHub release first because we can overwrite the tag.
|
|
||||||
// publishing to Maven Central is final.
|
|
||||||
new {
|
|
||||||
["github-release"] {
|
|
||||||
requires = releaseJobs
|
|
||||||
context = "pkl-github-release"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
new {
|
|
||||||
["deploy-release"] {
|
|
||||||
requires { "github-release" }
|
|
||||||
context = "pkl-maven-release"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
releaseBranch {
|
|
||||||
jobs = releaseJobs
|
|
||||||
}
|
|
||||||
|
|
||||||
triggerDocsBuild = "both"
|
|
||||||
|
|
||||||
triggerPackageDocsBuild = "release"
|
|
||||||
|
|
||||||
local buildNativeJobs: Mapping<String, BuildNativeJob> = new {
|
|
||||||
for (_dist in List("release", "snapshot")) {
|
|
||||||
for (_arch in List("amd64", "aarch64")) {
|
|
||||||
for (_os in List("macOS", "linux")) {
|
|
||||||
["pkl-cli-\(_os)-\(_arch)-\(_dist)"] {
|
|
||||||
arch = _arch
|
|
||||||
os = _os
|
|
||||||
isRelease = _dist == "release"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
["pkl-cli-linux-alpine-amd64-\(_dist)"] {
|
|
||||||
arch = "amd64"
|
|
||||||
os = "linux"
|
|
||||||
musl = true
|
|
||||||
isRelease = _dist == "release"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
local gradleCheckJobs: Mapping<String, GradleCheckJob> = new {
|
|
||||||
["gradle-check-jdk11"] {
|
|
||||||
javaVersion = "11.0"
|
|
||||||
isRelease = false
|
|
||||||
}
|
|
||||||
["gradle-check-jdk17"] {
|
|
||||||
javaVersion = "17.0"
|
|
||||||
isRelease = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
jobs {
|
|
||||||
for (jobName, job in buildNativeJobs) {
|
|
||||||
[jobName] = job.job
|
|
||||||
}
|
|
||||||
for (jobName, job in gradleCheckJobs) {
|
|
||||||
[jobName] = job.job
|
|
||||||
}
|
|
||||||
["bench"] = new SimpleGradleJob { command = "bench:jmh" }.job
|
|
||||||
["gradle-compatibility"] = new SimpleGradleJob {
|
|
||||||
name = "gradle compatibility"
|
|
||||||
command = #"""
|
|
||||||
:pkl-gradle:build \
|
|
||||||
:pkl-gradle:compatibilityTestReleases \
|
|
||||||
:pkl-gradle:compatibilityTestCandidate
|
|
||||||
"""#
|
|
||||||
}.job
|
|
||||||
["deploy-snapshot"] = new DeployJob { command = "publishToSonatype" }.job
|
|
||||||
["deploy-release"] = new DeployJob {
|
|
||||||
isRelease = true
|
|
||||||
command = "publishToSonatype closeAndReleaseSonatypeStagingRepository"
|
|
||||||
}.job
|
|
||||||
["github-release"] {
|
|
||||||
docker {
|
|
||||||
new { image = "maniator/gh:v2.40.1" }
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
new AttachWorkspaceStep { at = "." }
|
|
||||||
new RunStep {
|
|
||||||
name = "Publish release on GitHub"
|
|
||||||
command = #"""
|
|
||||||
# exclude build_artifacts.txt from publish
|
|
||||||
rm pkl-cli/build/executable/*.build_artifacts.txt
|
|
||||||
gh release create "${CIRCLE_TAG}" \
|
|
||||||
--title "${CIRCLE_TAG}" \
|
|
||||||
--target "${CIRCLE_SHA1}" \
|
|
||||||
--verify-tag \
|
|
||||||
--notes "Release notes: https://pkl-lang.org/main/current/release-notes/changelog.html#release-${CIRCLE_TAG}" \
|
|
||||||
--repo "${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" \
|
|
||||||
pkl-cli/build/executable/*
|
|
||||||
"""#
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
["check-patch-file"] {
|
|
||||||
docker {
|
|
||||||
new { image = "cimg/base:current" }
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
"checkout"
|
|
||||||
new RunStep {
|
|
||||||
// language=bash
|
|
||||||
command = #"""
|
|
||||||
git apply --reject patches/graalVm23.patch
|
|
||||||
"""#
|
|
||||||
}
|
|
||||||
}
|
|
||||||
resource_class = "small"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,935 +0,0 @@
|
|||||||
# Generated from CircleCI.pkl. DO NOT EDIT.
|
|
||||||
version: '2.1'
|
|
||||||
orbs:
|
|
||||||
pr-approval: apple/pr-approval@0.1.0
|
|
||||||
jobs:
|
|
||||||
pkl-cli-macOS-amd64-release:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
command: /usr/sbin/softwareupdate --install-rosetta --agree-to-license
|
|
||||||
name: Installing Rosetta 2
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
|
||||||
./gradlew --info --stacktrace -DreleaseBuild=true pkl-cli:macExecutableAmd64 pkl-core:testMacExecutableAmd64
|
|
||||||
name: gradle buildNative
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: '.'
|
|
||||||
paths:
|
|
||||||
- pkl-cli/build/executable/
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/test-results
|
|
||||||
environment:
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
resource_class: macos.m1.large.gen1
|
|
||||||
macos:
|
|
||||||
xcode: 15.2.0
|
|
||||||
pkl-cli-linux-amd64-release:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- restore_cache:
|
|
||||||
key: staticdeps-amd64
|
|
||||||
name: Restore static deps from cache
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
sed -ie '/\[ol8_codeready_builder\]/,/^$/s/enabled=0/enabled=1/g' /etc/yum.repos.d/oracle-linux-ol8.repo \
|
|
||||||
&& microdnf -y install util-linux tree coreutils-single findutils curl tar gzip git zlib-devel gcc-c++ make openssl glibc-langpack-en libstdc++-static \
|
|
||||||
&& microdnf clean all \
|
|
||||||
&& rm -rf /var/cache/dnf
|
|
||||||
|
|
||||||
# install jdk
|
|
||||||
curl -L \
|
|
||||||
https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.20.1%2B1/OpenJDK11U-jdk_x64_linux_hotspot_11.0.20.1_1.tar.gz -o /tmp/jdk.tar.gz
|
|
||||||
|
|
||||||
mkdir /jdk \
|
|
||||||
&& cd /jdk \
|
|
||||||
&& cat /tmp/jdk.tar.gz | tar --strip-components=1 -xzC .
|
|
||||||
|
|
||||||
mkdir -p ~/staticdeps/bin
|
|
||||||
|
|
||||||
cp /usr/lib/gcc/x86_64-redhat-linux/8/libstdc++.a ~/staticdeps
|
|
||||||
|
|
||||||
# install zlib
|
|
||||||
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
|
||||||
curl -L https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz -o /tmp/zlib.tar.gz
|
|
||||||
|
|
||||||
mkdir -p /tmp/dep_zlib-1.2.13 \
|
|
||||||
&& cd /tmp/dep_zlib-1.2.13 \
|
|
||||||
&& cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC . \
|
|
||||||
&& echo "zlib-1.2.13: configure..." && ./configure --static --prefix="$HOME"/staticdeps > /dev/null \
|
|
||||||
&& echo "zlib-1.2.13: make..." && make -s -j4 \
|
|
||||||
&& echo "zlib-1.2.13: make install..." && make -s install \
|
|
||||||
&& rm -rf /tmp/dep_zlib-1.2.13
|
|
||||||
fi
|
|
||||||
|
|
||||||
# install musl
|
|
||||||
if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then
|
|
||||||
curl -L https://musl.libc.org/releases/musl-1.2.2.tar.gz -o /tmp/musl.tar.gz
|
|
||||||
|
|
||||||
mkdir -p /tmp/dep_musl-1.2.2 \
|
|
||||||
&& cd /tmp/dep_musl-1.2.2 \
|
|
||||||
&& cat /tmp/musl.tar.gz | tar --strip-components=1 -xzC . \
|
|
||||||
&& echo "musl-1.2.2: configure..." && ./configure --disable-shared --prefix="$HOME"/staticdeps > /dev/null \
|
|
||||||
&& echo "musl-1.2.2: make..." && make -s -j4 \
|
|
||||||
&& echo "musl-1.2.2: make install..." && make -s install \
|
|
||||||
&& rm -rf /tmp/dep_musl-1.2.2
|
|
||||||
|
|
||||||
# native-image expects to find an executable at this path.
|
|
||||||
ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc
|
|
||||||
fi
|
|
||||||
name: Set up environment
|
|
||||||
shell: '#!/bin/bash -exo pipefail'
|
|
||||||
- save_cache:
|
|
||||||
paths:
|
|
||||||
- ~/staticdeps
|
|
||||||
key: staticdeps-amd64
|
|
||||||
name: Save statics deps to cache
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
|
||||||
./gradlew --info --stacktrace -DreleaseBuild=true pkl-cli:linuxExecutableAmd64 pkl-core:testLinuxExecutableAmd64
|
|
||||||
name: gradle buildNative
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: '.'
|
|
||||||
paths:
|
|
||||||
- pkl-cli/build/executable/
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/test-results
|
|
||||||
environment:
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
JAVA_HOME: /jdk
|
|
||||||
resource_class: xlarge
|
|
||||||
docker:
|
|
||||||
- image: oraclelinux:8-slim
|
|
||||||
pkl-cli-macOS-aarch64-release:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
command: git apply patches/graalVm23.patch
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
|
||||||
./gradlew --info --stacktrace -DreleaseBuild=true pkl-cli:macExecutableAarch64 pkl-core:testMacExecutableAarch64
|
|
||||||
name: gradle buildNative
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: '.'
|
|
||||||
paths:
|
|
||||||
- pkl-cli/build/executable/
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/test-results
|
|
||||||
environment:
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
resource_class: macos.m1.large.gen1
|
|
||||||
macos:
|
|
||||||
xcode: 15.2.0
|
|
||||||
pkl-cli-linux-aarch64-release:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- restore_cache:
|
|
||||||
key: staticdeps-aarch64
|
|
||||||
name: Restore static deps from cache
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
sed -ie '/\[ol8_codeready_builder\]/,/^$/s/enabled=0/enabled=1/g' /etc/yum.repos.d/oracle-linux-ol8.repo \
|
|
||||||
&& microdnf -y install util-linux tree coreutils-single findutils curl tar gzip git zlib-devel gcc-c++ make openssl glibc-langpack-en libstdc++-static \
|
|
||||||
&& microdnf clean all \
|
|
||||||
&& rm -rf /var/cache/dnf
|
|
||||||
|
|
||||||
# install jdk
|
|
||||||
curl -L \
|
|
||||||
https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.20.1%2B1/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.20.1_1.tar.gz -o /tmp/jdk.tar.gz
|
|
||||||
|
|
||||||
mkdir /jdk \
|
|
||||||
&& cd /jdk \
|
|
||||||
&& cat /tmp/jdk.tar.gz | tar --strip-components=1 -xzC .
|
|
||||||
|
|
||||||
mkdir -p ~/staticdeps/bin
|
|
||||||
|
|
||||||
cp /usr/lib/gcc/aarch64-redhat-linux/8/libstdc++.a ~/staticdeps
|
|
||||||
|
|
||||||
# install zlib
|
|
||||||
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
|
||||||
curl -L https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz -o /tmp/zlib.tar.gz
|
|
||||||
|
|
||||||
mkdir -p /tmp/dep_zlib-1.2.13 \
|
|
||||||
&& cd /tmp/dep_zlib-1.2.13 \
|
|
||||||
&& cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC . \
|
|
||||||
&& echo "zlib-1.2.13: configure..." && ./configure --static --prefix="$HOME"/staticdeps > /dev/null \
|
|
||||||
&& echo "zlib-1.2.13: make..." && make -s -j4 \
|
|
||||||
&& echo "zlib-1.2.13: make install..." && make -s install \
|
|
||||||
&& rm -rf /tmp/dep_zlib-1.2.13
|
|
||||||
fi
|
|
||||||
name: Set up environment
|
|
||||||
shell: '#!/bin/bash -exo pipefail'
|
|
||||||
- save_cache:
|
|
||||||
paths:
|
|
||||||
- ~/staticdeps
|
|
||||||
key: staticdeps-aarch64
|
|
||||||
name: Save statics deps to cache
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
|
||||||
./gradlew --info --stacktrace -DreleaseBuild=true pkl-cli:linuxExecutableAarch64 pkl-core:testLinuxExecutableAarch64
|
|
||||||
name: gradle buildNative
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: '.'
|
|
||||||
paths:
|
|
||||||
- pkl-cli/build/executable/
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/test-results
|
|
||||||
environment:
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
JAVA_HOME: /jdk
|
|
||||||
resource_class: arm.xlarge
|
|
||||||
docker:
|
|
||||||
- image: arm64v8/oraclelinux:8-slim
|
|
||||||
pkl-cli-linux-alpine-amd64-release:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- restore_cache:
|
|
||||||
key: staticdeps-amd64
|
|
||||||
name: Restore static deps from cache
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
sed -ie '/\[ol8_codeready_builder\]/,/^$/s/enabled=0/enabled=1/g' /etc/yum.repos.d/oracle-linux-ol8.repo \
|
|
||||||
&& microdnf -y install util-linux tree coreutils-single findutils curl tar gzip git zlib-devel gcc-c++ make openssl glibc-langpack-en libstdc++-static \
|
|
||||||
&& microdnf clean all \
|
|
||||||
&& rm -rf /var/cache/dnf
|
|
||||||
|
|
||||||
# install jdk
|
|
||||||
curl -L \
|
|
||||||
https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.20.1%2B1/OpenJDK11U-jdk_x64_linux_hotspot_11.0.20.1_1.tar.gz -o /tmp/jdk.tar.gz
|
|
||||||
|
|
||||||
mkdir /jdk \
|
|
||||||
&& cd /jdk \
|
|
||||||
&& cat /tmp/jdk.tar.gz | tar --strip-components=1 -xzC .
|
|
||||||
|
|
||||||
mkdir -p ~/staticdeps/bin
|
|
||||||
|
|
||||||
cp /usr/lib/gcc/x86_64-redhat-linux/8/libstdc++.a ~/staticdeps
|
|
||||||
|
|
||||||
# install zlib
|
|
||||||
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
|
||||||
curl -L https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz -o /tmp/zlib.tar.gz
|
|
||||||
|
|
||||||
mkdir -p /tmp/dep_zlib-1.2.13 \
|
|
||||||
&& cd /tmp/dep_zlib-1.2.13 \
|
|
||||||
&& cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC . \
|
|
||||||
&& echo "zlib-1.2.13: configure..." && ./configure --static --prefix="$HOME"/staticdeps > /dev/null \
|
|
||||||
&& echo "zlib-1.2.13: make..." && make -s -j4 \
|
|
||||||
&& echo "zlib-1.2.13: make install..." && make -s install \
|
|
||||||
&& rm -rf /tmp/dep_zlib-1.2.13
|
|
||||||
fi
|
|
||||||
|
|
||||||
# install musl
|
|
||||||
if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then
|
|
||||||
curl -L https://musl.libc.org/releases/musl-1.2.2.tar.gz -o /tmp/musl.tar.gz
|
|
||||||
|
|
||||||
mkdir -p /tmp/dep_musl-1.2.2 \
|
|
||||||
&& cd /tmp/dep_musl-1.2.2 \
|
|
||||||
&& cat /tmp/musl.tar.gz | tar --strip-components=1 -xzC . \
|
|
||||||
&& echo "musl-1.2.2: configure..." && ./configure --disable-shared --prefix="$HOME"/staticdeps > /dev/null \
|
|
||||||
&& echo "musl-1.2.2: make..." && make -s -j4 \
|
|
||||||
&& echo "musl-1.2.2: make install..." && make -s install \
|
|
||||||
&& rm -rf /tmp/dep_musl-1.2.2
|
|
||||||
|
|
||||||
# native-image expects to find an executable at this path.
|
|
||||||
ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc
|
|
||||||
fi
|
|
||||||
name: Set up environment
|
|
||||||
shell: '#!/bin/bash -exo pipefail'
|
|
||||||
- save_cache:
|
|
||||||
paths:
|
|
||||||
- ~/staticdeps
|
|
||||||
key: staticdeps-amd64
|
|
||||||
name: Save statics deps to cache
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
|
||||||
./gradlew --info --stacktrace -DreleaseBuild=true pkl-cli:alpineExecutableAmd64 pkl-core:testAlpineExecutableAmd64
|
|
||||||
name: gradle buildNative
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: '.'
|
|
||||||
paths:
|
|
||||||
- pkl-cli/build/executable/
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/test-results
|
|
||||||
environment:
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
JAVA_HOME: /jdk
|
|
||||||
resource_class: xlarge
|
|
||||||
docker:
|
|
||||||
- image: oraclelinux:8-slim
|
|
||||||
pkl-cli-macOS-amd64-snapshot:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
command: /usr/sbin/softwareupdate --install-rosetta --agree-to-license
|
|
||||||
name: Installing Rosetta 2
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
|
||||||
./gradlew --info --stacktrace pkl-cli:macExecutableAmd64 pkl-core:testMacExecutableAmd64
|
|
||||||
name: gradle buildNative
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: '.'
|
|
||||||
paths:
|
|
||||||
- pkl-cli/build/executable/
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/test-results
|
|
||||||
environment:
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
resource_class: macos.m1.large.gen1
|
|
||||||
macos:
|
|
||||||
xcode: 15.2.0
|
|
||||||
pkl-cli-linux-amd64-snapshot:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- restore_cache:
|
|
||||||
key: staticdeps-amd64
|
|
||||||
name: Restore static deps from cache
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
sed -ie '/\[ol8_codeready_builder\]/,/^$/s/enabled=0/enabled=1/g' /etc/yum.repos.d/oracle-linux-ol8.repo \
|
|
||||||
&& microdnf -y install util-linux tree coreutils-single findutils curl tar gzip git zlib-devel gcc-c++ make openssl glibc-langpack-en libstdc++-static \
|
|
||||||
&& microdnf clean all \
|
|
||||||
&& rm -rf /var/cache/dnf
|
|
||||||
|
|
||||||
# install jdk
|
|
||||||
curl -L \
|
|
||||||
https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.20.1%2B1/OpenJDK11U-jdk_x64_linux_hotspot_11.0.20.1_1.tar.gz -o /tmp/jdk.tar.gz
|
|
||||||
|
|
||||||
mkdir /jdk \
|
|
||||||
&& cd /jdk \
|
|
||||||
&& cat /tmp/jdk.tar.gz | tar --strip-components=1 -xzC .
|
|
||||||
|
|
||||||
mkdir -p ~/staticdeps/bin
|
|
||||||
|
|
||||||
cp /usr/lib/gcc/x86_64-redhat-linux/8/libstdc++.a ~/staticdeps
|
|
||||||
|
|
||||||
# install zlib
|
|
||||||
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
|
||||||
curl -L https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz -o /tmp/zlib.tar.gz
|
|
||||||
|
|
||||||
mkdir -p /tmp/dep_zlib-1.2.13 \
|
|
||||||
&& cd /tmp/dep_zlib-1.2.13 \
|
|
||||||
&& cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC . \
|
|
||||||
&& echo "zlib-1.2.13: configure..." && ./configure --static --prefix="$HOME"/staticdeps > /dev/null \
|
|
||||||
&& echo "zlib-1.2.13: make..." && make -s -j4 \
|
|
||||||
&& echo "zlib-1.2.13: make install..." && make -s install \
|
|
||||||
&& rm -rf /tmp/dep_zlib-1.2.13
|
|
||||||
fi
|
|
||||||
|
|
||||||
# install musl
|
|
||||||
if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then
|
|
||||||
curl -L https://musl.libc.org/releases/musl-1.2.2.tar.gz -o /tmp/musl.tar.gz
|
|
||||||
|
|
||||||
mkdir -p /tmp/dep_musl-1.2.2 \
|
|
||||||
&& cd /tmp/dep_musl-1.2.2 \
|
|
||||||
&& cat /tmp/musl.tar.gz | tar --strip-components=1 -xzC . \
|
|
||||||
&& echo "musl-1.2.2: configure..." && ./configure --disable-shared --prefix="$HOME"/staticdeps > /dev/null \
|
|
||||||
&& echo "musl-1.2.2: make..." && make -s -j4 \
|
|
||||||
&& echo "musl-1.2.2: make install..." && make -s install \
|
|
||||||
&& rm -rf /tmp/dep_musl-1.2.2
|
|
||||||
|
|
||||||
# native-image expects to find an executable at this path.
|
|
||||||
ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc
|
|
||||||
fi
|
|
||||||
name: Set up environment
|
|
||||||
shell: '#!/bin/bash -exo pipefail'
|
|
||||||
- save_cache:
|
|
||||||
paths:
|
|
||||||
- ~/staticdeps
|
|
||||||
key: staticdeps-amd64
|
|
||||||
name: Save statics deps to cache
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
|
||||||
./gradlew --info --stacktrace pkl-cli:linuxExecutableAmd64 pkl-core:testLinuxExecutableAmd64
|
|
||||||
name: gradle buildNative
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: '.'
|
|
||||||
paths:
|
|
||||||
- pkl-cli/build/executable/
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/test-results
|
|
||||||
environment:
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
JAVA_HOME: /jdk
|
|
||||||
resource_class: xlarge
|
|
||||||
docker:
|
|
||||||
- image: oraclelinux:8-slim
|
|
||||||
pkl-cli-macOS-aarch64-snapshot:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
command: git apply patches/graalVm23.patch
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
|
||||||
./gradlew --info --stacktrace pkl-cli:macExecutableAarch64 pkl-core:testMacExecutableAarch64
|
|
||||||
name: gradle buildNative
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: '.'
|
|
||||||
paths:
|
|
||||||
- pkl-cli/build/executable/
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/test-results
|
|
||||||
environment:
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
resource_class: macos.m1.large.gen1
|
|
||||||
macos:
|
|
||||||
xcode: 15.2.0
|
|
||||||
pkl-cli-linux-aarch64-snapshot:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- restore_cache:
|
|
||||||
key: staticdeps-aarch64
|
|
||||||
name: Restore static deps from cache
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
sed -ie '/\[ol8_codeready_builder\]/,/^$/s/enabled=0/enabled=1/g' /etc/yum.repos.d/oracle-linux-ol8.repo \
|
|
||||||
&& microdnf -y install util-linux tree coreutils-single findutils curl tar gzip git zlib-devel gcc-c++ make openssl glibc-langpack-en libstdc++-static \
|
|
||||||
&& microdnf clean all \
|
|
||||||
&& rm -rf /var/cache/dnf
|
|
||||||
|
|
||||||
# install jdk
|
|
||||||
curl -L \
|
|
||||||
https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.20.1%2B1/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.20.1_1.tar.gz -o /tmp/jdk.tar.gz
|
|
||||||
|
|
||||||
mkdir /jdk \
|
|
||||||
&& cd /jdk \
|
|
||||||
&& cat /tmp/jdk.tar.gz | tar --strip-components=1 -xzC .
|
|
||||||
|
|
||||||
mkdir -p ~/staticdeps/bin
|
|
||||||
|
|
||||||
cp /usr/lib/gcc/aarch64-redhat-linux/8/libstdc++.a ~/staticdeps
|
|
||||||
|
|
||||||
# install zlib
|
|
||||||
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
|
||||||
curl -L https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz -o /tmp/zlib.tar.gz
|
|
||||||
|
|
||||||
mkdir -p /tmp/dep_zlib-1.2.13 \
|
|
||||||
&& cd /tmp/dep_zlib-1.2.13 \
|
|
||||||
&& cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC . \
|
|
||||||
&& echo "zlib-1.2.13: configure..." && ./configure --static --prefix="$HOME"/staticdeps > /dev/null \
|
|
||||||
&& echo "zlib-1.2.13: make..." && make -s -j4 \
|
|
||||||
&& echo "zlib-1.2.13: make install..." && make -s install \
|
|
||||||
&& rm -rf /tmp/dep_zlib-1.2.13
|
|
||||||
fi
|
|
||||||
name: Set up environment
|
|
||||||
shell: '#!/bin/bash -exo pipefail'
|
|
||||||
- save_cache:
|
|
||||||
paths:
|
|
||||||
- ~/staticdeps
|
|
||||||
key: staticdeps-aarch64
|
|
||||||
name: Save statics deps to cache
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
|
||||||
./gradlew --info --stacktrace pkl-cli:linuxExecutableAarch64 pkl-core:testLinuxExecutableAarch64
|
|
||||||
name: gradle buildNative
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: '.'
|
|
||||||
paths:
|
|
||||||
- pkl-cli/build/executable/
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/test-results
|
|
||||||
environment:
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
JAVA_HOME: /jdk
|
|
||||||
resource_class: arm.xlarge
|
|
||||||
docker:
|
|
||||||
- image: arm64v8/oraclelinux:8-slim
|
|
||||||
pkl-cli-linux-alpine-amd64-snapshot:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- restore_cache:
|
|
||||||
key: staticdeps-amd64
|
|
||||||
name: Restore static deps from cache
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
sed -ie '/\[ol8_codeready_builder\]/,/^$/s/enabled=0/enabled=1/g' /etc/yum.repos.d/oracle-linux-ol8.repo \
|
|
||||||
&& microdnf -y install util-linux tree coreutils-single findutils curl tar gzip git zlib-devel gcc-c++ make openssl glibc-langpack-en libstdc++-static \
|
|
||||||
&& microdnf clean all \
|
|
||||||
&& rm -rf /var/cache/dnf
|
|
||||||
|
|
||||||
# install jdk
|
|
||||||
curl -L \
|
|
||||||
https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.20.1%2B1/OpenJDK11U-jdk_x64_linux_hotspot_11.0.20.1_1.tar.gz -o /tmp/jdk.tar.gz
|
|
||||||
|
|
||||||
mkdir /jdk \
|
|
||||||
&& cd /jdk \
|
|
||||||
&& cat /tmp/jdk.tar.gz | tar --strip-components=1 -xzC .
|
|
||||||
|
|
||||||
mkdir -p ~/staticdeps/bin
|
|
||||||
|
|
||||||
cp /usr/lib/gcc/x86_64-redhat-linux/8/libstdc++.a ~/staticdeps
|
|
||||||
|
|
||||||
# install zlib
|
|
||||||
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
|
||||||
curl -L https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz -o /tmp/zlib.tar.gz
|
|
||||||
|
|
||||||
mkdir -p /tmp/dep_zlib-1.2.13 \
|
|
||||||
&& cd /tmp/dep_zlib-1.2.13 \
|
|
||||||
&& cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC . \
|
|
||||||
&& echo "zlib-1.2.13: configure..." && ./configure --static --prefix="$HOME"/staticdeps > /dev/null \
|
|
||||||
&& echo "zlib-1.2.13: make..." && make -s -j4 \
|
|
||||||
&& echo "zlib-1.2.13: make install..." && make -s install \
|
|
||||||
&& rm -rf /tmp/dep_zlib-1.2.13
|
|
||||||
fi
|
|
||||||
|
|
||||||
# install musl
|
|
||||||
if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then
|
|
||||||
curl -L https://musl.libc.org/releases/musl-1.2.2.tar.gz -o /tmp/musl.tar.gz
|
|
||||||
|
|
||||||
mkdir -p /tmp/dep_musl-1.2.2 \
|
|
||||||
&& cd /tmp/dep_musl-1.2.2 \
|
|
||||||
&& cat /tmp/musl.tar.gz | tar --strip-components=1 -xzC . \
|
|
||||||
&& echo "musl-1.2.2: configure..." && ./configure --disable-shared --prefix="$HOME"/staticdeps > /dev/null \
|
|
||||||
&& echo "musl-1.2.2: make..." && make -s -j4 \
|
|
||||||
&& echo "musl-1.2.2: make install..." && make -s install \
|
|
||||||
&& rm -rf /tmp/dep_musl-1.2.2
|
|
||||||
|
|
||||||
# native-image expects to find an executable at this path.
|
|
||||||
ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc
|
|
||||||
fi
|
|
||||||
name: Set up environment
|
|
||||||
shell: '#!/bin/bash -exo pipefail'
|
|
||||||
- save_cache:
|
|
||||||
paths:
|
|
||||||
- ~/staticdeps
|
|
||||||
key: staticdeps-amd64
|
|
||||||
name: Save statics deps to cache
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
|
||||||
./gradlew --info --stacktrace pkl-cli:alpineExecutableAmd64 pkl-core:testAlpineExecutableAmd64
|
|
||||||
name: gradle buildNative
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: '.'
|
|
||||||
paths:
|
|
||||||
- pkl-cli/build/executable/
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/test-results
|
|
||||||
environment:
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
JAVA_HOME: /jdk
|
|
||||||
resource_class: xlarge
|
|
||||||
docker:
|
|
||||||
- image: oraclelinux:8-slim
|
|
||||||
gradle-check-jdk11:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
command: ./gradlew --info --stacktrace check
|
|
||||||
name: gradle check
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/test-results
|
|
||||||
environment:
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
docker:
|
|
||||||
- image: cimg/openjdk:11.0
|
|
||||||
gradle-check-jdk17:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
command: ./gradlew --info --stacktrace check
|
|
||||||
name: gradle check
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/test-results
|
|
||||||
environment:
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
docker:
|
|
||||||
- image: cimg/openjdk:17.0
|
|
||||||
bench:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
command: ./gradlew --info --stacktrace bench:jmh
|
|
||||||
name: bench:jmh
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/test-results
|
|
||||||
environment:
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
docker:
|
|
||||||
- image: cimg/openjdk:11.0
|
|
||||||
gradle-compatibility:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
./gradlew --info --stacktrace :pkl-gradle:build \
|
|
||||||
:pkl-gradle:compatibilityTestReleases \
|
|
||||||
:pkl-gradle:compatibilityTestCandidate
|
|
||||||
name: gradle compatibility
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/test-results
|
|
||||||
environment:
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
docker:
|
|
||||||
- image: cimg/openjdk:11.0
|
|
||||||
deploy-snapshot:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- attach_workspace:
|
|
||||||
at: '.'
|
|
||||||
- run:
|
|
||||||
command: ./gradlew --info --stacktrace publishToSonatype
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: '.'
|
|
||||||
paths:
|
|
||||||
- pkl-cli/build/executable/
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/test-results
|
|
||||||
environment:
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
docker:
|
|
||||||
- image: cimg/openjdk:11.0
|
|
||||||
deploy-release:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- attach_workspace:
|
|
||||||
at: '.'
|
|
||||||
- run:
|
|
||||||
command: ./gradlew --info --stacktrace -DreleaseBuild=true publishToSonatype closeAndReleaseSonatypeStagingRepository
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: '.'
|
|
||||||
paths:
|
|
||||||
- pkl-cli/build/executable/
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/test-results
|
|
||||||
environment:
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
docker:
|
|
||||||
- image: cimg/openjdk:11.0
|
|
||||||
github-release:
|
|
||||||
steps:
|
|
||||||
- attach_workspace:
|
|
||||||
at: '.'
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
# exclude build_artifacts.txt from publish
|
|
||||||
rm pkl-cli/build/executable/*.build_artifacts.txt
|
|
||||||
gh release create "${CIRCLE_TAG}" \
|
|
||||||
--title "${CIRCLE_TAG}" \
|
|
||||||
--target "${CIRCLE_SHA1}" \
|
|
||||||
--verify-tag \
|
|
||||||
--notes "Release notes: https://pkl-lang.org/main/current/release-notes/changelog.html#release-${CIRCLE_TAG}" \
|
|
||||||
--repo "${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" \
|
|
||||||
pkl-cli/build/executable/*
|
|
||||||
name: Publish release on GitHub
|
|
||||||
docker:
|
|
||||||
- image: maniator/gh:v2.40.1
|
|
||||||
check-patch-file:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
command: git apply --reject patches/graalVm23.patch
|
|
||||||
resource_class: small
|
|
||||||
docker:
|
|
||||||
- image: cimg/base:current
|
|
||||||
trigger-docsite-build:
|
|
||||||
steps:
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
curl --location \
|
|
||||||
--request POST \
|
|
||||||
--header "Content-Type: application/json" \
|
|
||||||
-u "${CIRCLE_TOKEN}:" \
|
|
||||||
--data '{ "branch": "main" }' \
|
|
||||||
"https://circleci.com/api/v2/project/github/apple/pkl-lang.org/pipeline"
|
|
||||||
name: Triggering docsite build
|
|
||||||
docker:
|
|
||||||
- image: cimg/base:current
|
|
||||||
trigger-package-docs-build:
|
|
||||||
steps:
|
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
curl --location \
|
|
||||||
--request POST \
|
|
||||||
--header "Content-Type: application/json" \
|
|
||||||
-u "${CIRCLE_TOKEN}:" \
|
|
||||||
--data '{ "branch": "main" }' \
|
|
||||||
"https://circleci.com/api/v2/project/github/apple/pkl-package-docs/pipeline"
|
|
||||||
name: Triggering docsite build
|
|
||||||
docker:
|
|
||||||
- image: cimg/base:current
|
|
||||||
workflows:
|
|
||||||
prb:
|
|
||||||
jobs:
|
|
||||||
- hold:
|
|
||||||
type: approval
|
|
||||||
- pr-approval/authenticate:
|
|
||||||
context: pkl-pr-approval
|
|
||||||
- gradle-check-jdk11:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- gradle-check-jdk17:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- check-patch-file:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
when:
|
|
||||||
matches:
|
|
||||||
value: << pipeline.git.branch >>
|
|
||||||
pattern: ^pull/\d+(/head)?$
|
|
||||||
main:
|
|
||||||
jobs:
|
|
||||||
- gradle-check-jdk11
|
|
||||||
- gradle-check-jdk17
|
|
||||||
- check-patch-file
|
|
||||||
- bench
|
|
||||||
- pkl-cli-macOS-amd64-snapshot
|
|
||||||
- pkl-cli-linux-amd64-snapshot
|
|
||||||
- pkl-cli-macOS-aarch64-snapshot
|
|
||||||
- pkl-cli-linux-aarch64-snapshot
|
|
||||||
- pkl-cli-linux-alpine-amd64-snapshot
|
|
||||||
- deploy-snapshot:
|
|
||||||
requires:
|
|
||||||
- gradle-check-jdk11
|
|
||||||
- gradle-check-jdk17
|
|
||||||
- check-patch-file
|
|
||||||
- bench
|
|
||||||
- pkl-cli-macOS-amd64-snapshot
|
|
||||||
- pkl-cli-linux-amd64-snapshot
|
|
||||||
- pkl-cli-macOS-aarch64-snapshot
|
|
||||||
- pkl-cli-linux-aarch64-snapshot
|
|
||||||
- pkl-cli-linux-alpine-amd64-snapshot
|
|
||||||
context: pkl-maven-release
|
|
||||||
- trigger-docsite-build:
|
|
||||||
requires:
|
|
||||||
- deploy-snapshot
|
|
||||||
context:
|
|
||||||
- pkl-pr-approval
|
|
||||||
when:
|
|
||||||
equal:
|
|
||||||
- main
|
|
||||||
- << pipeline.git.branch >>
|
|
||||||
release:
|
|
||||||
jobs:
|
|
||||||
- gradle-check-jdk11:
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore: /.*/
|
|
||||||
tags:
|
|
||||||
only: /^v?\d+\.\d+\.\d+$/
|
|
||||||
- gradle-check-jdk17:
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore: /.*/
|
|
||||||
tags:
|
|
||||||
only: /^v?\d+\.\d+\.\d+$/
|
|
||||||
- check-patch-file:
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore: /.*/
|
|
||||||
tags:
|
|
||||||
only: /^v?\d+\.\d+\.\d+$/
|
|
||||||
- bench:
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore: /.*/
|
|
||||||
tags:
|
|
||||||
only: /^v?\d+\.\d+\.\d+$/
|
|
||||||
- pkl-cli-macOS-amd64-release:
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore: /.*/
|
|
||||||
tags:
|
|
||||||
only: /^v?\d+\.\d+\.\d+$/
|
|
||||||
- pkl-cli-linux-amd64-release:
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore: /.*/
|
|
||||||
tags:
|
|
||||||
only: /^v?\d+\.\d+\.\d+$/
|
|
||||||
- pkl-cli-macOS-aarch64-release:
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore: /.*/
|
|
||||||
tags:
|
|
||||||
only: /^v?\d+\.\d+\.\d+$/
|
|
||||||
- pkl-cli-linux-aarch64-release:
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore: /.*/
|
|
||||||
tags:
|
|
||||||
only: /^v?\d+\.\d+\.\d+$/
|
|
||||||
- pkl-cli-linux-alpine-amd64-release:
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore: /.*/
|
|
||||||
tags:
|
|
||||||
only: /^v?\d+\.\d+\.\d+$/
|
|
||||||
- github-release:
|
|
||||||
requires:
|
|
||||||
- gradle-check-jdk11
|
|
||||||
- gradle-check-jdk17
|
|
||||||
- check-patch-file
|
|
||||||
- bench
|
|
||||||
- pkl-cli-macOS-amd64-release
|
|
||||||
- pkl-cli-linux-amd64-release
|
|
||||||
- pkl-cli-macOS-aarch64-release
|
|
||||||
- pkl-cli-linux-aarch64-release
|
|
||||||
- pkl-cli-linux-alpine-amd64-release
|
|
||||||
context: pkl-github-release
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore: /.*/
|
|
||||||
tags:
|
|
||||||
only: /^v?\d+\.\d+\.\d+$/
|
|
||||||
- deploy-release:
|
|
||||||
requires:
|
|
||||||
- github-release
|
|
||||||
context: pkl-maven-release
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore: /.*/
|
|
||||||
tags:
|
|
||||||
only: /^v?\d+\.\d+\.\d+$/
|
|
||||||
- trigger-package-docs-build:
|
|
||||||
requires:
|
|
||||||
- deploy-release
|
|
||||||
context:
|
|
||||||
- pkl-pr-approval
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore: /.*/
|
|
||||||
tags:
|
|
||||||
only: /^v?\d+\.\d+\.\d+$/
|
|
||||||
release-branch:
|
|
||||||
jobs:
|
|
||||||
- hold:
|
|
||||||
type: approval
|
|
||||||
- pr-approval/authenticate:
|
|
||||||
context: pkl-pr-approval
|
|
||||||
- gradle-check-jdk11:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- gradle-check-jdk17:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- check-patch-file:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- bench:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- pkl-cli-macOS-amd64-release:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- pkl-cli-linux-amd64-release:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- pkl-cli-macOS-aarch64-release:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- pkl-cli-linux-aarch64-release:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- pkl-cli-linux-alpine-amd64-release:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
when:
|
|
||||||
matches:
|
|
||||||
value: << pipeline.git.branch >>
|
|
||||||
pattern: ^release/\d+\.\d+$
|
|
||||||
@@ -1,166 +0,0 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
|
||||||
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
/// Builds the native `pkl` CLI
|
|
||||||
extends "GradleJob.pkl"
|
|
||||||
|
|
||||||
import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.1.0#/Config.pkl"
|
|
||||||
import "package://pkg.pkl-lang.org/pkl-pantry/pkl.experimental.uri@1.0.0#/URI.pkl"
|
|
||||||
|
|
||||||
/// The OS to run on
|
|
||||||
os: "macOS"|"linux"
|
|
||||||
|
|
||||||
/// The architecture to use
|
|
||||||
arch: "amd64"|"aarch64"
|
|
||||||
|
|
||||||
/// Whether to link to musl. Otherwise, links to glibc.
|
|
||||||
musl: Boolean = false
|
|
||||||
|
|
||||||
local setupLinuxEnvironment: Config.RunStep =
|
|
||||||
let (jdkVersion = "11.0.20.1+1")
|
|
||||||
let (muslVersion = "1.2.2")
|
|
||||||
let (zlibVersion = "1.2.13")
|
|
||||||
let (jdkVersionEncoded = URI.encodeComponent(jdkVersion))
|
|
||||||
let (jdkVersionAlt = jdkVersion.replaceLast("+", "_"))
|
|
||||||
let (majorJdkVersion = jdkVersion.split(".").first)
|
|
||||||
new {
|
|
||||||
name = "Set up environment"
|
|
||||||
shell = "#!/bin/bash -exo pipefail"
|
|
||||||
command = new Listing {
|
|
||||||
#"""
|
|
||||||
sed -ie '/\[ol8_codeready_builder\]/,/^$/s/enabled=0/enabled=1/g' /etc/yum.repos.d/oracle-linux-ol8.repo \
|
|
||||||
&& microdnf -y install util-linux tree coreutils-single findutils curl tar gzip git zlib-devel gcc-c++ make openssl glibc-langpack-en libstdc++-static \
|
|
||||||
&& microdnf clean all \
|
|
||||||
&& rm -rf /var/cache/dnf
|
|
||||||
|
|
||||||
# install jdk
|
|
||||||
curl -L \
|
|
||||||
https://github.com/adoptium/temurin\#(majorJdkVersion)-binaries/releases/download/jdk-\#(jdkVersionEncoded)/OpenJDK\#(majorJdkVersion)U-jdk_\#(if (arch == "amd64") "x64" else "aarch64")_linux_hotspot_\#(jdkVersionAlt).tar.gz -o /tmp/jdk.tar.gz
|
|
||||||
|
|
||||||
mkdir /jdk \
|
|
||||||
&& cd /jdk \
|
|
||||||
&& cat /tmp/jdk.tar.gz | tar --strip-components=1 -xzC .
|
|
||||||
|
|
||||||
mkdir -p ~/staticdeps/bin
|
|
||||||
|
|
||||||
cp /usr/lib/gcc/\#(if (arch == "amd64") "x86_64" else "aarch64")-redhat-linux/8/libstdc++.a ~/staticdeps
|
|
||||||
|
|
||||||
# install zlib
|
|
||||||
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
|
||||||
curl -L https://github.com/madler/zlib/releases/download/v\#(zlibVersion)/zlib-\#(zlibVersion).tar.gz -o /tmp/zlib.tar.gz
|
|
||||||
|
|
||||||
mkdir -p /tmp/dep_zlib-\#(zlibVersion) \
|
|
||||||
&& cd /tmp/dep_zlib-\#(zlibVersion) \
|
|
||||||
&& cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC . \
|
|
||||||
&& echo "zlib-\#(zlibVersion): configure..." && ./configure --static --prefix="$HOME"/staticdeps > /dev/null \
|
|
||||||
&& echo "zlib-\#(zlibVersion): make..." && make -s -j4 \
|
|
||||||
&& echo "zlib-\#(zlibVersion): make install..." && make -s install \
|
|
||||||
&& rm -rf /tmp/dep_zlib-\#(zlibVersion)
|
|
||||||
fi
|
|
||||||
"""#
|
|
||||||
// don't need musl on aarch because GraalVM only supports musl builds on x86
|
|
||||||
when (arch == "amd64") {
|
|
||||||
#"""
|
|
||||||
# install musl
|
|
||||||
if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then
|
|
||||||
curl -L https://musl.libc.org/releases/musl-\#(muslVersion).tar.gz -o /tmp/musl.tar.gz
|
|
||||||
|
|
||||||
mkdir -p /tmp/dep_musl-\#(muslVersion) \
|
|
||||||
&& cd /tmp/dep_musl-\#(muslVersion) \
|
|
||||||
&& cat /tmp/musl.tar.gz | tar --strip-components=1 -xzC . \
|
|
||||||
&& echo "musl-\#(muslVersion): configure..." && ./configure --disable-shared --prefix="$HOME"/staticdeps > /dev/null \
|
|
||||||
&& echo "musl-\#(muslVersion): make..." && make -s -j4 \
|
|
||||||
&& echo "musl-\#(muslVersion): make install..." && make -s install \
|
|
||||||
&& rm -rf /tmp/dep_musl-\#(muslVersion)
|
|
||||||
|
|
||||||
# native-image expects to find an executable at this path.
|
|
||||||
ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc
|
|
||||||
fi
|
|
||||||
"""#
|
|
||||||
}
|
|
||||||
}.join("\n\n")
|
|
||||||
}
|
|
||||||
|
|
||||||
steps {
|
|
||||||
when (os == "linux") {
|
|
||||||
new Config.RestoreCacheStep {
|
|
||||||
name = "Restore static deps from cache"
|
|
||||||
key = "staticdeps-\(arch)"
|
|
||||||
}
|
|
||||||
setupLinuxEnvironment
|
|
||||||
new Config.SaveCacheStep {
|
|
||||||
name = "Save statics deps to cache"
|
|
||||||
key = "staticdeps-\(arch)"
|
|
||||||
paths {
|
|
||||||
"~/staticdeps"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
when (os == "macOS" && arch == "amd64") {
|
|
||||||
new Config.RunStep {
|
|
||||||
name = "Installing Rosetta 2"
|
|
||||||
command = """
|
|
||||||
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
|
|
||||||
"""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// If building macOS/aarch64, we need to use GraalVM 23.
|
|
||||||
// We can't use GraalVM 23 for any other build because we need to support Java 11, which was
|
|
||||||
// dropped in GraalVM 23.
|
|
||||||
when (os == "macOS" && arch == "aarch64") {
|
|
||||||
new Config.RunStep {
|
|
||||||
command = "git apply patches/graalVm23.patch"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
new Config.RunStep {
|
|
||||||
name = "gradle buildNative"
|
|
||||||
local _os =
|
|
||||||
if (os == "macOS") "mac"
|
|
||||||
else if (musl) "alpine"
|
|
||||||
else "linux"
|
|
||||||
local jobName = "\(_os)Executable\(arch.capitalize())"
|
|
||||||
command = #"""
|
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
|
||||||
./gradlew \#(module.gradleArgs) pkl-cli:\#(jobName) pkl-core:test\#(jobName.capitalize())
|
|
||||||
"""#
|
|
||||||
}
|
|
||||||
new Config.PersistToWorkspaceStep {
|
|
||||||
root = "."
|
|
||||||
paths {
|
|
||||||
"pkl-cli/build/executable/"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
job {
|
|
||||||
when (os == "macOS") {
|
|
||||||
macos {
|
|
||||||
xcode = "15.2.0"
|
|
||||||
}
|
|
||||||
// Use M1 for all architectures. We build amd64/aarch64 based on the GraalVM version,
|
|
||||||
// which gets patched in via `git apply patches/graalVm23.patch`.
|
|
||||||
resource_class = "macos.m1.large.gen1"
|
|
||||||
} else {
|
|
||||||
docker {
|
|
||||||
new {
|
|
||||||
image = if (arch == "aarch64") "arm64v8/oraclelinux:8-slim" else "oraclelinux:8-slim"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
environment {
|
|
||||||
["JAVA_HOME"] = "/jdk"
|
|
||||||
}
|
|
||||||
resource_class = if (arch == "aarch64") "arm.xlarge" else "xlarge"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
|
||||||
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
extends "GradleJob.pkl"
|
|
||||||
|
|
||||||
import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.1.0#/Config.pkl"
|
|
||||||
|
|
||||||
local self = this
|
|
||||||
|
|
||||||
command: String
|
|
||||||
|
|
||||||
job {
|
|
||||||
docker {
|
|
||||||
new { image = "cimg/openjdk:11.0" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
steps {
|
|
||||||
new Config.AttachWorkspaceStep { at = "." }
|
|
||||||
new Config.RunStep {
|
|
||||||
command = "./gradlew \(self.gradleArgs) \(module.command)"
|
|
||||||
}
|
|
||||||
// add jpkl to workspace so it gets published as a GitHub release
|
|
||||||
new Config.PersistToWorkspaceStep {
|
|
||||||
root = "."
|
|
||||||
paths {
|
|
||||||
"pkl-cli/build/executable/"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
|
||||||
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
extends "GradleJob.pkl"
|
|
||||||
|
|
||||||
import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.1.0#/Config.pkl"
|
|
||||||
|
|
||||||
javaVersion: "11.0"|"17.0"
|
|
||||||
|
|
||||||
steps {
|
|
||||||
new Config.RunStep {
|
|
||||||
name = "gradle check"
|
|
||||||
command = "./gradlew \(module.gradleArgs) check"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
job {
|
|
||||||
docker {
|
|
||||||
new {
|
|
||||||
image = "cimg/openjdk:\(javaVersion)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
|
||||||
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
abstract module GradleJob
|
|
||||||
|
|
||||||
import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.1.0#/Config.pkl"
|
|
||||||
|
|
||||||
/// Whether this is a release build or not.
|
|
||||||
isRelease: Boolean = false
|
|
||||||
|
|
||||||
fixed gradleArgs = new Listing {
|
|
||||||
"--info"
|
|
||||||
"--stacktrace"
|
|
||||||
when (isRelease) {
|
|
||||||
"-DreleaseBuild=true"
|
|
||||||
}
|
|
||||||
}.join(" ")
|
|
||||||
|
|
||||||
steps: Listing<Config.Step>
|
|
||||||
|
|
||||||
job: Config.Job = new {
|
|
||||||
environment {
|
|
||||||
["LANG"] = "en_US.UTF-8"
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
"checkout"
|
|
||||||
...module.steps
|
|
||||||
new Config.RunStep {
|
|
||||||
// find all test results and write them to the home dir
|
|
||||||
name = "Gather test results"
|
|
||||||
command = """
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \\;
|
|
||||||
"""
|
|
||||||
`when` = "always"
|
|
||||||
}
|
|
||||||
new Config.StoreTestResults {
|
|
||||||
path = "~/test-results"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
|
||||||
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
extends "GradleJob.pkl"
|
|
||||||
|
|
||||||
import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.1.0#/Config.pkl"
|
|
||||||
|
|
||||||
name: String = command
|
|
||||||
|
|
||||||
command: String
|
|
||||||
|
|
||||||
steps {
|
|
||||||
new Config.RunStep {
|
|
||||||
name = module.name
|
|
||||||
command = """
|
|
||||||
./gradlew \(module.gradleArgs) \(module.command)
|
|
||||||
"""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
job {
|
|
||||||
docker {
|
|
||||||
new { image = "cimg/openjdk:11.0" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
# Auto-format Kotlin code
|
||||||
|
816cd483c8adf4c04e14236c173a1dc6bd2579ea
|
||||||
+12
-1
@@ -1,6 +1,17 @@
|
|||||||
# linguist-generated would suppress files in diffs
|
# linguist-generated would suppress files in diffs
|
||||||
**/src/test/files/** linguist-vendored
|
**/src/test/files/** linguist-vendored
|
||||||
|
.github/workflows/* linguist-generated
|
||||||
|
|
||||||
/docs/** linguist-documentation
|
/docs/** linguist-documentation
|
||||||
|
|
||||||
*.pkl linguist-language=Groovy
|
*.pcf linguist-language=Pkl
|
||||||
|
PklProject linguist-language=Pkl
|
||||||
|
|
||||||
|
* text eol=lf
|
||||||
|
*.bat text eol=crlf
|
||||||
|
|
||||||
|
*.gif binary
|
||||||
|
*.jar binary
|
||||||
|
*.woff2 binary
|
||||||
|
*.pem binary
|
||||||
|
*.png binary
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
files=`git diff --cached --name-status`
|
files=`git diff --cached --name-status`
|
||||||
|
|
||||||
if [[ $files =~ .circleci/config.pkl ]]; then
|
if [[ $files =~ .github/* ]]; then
|
||||||
pkl eval .circleci/config.pkl -o .circleci/config.yml
|
pkl eval --project-dir .github/ -m .github .github/index.pkl
|
||||||
git add .circleci/config.yml
|
git add .github/workflows/
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
amends "pkl:Project"
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
["pkl.impl.ghactions"] {
|
||||||
|
uri = "package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@1.6.0"
|
||||||
|
}
|
||||||
|
["gha"] {
|
||||||
|
uri = "package://pkg.pkl-lang.org/pkl-pantry/com.github.actions@1.4.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"schemaVersion": 1,
|
||||||
|
"resolvedDependencies": {
|
||||||
|
"package://pkg.pkl-lang.org/pkl-pantry/com.github.actions@1": {
|
||||||
|
"type": "remote",
|
||||||
|
"uri": "projectpackage://pkg.pkl-lang.org/pkl-pantry/com.github.actions@1.4.0",
|
||||||
|
"checksums": {
|
||||||
|
"sha256": "e0b9a9f71071d6101e9d764c069b2ec4a597d5315cb6e4c265b3f0d90c2b482c"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@1": {
|
||||||
|
"type": "remote",
|
||||||
|
"uri": "projectpackage://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@1.6.0",
|
||||||
|
"checksums": {
|
||||||
|
"sha256": "fbc3c456ea468a0fe6baa9b3d30167259ac04e721a41a10fe82d2970026f0b1d"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"package://pkg.pkl-lang.org/pkl-pantry/pkl.experimental.deepToTyped@1": {
|
||||||
|
"type": "remote",
|
||||||
|
"uri": "projectpackage://pkg.pkl-lang.org/pkl-pantry/pkl.experimental.deepToTyped@1.2.0",
|
||||||
|
"checksums": {
|
||||||
|
"sha256": "84c7feb391f4ac273a99dc89b8fd51dbcd21dbda4ce640f6908527f83acdd4d6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"package://pkg.pkl-lang.org/pkl-pantry/pkl.github.dependabotManagedActions@1": {
|
||||||
|
"type": "remote",
|
||||||
|
"uri": "projectpackage://pkg.pkl-lang.org/pkl-pantry/pkl.github.dependabotManagedActions@1.1.0",
|
||||||
|
"checksums": {
|
||||||
|
"sha256": "025fac778f2c5f75c8229fa4ec0f49ebdb99a61affe9aae489fefd8fccd92faa"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"package://pkg.pkl-lang.org/pkl-pantry/com.github.dependabot@1": {
|
||||||
|
"type": "remote",
|
||||||
|
"uri": "projectpackage://pkg.pkl-lang.org/pkl-pantry/com.github.dependabot@1.0.1",
|
||||||
|
"checksums": {
|
||||||
|
"sha256": "0a4fe9b0983716ec49fb060b9e5e83f8c365eb899d517123b43134416a9574b6"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
amends "@gha/Workflow.pkl"
|
||||||
|
|
||||||
|
import "@gha/catalog.pkl"
|
||||||
|
|
||||||
|
on {
|
||||||
|
push {
|
||||||
|
branches {
|
||||||
|
"main"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pull_request {}
|
||||||
|
schedule {
|
||||||
|
// Run at 01:38 on Saturday
|
||||||
|
new { cron = "38 1 * * 6" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local class CodeQLScan {
|
||||||
|
language: String
|
||||||
|
|
||||||
|
`build-mode`: String
|
||||||
|
}
|
||||||
|
|
||||||
|
local scans: Listing<CodeQLScan> = new {
|
||||||
|
new {
|
||||||
|
language = "actions"
|
||||||
|
`build-mode` = "none"
|
||||||
|
}
|
||||||
|
new {
|
||||||
|
language = "java-kotlin"
|
||||||
|
`build-mode` = "autobuild"
|
||||||
|
}
|
||||||
|
new {
|
||||||
|
language = "javascript-typescript"
|
||||||
|
`build-mode` = "none"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jobs {
|
||||||
|
for (scan in scans) {
|
||||||
|
["analyze-\(scan.language)"] {
|
||||||
|
name = "Analyze (\(scan.language))"
|
||||||
|
`runs-on` = "ubuntu-latest"
|
||||||
|
permissions {
|
||||||
|
`security-events` = "write"
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
catalog.`actions/checkout@v6`
|
||||||
|
new {
|
||||||
|
name = "Initialize CodeQL"
|
||||||
|
uses = "github/codeql-action/init@v4"
|
||||||
|
with {
|
||||||
|
["languages"] = scan.language
|
||||||
|
["build-mode"] = scan.`build-mode`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
new {
|
||||||
|
name = "Perform CodeQL Analysis"
|
||||||
|
uses = "github/codeql-action/analyze@v4"
|
||||||
|
with {
|
||||||
|
["category"] = "/language:\(scan.language)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: gradle
|
||||||
|
cooldown:
|
||||||
|
default-days: 7
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
cooldown:
|
||||||
|
default-days: 7
|
||||||
|
directory: /
|
||||||
|
ignore:
|
||||||
|
- dependency-name: '*'
|
||||||
|
update-types:
|
||||||
|
- version-update:semver-major
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
@@ -0,0 +1,247 @@
|
|||||||
|
amends "@pkl.impl.ghactions/PklCI.pkl"
|
||||||
|
|
||||||
|
import "@gha/Workflow.pkl"
|
||||||
|
|
||||||
|
import "jobs/BuildJavaExecutableJob.pkl"
|
||||||
|
import "jobs/BuildNativeJob.pkl"
|
||||||
|
import "jobs/DeployJob.pkl"
|
||||||
|
import "jobs/GithubRelease.pkl"
|
||||||
|
import "jobs/GradleJob.pkl"
|
||||||
|
import "jobs/PklJob.pkl"
|
||||||
|
import "jobs/SimpleGradleJob.pkl"
|
||||||
|
import "codeql.pkl"
|
||||||
|
|
||||||
|
triggerDocsBuild = "both"
|
||||||
|
|
||||||
|
testReports {
|
||||||
|
junit {
|
||||||
|
"**/build/test-results/**/*.xml"
|
||||||
|
}
|
||||||
|
html {
|
||||||
|
"**/build/reports/tests/**/*"
|
||||||
|
}
|
||||||
|
excludeJobs {
|
||||||
|
"bench"
|
||||||
|
"github-release"
|
||||||
|
"dependency-submission"
|
||||||
|
"dependency-review"
|
||||||
|
Regex("deploy-.*")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local baseGradleCheck: SimpleGradleJob = new {
|
||||||
|
isRelease = false
|
||||||
|
command = "check"
|
||||||
|
fetchDepth = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
local gradleCheck = (baseGradleCheck) {
|
||||||
|
os = "linux"
|
||||||
|
}
|
||||||
|
|
||||||
|
local gradleCheckWindows = (baseGradleCheck) {
|
||||||
|
os = "windows"
|
||||||
|
}
|
||||||
|
|
||||||
|
local typealias PklJobs = Mapping<String, PklJob | *Workflow.Job>
|
||||||
|
|
||||||
|
local toWorkflowJobs: (PklJobs) -> Workflow.Jobs = (it) -> new Workflow.Jobs {
|
||||||
|
for (k, v in it) {
|
||||||
|
when (v is PklJob) {
|
||||||
|
[k] = v.job
|
||||||
|
} else {
|
||||||
|
[k] = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local gradleCheckJobs: PklJobs = new {
|
||||||
|
["gradle-check"] = gradleCheck
|
||||||
|
["gradle-check-windows"] = gradleCheckWindows
|
||||||
|
}
|
||||||
|
|
||||||
|
local buildNativeJobs: Mapping<String, BuildNativeJob> = new {
|
||||||
|
for (_dist in List("release", "snapshot")) {
|
||||||
|
for (_project in List("pkl-cli", "pkl-doc")) {
|
||||||
|
for (_arch in List("amd64", "aarch64")) {
|
||||||
|
for (_os in List("macOS", "linux")) {
|
||||||
|
["\(_project)-\(_os)-\(_arch)-\(_dist)"] {
|
||||||
|
arch = _arch
|
||||||
|
os = _os
|
||||||
|
isRelease = _dist == "release"
|
||||||
|
project = _project
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
["\(_project)-alpine-linux-amd64-\(_dist)"] {
|
||||||
|
arch = "amd64"
|
||||||
|
os = "linux"
|
||||||
|
musl = true
|
||||||
|
isRelease = _dist == "release"
|
||||||
|
project = _project
|
||||||
|
}
|
||||||
|
["\(_project)-windows-amd64-\(_dist)"] {
|
||||||
|
arch = "amd64"
|
||||||
|
os = "windows"
|
||||||
|
isRelease = _dist == "release"
|
||||||
|
project = _project
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local buildNativeSnapshots = buildNativeJobs.toMap().filter((key, _) -> key.endsWith("snapshot"))
|
||||||
|
|
||||||
|
local buildNativeReleases = buildNativeJobs.toMap().filter((key, _) -> key.endsWith("release"))
|
||||||
|
|
||||||
|
local benchmarkJob: SimpleGradleJob = new { command = "bench:jmh" }
|
||||||
|
|
||||||
|
local gradleCompatibilityJob: SimpleGradleJob = new {
|
||||||
|
command = ":pkl-gradle:build :pkl-gradle:compatibilityTestReleases"
|
||||||
|
fetchDepth = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
local buildJavaExecutableJob: BuildJavaExecutableJob = new {
|
||||||
|
fetchDepth = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
local buildAndTestJobs: PklJobs = new {
|
||||||
|
...gradleCheckJobs
|
||||||
|
["bench"] = benchmarkJob
|
||||||
|
["gradle-compatibility"] = gradleCompatibilityJob
|
||||||
|
["java-executables-snapshot"] = (buildJavaExecutableJob) { isRelease = false }
|
||||||
|
...buildNativeSnapshots
|
||||||
|
}
|
||||||
|
|
||||||
|
local releaseJobs: PklJobs = new {
|
||||||
|
...gradleCheckJobs
|
||||||
|
["bench"] = benchmarkJob
|
||||||
|
["gradle-compatibility"] = gradleCompatibilityJob
|
||||||
|
["java-executables-release"] = (buildJavaExecutableJob) { isRelease = true }
|
||||||
|
...buildNativeReleases
|
||||||
|
}
|
||||||
|
|
||||||
|
// By default, just run ./gradlew check on linux.
|
||||||
|
// Trigger other checks based on GitHub PR description. Examples:
|
||||||
|
//
|
||||||
|
// * [windows] -- Test on Windows
|
||||||
|
// * [native] -- Test all native builds
|
||||||
|
// * [native-pkl-cli] -- Test all pkl-cli os/arch pairs
|
||||||
|
// * [native-pkl-cli-macos] -- Test pkl-cli on macOS
|
||||||
|
prb {
|
||||||
|
local prbJobs: Mapping<String, GradleJob> = new {
|
||||||
|
["gradle-check"] = gradleCheck
|
||||||
|
["gradle-check-windows"] = (gradleCheckWindows) {
|
||||||
|
`if` = "contains(github.event.pull_request.body, '[windows]')"
|
||||||
|
}
|
||||||
|
for (jobName, job in buildNativeSnapshots) {
|
||||||
|
[jobName] = (job) {
|
||||||
|
local tags = new Listing {
|
||||||
|
"[native]"
|
||||||
|
"[native-\(job.project)]"
|
||||||
|
"[native-\(job.project)-\(job.os)]"
|
||||||
|
"[native-\(job.project)-\(job.os)-\(job.arch)]"
|
||||||
|
"[native-\(job.project)-\(job.os)-\(job.arch)]"
|
||||||
|
when (job.musl) {
|
||||||
|
"[native-\(job.project)-alpine-\(job.os)-\(job.arch)]"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`if` =
|
||||||
|
tags
|
||||||
|
.toList()
|
||||||
|
.map((it) -> "contains(github.event.pull_request.body, '\(it)')")
|
||||||
|
.join(" || ")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
local prbJobs2 = (prbJobs) {
|
||||||
|
[[true]] {
|
||||||
|
// better SLA when not running on nightly
|
||||||
|
nightlyMacOS = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jobs = prbJobs2 |> toWorkflowJobs
|
||||||
|
}
|
||||||
|
|
||||||
|
build {
|
||||||
|
jobs = buildAndTestJobs |> toWorkflowJobs
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
jobs =
|
||||||
|
(buildAndTestJobs) {
|
||||||
|
["deploy-snapshot"] = (
|
||||||
|
new DeployJob {
|
||||||
|
extraGradleArgs {
|
||||||
|
"--no-parallel"
|
||||||
|
}
|
||||||
|
command = "publishToSonatype"
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
needs = buildAndTestJobs.keys.toListing()
|
||||||
|
}
|
||||||
|
["dependency-submission"] {
|
||||||
|
`runs-on` = "ubuntu-latest"
|
||||||
|
permissions {
|
||||||
|
contents = "write"
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
module.catalog.`actions/checkout@v6`
|
||||||
|
(module.catalog.`actions/setup-java@v5`) {
|
||||||
|
with {
|
||||||
|
`java-version` = "25"
|
||||||
|
distribution = "temurin"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(module.catalog.`gradle/actions/dependency-submission@v6`) {
|
||||||
|
with {
|
||||||
|
// language=regexp
|
||||||
|
`dependency-graph-include-configurations` =
|
||||||
|
".*[rR]untimeClasspath|.*[cC]ompileClasspath"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} |> toWorkflowJobs
|
||||||
|
}
|
||||||
|
|
||||||
|
releaseBranch {
|
||||||
|
jobs = releaseJobs |> toWorkflowJobs
|
||||||
|
}
|
||||||
|
|
||||||
|
release {
|
||||||
|
jobs =
|
||||||
|
(releaseJobs) {
|
||||||
|
["deploy-release"] = (
|
||||||
|
new DeployJob {
|
||||||
|
isRelease = true
|
||||||
|
command = "publishToSonatype closeAndReleaseSonatypeStagingRepository"
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
needs = releaseJobs.keys.toListing()
|
||||||
|
}
|
||||||
|
["github-release"] = new GithubRelease {
|
||||||
|
needs = "deploy-release"
|
||||||
|
}
|
||||||
|
} |> toWorkflowJobs
|
||||||
|
}
|
||||||
|
|
||||||
|
dependabot {
|
||||||
|
updates {
|
||||||
|
new {
|
||||||
|
`package-ecosystem` = "gradle"
|
||||||
|
schedule {
|
||||||
|
interval = "weekly"
|
||||||
|
}
|
||||||
|
cooldown {
|
||||||
|
`default-days` = 7
|
||||||
|
}
|
||||||
|
directory = "/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
workflows {
|
||||||
|
// add codeql workflow to set of workflows
|
||||||
|
["workflows/codeql.yml"] = codeql
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
extends "GradleJob.pkl"
|
||||||
|
|
||||||
|
import "@gha/catalog.pkl"
|
||||||
|
|
||||||
|
// Keep this in sync with projects that build java executables
|
||||||
|
local projects: List<String> = List("pkl-doc", "pkl-cli", "pkl-codegen-java", "pkl-codegen-kotlin")
|
||||||
|
|
||||||
|
local command =
|
||||||
|
new Listing<String> {
|
||||||
|
"./gradlew"
|
||||||
|
module.gradleArgs
|
||||||
|
for (project in projects) {
|
||||||
|
// NOTE: `build` doesn't build native executables
|
||||||
|
"\(project):build"
|
||||||
|
}
|
||||||
|
}.join(" ")
|
||||||
|
|
||||||
|
steps {
|
||||||
|
catalog.`actions/checkout@v6`
|
||||||
|
new {
|
||||||
|
name = "gradle build java executables"
|
||||||
|
shell = "bash"
|
||||||
|
run = command
|
||||||
|
}
|
||||||
|
(catalog.`actions/upload-artifact@v5`) {
|
||||||
|
name = "Upload executable artifacts"
|
||||||
|
with {
|
||||||
|
name = "executable-java"
|
||||||
|
path = "*/build/executable/**/*"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
extends "GradleJob.pkl"
|
||||||
|
|
||||||
|
import "@gha/catalog.pkl"
|
||||||
|
import "@gha/context.pkl"
|
||||||
|
|
||||||
|
/// Whether to link to musl. Otherwise, links to glibc.
|
||||||
|
musl: Boolean(implies(module.os == "linux")) = false
|
||||||
|
|
||||||
|
/// The Gradle project under which to generate the executable
|
||||||
|
project: String
|
||||||
|
|
||||||
|
extraGradleArgs {
|
||||||
|
when (os == "macOS" && arch == "amd64") {
|
||||||
|
"-Dpkl.targetArch=\(module.arch)"
|
||||||
|
#""-Dpkl.native--native-compiler-path=${GITHUB_WORKSPACE}/.github/scripts/cc_macos_amd64.sh""#
|
||||||
|
}
|
||||||
|
when (musl) {
|
||||||
|
"-Dpkl.musl=true"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
preSteps {
|
||||||
|
when (os == "linux" && !musl) {
|
||||||
|
new {
|
||||||
|
name = "Install deps"
|
||||||
|
run =
|
||||||
|
"dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
steps {
|
||||||
|
when (musl) {
|
||||||
|
new {
|
||||||
|
name = "Install musl and zlib"
|
||||||
|
run = read("../scripts/install_musl.sh").text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// workaround for https://github.com/actions/checkout/issues/1048
|
||||||
|
when (os == "linux" && !musl) {
|
||||||
|
new {
|
||||||
|
name = "Fix git ownership"
|
||||||
|
// language=bash
|
||||||
|
run = #"git status || git config --system --add safe.directory "$GITHUB_WORKSPACE""#
|
||||||
|
}
|
||||||
|
}
|
||||||
|
new {
|
||||||
|
name = "gradle buildNative"
|
||||||
|
shell = "bash"
|
||||||
|
run = "./gradlew \(module.gradleArgs) \(project):buildNative"
|
||||||
|
}
|
||||||
|
(catalog.`actions/upload-artifact@v5`) {
|
||||||
|
name = "Upload executable artifacts"
|
||||||
|
with {
|
||||||
|
name =
|
||||||
|
if (musl)
|
||||||
|
"executable-\(project)-alpine-\(module.os)-\(module.arch)"
|
||||||
|
else
|
||||||
|
"executable-\(project)-\(module.os)-\(module.arch)"
|
||||||
|
// Need to insert a wildcard to make actions/upload-artifact preserve the folder hierarchy.
|
||||||
|
// See https://github.com/actions/upload-artifact/issues/206
|
||||||
|
path = "\(project)*/build/executable/**/*"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fixed job {
|
||||||
|
when (os == "linux" && !musl) {
|
||||||
|
container {
|
||||||
|
image = "redhat/ubi8:8.10"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
extends "GradleJob.pkl"
|
||||||
|
|
||||||
|
import "@gha/catalog.pkl"
|
||||||
|
import "@gha/Workflow.pkl"
|
||||||
|
import "@pkl.impl.ghactions/helpers.pkl"
|
||||||
|
|
||||||
|
local self = this
|
||||||
|
|
||||||
|
command: String
|
||||||
|
|
||||||
|
arch = "amd64"
|
||||||
|
|
||||||
|
os = "linux"
|
||||||
|
|
||||||
|
steps {
|
||||||
|
catalog.`actions/checkout@v6`
|
||||||
|
(catalog.`actions/download-artifact@v6`) {
|
||||||
|
with {
|
||||||
|
pattern = "executable-**"
|
||||||
|
`merge-multiple` = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
new Workflow.Step {
|
||||||
|
run = "./gradlew \(self.gradleArgs) \(module.command)"
|
||||||
|
}
|
||||||
|
|> helpers.withMavenPublishSecrets
|
||||||
|
}
|
||||||
|
|
||||||
|
fixed job {
|
||||||
|
environment = "maven-release"
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
module GithubRelease
|
||||||
|
|
||||||
|
extends "PklJob.pkl"
|
||||||
|
|
||||||
|
import "@gha/catalog.pkl"
|
||||||
|
import "@gha/context.pkl"
|
||||||
|
|
||||||
|
fixed job {
|
||||||
|
`runs-on` = "ubuntu-latest"
|
||||||
|
permissions {
|
||||||
|
contents = "write"
|
||||||
|
}
|
||||||
|
needs = "deploy-release"
|
||||||
|
steps {
|
||||||
|
(catalog.`actions/download-artifact@v6`) {
|
||||||
|
with {
|
||||||
|
pattern = "executable-**"
|
||||||
|
`merge-multiple` = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
new {
|
||||||
|
name = "Publish release on GitHub"
|
||||||
|
env {
|
||||||
|
["GH_TOKEN"] = context.github.token
|
||||||
|
["TAG_NAME"] = context.github.refName
|
||||||
|
["GIT_SHA"] = context.github.sha
|
||||||
|
["GH_REPO"] = context.github.repository
|
||||||
|
}
|
||||||
|
// language=bash
|
||||||
|
run =
|
||||||
|
#"""
|
||||||
|
# exclude build_artifacts.txt from publish
|
||||||
|
rm -f */build/executable/*.build_artifacts.txt
|
||||||
|
find */build/executable/* -type d | xargs rm -rf
|
||||||
|
gh release create ${TAG_NAME} \
|
||||||
|
--title "${TAG_NAME}" \
|
||||||
|
--target "${GIT_SHA}" \
|
||||||
|
--verify-tag \
|
||||||
|
--notes "Release notes: https://pkl-lang.org/main/current/release-notes/changelog.html#release-${TAG_NAME}" \
|
||||||
|
*/build/executable/*
|
||||||
|
"""#
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
abstract module GradleJob
|
||||||
|
|
||||||
|
extends "PklJob.pkl"
|
||||||
|
|
||||||
|
import "@gha/Workflow.pkl"
|
||||||
|
import "@pkl.impl.ghactions/catalog.pkl"
|
||||||
|
|
||||||
|
/// Whether this is a release build or not.
|
||||||
|
isRelease: Boolean = false
|
||||||
|
|
||||||
|
/// The architecture to use
|
||||||
|
arch: "amd64" | "aarch64" = "amd64"
|
||||||
|
|
||||||
|
/// The OS to run on.
|
||||||
|
os: "macOS" | "linux" | "windows" = "linux"
|
||||||
|
|
||||||
|
// TODO flip this to `true` when nightly macOS is available
|
||||||
|
/// Whether to run on nightly macOS.
|
||||||
|
nightlyMacOS: Boolean(implies(os == "macOS")) = false
|
||||||
|
|
||||||
|
extraGradleArgs: Listing<String>
|
||||||
|
|
||||||
|
steps: Listing<Workflow.Step>
|
||||||
|
|
||||||
|
preSteps: Listing<Workflow.Step>
|
||||||
|
|
||||||
|
/// The fetch depth to use when doing a git checkout.
|
||||||
|
fetchDepth: Int?
|
||||||
|
|
||||||
|
fixed gradleArgs =
|
||||||
|
new Listing {
|
||||||
|
"--info"
|
||||||
|
"--stacktrace"
|
||||||
|
"--no-daemon"
|
||||||
|
"-DpklMultiJdkTesting=true"
|
||||||
|
when (isRelease) {
|
||||||
|
"-DreleaseBuild=true"
|
||||||
|
}
|
||||||
|
...extraGradleArgs
|
||||||
|
}.join(" ")
|
||||||
|
|
||||||
|
fixed job {
|
||||||
|
env {
|
||||||
|
["LANG"] = "en_US.UTF-8"
|
||||||
|
when (os == "windows") {
|
||||||
|
["JAVA_HOME"] = "/jdk"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
when (os == "macOS") {
|
||||||
|
`if` =
|
||||||
|
let (cond = "github.repository_owner == 'apple'")
|
||||||
|
if (super.`if` != null)
|
||||||
|
"(\(super.`if`)) && \(cond)"
|
||||||
|
else
|
||||||
|
cond
|
||||||
|
}
|
||||||
|
`runs-on` =
|
||||||
|
if (os == "linux" && arch == "amd64")
|
||||||
|
"ubuntu-latest"
|
||||||
|
else if (os == "linux" && arch == "aarch64")
|
||||||
|
"ubuntu-24.04-arm"
|
||||||
|
else if (os == "windows")
|
||||||
|
"windows-latest"
|
||||||
|
else
|
||||||
|
new Listing {
|
||||||
|
"self-hosted"
|
||||||
|
"macos"
|
||||||
|
when (nightlyMacOS) {
|
||||||
|
"nightly"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
...preSteps
|
||||||
|
// full checkout (needed for spotless)
|
||||||
|
(catalog.`actions/checkout@v6`) {
|
||||||
|
when (fetchDepth != null) {
|
||||||
|
with {
|
||||||
|
`fetch-depth` = fetchDepth
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(catalog.`actions/setup-java@v5`) {
|
||||||
|
with {
|
||||||
|
`java-version` = "25"
|
||||||
|
distribution = "temurin"
|
||||||
|
architecture =
|
||||||
|
if (arch == "amd64")
|
||||||
|
"x64"
|
||||||
|
else
|
||||||
|
"aarch64"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(catalog.`gradle/actions/setup-gradle@v5`) {
|
||||||
|
when (isRelease) {
|
||||||
|
with {
|
||||||
|
`cache-disabled` = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
...module.steps
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
abstract module PklJob
|
||||||
|
|
||||||
|
extends "@pkl.impl.ghactions/jobs/PklJob.pkl"
|
||||||
|
|
||||||
|
/// Identify any jobs that must complete successfully before this job will run.
|
||||||
|
///
|
||||||
|
/// It can be a string or array of strings.
|
||||||
|
/// If a job fails or is skipped, all jobs that need it are skipped unless the jobs use a conditional expression that
|
||||||
|
/// causes the job to continue.
|
||||||
|
/// If a run contains a series of jobs that need each other, a failure or skip applies to all jobs in the dependency
|
||||||
|
/// chain from the point of failure or skip onwards. If you would like a job to run even if a job it is dependent on
|
||||||
|
/// did not succeed, use the `always()` conditional expression in `jobs.<job_id>.if`.
|
||||||
|
///
|
||||||
|
/// See: <https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idneeds>
|
||||||
|
needs: (String | *Listing<String>)?
|
||||||
|
|
||||||
|
/// A conditional to prevent a job from running unless a condition is met.
|
||||||
|
///
|
||||||
|
/// You can use any supported context and expression to create a conditional.
|
||||||
|
/// For more information on which contexts are supported in this key, see
|
||||||
|
/// [Contexts reference](https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#context-availability).
|
||||||
|
@SourceCode { language = "GithubExpressionLanguage" }
|
||||||
|
`if`: String?
|
||||||
|
|
||||||
|
/// The underlying workflow job
|
||||||
|
fixed job {
|
||||||
|
`if` = module.`if`
|
||||||
|
needs = module.needs
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
extends "GradleJob.pkl"
|
||||||
|
|
||||||
|
name: String = command
|
||||||
|
|
||||||
|
command: String
|
||||||
|
|
||||||
|
os = "linux"
|
||||||
|
|
||||||
|
steps {
|
||||||
|
new {
|
||||||
|
name = module.name
|
||||||
|
shell = "bash"
|
||||||
|
run =
|
||||||
|
"""
|
||||||
|
./gradlew \(module.gradleArgs) \(module.command)
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
}
|
||||||
Executable
+2
@@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
clang -arch x86_64 "$@"
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
set -e
|
||||||
|
mkdir -p ~/staticdeps/
|
||||||
|
|
||||||
|
ZLIB_VERSION="1.2.13"
|
||||||
|
MUSL_VERSION="1.2.5"
|
||||||
|
|
||||||
|
# install zlib
|
||||||
|
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
||||||
|
# Download zlib tarball and signature
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz" -o /tmp/zlib.tar.gz
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz.asc" -o /tmp/zlib.tar.gz.asc
|
||||||
|
|
||||||
|
# Import zlib GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 5ED46A6721D365587791E2AA783FCD8E58BCAFBA
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying zlib GPG signature..."
|
||||||
|
gpg --verify /tmp/zlib.tar.gz.asc /tmp/zlib.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
cd "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: configure..."
|
||||||
|
./configure --static --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf /tmp/dep_zlib-${ZLIB_VERSION}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# install musl
|
||||||
|
if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then
|
||||||
|
# Download musl tarball and signature
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz" -o /tmp/musl.tar.gz
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz.asc" -o /tmp/musl.tar.gz.asc
|
||||||
|
|
||||||
|
# Import musl GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 836489290BB6B70F99FFDA0556BCDB593020450F
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying musl GPG signature..."
|
||||||
|
gpg --verify /tmp/musl.tar.gz.asc /tmp/musl.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
cd "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/musl.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: configure..."
|
||||||
|
./configure --disable-shared --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# native-image expects to find an executable at this path.
|
||||||
|
ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${HOME}/staticdeps/bin" >> "$GITHUB_PATH"
|
||||||
Generated
+40
@@ -0,0 +1,40 @@
|
|||||||
|
#file: noinspection MandatoryParamsAbsent,UndefinedAction
|
||||||
|
# This is a fake workflow that never runs.
|
||||||
|
# It's used to pin actions to specific git SHAs when generating actual workflows.
|
||||||
|
# It also gets updated by dependabot (see .github/dependabot.yml).
|
||||||
|
# Generated from Workflow.pkl. DO NOT EDIT.
|
||||||
|
name: __lockfile__
|
||||||
|
'on':
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- '**'
|
||||||
|
tags-ignore:
|
||||||
|
- '**'
|
||||||
|
permissions: {}
|
||||||
|
jobs:
|
||||||
|
locks:
|
||||||
|
if: 'false'
|
||||||
|
runs-on: nothing
|
||||||
|
steps:
|
||||||
|
- name: EnricoMi/publish-unit-test-result-action@v2
|
||||||
|
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
|
||||||
|
- name: actions/checkout@v6
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
- name: actions/create-github-app-token@v2
|
||||||
|
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
|
||||||
|
- name: actions/download-artifact@v6
|
||||||
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
||||||
|
- name: actions/setup-java@v5
|
||||||
|
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
- name: actions/upload-artifact@v5
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
- name: dawidd6/action-download-artifact@v11
|
||||||
|
uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11
|
||||||
|
- name: github/codeql-action/analyze@v4
|
||||||
|
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
|
||||||
|
- name: github/codeql-action/init@v4
|
||||||
|
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
|
||||||
|
- name: gradle/actions/dependency-submission@v6
|
||||||
|
uses: gradle/actions/dependency-submission@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6
|
||||||
|
- name: gradle/actions/setup-gradle@v5
|
||||||
|
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
Generated
+826
@@ -0,0 +1,826 @@
|
|||||||
|
# Generated from Workflow.pkl. DO NOT EDIT.
|
||||||
|
name: Build
|
||||||
|
'on':
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- main
|
||||||
|
- release/*
|
||||||
|
- dependabot/**
|
||||||
|
tags-ignore:
|
||||||
|
- '**'
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
jobs:
|
||||||
|
gradle-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: check
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true check
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-gradle-check
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-gradle-check
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
gradle-check-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
JAVA_HOME: /jdk
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: check
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true check
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-gradle-check-windows
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-gradle-check-windows
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
bench:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: bench:jmh
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true bench:jmh
|
||||||
|
gradle-compatibility:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: :pkl-gradle:build :pkl-gradle:compatibilityTestReleases
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true :pkl-gradle:build :pkl-gradle:compatibilityTestReleases
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-gradle-compatibility
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-gradle-compatibility
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
java-executables-snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: gradle build java executables
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:build pkl-cli:build pkl-codegen-java:build pkl-codegen-kotlin:build
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-java
|
||||||
|
path: '*/build/executable/**/*'
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-java-executables-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-java-executables-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-macOS-amd64-snapshot:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -Dpkl.targetArch=amd64 "-Dpkl.native--native-compiler-path=${GITHUB_WORKSPACE}/.github/scripts/cc_macos_amd64.sh" pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-macOS-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-macOS-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-macOS-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-linux-amd64-snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-linux-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-linux-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-linux-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-cli-macOS-aarch64-snapshot:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-macOS-aarch64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-macOS-aarch64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-macOS-aarch64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-linux-aarch64-snapshot:
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-linux-aarch64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-linux-aarch64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-linux-aarch64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-cli-alpine-linux-amd64-snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Install musl and zlib
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
mkdir -p ~/staticdeps/
|
||||||
|
|
||||||
|
ZLIB_VERSION="1.2.13"
|
||||||
|
MUSL_VERSION="1.2.5"
|
||||||
|
|
||||||
|
# install zlib
|
||||||
|
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
||||||
|
# Download zlib tarball and signature
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz" -o /tmp/zlib.tar.gz
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz.asc" -o /tmp/zlib.tar.gz.asc
|
||||||
|
|
||||||
|
# Import zlib GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 5ED46A6721D365587791E2AA783FCD8E58BCAFBA
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying zlib GPG signature..."
|
||||||
|
gpg --verify /tmp/zlib.tar.gz.asc /tmp/zlib.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
cd "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: configure..."
|
||||||
|
./configure --static --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf /tmp/dep_zlib-${ZLIB_VERSION}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# install musl
|
||||||
|
if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then
|
||||||
|
# Download musl tarball and signature
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz" -o /tmp/musl.tar.gz
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz.asc" -o /tmp/musl.tar.gz.asc
|
||||||
|
|
||||||
|
# Import musl GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 836489290BB6B70F99FFDA0556BCDB593020450F
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying musl GPG signature..."
|
||||||
|
gpg --verify /tmp/musl.tar.gz.asc /tmp/musl.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
cd "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/musl.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: configure..."
|
||||||
|
./configure --disable-shared --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# native-image expects to find an executable at this path.
|
||||||
|
ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${HOME}/staticdeps/bin" >> "$GITHUB_PATH"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -Dpkl.musl=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-alpine-linux-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-alpine-linux-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-alpine-linux-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-windows-amd64-snapshot:
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
JAVA_HOME: /jdk
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-windows-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-windows-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-windows-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-macOS-amd64-snapshot:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -Dpkl.targetArch=amd64 "-Dpkl.native--native-compiler-path=${GITHUB_WORKSPACE}/.github/scripts/cc_macos_amd64.sh" pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-macOS-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-macOS-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-macOS-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-linux-amd64-snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-linux-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-linux-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-linux-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-doc-macOS-aarch64-snapshot:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-macOS-aarch64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-macOS-aarch64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-macOS-aarch64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-linux-aarch64-snapshot:
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-linux-aarch64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-linux-aarch64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-linux-aarch64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-doc-alpine-linux-amd64-snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Install musl and zlib
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
mkdir -p ~/staticdeps/
|
||||||
|
|
||||||
|
ZLIB_VERSION="1.2.13"
|
||||||
|
MUSL_VERSION="1.2.5"
|
||||||
|
|
||||||
|
# install zlib
|
||||||
|
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
||||||
|
# Download zlib tarball and signature
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz" -o /tmp/zlib.tar.gz
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz.asc" -o /tmp/zlib.tar.gz.asc
|
||||||
|
|
||||||
|
# Import zlib GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 5ED46A6721D365587791E2AA783FCD8E58BCAFBA
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying zlib GPG signature..."
|
||||||
|
gpg --verify /tmp/zlib.tar.gz.asc /tmp/zlib.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
cd "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: configure..."
|
||||||
|
./configure --static --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf /tmp/dep_zlib-${ZLIB_VERSION}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# install musl
|
||||||
|
if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then
|
||||||
|
# Download musl tarball and signature
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz" -o /tmp/musl.tar.gz
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz.asc" -o /tmp/musl.tar.gz.asc
|
||||||
|
|
||||||
|
# Import musl GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 836489290BB6B70F99FFDA0556BCDB593020450F
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying musl GPG signature..."
|
||||||
|
gpg --verify /tmp/musl.tar.gz.asc /tmp/musl.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
cd "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/musl.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: configure..."
|
||||||
|
./configure --disable-shared --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# native-image expects to find an executable at this path.
|
||||||
|
ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${HOME}/staticdeps/bin" >> "$GITHUB_PATH"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -Dpkl.musl=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-alpine-linux-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-alpine-linux-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-alpine-linux-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-windows-amd64-snapshot:
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
JAVA_HOME: /jdk
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-windows-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-windows-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-windows-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
publish-test-results:
|
||||||
|
if: '!cancelled()'
|
||||||
|
needs:
|
||||||
|
- gradle-check
|
||||||
|
- gradle-check-windows
|
||||||
|
- gradle-compatibility
|
||||||
|
- java-executables-snapshot
|
||||||
|
- pkl-cli-macOS-amd64-snapshot
|
||||||
|
- pkl-cli-linux-amd64-snapshot
|
||||||
|
- pkl-cli-macOS-aarch64-snapshot
|
||||||
|
- pkl-cli-linux-aarch64-snapshot
|
||||||
|
- pkl-cli-alpine-linux-amd64-snapshot
|
||||||
|
- pkl-cli-windows-amd64-snapshot
|
||||||
|
- pkl-doc-macOS-amd64-snapshot
|
||||||
|
- pkl-doc-linux-amd64-snapshot
|
||||||
|
- pkl-doc-macOS-aarch64-snapshot
|
||||||
|
- pkl-doc-linux-aarch64-snapshot
|
||||||
|
- pkl-doc-alpine-linux-amd64-snapshot
|
||||||
|
- pkl-doc-windows-amd64-snapshot
|
||||||
|
permissions:
|
||||||
|
checks: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
||||||
|
with:
|
||||||
|
pattern: test-results-xml-*
|
||||||
|
- name: Publish test results
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
|
||||||
|
with:
|
||||||
|
comment_mode: 'off'
|
||||||
|
files: test-results-xml-*/**/*.xml
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-publish-test-results
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
Generated
+63
@@ -0,0 +1,63 @@
|
|||||||
|
# Generated from Workflow.pkl. DO NOT EDIT.
|
||||||
|
'on':
|
||||||
|
pull_request: {}
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
schedule:
|
||||||
|
- cron: 38 1 * * 6
|
||||||
|
jobs:
|
||||||
|
analyze-actions:
|
||||||
|
name: Analyze (actions)
|
||||||
|
permissions:
|
||||||
|
security-events: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
|
||||||
|
with:
|
||||||
|
languages: actions
|
||||||
|
build-mode: none
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
|
||||||
|
with:
|
||||||
|
category: /language:actions
|
||||||
|
analyze-java-kotlin:
|
||||||
|
name: Analyze (java-kotlin)
|
||||||
|
permissions:
|
||||||
|
security-events: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
|
||||||
|
with:
|
||||||
|
languages: java-kotlin
|
||||||
|
build-mode: autobuild
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
|
||||||
|
with:
|
||||||
|
category: /language:java-kotlin
|
||||||
|
analyze-javascript-typescript:
|
||||||
|
name: Analyze (javascript-typescript)
|
||||||
|
permissions:
|
||||||
|
security-events: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
|
||||||
|
with:
|
||||||
|
languages: javascript-typescript
|
||||||
|
build-mode: none
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
|
||||||
|
with:
|
||||||
|
category: /language:javascript-typescript
|
||||||
Generated
+929
@@ -0,0 +1,929 @@
|
|||||||
|
# Generated from Workflow.pkl. DO NOT EDIT.
|
||||||
|
name: Build (main)
|
||||||
|
'on':
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
tags-ignore:
|
||||||
|
- '**'
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
jobs:
|
||||||
|
gradle-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: check
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true check
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-gradle-check
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-gradle-check
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
gradle-check-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
JAVA_HOME: /jdk
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: check
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true check
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-gradle-check-windows
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-gradle-check-windows
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
bench:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: bench:jmh
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true bench:jmh
|
||||||
|
gradle-compatibility:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: :pkl-gradle:build :pkl-gradle:compatibilityTestReleases
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true :pkl-gradle:build :pkl-gradle:compatibilityTestReleases
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-gradle-compatibility
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-gradle-compatibility
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
java-executables-snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: gradle build java executables
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:build pkl-cli:build pkl-codegen-java:build pkl-codegen-kotlin:build
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-java
|
||||||
|
path: '*/build/executable/**/*'
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-java-executables-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-java-executables-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-macOS-amd64-snapshot:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -Dpkl.targetArch=amd64 "-Dpkl.native--native-compiler-path=${GITHUB_WORKSPACE}/.github/scripts/cc_macos_amd64.sh" pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-macOS-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-macOS-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-macOS-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-linux-amd64-snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-linux-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-linux-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-linux-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-cli-macOS-aarch64-snapshot:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-macOS-aarch64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-macOS-aarch64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-macOS-aarch64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-linux-aarch64-snapshot:
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-linux-aarch64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-linux-aarch64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-linux-aarch64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-cli-alpine-linux-amd64-snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Install musl and zlib
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
mkdir -p ~/staticdeps/
|
||||||
|
|
||||||
|
ZLIB_VERSION="1.2.13"
|
||||||
|
MUSL_VERSION="1.2.5"
|
||||||
|
|
||||||
|
# install zlib
|
||||||
|
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
||||||
|
# Download zlib tarball and signature
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz" -o /tmp/zlib.tar.gz
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz.asc" -o /tmp/zlib.tar.gz.asc
|
||||||
|
|
||||||
|
# Import zlib GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 5ED46A6721D365587791E2AA783FCD8E58BCAFBA
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying zlib GPG signature..."
|
||||||
|
gpg --verify /tmp/zlib.tar.gz.asc /tmp/zlib.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
cd "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: configure..."
|
||||||
|
./configure --static --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf /tmp/dep_zlib-${ZLIB_VERSION}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# install musl
|
||||||
|
if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then
|
||||||
|
# Download musl tarball and signature
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz" -o /tmp/musl.tar.gz
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz.asc" -o /tmp/musl.tar.gz.asc
|
||||||
|
|
||||||
|
# Import musl GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 836489290BB6B70F99FFDA0556BCDB593020450F
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying musl GPG signature..."
|
||||||
|
gpg --verify /tmp/musl.tar.gz.asc /tmp/musl.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
cd "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/musl.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: configure..."
|
||||||
|
./configure --disable-shared --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# native-image expects to find an executable at this path.
|
||||||
|
ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${HOME}/staticdeps/bin" >> "$GITHUB_PATH"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -Dpkl.musl=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-alpine-linux-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-alpine-linux-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-alpine-linux-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-windows-amd64-snapshot:
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
JAVA_HOME: /jdk
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-windows-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-windows-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-windows-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-macOS-amd64-snapshot:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -Dpkl.targetArch=amd64 "-Dpkl.native--native-compiler-path=${GITHUB_WORKSPACE}/.github/scripts/cc_macos_amd64.sh" pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-macOS-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-macOS-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-macOS-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-linux-amd64-snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-linux-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-linux-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-linux-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-doc-macOS-aarch64-snapshot:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-macOS-aarch64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-macOS-aarch64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-macOS-aarch64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-linux-aarch64-snapshot:
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-linux-aarch64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-linux-aarch64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-linux-aarch64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-doc-alpine-linux-amd64-snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Install musl and zlib
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
mkdir -p ~/staticdeps/
|
||||||
|
|
||||||
|
ZLIB_VERSION="1.2.13"
|
||||||
|
MUSL_VERSION="1.2.5"
|
||||||
|
|
||||||
|
# install zlib
|
||||||
|
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
||||||
|
# Download zlib tarball and signature
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz" -o /tmp/zlib.tar.gz
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz.asc" -o /tmp/zlib.tar.gz.asc
|
||||||
|
|
||||||
|
# Import zlib GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 5ED46A6721D365587791E2AA783FCD8E58BCAFBA
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying zlib GPG signature..."
|
||||||
|
gpg --verify /tmp/zlib.tar.gz.asc /tmp/zlib.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
cd "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: configure..."
|
||||||
|
./configure --static --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf /tmp/dep_zlib-${ZLIB_VERSION}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# install musl
|
||||||
|
if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then
|
||||||
|
# Download musl tarball and signature
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz" -o /tmp/musl.tar.gz
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz.asc" -o /tmp/musl.tar.gz.asc
|
||||||
|
|
||||||
|
# Import musl GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 836489290BB6B70F99FFDA0556BCDB593020450F
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying musl GPG signature..."
|
||||||
|
gpg --verify /tmp/musl.tar.gz.asc /tmp/musl.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
cd "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/musl.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: configure..."
|
||||||
|
./configure --disable-shared --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# native-image expects to find an executable at this path.
|
||||||
|
ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${HOME}/staticdeps/bin" >> "$GITHUB_PATH"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -Dpkl.musl=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-alpine-linux-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-alpine-linux-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-alpine-linux-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-windows-amd64-snapshot:
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
JAVA_HOME: /jdk
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-windows-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-windows-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-windows-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
deploy-snapshot:
|
||||||
|
needs:
|
||||||
|
- gradle-check
|
||||||
|
- gradle-check-windows
|
||||||
|
- bench
|
||||||
|
- gradle-compatibility
|
||||||
|
- java-executables-snapshot
|
||||||
|
- pkl-cli-macOS-amd64-snapshot
|
||||||
|
- pkl-cli-linux-amd64-snapshot
|
||||||
|
- pkl-cli-macOS-aarch64-snapshot
|
||||||
|
- pkl-cli-linux-aarch64-snapshot
|
||||||
|
- pkl-cli-alpine-linux-amd64-snapshot
|
||||||
|
- pkl-cli-windows-amd64-snapshot
|
||||||
|
- pkl-doc-macOS-amd64-snapshot
|
||||||
|
- pkl-doc-linux-amd64-snapshot
|
||||||
|
- pkl-doc-macOS-aarch64-snapshot
|
||||||
|
- pkl-doc-linux-aarch64-snapshot
|
||||||
|
- pkl-doc-alpine-linux-amd64-snapshot
|
||||||
|
- pkl-doc-windows-amd64-snapshot
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
environment: maven-release
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
||||||
|
with:
|
||||||
|
pattern: executable-**
|
||||||
|
merge-multiple: true
|
||||||
|
- env:
|
||||||
|
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEYID }}
|
||||||
|
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
|
||||||
|
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
|
||||||
|
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }}
|
||||||
|
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }}
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true --no-parallel publishToSonatype
|
||||||
|
dependency-submission:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
- uses: gradle/actions/dependency-submission@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6
|
||||||
|
with:
|
||||||
|
dependency-graph-include-configurations: .*[rR]untimeClasspath|.*[cC]ompileClasspath
|
||||||
|
publish-test-results:
|
||||||
|
if: '!cancelled()'
|
||||||
|
needs:
|
||||||
|
- gradle-check
|
||||||
|
- gradle-check-windows
|
||||||
|
- gradle-compatibility
|
||||||
|
- java-executables-snapshot
|
||||||
|
- pkl-cli-macOS-amd64-snapshot
|
||||||
|
- pkl-cli-linux-amd64-snapshot
|
||||||
|
- pkl-cli-macOS-aarch64-snapshot
|
||||||
|
- pkl-cli-linux-aarch64-snapshot
|
||||||
|
- pkl-cli-alpine-linux-amd64-snapshot
|
||||||
|
- pkl-cli-windows-amd64-snapshot
|
||||||
|
- pkl-doc-macOS-amd64-snapshot
|
||||||
|
- pkl-doc-linux-amd64-snapshot
|
||||||
|
- pkl-doc-macOS-aarch64-snapshot
|
||||||
|
- pkl-doc-linux-aarch64-snapshot
|
||||||
|
- pkl-doc-alpine-linux-amd64-snapshot
|
||||||
|
- pkl-doc-windows-amd64-snapshot
|
||||||
|
permissions:
|
||||||
|
checks: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
||||||
|
with:
|
||||||
|
pattern: test-results-xml-*
|
||||||
|
- name: Publish test results
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
|
||||||
|
with:
|
||||||
|
comment_mode: 'off'
|
||||||
|
files: test-results-xml-*/**/*.xml
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-publish-test-results
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
trigger-downstream-builds:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
needs:
|
||||||
|
- gradle-check
|
||||||
|
- gradle-check-windows
|
||||||
|
- bench
|
||||||
|
- gradle-compatibility
|
||||||
|
- java-executables-snapshot
|
||||||
|
- pkl-cli-macOS-amd64-snapshot
|
||||||
|
- pkl-cli-linux-amd64-snapshot
|
||||||
|
- pkl-cli-macOS-aarch64-snapshot
|
||||||
|
- pkl-cli-linux-aarch64-snapshot
|
||||||
|
- pkl-cli-alpine-linux-amd64-snapshot
|
||||||
|
- pkl-cli-windows-amd64-snapshot
|
||||||
|
- pkl-doc-macOS-amd64-snapshot
|
||||||
|
- pkl-doc-linux-amd64-snapshot
|
||||||
|
- pkl-doc-macOS-aarch64-snapshot
|
||||||
|
- pkl-doc-linux-aarch64-snapshot
|
||||||
|
- pkl-doc-alpine-linux-amd64-snapshot
|
||||||
|
- pkl-doc-windows-amd64-snapshot
|
||||||
|
- deploy-snapshot
|
||||||
|
- dependency-submission
|
||||||
|
- publish-test-results
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Create app token
|
||||||
|
id: app-token
|
||||||
|
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.PKL_CI_CLIENT_ID }}
|
||||||
|
private-key: ${{ secrets.PKL_CI }}
|
||||||
|
owner: ${{ github.repository_owner }}
|
||||||
|
- name: Trigger pkl-lang.org build
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
|
SOURCE_RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||||
|
run: |-
|
||||||
|
gh workflow run \
|
||||||
|
--repo apple/pkl-lang.org \
|
||||||
|
--ref main \
|
||||||
|
--field source_run="${SOURCE_RUN}" \
|
||||||
|
main.yml
|
||||||
Generated
+755
@@ -0,0 +1,755 @@
|
|||||||
|
# Generated from Workflow.pkl. DO NOT EDIT.
|
||||||
|
name: Pull Request
|
||||||
|
'on':
|
||||||
|
pull_request: {}
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
jobs:
|
||||||
|
gradle-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: check
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true check
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-gradle-check
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-gradle-check
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
gradle-check-windows:
|
||||||
|
if: contains(github.event.pull_request.body, '[windows]')
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
JAVA_HOME: /jdk
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: check
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true check
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-gradle-check-windows
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-gradle-check-windows
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-macOS-amd64-snapshot:
|
||||||
|
if: (contains(github.event.pull_request.body, '[native]') || contains(github.event.pull_request.body, '[native-pkl-cli]') || contains(github.event.pull_request.body, '[native-pkl-cli-macOS]') || contains(github.event.pull_request.body, '[native-pkl-cli-macOS-amd64]') || contains(github.event.pull_request.body, '[native-pkl-cli-macOS-amd64]')) && github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -Dpkl.targetArch=amd64 "-Dpkl.native--native-compiler-path=${GITHUB_WORKSPACE}/.github/scripts/cc_macos_amd64.sh" pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-macOS-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-macOS-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-macOS-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-linux-amd64-snapshot:
|
||||||
|
if: contains(github.event.pull_request.body, '[native]') || contains(github.event.pull_request.body, '[native-pkl-cli]') || contains(github.event.pull_request.body, '[native-pkl-cli-linux]') || contains(github.event.pull_request.body, '[native-pkl-cli-linux-amd64]') || contains(github.event.pull_request.body, '[native-pkl-cli-linux-amd64]')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-linux-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-linux-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-linux-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-cli-macOS-aarch64-snapshot:
|
||||||
|
if: (contains(github.event.pull_request.body, '[native]') || contains(github.event.pull_request.body, '[native-pkl-cli]') || contains(github.event.pull_request.body, '[native-pkl-cli-macOS]') || contains(github.event.pull_request.body, '[native-pkl-cli-macOS-aarch64]') || contains(github.event.pull_request.body, '[native-pkl-cli-macOS-aarch64]')) && github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-macOS-aarch64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-macOS-aarch64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-macOS-aarch64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-linux-aarch64-snapshot:
|
||||||
|
if: contains(github.event.pull_request.body, '[native]') || contains(github.event.pull_request.body, '[native-pkl-cli]') || contains(github.event.pull_request.body, '[native-pkl-cli-linux]') || contains(github.event.pull_request.body, '[native-pkl-cli-linux-aarch64]') || contains(github.event.pull_request.body, '[native-pkl-cli-linux-aarch64]')
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-linux-aarch64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-linux-aarch64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-linux-aarch64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-cli-alpine-linux-amd64-snapshot:
|
||||||
|
if: contains(github.event.pull_request.body, '[native]') || contains(github.event.pull_request.body, '[native-pkl-cli]') || contains(github.event.pull_request.body, '[native-pkl-cli-linux]') || contains(github.event.pull_request.body, '[native-pkl-cli-linux-amd64]') || contains(github.event.pull_request.body, '[native-pkl-cli-linux-amd64]') || contains(github.event.pull_request.body, '[native-pkl-cli-alpine-linux-amd64]')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Install musl and zlib
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
mkdir -p ~/staticdeps/
|
||||||
|
|
||||||
|
ZLIB_VERSION="1.2.13"
|
||||||
|
MUSL_VERSION="1.2.5"
|
||||||
|
|
||||||
|
# install zlib
|
||||||
|
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
||||||
|
# Download zlib tarball and signature
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz" -o /tmp/zlib.tar.gz
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz.asc" -o /tmp/zlib.tar.gz.asc
|
||||||
|
|
||||||
|
# Import zlib GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 5ED46A6721D365587791E2AA783FCD8E58BCAFBA
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying zlib GPG signature..."
|
||||||
|
gpg --verify /tmp/zlib.tar.gz.asc /tmp/zlib.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
cd "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: configure..."
|
||||||
|
./configure --static --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf /tmp/dep_zlib-${ZLIB_VERSION}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# install musl
|
||||||
|
if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then
|
||||||
|
# Download musl tarball and signature
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz" -o /tmp/musl.tar.gz
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz.asc" -o /tmp/musl.tar.gz.asc
|
||||||
|
|
||||||
|
# Import musl GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 836489290BB6B70F99FFDA0556BCDB593020450F
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying musl GPG signature..."
|
||||||
|
gpg --verify /tmp/musl.tar.gz.asc /tmp/musl.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
cd "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/musl.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: configure..."
|
||||||
|
./configure --disable-shared --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# native-image expects to find an executable at this path.
|
||||||
|
ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${HOME}/staticdeps/bin" >> "$GITHUB_PATH"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -Dpkl.musl=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-alpine-linux-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-alpine-linux-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-alpine-linux-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-windows-amd64-snapshot:
|
||||||
|
if: contains(github.event.pull_request.body, '[native]') || contains(github.event.pull_request.body, '[native-pkl-cli]') || contains(github.event.pull_request.body, '[native-pkl-cli-windows]') || contains(github.event.pull_request.body, '[native-pkl-cli-windows-amd64]') || contains(github.event.pull_request.body, '[native-pkl-cli-windows-amd64]')
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
JAVA_HOME: /jdk
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-windows-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-windows-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-windows-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-macOS-amd64-snapshot:
|
||||||
|
if: (contains(github.event.pull_request.body, '[native]') || contains(github.event.pull_request.body, '[native-pkl-doc]') || contains(github.event.pull_request.body, '[native-pkl-doc-macOS]') || contains(github.event.pull_request.body, '[native-pkl-doc-macOS-amd64]') || contains(github.event.pull_request.body, '[native-pkl-doc-macOS-amd64]')) && github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -Dpkl.targetArch=amd64 "-Dpkl.native--native-compiler-path=${GITHUB_WORKSPACE}/.github/scripts/cc_macos_amd64.sh" pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-macOS-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-macOS-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-macOS-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-linux-amd64-snapshot:
|
||||||
|
if: contains(github.event.pull_request.body, '[native]') || contains(github.event.pull_request.body, '[native-pkl-doc]') || contains(github.event.pull_request.body, '[native-pkl-doc-linux]') || contains(github.event.pull_request.body, '[native-pkl-doc-linux-amd64]') || contains(github.event.pull_request.body, '[native-pkl-doc-linux-amd64]')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-linux-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-linux-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-linux-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-doc-macOS-aarch64-snapshot:
|
||||||
|
if: (contains(github.event.pull_request.body, '[native]') || contains(github.event.pull_request.body, '[native-pkl-doc]') || contains(github.event.pull_request.body, '[native-pkl-doc-macOS]') || contains(github.event.pull_request.body, '[native-pkl-doc-macOS-aarch64]') || contains(github.event.pull_request.body, '[native-pkl-doc-macOS-aarch64]')) && github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-macOS-aarch64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-macOS-aarch64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-macOS-aarch64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-linux-aarch64-snapshot:
|
||||||
|
if: contains(github.event.pull_request.body, '[native]') || contains(github.event.pull_request.body, '[native-pkl-doc]') || contains(github.event.pull_request.body, '[native-pkl-doc-linux]') || contains(github.event.pull_request.body, '[native-pkl-doc-linux-aarch64]') || contains(github.event.pull_request.body, '[native-pkl-doc-linux-aarch64]')
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-linux-aarch64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-linux-aarch64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-linux-aarch64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-doc-alpine-linux-amd64-snapshot:
|
||||||
|
if: contains(github.event.pull_request.body, '[native]') || contains(github.event.pull_request.body, '[native-pkl-doc]') || contains(github.event.pull_request.body, '[native-pkl-doc-linux]') || contains(github.event.pull_request.body, '[native-pkl-doc-linux-amd64]') || contains(github.event.pull_request.body, '[native-pkl-doc-linux-amd64]') || contains(github.event.pull_request.body, '[native-pkl-doc-alpine-linux-amd64]')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Install musl and zlib
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
mkdir -p ~/staticdeps/
|
||||||
|
|
||||||
|
ZLIB_VERSION="1.2.13"
|
||||||
|
MUSL_VERSION="1.2.5"
|
||||||
|
|
||||||
|
# install zlib
|
||||||
|
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
||||||
|
# Download zlib tarball and signature
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz" -o /tmp/zlib.tar.gz
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz.asc" -o /tmp/zlib.tar.gz.asc
|
||||||
|
|
||||||
|
# Import zlib GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 5ED46A6721D365587791E2AA783FCD8E58BCAFBA
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying zlib GPG signature..."
|
||||||
|
gpg --verify /tmp/zlib.tar.gz.asc /tmp/zlib.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
cd "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: configure..."
|
||||||
|
./configure --static --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf /tmp/dep_zlib-${ZLIB_VERSION}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# install musl
|
||||||
|
if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then
|
||||||
|
# Download musl tarball and signature
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz" -o /tmp/musl.tar.gz
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz.asc" -o /tmp/musl.tar.gz.asc
|
||||||
|
|
||||||
|
# Import musl GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 836489290BB6B70F99FFDA0556BCDB593020450F
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying musl GPG signature..."
|
||||||
|
gpg --verify /tmp/musl.tar.gz.asc /tmp/musl.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
cd "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/musl.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: configure..."
|
||||||
|
./configure --disable-shared --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# native-image expects to find an executable at this path.
|
||||||
|
ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${HOME}/staticdeps/bin" >> "$GITHUB_PATH"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -Dpkl.musl=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-alpine-linux-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-alpine-linux-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-alpine-linux-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-windows-amd64-snapshot:
|
||||||
|
if: contains(github.event.pull_request.body, '[native]') || contains(github.event.pull_request.body, '[native-pkl-doc]') || contains(github.event.pull_request.body, '[native-pkl-doc-windows]') || contains(github.event.pull_request.body, '[native-pkl-doc-windows-amd64]') || contains(github.event.pull_request.body, '[native-pkl-doc-windows-amd64]')
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
JAVA_HOME: /jdk
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-windows-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-windows-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-windows-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
upload-event-file:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Upload event file
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-event-file
|
||||||
|
path: ${{ github.event_path }}
|
||||||
|
check-pkl-github-actions:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Setup Pkl
|
||||||
|
id: setup-pkl
|
||||||
|
env:
|
||||||
|
PKL_VERSION: 0.30.0
|
||||||
|
PKL_FILENAME: pkl
|
||||||
|
PKL_DOWNLOAD_URL: https://github.com/apple/pkl/releases/download/0.30.0/pkl-linux-amd64
|
||||||
|
shell: bash
|
||||||
|
run: |-
|
||||||
|
DIR="$(mktemp -d /tmp/pkl-$PKL_VERSION-XXXXXX)"
|
||||||
|
PKL_EXEC="$DIR/$PKL_FILENAME"
|
||||||
|
curl -sfL -o $PKL_EXEC "$PKL_DOWNLOAD_URL"
|
||||||
|
chmod +x $PKL_EXEC
|
||||||
|
echo "$DIR" >> "$GITHUB_PATH"
|
||||||
|
echo "pkl_exec=$PKL_EXEC" >> "$GITHUB_OUTPUT"
|
||||||
|
- shell: bash
|
||||||
|
run: rm -rf .github/**/[a-z]*.yml
|
||||||
|
- shell: bash
|
||||||
|
run: pkl eval -m .github/ --project-dir .github/ .github/index.pkl
|
||||||
|
- name: check git status
|
||||||
|
shell: bash
|
||||||
|
run: |-
|
||||||
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
|
echo "Running pkl resulted in a diff! You likely need to run 'pkl eval' and commit the changes."
|
||||||
|
git diff --name-only
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
Generated
+864
@@ -0,0 +1,864 @@
|
|||||||
|
# Generated from Workflow.pkl. DO NOT EDIT.
|
||||||
|
name: Build (release branch)
|
||||||
|
'on':
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- release/*
|
||||||
|
tags-ignore:
|
||||||
|
- '**'
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
jobs:
|
||||||
|
gradle-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: check
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true check
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-gradle-check
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-gradle-check
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
gradle-check-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
JAVA_HOME: /jdk
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: check
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true check
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-gradle-check-windows
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-gradle-check-windows
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
bench:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: bench:jmh
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true bench:jmh
|
||||||
|
gradle-compatibility:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: :pkl-gradle:build :pkl-gradle:compatibilityTestReleases
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true :pkl-gradle:build :pkl-gradle:compatibilityTestReleases
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-gradle-compatibility
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-gradle-compatibility
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
java-executables-snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: gradle build java executables
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:build pkl-cli:build pkl-codegen-java:build pkl-codegen-kotlin:build
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-java
|
||||||
|
path: '*/build/executable/**/*'
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-java-executables-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-java-executables-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-macOS-amd64-snapshot:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -Dpkl.targetArch=amd64 "-Dpkl.native--native-compiler-path=${GITHUB_WORKSPACE}/.github/scripts/cc_macos_amd64.sh" pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-macOS-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-macOS-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-macOS-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-linux-amd64-snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-linux-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-linux-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-linux-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-cli-macOS-aarch64-snapshot:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-macOS-aarch64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-macOS-aarch64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-macOS-aarch64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-linux-aarch64-snapshot:
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-linux-aarch64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-linux-aarch64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-linux-aarch64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-cli-alpine-linux-amd64-snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Install musl and zlib
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
mkdir -p ~/staticdeps/
|
||||||
|
|
||||||
|
ZLIB_VERSION="1.2.13"
|
||||||
|
MUSL_VERSION="1.2.5"
|
||||||
|
|
||||||
|
# install zlib
|
||||||
|
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
||||||
|
# Download zlib tarball and signature
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz" -o /tmp/zlib.tar.gz
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz.asc" -o /tmp/zlib.tar.gz.asc
|
||||||
|
|
||||||
|
# Import zlib GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 5ED46A6721D365587791E2AA783FCD8E58BCAFBA
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying zlib GPG signature..."
|
||||||
|
gpg --verify /tmp/zlib.tar.gz.asc /tmp/zlib.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
cd "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: configure..."
|
||||||
|
./configure --static --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf /tmp/dep_zlib-${ZLIB_VERSION}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# install musl
|
||||||
|
if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then
|
||||||
|
# Download musl tarball and signature
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz" -o /tmp/musl.tar.gz
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz.asc" -o /tmp/musl.tar.gz.asc
|
||||||
|
|
||||||
|
# Import musl GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 836489290BB6B70F99FFDA0556BCDB593020450F
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying musl GPG signature..."
|
||||||
|
gpg --verify /tmp/musl.tar.gz.asc /tmp/musl.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
cd "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/musl.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: configure..."
|
||||||
|
./configure --disable-shared --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# native-image expects to find an executable at this path.
|
||||||
|
ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${HOME}/staticdeps/bin" >> "$GITHUB_PATH"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -Dpkl.musl=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-alpine-linux-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-alpine-linux-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-alpine-linux-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-windows-amd64-snapshot:
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
JAVA_HOME: /jdk
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-windows-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-windows-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-windows-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-macOS-amd64-snapshot:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -Dpkl.targetArch=amd64 "-Dpkl.native--native-compiler-path=${GITHUB_WORKSPACE}/.github/scripts/cc_macos_amd64.sh" pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-macOS-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-macOS-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-macOS-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-linux-amd64-snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-linux-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-linux-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-linux-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-doc-macOS-aarch64-snapshot:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-macOS-aarch64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-macOS-aarch64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-macOS-aarch64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-linux-aarch64-snapshot:
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-linux-aarch64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-linux-aarch64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-linux-aarch64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-doc-alpine-linux-amd64-snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: Install musl and zlib
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
mkdir -p ~/staticdeps/
|
||||||
|
|
||||||
|
ZLIB_VERSION="1.2.13"
|
||||||
|
MUSL_VERSION="1.2.5"
|
||||||
|
|
||||||
|
# install zlib
|
||||||
|
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
||||||
|
# Download zlib tarball and signature
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz" -o /tmp/zlib.tar.gz
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz.asc" -o /tmp/zlib.tar.gz.asc
|
||||||
|
|
||||||
|
# Import zlib GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 5ED46A6721D365587791E2AA783FCD8E58BCAFBA
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying zlib GPG signature..."
|
||||||
|
gpg --verify /tmp/zlib.tar.gz.asc /tmp/zlib.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
cd "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: configure..."
|
||||||
|
./configure --static --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf /tmp/dep_zlib-${ZLIB_VERSION}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# install musl
|
||||||
|
if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then
|
||||||
|
# Download musl tarball and signature
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz" -o /tmp/musl.tar.gz
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz.asc" -o /tmp/musl.tar.gz.asc
|
||||||
|
|
||||||
|
# Import musl GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 836489290BB6B70F99FFDA0556BCDB593020450F
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying musl GPG signature..."
|
||||||
|
gpg --verify /tmp/musl.tar.gz.asc /tmp/musl.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
cd "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/musl.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: configure..."
|
||||||
|
./configure --disable-shared --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# native-image expects to find an executable at this path.
|
||||||
|
ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${HOME}/staticdeps/bin" >> "$GITHUB_PATH"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -Dpkl.musl=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-alpine-linux-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-alpine-linux-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-alpine-linux-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-windows-amd64-snapshot:
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
JAVA_HOME: /jdk
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-windows-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-windows-amd64-snapshot
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-windows-amd64-snapshot
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
publish-test-results:
|
||||||
|
if: '!cancelled()'
|
||||||
|
needs:
|
||||||
|
- gradle-check
|
||||||
|
- gradle-check-windows
|
||||||
|
- gradle-compatibility
|
||||||
|
- java-executables-snapshot
|
||||||
|
- pkl-cli-macOS-amd64-snapshot
|
||||||
|
- pkl-cli-linux-amd64-snapshot
|
||||||
|
- pkl-cli-macOS-aarch64-snapshot
|
||||||
|
- pkl-cli-linux-aarch64-snapshot
|
||||||
|
- pkl-cli-alpine-linux-amd64-snapshot
|
||||||
|
- pkl-cli-windows-amd64-snapshot
|
||||||
|
- pkl-doc-macOS-amd64-snapshot
|
||||||
|
- pkl-doc-linux-amd64-snapshot
|
||||||
|
- pkl-doc-macOS-aarch64-snapshot
|
||||||
|
- pkl-doc-linux-aarch64-snapshot
|
||||||
|
- pkl-doc-alpine-linux-amd64-snapshot
|
||||||
|
- pkl-doc-windows-amd64-snapshot
|
||||||
|
permissions:
|
||||||
|
checks: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
||||||
|
with:
|
||||||
|
pattern: test-results-xml-*
|
||||||
|
- name: Publish test results
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
|
||||||
|
with:
|
||||||
|
comment_mode: 'off'
|
||||||
|
files: test-results-xml-*/**/*.xml
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-publish-test-results
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
trigger-downstream-builds:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
needs:
|
||||||
|
- gradle-check
|
||||||
|
- gradle-check-windows
|
||||||
|
- bench
|
||||||
|
- gradle-compatibility
|
||||||
|
- java-executables-snapshot
|
||||||
|
- pkl-cli-macOS-amd64-snapshot
|
||||||
|
- pkl-cli-linux-amd64-snapshot
|
||||||
|
- pkl-cli-macOS-aarch64-snapshot
|
||||||
|
- pkl-cli-linux-aarch64-snapshot
|
||||||
|
- pkl-cli-alpine-linux-amd64-snapshot
|
||||||
|
- pkl-cli-windows-amd64-snapshot
|
||||||
|
- pkl-doc-macOS-amd64-snapshot
|
||||||
|
- pkl-doc-linux-amd64-snapshot
|
||||||
|
- pkl-doc-macOS-aarch64-snapshot
|
||||||
|
- pkl-doc-linux-aarch64-snapshot
|
||||||
|
- pkl-doc-alpine-linux-amd64-snapshot
|
||||||
|
- pkl-doc-windows-amd64-snapshot
|
||||||
|
- publish-test-results
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Create app token
|
||||||
|
id: app-token
|
||||||
|
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.PKL_CI_CLIENT_ID }}
|
||||||
|
private-key: ${{ secrets.PKL_CI }}
|
||||||
|
owner: ${{ github.repository_owner }}
|
||||||
|
- name: Trigger pkl-lang.org build
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
|
SOURCE_RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||||
|
run: |-
|
||||||
|
gh workflow run \
|
||||||
|
--repo apple/pkl-lang.org \
|
||||||
|
--ref main \
|
||||||
|
--field source_run="${SOURCE_RUN}" \
|
||||||
|
main.yml
|
||||||
Generated
+954
@@ -0,0 +1,954 @@
|
|||||||
|
# Generated from Workflow.pkl. DO NOT EDIT.
|
||||||
|
name: Release
|
||||||
|
'on':
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- '**'
|
||||||
|
tags:
|
||||||
|
- '**'
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
jobs:
|
||||||
|
gradle-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: check
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true check
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-gradle-check
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-gradle-check
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
gradle-check-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
JAVA_HOME: /jdk
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: check
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true check
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-gradle-check-windows
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-gradle-check-windows
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
bench:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: bench:jmh
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true bench:jmh
|
||||||
|
gradle-compatibility:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with: {}
|
||||||
|
- name: :pkl-gradle:build :pkl-gradle:compatibilityTestReleases
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true :pkl-gradle:build :pkl-gradle:compatibilityTestReleases
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-gradle-compatibility
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-gradle-compatibility
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
java-executables-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with:
|
||||||
|
cache-disabled: true
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: gradle build java executables
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -DreleaseBuild=true pkl-doc:build pkl-cli:build pkl-codegen-java:build pkl-codegen-kotlin:build
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-java
|
||||||
|
path: '*/build/executable/**/*'
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-java-executables-release
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-java-executables-release
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-macOS-amd64-release:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with:
|
||||||
|
cache-disabled: true
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -DreleaseBuild=true -Dpkl.targetArch=amd64 "-Dpkl.native--native-compiler-path=${GITHUB_WORKSPACE}/.github/scripts/cc_macos_amd64.sh" pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-macOS-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-macOS-amd64-release
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-macOS-amd64-release
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-linux-amd64-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with:
|
||||||
|
cache-disabled: true
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -DreleaseBuild=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-linux-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-linux-amd64-release
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-linux-amd64-release
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-cli-macOS-aarch64-release:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with:
|
||||||
|
cache-disabled: true
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -DreleaseBuild=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-macOS-aarch64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-macOS-aarch64-release
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-macOS-aarch64-release
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-linux-aarch64-release:
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with:
|
||||||
|
cache-disabled: true
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -DreleaseBuild=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-linux-aarch64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-linux-aarch64-release
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-linux-aarch64-release
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-cli-alpine-linux-amd64-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with:
|
||||||
|
cache-disabled: true
|
||||||
|
- name: Install musl and zlib
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
mkdir -p ~/staticdeps/
|
||||||
|
|
||||||
|
ZLIB_VERSION="1.2.13"
|
||||||
|
MUSL_VERSION="1.2.5"
|
||||||
|
|
||||||
|
# install zlib
|
||||||
|
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
||||||
|
# Download zlib tarball and signature
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz" -o /tmp/zlib.tar.gz
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz.asc" -o /tmp/zlib.tar.gz.asc
|
||||||
|
|
||||||
|
# Import zlib GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 5ED46A6721D365587791E2AA783FCD8E58BCAFBA
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying zlib GPG signature..."
|
||||||
|
gpg --verify /tmp/zlib.tar.gz.asc /tmp/zlib.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
cd "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: configure..."
|
||||||
|
./configure --static --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf /tmp/dep_zlib-${ZLIB_VERSION}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# install musl
|
||||||
|
if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then
|
||||||
|
# Download musl tarball and signature
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz" -o /tmp/musl.tar.gz
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz.asc" -o /tmp/musl.tar.gz.asc
|
||||||
|
|
||||||
|
# Import musl GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 836489290BB6B70F99FFDA0556BCDB593020450F
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying musl GPG signature..."
|
||||||
|
gpg --verify /tmp/musl.tar.gz.asc /tmp/musl.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
cd "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/musl.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: configure..."
|
||||||
|
./configure --disable-shared --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# native-image expects to find an executable at this path.
|
||||||
|
ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${HOME}/staticdeps/bin" >> "$GITHUB_PATH"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -DreleaseBuild=true -Dpkl.musl=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-alpine-linux-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-alpine-linux-amd64-release
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-alpine-linux-amd64-release
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-cli-windows-amd64-release:
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
JAVA_HOME: /jdk
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with:
|
||||||
|
cache-disabled: true
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -DreleaseBuild=true pkl-cli:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-cli-windows-amd64
|
||||||
|
path: pkl-cli*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-cli-windows-amd64-release
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-cli-windows-amd64-release
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-macOS-amd64-release:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with:
|
||||||
|
cache-disabled: true
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -DreleaseBuild=true -Dpkl.targetArch=amd64 "-Dpkl.native--native-compiler-path=${GITHUB_WORKSPACE}/.github/scripts/cc_macos_amd64.sh" pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-macOS-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-macOS-amd64-release
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-macOS-amd64-release
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-linux-amd64-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with:
|
||||||
|
cache-disabled: true
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -DreleaseBuild=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-linux-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-linux-amd64-release
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-linux-amd64-release
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-doc-macOS-aarch64-release:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- macos
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with:
|
||||||
|
cache-disabled: true
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -DreleaseBuild=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-macOS-aarch64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-macOS-aarch64-release
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-macOS-aarch64-release
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-linux-aarch64-release:
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: dnf install -y git binutils gcc glibc-devel zlib-devel libstdc++-static glibc-langpack-en
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: aarch64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with:
|
||||||
|
cache-disabled: true
|
||||||
|
- name: Fix git ownership
|
||||||
|
run: git status || git config --system --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -DreleaseBuild=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-linux-aarch64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-linux-aarch64-release
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-linux-aarch64-release
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
container:
|
||||||
|
image: redhat/ubi8:8.10
|
||||||
|
pkl-doc-alpine-linux-amd64-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with:
|
||||||
|
cache-disabled: true
|
||||||
|
- name: Install musl and zlib
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
mkdir -p ~/staticdeps/
|
||||||
|
|
||||||
|
ZLIB_VERSION="1.2.13"
|
||||||
|
MUSL_VERSION="1.2.5"
|
||||||
|
|
||||||
|
# install zlib
|
||||||
|
if [[ ! -f ~/staticdeps/include/zlib.h ]]; then
|
||||||
|
# Download zlib tarball and signature
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz" -o /tmp/zlib.tar.gz
|
||||||
|
curl -Lf "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz.asc" -o /tmp/zlib.tar.gz.asc
|
||||||
|
|
||||||
|
# Import zlib GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 5ED46A6721D365587791E2AA783FCD8E58BCAFBA
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying zlib GPG signature..."
|
||||||
|
gpg --verify /tmp/zlib.tar.gz.asc /tmp/zlib.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
cd "/tmp/dep_zlib-${ZLIB_VERSION}"
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: configure..."
|
||||||
|
./configure --static --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "zlib-${ZLIB_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf /tmp/dep_zlib-${ZLIB_VERSION}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# install musl
|
||||||
|
if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then
|
||||||
|
# Download musl tarball and signature
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz" -o /tmp/musl.tar.gz
|
||||||
|
curl -Lf "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz.asc" -o /tmp/musl.tar.gz.asc
|
||||||
|
|
||||||
|
# Import musl GPG key
|
||||||
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 836489290BB6B70F99FFDA0556BCDB593020450F
|
||||||
|
|
||||||
|
# Verify GPG signature
|
||||||
|
echo "Verifying musl GPG signature..."
|
||||||
|
gpg --verify /tmp/musl.tar.gz.asc /tmp/musl.tar.gz
|
||||||
|
|
||||||
|
mkdir -p "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
cd "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat /tmp/musl.tar.gz | tar --strip-components=1 -xzC .
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: configure..."
|
||||||
|
./configure --disable-shared --prefix="$HOME"/staticdeps > /dev/null
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make..."
|
||||||
|
make -s -j4
|
||||||
|
|
||||||
|
echo "musl-${MUSL_VERSION}: make install..."
|
||||||
|
make -s install
|
||||||
|
|
||||||
|
rm -rf "/tmp/dep_musl-${MUSL_VERSION}"
|
||||||
|
|
||||||
|
# native-image expects to find an executable at this path.
|
||||||
|
ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${HOME}/staticdeps/bin" >> "$GITHUB_PATH"
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -DreleaseBuild=true -Dpkl.musl=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-alpine-linux-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-alpine-linux-amd64-release
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-alpine-linux-amd64-release
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
pkl-doc-windows-amd64-release:
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
JAVA_HOME: /jdk
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with:
|
||||||
|
cache-disabled: true
|
||||||
|
- name: gradle buildNative
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -DreleaseBuild=true pkl-doc:buildNative
|
||||||
|
- name: Upload executable artifacts
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: executable-pkl-doc-windows-amd64
|
||||||
|
path: pkl-doc*/build/executable/**/*
|
||||||
|
- name: Upload Test Result XML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-xml-pkl-doc-windows-amd64-release
|
||||||
|
path: '**/build/test-results/**/*.xml'
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-pkl-doc-windows-amd64-release
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
deploy-release:
|
||||||
|
needs:
|
||||||
|
- gradle-check
|
||||||
|
- gradle-check-windows
|
||||||
|
- bench
|
||||||
|
- gradle-compatibility
|
||||||
|
- java-executables-release
|
||||||
|
- pkl-cli-macOS-amd64-release
|
||||||
|
- pkl-cli-linux-amd64-release
|
||||||
|
- pkl-cli-macOS-aarch64-release
|
||||||
|
- pkl-cli-linux-aarch64-release
|
||||||
|
- pkl-cli-alpine-linux-amd64-release
|
||||||
|
- pkl-cli-windows-amd64-release
|
||||||
|
- pkl-doc-macOS-amd64-release
|
||||||
|
- pkl-doc-linux-amd64-release
|
||||||
|
- pkl-doc-macOS-aarch64-release
|
||||||
|
- pkl-doc-linux-aarch64-release
|
||||||
|
- pkl-doc-alpine-linux-amd64-release
|
||||||
|
- pkl-doc-windows-amd64-release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
environment: maven-release
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||||
|
with:
|
||||||
|
java-version: '25'
|
||||||
|
distribution: temurin
|
||||||
|
architecture: x64
|
||||||
|
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
||||||
|
with:
|
||||||
|
cache-disabled: true
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
||||||
|
with:
|
||||||
|
pattern: executable-**
|
||||||
|
merge-multiple: true
|
||||||
|
- env:
|
||||||
|
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEYID }}
|
||||||
|
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
|
||||||
|
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
|
||||||
|
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }}
|
||||||
|
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }}
|
||||||
|
run: ./gradlew --info --stacktrace --no-daemon -DpklMultiJdkTesting=true -DreleaseBuild=true publishToSonatype closeAndReleaseSonatypeStagingRepository
|
||||||
|
github-release:
|
||||||
|
needs: deploy-release
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
||||||
|
with:
|
||||||
|
pattern: executable-**
|
||||||
|
merge-multiple: true
|
||||||
|
- name: Publish release on GitHub
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG_NAME: ${{ github.ref_name }}
|
||||||
|
GIT_SHA: ${{ github.sha }}
|
||||||
|
GH_REPO: ${{ github.repository }}
|
||||||
|
run: |-
|
||||||
|
# exclude build_artifacts.txt from publish
|
||||||
|
rm -f */build/executable/*.build_artifacts.txt
|
||||||
|
find */build/executable/* -type d | xargs rm -rf
|
||||||
|
gh release create ${TAG_NAME} \
|
||||||
|
--title "${TAG_NAME}" \
|
||||||
|
--target "${GIT_SHA}" \
|
||||||
|
--verify-tag \
|
||||||
|
--notes "Release notes: https://pkl-lang.org/main/current/release-notes/changelog.html#release-${TAG_NAME}" \
|
||||||
|
*/build/executable/*
|
||||||
|
publish-test-results:
|
||||||
|
if: '!cancelled()'
|
||||||
|
needs:
|
||||||
|
- gradle-check
|
||||||
|
- gradle-check-windows
|
||||||
|
- gradle-compatibility
|
||||||
|
- java-executables-release
|
||||||
|
- pkl-cli-macOS-amd64-release
|
||||||
|
- pkl-cli-linux-amd64-release
|
||||||
|
- pkl-cli-macOS-aarch64-release
|
||||||
|
- pkl-cli-linux-aarch64-release
|
||||||
|
- pkl-cli-alpine-linux-amd64-release
|
||||||
|
- pkl-cli-windows-amd64-release
|
||||||
|
- pkl-doc-macOS-amd64-release
|
||||||
|
- pkl-doc-linux-amd64-release
|
||||||
|
- pkl-doc-macOS-aarch64-release
|
||||||
|
- pkl-doc-linux-aarch64-release
|
||||||
|
- pkl-doc-alpine-linux-amd64-release
|
||||||
|
- pkl-doc-windows-amd64-release
|
||||||
|
permissions:
|
||||||
|
checks: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
||||||
|
with:
|
||||||
|
pattern: test-results-xml-*
|
||||||
|
- name: Publish test results
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
|
||||||
|
with:
|
||||||
|
comment_mode: 'off'
|
||||||
|
files: test-results-xml-*/**/*.xml
|
||||||
|
- name: Upload Test Result HTML
|
||||||
|
if: '!cancelled()'
|
||||||
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
||||||
|
with:
|
||||||
|
name: test-results-html-publish-test-results
|
||||||
|
path: '**/build/reports/tests/**/*'
|
||||||
|
if-no-files-found: ignore
|
||||||
|
trigger-downstream-builds:
|
||||||
|
if: github.repository_owner == 'apple'
|
||||||
|
needs:
|
||||||
|
- gradle-check
|
||||||
|
- gradle-check-windows
|
||||||
|
- bench
|
||||||
|
- gradle-compatibility
|
||||||
|
- java-executables-release
|
||||||
|
- pkl-cli-macOS-amd64-release
|
||||||
|
- pkl-cli-linux-amd64-release
|
||||||
|
- pkl-cli-macOS-aarch64-release
|
||||||
|
- pkl-cli-linux-aarch64-release
|
||||||
|
- pkl-cli-alpine-linux-amd64-release
|
||||||
|
- pkl-cli-windows-amd64-release
|
||||||
|
- pkl-doc-macOS-amd64-release
|
||||||
|
- pkl-doc-linux-amd64-release
|
||||||
|
- pkl-doc-macOS-aarch64-release
|
||||||
|
- pkl-doc-linux-aarch64-release
|
||||||
|
- pkl-doc-alpine-linux-amd64-release
|
||||||
|
- pkl-doc-windows-amd64-release
|
||||||
|
- deploy-release
|
||||||
|
- github-release
|
||||||
|
- publish-test-results
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Create app token
|
||||||
|
id: app-token
|
||||||
|
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.PKL_CI_CLIENT_ID }}
|
||||||
|
private-key: ${{ secrets.PKL_CI }}
|
||||||
|
owner: ${{ github.repository_owner }}
|
||||||
|
- name: Trigger pkl-lang.org build
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
|
SOURCE_RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||||
|
run: |-
|
||||||
|
gh workflow run \
|
||||||
|
--repo apple/pkl-lang.org \
|
||||||
|
--ref main \
|
||||||
|
--field source_run="${SOURCE_RUN}" \
|
||||||
|
main.yml
|
||||||
Generated
+34
@@ -0,0 +1,34 @@
|
|||||||
|
# Generated from Workflow.pkl. DO NOT EDIT.
|
||||||
|
name: PR Test Reports
|
||||||
|
'on':
|
||||||
|
workflow_run:
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
workflows:
|
||||||
|
- Pull Request
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
jobs:
|
||||||
|
test-results:
|
||||||
|
name: Test Results
|
||||||
|
if: github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure'
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
checks: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Download artifacts
|
||||||
|
uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11
|
||||||
|
with:
|
||||||
|
path: artifacts
|
||||||
|
name: test-results-.*
|
||||||
|
name_is_regexp: true
|
||||||
|
run_id: ${{ github.event.workflow_run.id }}
|
||||||
|
- name: Publish test results
|
||||||
|
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
|
||||||
|
with:
|
||||||
|
commit: ${{ github.event.workflow_run.head_sha }}
|
||||||
|
comment_mode: 'off'
|
||||||
|
files: artifacts/**/*.xml
|
||||||
|
event_file: artifacts/test-results-event-file/event.json
|
||||||
|
event_name: ${{ github.event.workflow_run.event }}
|
||||||
+8
-3
@@ -5,15 +5,20 @@
|
|||||||
.gradle/
|
.gradle/
|
||||||
build/
|
build/
|
||||||
generated/
|
generated/
|
||||||
|
testgenerated/
|
||||||
|
|
||||||
# IntelliJ
|
# IntelliJ
|
||||||
.idea/
|
.idea/
|
||||||
|
!.idea/icon.svg
|
||||||
!.idea/codestyles/
|
!.idea/codestyles/
|
||||||
!.idea/inspectionProfiles/
|
!.idea/inspectionProfiles/
|
||||||
!.idea/runConfigurations/
|
!.idea/runConfigurations/
|
||||||
!.idea/scopes/
|
!.idea/scopes/
|
||||||
!.idea/vcs.xml
|
!.idea/vcs.xml
|
||||||
|
.intellijPlatform/
|
||||||
|
|
||||||
# :pkl-core:makeIntelliJAntlrPluginHappy
|
.vscode/
|
||||||
gen/
|
|
||||||
PklLexer.tokens
|
.pkl-lsp/
|
||||||
|
|
||||||
|
.kotlin/
|
||||||
|
|||||||
Generated
+1
@@ -63,6 +63,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option name="IMPORT_LAYOUT_TABLE">
|
<option name="IMPORT_LAYOUT_TABLE">
|
||||||
<value>
|
<value>
|
||||||
|
<package name="" withSubpackages="true" static="false" module="true" />
|
||||||
<package name="" withSubpackages="true" static="true" />
|
<package name="" withSubpackages="true" static="true" />
|
||||||
<emptyLine />
|
<emptyLine />
|
||||||
<package name="" withSubpackages="true" static="false" />
|
<package name="" withSubpackages="true" static="false" />
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
+53
@@ -12,9 +12,61 @@
|
|||||||
<option name="REPORT_FIELDS" value="true" />
|
<option name="REPORT_FIELDS" value="true" />
|
||||||
</inspection_tool>
|
</inspection_tool>
|
||||||
<inspection_tool class="ClassCanBeRecord" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
<inspection_tool class="ClassCanBeRecord" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||||
|
<inspection_tool class="CustomRegExpInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="myConfigurations">
|
||||||
|
<list>
|
||||||
|
<RegExpInspectionConfiguration>
|
||||||
|
<option name="name" value="PklCliDirectProjectEvaluatorSettingsAccess" />
|
||||||
|
<option name="suppressId" value="PklCliDirectProjectEvaluatorSettingsAccess" />
|
||||||
|
<option name="uuid" value="dd497f47-d38f-3fab-9ed7-eabe699620c8" />
|
||||||
|
<option name="patterns">
|
||||||
|
<list>
|
||||||
|
<InspectionPattern>
|
||||||
|
<option name="regExp" value="project\?\.evaluatorSettings" />
|
||||||
|
<option name="_fileType" value="Kotlin" />
|
||||||
|
<option name="searchContext" value="ANY" />
|
||||||
|
<option name="replacement" value="evaluatorSettings" />
|
||||||
|
</InspectionPattern>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</RegExpInspectionConfiguration>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</inspection_tool>
|
||||||
<inspection_tool class="FieldMayBeFinal" enabled="true" level="INFORMATION" enabled_by_default="true">
|
<inspection_tool class="FieldMayBeFinal" enabled="true" level="INFORMATION" enabled_by_default="true">
|
||||||
<scope name="AllExceptTruffleAst" level="WARNING" enabled="true" />
|
<scope name="AllExceptTruffleAst" level="WARNING" enabled="true" />
|
||||||
</inspection_tool>
|
</inspection_tool>
|
||||||
|
<inspection_tool class="HttpUrlsUsage" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||||
|
<option name="ignoredUrls">
|
||||||
|
<list>
|
||||||
|
<option value="http://" />
|
||||||
|
<option value="http://0.0.0.0" />
|
||||||
|
<option value="http://127.0.0.1" />
|
||||||
|
<option value="http://activemq.apache.org/schema/" />
|
||||||
|
<option value="http://cxf.apache.org/schemas/" />
|
||||||
|
<option value="http://java.sun.com/" />
|
||||||
|
<option value="http://javafx.com/fxml" />
|
||||||
|
<option value="http://javafx.com/javafx/" />
|
||||||
|
<option value="http://json-schema.org/draft" />
|
||||||
|
<option value="http://localhost" />
|
||||||
|
<option value="http://maven.apache.org/POM/" />
|
||||||
|
<option value="http://maven.apache.org/xsd/" />
|
||||||
|
<option value="http://primefaces.org/ui" />
|
||||||
|
<option value="http://schema.cloudfoundry.org/spring/" />
|
||||||
|
<option value="http://schemas.xmlsoap.org/" />
|
||||||
|
<option value="http://tiles.apache.org/" />
|
||||||
|
<option value="http://www.ibm.com/webservices/xsd" />
|
||||||
|
<option value="http://www.jboss.com/xml/ns/" />
|
||||||
|
<option value="http://www.jboss.org/j2ee/schema/" />
|
||||||
|
<option value="http://www.springframework.org/schema/" />
|
||||||
|
<option value="http://www.springframework.org/security/tags" />
|
||||||
|
<option value="http://www.springframework.org/tags" />
|
||||||
|
<option value="http://www.thymeleaf.org" />
|
||||||
|
<option value="http://www.w3.org/" />
|
||||||
|
<option value="http://xmlns.jcp.org/" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</inspection_tool>
|
||||||
<inspection_tool class="JavadocBlankLines" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="JavadocBlankLines" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="NullableProblems" enabled="true" level="WARNING" enabled_by_default="false">
|
<inspection_tool class="NullableProblems" enabled="true" level="WARNING" enabled_by_default="false">
|
||||||
<scope name="AllExceptGenerated" level="WARNING" enabled="true">
|
<scope name="AllExceptGenerated" level="WARNING" enabled="true">
|
||||||
@@ -42,5 +94,6 @@
|
|||||||
<option name="processLiterals" value="true" />
|
<option name="processLiterals" value="true" />
|
||||||
<option name="processComments" value="true" />
|
<option name="processComments" value="true" />
|
||||||
</inspection_tool>
|
</inspection_tool>
|
||||||
|
<inspection_tool class="dd497f47-d38f-3fab-9ed7-eabe699620c8" enabled="true" level="ERROR" enabled_by_default="true" editorAttributes="ERRORS_ATTRIBUTES" />
|
||||||
</profile>
|
</profile>
|
||||||
</component>
|
</component>
|
||||||
Generated
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
<component name="DependencyValidationManager">
|
<component name="DependencyValidationManager">
|
||||||
<scope name="AllExceptTruffleAst" pattern="(src:*..*||test:*..*||lib:*..*)&&!src[pkl.pkl-core.main]:com.apple.pkl.core.ast..*&&!src[pkl.pkl-core.main]:com.apple.pkl.core.stdlib..*Nodes" />
|
<scope name="AllExceptTruffleAst" pattern="(src:*..*||test:*..*||lib:*..*)&&!src[pkl.pkl-core.main]:org.pkl.core.ast..*&&!src[pkl.pkl-core.main]:org.pkl.core.stdlib..*Nodes" />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
17.0
|
21
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Jen Basch <421772+HT154@users.noreply.github.com>
|
||||||
|
Jen Basch <jbasch@apple.com>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
== Code of Conduct
|
## Code of Conduct
|
||||||
|
|
||||||
=== Our Pledge
|
### Our Pledge
|
||||||
|
|
||||||
In the interest of fostering an open and welcoming environment, we as
|
In the interest of fostering an open and welcoming environment, we as
|
||||||
contributors and maintainers pledge to making participation in our
|
contributors and maintainers pledge to making participation in our
|
||||||
@@ -10,7 +10,7 @@ characteristics, gender identity and expression, level of experience,
|
|||||||
education, socio-economic status, nationality, personal appearance,
|
education, socio-economic status, nationality, personal appearance,
|
||||||
race, religion, or sexual identity and orientation.
|
race, religion, or sexual identity and orientation.
|
||||||
|
|
||||||
=== Our Standards
|
### Our Standards
|
||||||
|
|
||||||
Examples of behavior that contributes to creating a positive environment
|
Examples of behavior that contributes to creating a positive environment
|
||||||
include:
|
include:
|
||||||
@@ -33,7 +33,7 @@ electronic address, without explicit permission
|
|||||||
* Other conduct which could reasonably be considered inappropriate in a
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
professional setting
|
professional setting
|
||||||
|
|
||||||
=== Our Responsibilities
|
### Our Responsibilities
|
||||||
|
|
||||||
Project maintainers are responsible for clarifying the standards of
|
Project maintainers are responsible for clarifying the standards of
|
||||||
acceptable behavior and are expected to take appropriate and fair
|
acceptable behavior and are expected to take appropriate and fair
|
||||||
@@ -45,7 +45,7 @@ contributions that are not aligned to this Code of Conduct, or to ban
|
|||||||
temporarily or permanently any contributor for other behaviors that they
|
temporarily or permanently any contributor for other behaviors that they
|
||||||
deem inappropriate, threatening, offensive, or harmful.
|
deem inappropriate, threatening, offensive, or harmful.
|
||||||
|
|
||||||
=== Scope
|
### Scope
|
||||||
|
|
||||||
This Code of Conduct applies within all project spaces, and it also
|
This Code of Conduct applies within all project spaces, and it also
|
||||||
applies when an individual is representing the project or its community
|
applies when an individual is representing the project or its community
|
||||||
@@ -55,7 +55,7 @@ official social media account, or acting as an appointed representative
|
|||||||
at an online or offline event. Representation of a project may be
|
at an online or offline event. Representation of a project may be
|
||||||
further defined and clarified by project maintainers.
|
further defined and clarified by project maintainers.
|
||||||
|
|
||||||
=== Enforcement
|
### Enforcement
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may
|
Instances of abusive, harassing, or otherwise unacceptable behavior may
|
||||||
be reported by contacting the open source team at
|
be reported by contacting the open source team at
|
||||||
@@ -70,9 +70,8 @@ Project maintainers who do not follow or enforce the Code of Conduct in
|
|||||||
good faith may face temporary or permanent repercussions as determined
|
good faith may face temporary or permanent repercussions as determined
|
||||||
by other members of the project’s leadership.
|
by other members of the project’s leadership.
|
||||||
|
|
||||||
=== Attribution
|
### Attribution
|
||||||
|
|
||||||
This Code of Conduct is adapted from the
|
This Code of Conduct is adapted from the
|
||||||
https://www.contributor-covenant.org[Contributor Covenant], version 1.4,
|
[Contributor Covenant](https://www.contributor-covenant.org), version 1.4,
|
||||||
available at
|
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||||
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
|
||||||
+47
-22
@@ -2,20 +2,22 @@
|
|||||||
:uri-gng: https://gng.dsun.org
|
:uri-gng: https://gng.dsun.org
|
||||||
:uri-jenv: https://www.jenv.be
|
:uri-jenv: https://www.jenv.be
|
||||||
:uri-intellij: https://www.jetbrains.com/idea/download/
|
:uri-intellij: https://www.jetbrains.com/idea/download/
|
||||||
:uri-jdk: https://adoptopenjdk.net/releases.html
|
:uri-native-prerequisites-linux: https://www.graalvm.org/latest/getting-started/linux/#prerequisites-for-native-image-on-linux
|
||||||
|
:uri-native-prerequisites-windows: https://www.graalvm.org/latest/getting-started/windows/#prerequisites-for-native-image-on-windows
|
||||||
|
|
||||||
== Setup
|
== Setup
|
||||||
|
|
||||||
. (mandatory) Install {uri-jdk}[OpenJDK 11 HotSpot] (as long as we support JDK11)
|
. (mandatory) Install a JDK (JDK 21+ required).
|
||||||
. (mandatory) Setup Gradle on your system
|
. (recommended) Install {uri-intellij}[IntelliJ IDEA] +
|
||||||
. (recommended) Install {uri-intellij}[IntelliJ IDEA 2023.x] +
|
|
||||||
To import the project into IntelliJ, go to File->Open and select the project's root directory.
|
To import the project into IntelliJ, go to File->Open and select the project's root directory.
|
||||||
If the project is opened but not imported, look for a popup in the lower right corner
|
If the project is opened but not imported, look for a popup in the lower right corner
|
||||||
and click its "Import Gradle Project" link.
|
and click its "Import Gradle Project" link.
|
||||||
. (recommended) Install {uri-gng}[gng] +
|
. (recommended) Install {uri-gng}[gng] +
|
||||||
_gng_ enables to run Gradle commands with `gw` (instead of `./gradlew`) from any subdirectory.
|
_gng_ enables you to run Gradle commands with `gw` (instead of `./gradlew`) from any subdirectory.
|
||||||
|
. (recommended) Set up Git ignore-revs +
|
||||||
|
`git config blame.ignoreRevsFile .git-blame-ignore-revs`
|
||||||
. (recommended) Install {uri-jenv}[jenv] and plugins +
|
. (recommended) Install {uri-jenv}[jenv] and plugins +
|
||||||
_jenv_ use specific JDK versions in certain subdirectories. _Pkl_ comes with a `.java-version` file specifying JDK 17. +
|
_jenv_ uses specific JDK versions in certain subdirectories. _Pkl_ comes with a `.java-version` file specifying JDK 21. +
|
||||||
Enable _jenv_ plugins for better handling by `gradle`:
|
Enable _jenv_ plugins for better handling by `gradle`:
|
||||||
+
|
+
|
||||||
[source,shell]
|
[source,shell]
|
||||||
@@ -23,20 +25,38 @@ Enable _jenv_ plugins for better handling by `gradle`:
|
|||||||
jenv enable-plugin gradle
|
jenv enable-plugin gradle
|
||||||
jenv enable-plugin export
|
jenv enable-plugin export
|
||||||
----
|
----
|
||||||
|
. (optional) If you've named the original apple/pkl git repository something other than `origin`, set env var `PKL_ORIGINAL_REMOTE_NAME` to that name in your `.bashrc`, `.zshrc`, `config.fish` or however you manage your local environment.
|
||||||
|
+
|
||||||
|
This will allow spotless to pick the correct starting branch when formatting source code files.
|
||||||
|
Otherwise, you might see that _every_ file has its copyright year updated.
|
||||||
|
|
||||||
|
=== Additional Linux Setup
|
||||||
|
. (optional) To build the native executable (`./gradlew buildNative`),
|
||||||
|
install {uri-native-prerequisites-linux}[Prerequisites For Native Image on Linux].
|
||||||
|
|
||||||
|
=== Additional Windows Setup
|
||||||
|
. (optional) Go to `System->For developers` and enable `Developer Mode`.
|
||||||
|
Otherwise, some tests may fail due to insufficient file system privileges.
|
||||||
|
. (optional) To build the native executable (`./gradlew buildNative`),
|
||||||
|
install {uri-native-prerequisites-windows}[Prerequisites For Native Image on Windows].
|
||||||
|
|
||||||
== Common Build Commands
|
== Common Build Commands
|
||||||
|
|
||||||
[source,shell]
|
[source,shell]
|
||||||
----
|
----
|
||||||
gw clean
|
gw clean
|
||||||
gw test
|
gw test # run all tests except native executable tests
|
||||||
|
gw spotlessApply # fix code formatting
|
||||||
gw build # build everything except native executables
|
gw build # build everything except native executables
|
||||||
gw buildNative # build macOS executable on macOS,
|
gw pkl-cli:testNative # run native executable tests
|
||||||
# Linux and Alpine executables on Linux
|
gw pkl-cli:buildNative # build native executable for current platform
|
||||||
gw pkldoc # generate standard library docs
|
|
||||||
|
|
||||||
pkl-cli/build/executable/jpkl # run Java executable
|
pkl-cli/build/executable/jpkl # run Java executable
|
||||||
pkl-cli/build/executable/pkl-macos-amd64 # run Mac executable
|
pkl-cli/build/executable/pkl-macos-aarch64 # run Mac executable
|
||||||
|
pkl-cli/build/executable/pkl-macos-amd64 # run Intel Mac executable
|
||||||
|
pkl-cli/build/executable/pkl-linux-amd64 # run Linux executable
|
||||||
|
pkl-cli/build/executable/pkl-alpine-linux-amd64 # run Alpine Linux executable
|
||||||
|
pkl-cli/build/executable/pkl-windows-amd64.exe # run Windows executable
|
||||||
----
|
----
|
||||||
|
|
||||||
== Update Gradle
|
== Update Gradle
|
||||||
@@ -54,36 +74,41 @@ gw wrapper --gradle-version [version] --gradle-distribution-sha256-sum [sha]
|
|||||||
|
|
||||||
. (optional) Update _gradle/libs.version.toml_
|
. (optional) Update _gradle/libs.version.toml_
|
||||||
based on version information from https://search.maven.org, https://plugins.gradle.org, and GitHub repos
|
based on version information from https://search.maven.org, https://plugins.gradle.org, and GitHub repos
|
||||||
. Run `gw updateDependencyLocks`
|
|
||||||
. Validate changes with `gw build buildNative`
|
. Validate changes with `gw build buildNative`
|
||||||
. Review and commit the updated dependency lock files
|
|
||||||
|
|
||||||
== Code Generation
|
== Code Generation
|
||||||
|
|
||||||
* Truffle code generation is performed by Truffle's annotation processor, which runs as part of task `:pkl-core:compileJava`
|
* Truffle code generation is performed by Truffle's annotation processor, which runs as part of task `:pkl-core:compileJava`
|
||||||
** Output dir is `generated/truffle/`
|
** Output dir is `generated/truffle/`
|
||||||
* ANTLR code generation is performed by task `:pkl-core:generateGrammarSource`
|
|
||||||
** Output dir is `generated/antlr/`
|
== Remote JVM Debugging
|
||||||
|
|
||||||
|
To enable remote JVM debugging when running Gradle tasks (e.g. test), add the flag `-Djvmdebug=true`.
|
||||||
|
This will listen on port 5005.
|
||||||
|
|
||||||
|
Example: `./gradlew test -Djvmdebug=true`
|
||||||
|
|
||||||
|
== Snippet Test Plugin
|
||||||
|
|
||||||
|
There is an IntelliJ plugin meant for development on the Pkl project itself located in https://github.com/apple/pkl-project-commons[pkl-project-commons].
|
||||||
|
|
||||||
|
See https://github.com/apple/pkl-project-commons?tab=readme-ov-file#internal-intellij-plugin[its readme] for instructions on how to set it up.
|
||||||
|
|
||||||
== Resources
|
== Resources
|
||||||
|
|
||||||
=== ANTLR
|
For automated build setup examples see our https://github.com/apple/pkl/blob/main/.github/[GitHub Actions] jobs like our https://github.com/apple/pkl/blob/main/.github/jobs/BuildNativeJob.pkl[BuildNativeJob.pkl], where we build Pkl automatically.
|
||||||
|
|
||||||
* https://github.com/antlr/antlr4/blob/main/doc/index.md[Documentation]
|
|
||||||
* https://groups.google.com/forum/#!forum/antlr-discussion[Forums]
|
|
||||||
* https://github.com/mobileink/lab.clj.antlr/tree/main/doc[Some third-party docs]
|
|
||||||
|
|
||||||
=== Truffle
|
=== Truffle
|
||||||
|
|
||||||
* http://ssw.jku.at/Research/Projects/JVM/Truffle.html[Homepage]
|
* http://ssw.jku.at/Research/Projects/JVM/Truffle.html[Homepage]
|
||||||
* https://github.com/graalvm/truffle[GitHub]
|
* https://github.com/graalvm/truffle[GitHub]
|
||||||
* http://lafo.ssw.uni-linz.ac.at/javadoc/truffle/latest/[Javadoc]
|
* http://lafo.ssw.uni-linz.ac.at/javadoc/truffle/latest/[Javadoc]
|
||||||
* http://mail.openjdk.java.net/pipermail/graal-dev/[Mailing List]
|
* https://mail.openjdk.org/pipermail/graal-dev/[Mailing List]
|
||||||
* https://medium.com/@octskyward/graal-truffle-134d8f28fb69#.2db370y2g[Graal & Truffle (Article)]
|
* https://medium.com/@octskyward/graal-truffle-134d8f28fb69#.2db370y2g[Graal & Truffle (Article)]
|
||||||
* https://comserv.cs.ut.ee/home/files/Pool_ComputerScience_2016.pdf?study=ATILoputoo&reference=6319668E7151D556131810BC3F4A627D7FEF5F3B[Truffle Overview (see chapter 1)]
|
* https://comserv.cs.ut.ee/home/files/Pool_ComputerScience_2016.pdf?study=ATILoputoo&reference=6319668E7151D556131810BC3F4A627D7FEF5F3B[Truffle Overview (see chapter 1)]
|
||||||
* https://gist.github.com/smarr/d1f8f2101b5cc8e14e12[Truffle: Languages and Material]
|
* https://gist.github.com/smarr/d1f8f2101b5cc8e14e12[Truffle: Languages and Material]
|
||||||
* https://github.com/smarr/truffle-notes[Truffle Notes]
|
* https://github.com/smarr/truffle-notes[Truffle Notes]
|
||||||
* https://wiki.openjdk.java.net/display/Graal/Truffle+FAQ+and+Guidelines[Truffle FAQ]
|
* https://www.graalvm.org/latest/graalvm-as-a-platform/language-implementation-framework/[Truffle Language Implementation Framework]
|
||||||
|
|
||||||
=== Other Config Languages
|
=== Other Config Languages
|
||||||
|
|
||||||
|
|||||||
@@ -8,4 +8,5 @@ See link:CONTRIBUTING.adoc[] for general contribution guidelines.
|
|||||||
|
|
||||||
* https://github.com/bioball[Daniel Chao]
|
* https://github.com/bioball[Daniel Chao]
|
||||||
* https://github.com/stackoverflow[Islon Scherer]
|
* https://github.com/stackoverflow[Islon Scherer]
|
||||||
|
* https://github.com/HT154[Jen Basch]
|
||||||
* https://github.com/holzensp[Philip Hölzenspies]
|
* https://github.com/holzensp[Philip Hölzenspies]
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
Copyright © 2024 Apple Inc. and the Pkl project authors
|
Copyright © 2024-2026 Apple Inc. and the Pkl project authors
|
||||||
|
|
||||||
|
|
||||||
Portions of this software were originally based on 'SnakeYAML' developed by Andrey Somov.
|
Portions of this software were originally based on 'SnakeYAML' developed by Andrey Somov.
|
||||||
|
|||||||
+87
-1
@@ -1,4 +1,4 @@
|
|||||||
= Pkl
|
= image:.idea/icon.svg[Pkl,30] Pkl
|
||||||
|
|
||||||
:uri-homepage: https://pkl-lang.org
|
:uri-homepage: https://pkl-lang.org
|
||||||
:uri-docs: {uri-homepage}/main/current
|
:uri-docs: {uri-homepage}/main/current
|
||||||
@@ -11,6 +11,8 @@
|
|||||||
:uri-pkl-examples: https://pkl-lang.org/main/current/examples.html
|
:uri-pkl-examples: https://pkl-lang.org/main/current/examples.html
|
||||||
:uri-installation: https://pkl-lang.org/main/current/pkl-cli/index.html#installation
|
:uri-installation: https://pkl-lang.org/main/current/pkl-cli/index.html#installation
|
||||||
:uri-lang-reference: https://pkl-lang.org/main/current/language-reference/index.html
|
:uri-lang-reference: https://pkl-lang.org/main/current/language-reference/index.html
|
||||||
|
:uri-ci-artifacts: https://s01.oss.sonatype.org/content/groups/public/org/pkl-lang/
|
||||||
|
:uri-ci-pipeline: https://github.com/apple/pkl/actions
|
||||||
|
|
||||||
A configuration as code language with rich validation and tooling.
|
A configuration as code language with rich validation and tooling.
|
||||||
|
|
||||||
@@ -34,3 +36,87 @@ We'd love to hear from you!
|
|||||||
|
|
||||||
* Create an {uri-github-issue}[issue]
|
* Create an {uri-github-issue}[issue]
|
||||||
* Ask a question on {uri-github-discussions}[GitHub Discussions]
|
* Ask a question on {uri-github-discussions}[GitHub Discussions]
|
||||||
|
|
||||||
|
== Development
|
||||||
|
|
||||||
|
image:https://github.com/apple/pkl/actions/workflows/main.yml/badge.svg?style=svg["Build (main)", link="https://github.com/apple/pkl/actions/workflows/main.yml"]
|
||||||
|
|
||||||
|
* link:CONTRIBUTING.adoc[] for tips on pull requests and filing issues
|
||||||
|
* link:DEVELOPMENT.adoc[] for build instructions
|
||||||
|
* {uri-ci-artifacts}[Sonatype Repository] for the artifacts/binaries built by our {uri-ci-pipeline}[CI pipelines] (and those of our other tools and packages repositories).
|
||||||
|
|
||||||
|
== Pkl GitHub Repositories
|
||||||
|
|
||||||
|
[%autowidth]
|
||||||
|
|===
|
||||||
|
|Name |Description
|
||||||
|
|
||||||
|
|`apple/pkl`
|
||||||
|
|A configuration as code language with rich validation and tooling.
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-evolution[`apple/pkl-evolution`]
|
||||||
|
|Suggested Pkl Improvements, Changes, or Enhancements (SPICEs)
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-go[`apple/pkl-go`]
|
||||||
|
|Pkl bindings for the Go programming language
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-go-examples[`apple/pkl-go-examples`]
|
||||||
|
|Examples for using Pkl within Go applications
|
||||||
|
|
||||||
|
|https://github.com/apple/highlightjs-pkl[`apple/highlightjs-pkl`]
|
||||||
|
|Highlight.js syntax highlighting for Pkl
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-intellij[`apple/pkl-intellij`]
|
||||||
|
|JetBrains editor plugins providing Pkl language support
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-jvm-examples[`apple/pkl-jvm-examples`]
|
||||||
|
|Examples for using Pkl within JVM applications
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-k8s[`apple/pkl-k8s`]
|
||||||
|
|Templates for using Pkl with Kubernetes
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-k8s-examples[`apple/pkl-k8s-examples`]
|
||||||
|
|Examples for using Pkl with Kubernetes
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-lang.org[`apple/pkl-lang.org`]
|
||||||
|
|The pkl-lang.org website
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-lsp[`apple/pkl-lsp`]
|
||||||
|
|Language server for Pkl, implementing the server-side of the Language Server Protocol
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-neovim[`apple/pkl-neovim`]
|
||||||
|
|Pkl language support for Neovim
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-package-docs[`apple/pkl-package-docs`]
|
||||||
|
|Documentation for Pkl packages
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-pantry[`apple/pkl-pantry`]
|
||||||
|
|Shared Pkl packages
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-project-commons[`apple/pkl-project-commons`]
|
||||||
|
|Utility libraries for Pkl
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-readers[`apple/pkl-readers`]
|
||||||
|
|Shared Pkl https://pkl-lang.org/main/current/language-reference/index.html#external-readers[external reader] tools
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-spring[`apple/pkl-spring`]
|
||||||
|
|Spring Boot extension for configuring Boot apps with Pkl
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-swift[`apple/pkl-swift`]
|
||||||
|
|Pkl bindings for the Swift programming language
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-swift-examples[`apple/pkl-swift-examples`]
|
||||||
|
|Examples for using Pkl within Swift applications
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl-vscode[`apple/pkl-vscode`]
|
||||||
|
|Pkl language support for VS Code
|
||||||
|
|
||||||
|
|https://github.com/apple/pkl.tmbundle[`apple/pkl.tmbundle`]
|
||||||
|
|TextMate bundle for Pkl
|
||||||
|
|
||||||
|
|https://github.com/apple/tree-sitter-pkl[`apple/tree-sitter-pkl`]
|
||||||
|
|Tree-sitter parser for Pkl
|
||||||
|
|
||||||
|
|https://github.com/apple/rules_pkl[`apple/rules_pkl`]
|
||||||
|
|Bazel build rules for Pkl
|
||||||
|
|===
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
= Security
|
# Security
|
||||||
|
|
||||||
For the protection of our community, the Pkl team does not disclose, discuss, or confirm security issues until our investigation is complete and any necessary updates are generally available.
|
For the protection of our community, the Pkl team does not disclose, discuss, or confirm security issues until our investigation is complete and any necessary updates are generally available.
|
||||||
|
|
||||||
== Reporting a security vulnerability
|
## Reporting a security vulnerability
|
||||||
|
|
||||||
If you have discovered a security vulnerability within the Pkl project, please report it to us.
|
If you have discovered a security vulnerability within the Pkl project, please report it to us.
|
||||||
We welcome reports from everyone, including security researchers, developers, and users.
|
We welcome reports from everyone, including security researchers, developers, and users.
|
||||||
|
|
||||||
Security vulnerabilities may be reported on the link:https://security.apple.com/submit[Report a vulnerability] form.
|
Security vulnerabilities may be reported on the [Report a vulnerability](https://security.apple.com/submit) form.
|
||||||
When submitting a vulnerability, select "Apple Devices and Software" as the affected platform, and "Open Source" as the affected area.
|
When submitting a vulnerability, select "Apple Devices and Software" as the affected platform, and "Open Source" as the affected area.
|
||||||
|
|
||||||
For more information, see https://pkl-lang.org/security.html.
|
For more information, see https://pkl-lang.org/security.html.
|
||||||
+21
-32
@@ -26,18 +26,7 @@ Copyright © 2017 Square, Inc.
|
|||||||
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||||
|
|
||||||
4) ANTLR 4 Runtime (Optimized) (http://tunnelvisionlabs.com)
|
4) GeantyRef (https://github.com/leangen/geantyref)
|
||||||
POM License: The BSD License - http://www.antlr.org/license.html
|
|
||||||
|
|
||||||
Copyright (c) 2012 Terence Parr and Sam Harwell
|
|
||||||
All rights reserved.
|
|
||||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
||||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
||||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
||||||
Neither the name of the author 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 OWNER 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.
|
|
||||||
|
|
||||||
5) GeantyRef (https://github.com/leangen/geantyref)
|
|
||||||
Manifest license URL: https://www.apache.org/licenses/LICENSE-2.0
|
Manifest license URL: https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
||||||
@@ -47,7 +36,7 @@ Copyright © 2017 Kaqqao
|
|||||||
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||||
|
|
||||||
6) commonmark-java core
|
5) commonmark-java core
|
||||||
POM License: The 2-Clause BSD License - https://opensource.org/licenses/BSD-2-Clause
|
POM License: The 2-Clause BSD License - https://opensource.org/licenses/BSD-2-Clause
|
||||||
|
|
||||||
Embedded license:
|
Embedded license:
|
||||||
@@ -78,7 +67,7 @@ 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
|
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.
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
7) commonmark-java extension for tables
|
6) commonmark-java extension for tables
|
||||||
POM License: The 2-Clause BSD License - https://opensource.org/licenses/BSD-2-Clause
|
POM License: The 2-Clause BSD License - https://opensource.org/licenses/BSD-2-Clause
|
||||||
|
|
||||||
Embedded license:
|
Embedded license:
|
||||||
@@ -109,7 +98,7 @@ 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
|
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.
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
8) jansi (http://fusesource.com/)
|
7) jansi (http://fusesource.com/)
|
||||||
Manifest license URL: https://www.apache.org/licenses/LICENSE-2.0
|
Manifest license URL: https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
||||||
@@ -119,13 +108,13 @@ Copyright © Fusesource 2023
|
|||||||
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||||
|
|
||||||
9) Graal Sdk (https://github.com/oracle/graal)
|
8) Graal Sdk (https://github.com/oracle/graal)
|
||||||
POM License: Universal Permissive License, Version 1.0 - http://opensource.org/licenses/UPL
|
POM License: Universal Permissive License, Version 1.0 - http://opensource.org/licenses/UPL
|
||||||
|
|
||||||
10) Truffle API (http://openjdk.java.net/projects/graal)
|
9) Truffle API (http://openjdk.java.net/projects/graal)
|
||||||
POM License: Universal Permissive License, Version 1.0 - http://opensource.org/licenses/UPL
|
POM License: Universal Permissive License, Version 1.0 - http://opensource.org/licenses/UPL
|
||||||
|
|
||||||
11) IntelliJ IDEA Annotations (http://www.jetbrains.org)
|
10) IntelliJ IDEA Annotations (http://www.jetbrains.org)
|
||||||
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
The Apache License
|
The Apache License
|
||||||
@@ -133,7 +122,7 @@ Copyright © Jetbrains 2023
|
|||||||
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||||
|
|
||||||
12) kotlin-reflect (https://kotlinlang.org/)
|
11) kotlin-reflect (https://kotlinlang.org/)
|
||||||
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
The Apache License
|
The Apache License
|
||||||
@@ -141,7 +130,7 @@ Copyright © Wuseal 2018
|
|||||||
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||||
|
|
||||||
13) kotlin-stdlib (https://kotlinlang.org/)
|
12) kotlin-stdlib (https://kotlinlang.org/)
|
||||||
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
The Apache License
|
The Apache License
|
||||||
@@ -149,7 +138,7 @@ Copyright © 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contribu
|
|||||||
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||||
|
|
||||||
14) kotlin-stdlib-common (https://kotlinlang.org/)
|
13) kotlin-stdlib-common (https://kotlinlang.org/)
|
||||||
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
The Apache License
|
The Apache License
|
||||||
@@ -157,7 +146,7 @@ Copyright © 2023 Kotlin Team
|
|||||||
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||||
|
|
||||||
15) kotlin-stdlib-jdk7 (https://kotlinlang.org/)
|
14) kotlin-stdlib-jdk7 (https://kotlinlang.org/)
|
||||||
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
The Apache License
|
The Apache License
|
||||||
@@ -165,7 +154,7 @@ Copyright © 2023 Kotlin Team
|
|||||||
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||||
|
|
||||||
16) kotlin-stdlib-jdk8 (https://kotlinlang.org/)
|
15) kotlin-stdlib-jdk8 (https://kotlinlang.org/)
|
||||||
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
The Apache License
|
The Apache License
|
||||||
@@ -173,7 +162,7 @@ Copyright © 2023 Kotlin Team
|
|||||||
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||||
|
|
||||||
17) kotlinx.html (https://github.com/Kotlin/kotlinx.html)
|
16) kotlinx.html (https://github.com/Kotlin/kotlinx.html)
|
||||||
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
The Apache License
|
The Apache License
|
||||||
@@ -181,7 +170,7 @@ Copyright © 2017 Yole
|
|||||||
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||||
|
|
||||||
18) kotlinx-serialization-core (https://github.com/Kotlin/kotlinx.serialization)
|
17) kotlinx-serialization-core (https://github.com/Kotlin/kotlinx.serialization)
|
||||||
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
The Apache License
|
The Apache License
|
||||||
@@ -189,7 +178,7 @@ The Apache License
|
|||||||
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||||
|
|
||||||
19) kotlinx-serialization-json (https://github.com/Kotlin/kotlinx.serialization)
|
18) kotlinx-serialization-json (https://github.com/Kotlin/kotlinx.serialization)
|
||||||
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
The Apache License
|
The Apache License
|
||||||
@@ -197,7 +186,7 @@ The Apache License
|
|||||||
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||||
|
|
||||||
20) JLine Reader
|
19) JLine Reader
|
||||||
Manifest license URL: https://opensource.org/licenses/BSD-3-Clause
|
Manifest license URL: https://opensource.org/licenses/BSD-3-Clause
|
||||||
|
|
||||||
POM License: The 3-Clause BSD License - https://opensource.org/licenses/BSD-3-Clause
|
POM License: The 3-Clause BSD License - https://opensource.org/licenses/BSD-3-Clause
|
||||||
@@ -216,7 +205,7 @@ 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 OWNER 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.
|
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 OWNER 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.
|
||||||
|
|
||||||
21) JLine Terminal
|
20) JLine Terminal
|
||||||
Manifest license URL: https://opensource.org/licenses/BSD-3-Clause
|
Manifest license URL: https://opensource.org/licenses/BSD-3-Clause
|
||||||
|
|
||||||
POM License: The 3-Clause BSD License - https://opensource.org/licenses/BSD-3-Clause
|
POM License: The 3-Clause BSD License - https://opensource.org/licenses/BSD-3-Clause
|
||||||
@@ -235,7 +224,7 @@ 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 OWNER 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.
|
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 OWNER 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.
|
||||||
|
|
||||||
22) JLine JANSI Terminal
|
21) JLine JANSI Terminal
|
||||||
Manifest license URL: https://opensource.org/licenses/BSD-3-Clause
|
Manifest license URL: https://opensource.org/licenses/BSD-3-Clause
|
||||||
|
|
||||||
POM License: The 3-Clause BSD License - https://opensource.org/licenses/BSD-3-Clause
|
POM License: The 3-Clause BSD License - https://opensource.org/licenses/BSD-3-Clause
|
||||||
@@ -254,7 +243,7 @@ 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 OWNER 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.
|
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 OWNER 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.
|
||||||
|
|
||||||
23) msgpack-core (https://msgpack.org/)
|
22) msgpack-core (https://msgpack.org/)
|
||||||
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
The Apache License
|
The Apache License
|
||||||
@@ -262,7 +251,7 @@ Copyright © 2016 Sadayuki Furuhashi, Muga Nishizawa, Taro L. Saito, Mitsunori K
|
|||||||
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||||
|
|
||||||
24) Paguro (https://github.com/GlenKPeterson/Paguro)
|
23) Paguro (https://github.com/GlenKPeterson/Paguro)
|
||||||
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
The Apache License
|
The Apache License
|
||||||
@@ -364,7 +353,7 @@ Everyone is permitted to copy and distribute copies of this Agreement, but in or
|
|||||||
|
|
||||||
This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
|
This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
|
||||||
|
|
||||||
25) SnakeYAML Engine (http://www.snakeyaml.org)
|
24) SnakeYAML Engine (http://www.snakeyaml.org)
|
||||||
Manifest license URL: https://www.apache.org/licenses/LICENSE-2.0
|
Manifest license URL: https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
POM License: Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|||||||
+31
-20
@@ -1,31 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
plugins {
|
plugins {
|
||||||
pklAllProjects
|
id("pklAllProjects")
|
||||||
pklJavaLibrary
|
id("pklJavaLibrary")
|
||||||
pklGraalVm
|
|
||||||
id("me.champeau.jmh")
|
id("me.champeau.jmh")
|
||||||
}
|
}
|
||||||
|
|
||||||
val truffle: Configuration by configurations.creating
|
val truffle: Configuration by configurations.creating
|
||||||
val graal: Configuration by configurations.creating
|
val graal: Configuration by configurations.creating
|
||||||
|
|
||||||
@Suppress("UnstableApiUsage")
|
|
||||||
dependencies {
|
dependencies {
|
||||||
jmh(project(":pkl-core"))
|
jmh(projects.pklCore)
|
||||||
// necessary because antlr4-runtime is declared as implementation dependency in pkl-core.gradle
|
jmh(projects.pklCommonsTest)
|
||||||
jmh(libs.antlrRuntime)
|
jmh(projects.pklParser)
|
||||||
truffle(libs.truffleApi)
|
truffle(libs.truffleApi)
|
||||||
graal(libs.graalCompiler)
|
graal(libs.graalCompiler)
|
||||||
}
|
}
|
||||||
|
|
||||||
jmh {
|
jmh {
|
||||||
//include = ["fib_class_java"]
|
// include = ["fib_class_java"]
|
||||||
//include = ["fib_class_constrained1", "fib_class_constrained2"]
|
// include = ["fib_class_constrained1", "fib_class_constrained2"]
|
||||||
jmhVersion.set(libs.versions.jmh)
|
jmhVersion.set(libs.versions.jmh)
|
||||||
// jvmArgsAppend = "-Dgraal.TruffleCompilationExceptionsAreFatal=true " +
|
// jvmArgsAppend = "-Dgraal.TruffleCompilationExceptionsAreFatal=true " +
|
||||||
// "-Dgraal.Dump=Truffle,TruffleTree -Dgraal.TraceTruffleCompilation=true " +
|
// "-Dgraal.Dump=Truffle,TruffleTree -Dgraal.TraceTruffleCompilation=true " +
|
||||||
// "-Dgraal.TruffleFunctionInlining=false"
|
// "-Dgraal.TruffleFunctionInlining=false"
|
||||||
jvm.set("${buildInfo.graalVm.baseDir}/bin/java")
|
jvm.set("${buildInfo.graalVmAmd64.baseDir}/bin/java")
|
||||||
// see: https://docs.oracle.com/en/graalvm/enterprise/20/docs/graalvm-as-a-platform/implement-language/#disable-class-path-separation
|
// see:
|
||||||
|
// https://docs.oracle.com/en/graalvm/enterprise/20/docs/graalvm-as-a-platform/implement-language/#disable-class-path-separation
|
||||||
jvmArgs.set(
|
jvmArgs.set(
|
||||||
listOf(
|
listOf(
|
||||||
// one JVM arg per list element doesn't work, but the following does
|
// one JVM arg per list element doesn't work, but the following does
|
||||||
@@ -33,16 +47,13 @@ jmh {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
includeTests.set(false)
|
includeTests.set(false)
|
||||||
//threads = Runtime.runtime.availableProcessors() / 2 + 1
|
// threads = Runtime.runtime.availableProcessors() / 2 + 1
|
||||||
//synchronizeIterations = false
|
// synchronizeIterations = false
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named("jmh") {
|
tasks.named("jmh") { dependsOn(":installGraalVmAmd64") }
|
||||||
dependsOn(":installGraalVm")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prevent this error which occurs when building in IntelliJ:
|
// Prevent this error which occurs when building in IntelliJ:
|
||||||
// "Entry org/pkl/core/fib_class_typed.pkl is a duplicate but no duplicate handling strategy has been set."
|
// "Entry org/pkl/core/fib_class_typed.pkl is a duplicate but no duplicate handling strategy has
|
||||||
tasks.processJmhResources {
|
// been set."
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
tasks.processJmhResources { duplicatesStrategy = DuplicatesStrategy.EXCLUDE }
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
# This is a Gradle generated file for dependency locking.
|
|
||||||
# Manual edits can break the build and are not advised.
|
|
||||||
# This file is expected to be part of source control.
|
|
||||||
com.tunnelvisionlabs:antlr4-runtime:4.9.0=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
|
||||||
net.bytebuddy:byte-buddy:1.12.21=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
|
||||||
org.apache.commons:commons-math3:3.2=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
|
||||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.graalvm.compiler:compiler:22.3.1=graal
|
|
||||||
org.graalvm.sdk:graal-sdk:22.3.1=graal,jmh,jmhRuntimeClasspath,truffle
|
|
||||||
org.graalvm.truffle:truffle-api:22.3.1=graal,jmh,jmhRuntimeClasspath,truffle
|
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:1.7.10=kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-reflect:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-script-runtime:1.7.10=kotlinCompilerClasspath,kotlinCompilerPluginClasspathJmh,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-common:1.7.10=kotlinCompilerPluginClasspathJmh,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.7.10=kotlinCompilerPluginClasspathJmh,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.7.10=kotlinCompilerPluginClasspathJmh,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-jvm:1.7.10=kotlinCompilerPluginClasspathJmh,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=kotlinCompilerClasspath,kotlinCompilerPluginClasspathJmh,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-stdlib:1.7.10=kotlinCompilerClasspath,kotlinCompilerPluginClasspathJmh,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.jetbrains:annotations:13.0=kotlinCompilerClasspath,kotlinCompilerPluginClasspathJmh,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.junit.jupiter:junit-jupiter-api:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.junit.jupiter:junit-jupiter-engine:5.9.3=testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.junit.jupiter:junit-jupiter-params:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.junit.platform:junit-platform-commons:1.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.junit.platform:junit-platform-engine:1.9.3=testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.junit:junit-bom:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.openjdk.jmh:jmh-core:1.36=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
|
||||||
org.openjdk.jmh:jmh-generator-asm:1.36=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
|
||||||
org.openjdk.jmh:jmh-generator-bytecode:1.36=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
|
||||||
org.openjdk.jmh:jmh-generator-reflection:1.36=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
|
||||||
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.organicdesign:Paguro:3.10.3=jmh,jmhRuntimeClasspath
|
|
||||||
org.ow2.asm:asm:9.0=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
|
||||||
org.snakeyaml:snakeyaml-engine:2.5=jmh,jmhRuntimeClasspath
|
|
||||||
empty=annotationProcessor,apiDependenciesMetadata,archives,compile,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,default,implementationDependenciesMetadata,intransitiveDependenciesMetadata,jmhAnnotationProcessor,jmhApiDependenciesMetadata,jmhCompile,jmhCompileOnly,jmhCompileOnlyDependenciesMetadata,jmhIntransitiveDependenciesMetadata,jmhKotlinScriptDef,jmhKotlinScriptDefExtensions,jmhRuntime,jmhRuntimeOnlyDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeClasspath,runtimeOnlyDependenciesMetadata,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -23,6 +23,8 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import org.openjdk.jmh.annotations.*;
|
import org.openjdk.jmh.annotations.*;
|
||||||
import org.openjdk.jmh.util.TempFile;
|
import org.openjdk.jmh.util.TempFile;
|
||||||
import org.openjdk.jmh.util.TempFileManager;
|
import org.openjdk.jmh.util.TempFileManager;
|
||||||
|
import org.pkl.core.evaluatorSettings.TraceMode;
|
||||||
|
import org.pkl.core.http.HttpClient;
|
||||||
import org.pkl.core.module.ModuleKeyFactories;
|
import org.pkl.core.module.ModuleKeyFactories;
|
||||||
import org.pkl.core.repl.ReplRequest;
|
import org.pkl.core.repl.ReplRequest;
|
||||||
import org.pkl.core.repl.ReplResponse;
|
import org.pkl.core.repl.ReplResponse;
|
||||||
@@ -39,6 +41,7 @@ public class ListSort {
|
|||||||
private static final ReplServer repl =
|
private static final ReplServer repl =
|
||||||
new ReplServer(
|
new ReplServer(
|
||||||
SecurityManagers.defaultManager,
|
SecurityManagers.defaultManager,
|
||||||
|
HttpClient.dummyClient(),
|
||||||
Loggers.stdErr(),
|
Loggers.stdErr(),
|
||||||
List.of(ModuleKeyFactories.standardLibrary),
|
List.of(ModuleKeyFactories.standardLibrary),
|
||||||
List.of(ResourceReaders.file()),
|
List.of(ResourceReaders.file()),
|
||||||
@@ -48,7 +51,9 @@ public class ListSort {
|
|||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
IoUtils.getCurrentWorkingDir(),
|
IoUtils.getCurrentWorkingDir(),
|
||||||
StackFrameTransformers.defaultTransformer);
|
StackFrameTransformers.defaultTransformer,
|
||||||
|
false,
|
||||||
|
TraceMode.COMPACT);
|
||||||
private static final List<Object> list = new ArrayList<>(100000);
|
private static final List<Object> list = new ArrayList<>(100000);
|
||||||
|
|
||||||
static {
|
static {
|
||||||
@@ -109,10 +114,10 @@ public class ListSort {
|
|||||||
// append `.length` to avoid rendering the list
|
// append `.length` to avoid rendering the list
|
||||||
new ReplRequest.Eval("sort", "nums.sortWith(cmp).length", false, false))
|
new ReplRequest.Eval("sort", "nums.sortWith(cmp).length", false, false))
|
||||||
.get(0);
|
.get(0);
|
||||||
if (!(response instanceof ReplResponse.EvalSuccess)) {
|
if (!(response instanceof ReplResponse.EvalSuccess success)) {
|
||||||
throw new AssertionError(response);
|
throw new AssertionError(response);
|
||||||
}
|
}
|
||||||
return ((ReplResponse.EvalSuccess) response).getResult();
|
return success.getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
// note that this is an uneven comparison
|
// note that this is an uneven comparison
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -15,8 +15,17 @@
|
|||||||
*/
|
*/
|
||||||
package org.pkl.core.parser;
|
package org.pkl.core.parser;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UncheckedIOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import org.openjdk.jmh.annotations.*;
|
import org.openjdk.jmh.annotations.*;
|
||||||
|
import org.pkl.commons.test.FileTestUtils;
|
||||||
|
import org.pkl.commons.test.FileTestUtilsKt;
|
||||||
|
import org.pkl.core.Release;
|
||||||
|
import org.pkl.core.util.IoUtils;
|
||||||
|
import org.pkl.parser.Parser;
|
||||||
|
import org.pkl.parser.ParserError;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
@Warmup(iterations = 5, time = 2)
|
@Warmup(iterations = 5, time = 2)
|
||||||
@@ -24,36 +33,33 @@ import org.openjdk.jmh.annotations.*;
|
|||||||
@OutputTimeUnit(TimeUnit.SECONDS)
|
@OutputTimeUnit(TimeUnit.SECONDS)
|
||||||
@Fork(1)
|
@Fork(1)
|
||||||
public class ParserBenchmark {
|
public class ParserBenchmark {
|
||||||
// One-time execution of this code took ~10s until moving rule alternative
|
|
||||||
// for parenthesized expression after alternative for anonymous function.
|
|
||||||
@Benchmark
|
@Benchmark
|
||||||
public void run() {
|
public void parseStdlib() {
|
||||||
new Parser()
|
for (var stdlibModule : Release.current().standardLibrary().modules()) {
|
||||||
.parseModule(
|
try {
|
||||||
"a1 {\n"
|
var moduleSource =
|
||||||
+ " a2 {\n"
|
IoUtils.readClassPathResourceAsString(
|
||||||
+ " a3 {\n"
|
getClass(), "/org/pkl/core/stdlib/%s.pkl".formatted(stdlibModule.substring(4)));
|
||||||
+ " a4 {\n"
|
new Parser().parseModule(moduleSource);
|
||||||
+ " a5 {\n"
|
} catch (IOException e) {
|
||||||
+ " a6 {\n"
|
throw new UncheckedIOException(e);
|
||||||
+ " a7 {\n"
|
}
|
||||||
+ " a8 {\n"
|
}
|
||||||
+ " a9 {\n"
|
}
|
||||||
+ " a10 {\n"
|
|
||||||
+ " a11 {\n"
|
@Benchmark
|
||||||
+ " a12 {\n"
|
public void parseSnippetTests() {
|
||||||
+ " a13 = map(map(map((x) -> 1)))\n"
|
var snippetTestDir =
|
||||||
+ " }\n"
|
FileTestUtils.getRootProjectDir()
|
||||||
+ " }\n"
|
.resolve("pkl-core/src/test/files/LanguageSnippetTests/input");
|
||||||
+ " }\n"
|
for (var snippet : FileTestUtilsKt.listFilesRecursively(snippetTestDir)) {
|
||||||
+ " }\n"
|
try {
|
||||||
+ " }\n"
|
var moduleSource = Files.readString(snippet);
|
||||||
+ " }\n"
|
new Parser().parseModule(moduleSource);
|
||||||
+ " }\n"
|
} catch (IOException e) {
|
||||||
+ " }\n"
|
throw new UncheckedIOException(e);
|
||||||
+ " }\n"
|
} catch (ParserError ignore) {
|
||||||
+ " }\n"
|
}
|
||||||
+ " }\n"
|
}
|
||||||
+ "}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
`kotlin-dsl`
|
||||||
|
`jvm-toolchains`
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To avoid the provisioning of multiple JDKs and other build issues, keep this value in sync with
|
||||||
|
* the JVM toolchain versions in `BuildInfo.kt` and `gradle-daemon-jvm.properties`.
|
||||||
|
*/
|
||||||
|
val toolchainVersion = 25
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(libs.downloadTaskPlugin)
|
||||||
|
implementation(libs.errorPronePlugin)
|
||||||
|
implementation(libs.nullawayPlugin)
|
||||||
|
implementation(libs.spotlessPlugin)
|
||||||
|
implementation(libs.kotlinPlugin) { exclude(module = "kotlin-android-extensions") }
|
||||||
|
implementation(libs.shadowPlugin)
|
||||||
|
|
||||||
|
// fix from the Gradle team: makes version catalog symbols available in build scripts
|
||||||
|
// see here for more: https://github.com/gradle/gradle/issues/15383
|
||||||
|
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
|
||||||
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
toolchain {
|
||||||
|
languageVersion = JavaLanguageVersion.of(toolchainVersion)
|
||||||
|
vendor = JvmVendorSpec.ADOPTIUM
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<JavaCompile>().configureEach { options.release = toolchainVersion }
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
jvmToolchain(toolchainVersion)
|
||||||
|
compilerOptions {
|
||||||
|
jvmTarget = JvmTarget.fromTarget(toolchainVersion.toString())
|
||||||
|
freeCompilerArgs.add("-Xjdk-release=$toolchainVersion")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
@file:Suppress("UnstableApiUsage")
|
||||||
|
|
||||||
|
rootProject.name = "build-logic"
|
||||||
|
|
||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
gradlePluginPortal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" }
|
||||||
|
|
||||||
|
// makes ~/.gradle/init.gradle unnecessary and ~/.gradle/gradle.properties optional
|
||||||
|
dependencyResolutionManagement {
|
||||||
|
// use same version catalog as main build
|
||||||
|
versionCatalogs { register("libs") { from(files("../gradle/libs.versions.toml")) } }
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
|
||||||
|
mavenCentral()
|
||||||
|
gradlePluginPortal()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,427 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
@file:Suppress("MemberVisibilityCanBePrivate")
|
||||||
|
|
||||||
|
import java.io.File
|
||||||
|
import org.gradle.api.Project
|
||||||
|
import org.gradle.api.artifacts.VersionCatalog
|
||||||
|
import org.gradle.api.artifacts.VersionCatalogsExtension
|
||||||
|
import org.gradle.api.attributes.Category
|
||||||
|
import org.gradle.api.provider.Provider
|
||||||
|
import org.gradle.api.tasks.TaskProvider
|
||||||
|
import org.gradle.api.tasks.testing.Test
|
||||||
|
import org.gradle.internal.extensions.stdlib.capitalized
|
||||||
|
import org.gradle.jvm.toolchain.*
|
||||||
|
import org.gradle.kotlin.dsl.*
|
||||||
|
import org.gradle.kotlin.dsl.support.serviceOf
|
||||||
|
import org.gradle.process.CommandLineArgumentProvider
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JVM bytecode target; this is pinned at a reasonable version, because downstream JVM projects
|
||||||
|
* which consume Pkl will need a minimum bytecode level at or above this one.
|
||||||
|
*
|
||||||
|
* Kotlin and Java need matching bytecode targets, so this is expressed as a build setting and
|
||||||
|
* constant default. To override, pass `-DpklJdkToolchain=X` to the Gradle command line, where X is
|
||||||
|
* a major Java version.
|
||||||
|
*/
|
||||||
|
const val PKL_JVM_TARGET_DEFAULT_MAXIMUM = 17
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Pkl build requires JDK 25+; otherwise, NullAway will not work correctly.
|
||||||
|
*
|
||||||
|
* This is a build-time requirement, not a runtime requirement. To avoid the provisioning of
|
||||||
|
* multiple JDKs and other build issues, keep this value in sync with the JVM toolchain versions in
|
||||||
|
* `build-logic/build.gradle.kts` and `gradle-daemon-jvm.properties`.
|
||||||
|
*/
|
||||||
|
const val PKL_JDK_VERSION_MIN = 25
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The JDK minimum is set to match the bytecode minimum, to guarantee that fat JARs work against the
|
||||||
|
* earliest supported bytecode target.
|
||||||
|
*/
|
||||||
|
const val PKL_TEST_JDK_MINIMUM = PKL_JVM_TARGET_DEFAULT_MAXIMUM
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Maximum JDK version which Pkl is tested with; this should be bumped when new JDK releases are
|
||||||
|
* issued.
|
||||||
|
*/
|
||||||
|
const val PKL_TEST_JDK_MAXIMUM = 26
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If `true`, all JDK releases between [PKL_TEST_JDK_MINIMUM] and [PKL_TEST_JDK_MAXIMUM] are tested.
|
||||||
|
* If `false`, only LTS releases within that range are tested. To override, pass
|
||||||
|
* `-DpklTestAllJdks=true` on the Gradle command line.
|
||||||
|
*/
|
||||||
|
const val PKL_TEST_ALL_JDKS = false
|
||||||
|
|
||||||
|
// `buildInfo` in main build scripts
|
||||||
|
// `project.extensions.getByType<BuildInfo>()` in precompiled script plugins
|
||||||
|
open class BuildInfo(private val project: Project) {
|
||||||
|
inner class GraalVm(val arch: String) {
|
||||||
|
val homeDir: String by lazy {
|
||||||
|
System.getenv("GRAALVM_HOME") ?: "${System.getProperty("user.home")}/.graalvm"
|
||||||
|
}
|
||||||
|
|
||||||
|
val version: String by lazy { libs.findVersion("graalVm").get().toString() }
|
||||||
|
|
||||||
|
val graalVmJdkVersion: String by lazy { libs.findVersion("graalVmJdkVersion").get().toString() }
|
||||||
|
|
||||||
|
val osName: String by lazy {
|
||||||
|
when {
|
||||||
|
os.isMacOsX -> "macos"
|
||||||
|
os.isLinux -> "linux"
|
||||||
|
os.isWindows -> "windows"
|
||||||
|
else -> throw RuntimeException("${os.familyName} is not supported.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val baseName: String by lazy {
|
||||||
|
"graalvm-community-jdk-${graalVmJdkVersion}_${osName}-${arch}_bin"
|
||||||
|
}
|
||||||
|
|
||||||
|
val downloadUrl: String by lazy {
|
||||||
|
val extension = if (os.isWindows) "zip" else "tar.gz"
|
||||||
|
"https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${graalVmJdkVersion}/$baseName.$extension"
|
||||||
|
}
|
||||||
|
|
||||||
|
val downloadFile: File by lazy {
|
||||||
|
val extension = if (os.isWindows) "zip" else "tar.gz"
|
||||||
|
File(homeDir, "${baseName}.$extension")
|
||||||
|
}
|
||||||
|
|
||||||
|
val installDir: File by lazy { File(homeDir, baseName) }
|
||||||
|
|
||||||
|
val baseDir: String by lazy {
|
||||||
|
if (os.isMacOsX) "$installDir/Contents/Home" else installDir.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The target architecture to build, defaulting to the system architecture. */
|
||||||
|
val targetArch by lazy { System.getProperty("pkl.targetArch") ?: arch }
|
||||||
|
|
||||||
|
/** Tells if this is a cross-arch build (e.g. targeting amd64 when on an aarch64 machine). */
|
||||||
|
val isCrossArch by lazy { arch != targetArch }
|
||||||
|
|
||||||
|
/** Tells if cross-arch builds are supported on this machine. */
|
||||||
|
val isCrossArchSupported by lazy { os.isMacOsX }
|
||||||
|
|
||||||
|
/** Whether to build native executables using the musl toolchain or not. */
|
||||||
|
val musl: Boolean by lazy { java.lang.Boolean.getBoolean("pkl.musl") }
|
||||||
|
|
||||||
|
/** Same logic as [org.gradle.internal.os.OperatingSystem#arch], which is protected. */
|
||||||
|
val arch: String by lazy {
|
||||||
|
when (val arch = System.getProperty("os.arch")) {
|
||||||
|
"x86" -> "i386"
|
||||||
|
"x86_64" -> "amd64"
|
||||||
|
"powerpc" -> "ppc"
|
||||||
|
else -> arch
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val graalVmAarch64: GraalVm = GraalVm("aarch64")
|
||||||
|
|
||||||
|
val graalVmAmd64: GraalVm = GraalVm("x64")
|
||||||
|
|
||||||
|
val isCiBuild: Boolean by lazy { System.getenv("CI") != null }
|
||||||
|
|
||||||
|
val isReleaseBuild: Boolean by lazy { java.lang.Boolean.getBoolean("releaseBuild") }
|
||||||
|
|
||||||
|
val isNativeArch: Boolean by lazy { java.lang.Boolean.getBoolean("nativeArch") }
|
||||||
|
|
||||||
|
val jvmTarget: Int by lazy {
|
||||||
|
System.getProperty("pklJvmTarget")?.toInt() ?: PKL_JVM_TARGET_DEFAULT_MAXIMUM
|
||||||
|
}
|
||||||
|
|
||||||
|
// JPMS exports for Truffle; needed on some versions of Java, and transitively within some JARs.
|
||||||
|
private val jpmsExports =
|
||||||
|
arrayOf(
|
||||||
|
"org.graalvm.truffle/com.oracle.truffle.api.exception=ALL-UNNAMED",
|
||||||
|
"org.graalvm.truffle/com.oracle.truffle.api=ALL-UNNAMED",
|
||||||
|
"org.graalvm.truffle/com.oracle.truffle.api.nodes=ALL-UNNAMED",
|
||||||
|
"org.graalvm.truffle/com.oracle.truffle.api.source=ALL-UNNAMED",
|
||||||
|
)
|
||||||
|
|
||||||
|
// Extra JPMS modules forced onto the module path via `--add-modules` in some cases.
|
||||||
|
private val jpmsAddModules = arrayOf("jdk.unsupported")
|
||||||
|
|
||||||
|
// Formats `jpmsExports` for use in JAR manifest attributes.
|
||||||
|
val jpmsExportsForJarManifest: String by lazy {
|
||||||
|
jpmsExports.joinToString(" ") { it.substringBefore("=") }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Formats `jpmsExports` for use on the command line with `--add-exports`.
|
||||||
|
val jpmsExportsForAddExportsFlags: Collection<String> by lazy {
|
||||||
|
jpmsExports.map { "--add-exports=$it" }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Formats `jpmsAddModules` for use on the command line with `--add-modules`.
|
||||||
|
val jpmsAddModulesFlags: Collection<String> by lazy { jpmsAddModules.map { "--add-modules=$it" } }
|
||||||
|
|
||||||
|
// JVM properties to set during testing.
|
||||||
|
val testProperties =
|
||||||
|
mapOf<String, Any>(
|
||||||
|
// @TODO: this should be removed once pkl supports JPMS as a true Java Module.
|
||||||
|
"polyglotimpl.DisableClassPathIsolation" to true
|
||||||
|
)
|
||||||
|
|
||||||
|
val jdkVendor: JvmVendorSpec = JvmVendorSpec.ADOPTIUM
|
||||||
|
|
||||||
|
val jdkToolchainVersion: JavaLanguageVersion by lazy {
|
||||||
|
JavaLanguageVersion.of(System.getProperty("pklJdkToolchain")?.toInt() ?: PKL_JDK_VERSION_MIN)
|
||||||
|
}
|
||||||
|
|
||||||
|
val jdkTestFloor: JavaLanguageVersion by lazy { JavaLanguageVersion.of(PKL_TEST_JDK_MINIMUM) }
|
||||||
|
|
||||||
|
val jdkTestCeiling: JavaLanguageVersion by lazy { JavaLanguageVersion.of(PKL_TEST_JDK_MAXIMUM) }
|
||||||
|
|
||||||
|
val testAllJdks: Boolean by lazy {
|
||||||
|
// By default, Pkl is tested against LTS JDK releases within the bounds of `PKL_TEST_JDK_TARGET`
|
||||||
|
// and `PKL_TEST_JDK_MAXIMUM`. To test against the full suite of JDK versions, past and present,
|
||||||
|
// set `-DpklTestAllJdks=true` on the Gradle command line. This results in non-LTS releases, old
|
||||||
|
// releases, and "experimental releases" (newer than the toolchain version) being included in
|
||||||
|
// the default `check` suite.
|
||||||
|
System.getProperty("pklTestAllJdks")?.toBoolean() ?: PKL_TEST_ALL_JDKS
|
||||||
|
}
|
||||||
|
|
||||||
|
val testExperimentalJdks: Boolean by lazy {
|
||||||
|
System.getProperty("pklTestFutureJdks")?.toBoolean() ?: false
|
||||||
|
}
|
||||||
|
|
||||||
|
val testJdkVendors: Sequence<JvmVendorSpec> by lazy {
|
||||||
|
// By default, only Adoptium is tested during multi-JDK testing. Flip `-DpklTestAllVendors=true`
|
||||||
|
// to additionally test against GraalVM and Oracle.
|
||||||
|
when (System.getProperty("pklTestAllVendors")?.toBoolean()) {
|
||||||
|
true -> sequenceOf(JvmVendorSpec.ADOPTIUM, JvmVendorSpec.GRAAL_VM, JvmVendorSpec.ORACLE)
|
||||||
|
else -> sequenceOf(JvmVendorSpec.ADOPTIUM)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private val isArmWindows: Boolean
|
||||||
|
get() {
|
||||||
|
if (!os.isWindows) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// System.getProperty("os.arch") returns the architecture of the JVM, not the host OS.
|
||||||
|
val procArch = System.getenv("PROCESSOR_ARCHITECTURE")
|
||||||
|
return "ARM64".equals(procArch, ignoreCase = true)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Assembles a collection of JDK versions which tests can be run against, considering ancillary
|
||||||
|
// parameters like `testAllJdks` and `testExperimentalJdks`.
|
||||||
|
val jdkTestRange: Collection<JavaLanguageVersion> by lazy {
|
||||||
|
if (isArmWindows) {
|
||||||
|
// Java toolchains does not work on ARM windows: https://github.com/gradle/gradle/issues/29807
|
||||||
|
// prevent creating tasks to test different JDKs if developing on a Windows ARM machine.
|
||||||
|
return@lazy listOf()
|
||||||
|
}
|
||||||
|
JavaVersionRange.inclusive(jdkTestFloor, jdkTestCeiling).toList()
|
||||||
|
}
|
||||||
|
|
||||||
|
val JavaLanguageVersion.isEnabled: Boolean
|
||||||
|
get() = isVersionEnabled(this)
|
||||||
|
|
||||||
|
fun isVersionEnabled(version: JavaLanguageVersion): Boolean {
|
||||||
|
return when {
|
||||||
|
testAllJdks -> true
|
||||||
|
multiJdkTesting -> JavaVersionRange.isLTS(version)
|
||||||
|
testExperimentalJdks -> version > jdkToolchainVersion
|
||||||
|
else -> false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun JavaToolchainSpec.pklJdkToolchain() {
|
||||||
|
languageVersion.set(jdkToolchainVersion)
|
||||||
|
vendor.set(jdkVendor)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun labelForVendor(vendor: JvmVendorSpec): String =
|
||||||
|
when (vendor) {
|
||||||
|
JvmVendorSpec.AZUL -> "Zulu"
|
||||||
|
JvmVendorSpec.GRAAL_VM -> "GraalVm"
|
||||||
|
JvmVendorSpec.ORACLE -> "Oracle"
|
||||||
|
JvmVendorSpec.ADOPTIUM -> "Adoptium"
|
||||||
|
else -> error("Unrecognized JDK vendor: $vendor")
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun testNamer(baseName: () -> String): (JavaLanguageVersion, JvmVendorSpec?) -> String =
|
||||||
|
{ jdkTarget, vendor ->
|
||||||
|
val targetToken =
|
||||||
|
when (vendor) {
|
||||||
|
null -> "Jdk${jdkTarget.asInt()}"
|
||||||
|
else -> "Jdk${jdkTarget.asInt()}${labelForVendor(vendor).capitalized()}"
|
||||||
|
}
|
||||||
|
if (jdkTarget > jdkToolchainVersion) {
|
||||||
|
// test targets above the toolchain target are considered "experimental".
|
||||||
|
"${baseName()}${targetToken}Experimental"
|
||||||
|
} else {
|
||||||
|
"${baseName()}${targetToken}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Suppress("UnstableApiUsage")
|
||||||
|
fun multiJdkTestingWith(
|
||||||
|
templateTask: TaskProvider<out Test>,
|
||||||
|
configurator: MultiJdkTestConfigurator = {},
|
||||||
|
): Iterable<Provider<out Any>> =
|
||||||
|
with(project) {
|
||||||
|
val isMultiVendor = testJdkVendors.count() > 1
|
||||||
|
val baseNameProvider = { templateTask.get().name }
|
||||||
|
val namer = testNamer(baseNameProvider)
|
||||||
|
val applyConfig: MultiJdkTestConfigurator = { (version, jdk) ->
|
||||||
|
// 1) copy configurations from the template task
|
||||||
|
templateTask.get().let { template ->
|
||||||
|
// copy explicit dependencies not inferred from task inputs
|
||||||
|
dependsOn(template.dependsOn)
|
||||||
|
classpath = template.classpath
|
||||||
|
testClassesDirs = template.testClassesDirs
|
||||||
|
jvmArgs.addAll(template.jvmArgs)
|
||||||
|
jvmArgumentProviders.addAll(template.jvmArgumentProviders)
|
||||||
|
forkEvery = template.forkEvery
|
||||||
|
maxParallelForks = template.maxParallelForks
|
||||||
|
minHeapSize = template.minHeapSize
|
||||||
|
maxHeapSize = template.maxHeapSize
|
||||||
|
exclude(template.excludes)
|
||||||
|
template.systemProperties.forEach { prop -> systemProperty(prop.key, prop.value) }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2) assign launcher
|
||||||
|
javaLauncher = jdk
|
||||||
|
|
||||||
|
// 3) dispatch the user's configurator
|
||||||
|
configurator(version to jdk)
|
||||||
|
}
|
||||||
|
|
||||||
|
serviceOf<JavaToolchainService>().let { toolchains ->
|
||||||
|
jdkTestRange
|
||||||
|
.flatMap { targetVersion ->
|
||||||
|
// multiply out by jdk vendor
|
||||||
|
testJdkVendors.map { vendor -> (targetVersion to vendor) }
|
||||||
|
}
|
||||||
|
.mapNotNull { (jdkTarget, vendor) ->
|
||||||
|
if (jdkToolchainVersion == jdkTarget) {
|
||||||
|
tasks.register(namer(jdkTarget, vendor)) {
|
||||||
|
// alias to `test`
|
||||||
|
dependsOn(templateTask)
|
||||||
|
group = Category.VERIFICATION
|
||||||
|
description =
|
||||||
|
"Alias for regular '${baseNameProvider()}' task, on JDK ${jdkTarget.asInt()}"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Always register and enable the task so it can be run explicitly,
|
||||||
|
// but only return it if it should be included in "check".
|
||||||
|
val task =
|
||||||
|
tasks.register(namer(jdkTarget, vendor.takeIf { isMultiVendor }), Test::class) {
|
||||||
|
group = Category.VERIFICATION
|
||||||
|
description = "Run tests against JDK ${jdkTarget.asInt()}"
|
||||||
|
applyConfig(jdkTarget to toolchains.launcherFor { languageVersion = jdkTarget })
|
||||||
|
// fix: on jdk17, we must force the polyglot module on to the modulepath
|
||||||
|
if (jdkTarget.asInt() == 17)
|
||||||
|
jvmArgumentProviders.add(
|
||||||
|
CommandLineArgumentProvider {
|
||||||
|
buildList { listOf("--add-modules=org.graalvm.polyglot") }
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
task.takeIf { jdkTarget.isEnabled }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.toList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val javaCompiler: Provider<JavaCompiler> by lazy {
|
||||||
|
project.serviceOf<JavaToolchainService>().let { toolchainService ->
|
||||||
|
toolchainService.compilerFor { pklJdkToolchain() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val javaTestLauncher: Provider<JavaLauncher> by lazy {
|
||||||
|
project.serviceOf<JavaToolchainService>().let { toolchainService ->
|
||||||
|
toolchainService.launcherFor { pklJdkToolchain() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val multiJdkTesting: Boolean by lazy {
|
||||||
|
// Test Pkl against a full range of JDK versions, past and present, within the
|
||||||
|
// supported bounds of `PKL_TEST_JDK_TARGET` and `PKL_TEST_JDK_MAXIMUM`.
|
||||||
|
//
|
||||||
|
// In CI, this defaults to `true` to catch potential cross-JDK compat regressions or other bugs.
|
||||||
|
// In local dev, this defaults to `false` to speed up the build and reduce contributor load.
|
||||||
|
System.getProperty("pklMultiJdkTesting")?.toBoolean() ?: isCiBuild
|
||||||
|
}
|
||||||
|
|
||||||
|
val hasMuslToolchain: Boolean by lazy {
|
||||||
|
// see .github/scripts/install_musl.sh
|
||||||
|
File(System.getProperty("user.home"), "staticdeps/bin/x86_64-linux-musl-gcc").exists()
|
||||||
|
}
|
||||||
|
|
||||||
|
val os: org.gradle.internal.os.OperatingSystem by lazy {
|
||||||
|
org.gradle.internal.os.OperatingSystem.current()
|
||||||
|
}
|
||||||
|
|
||||||
|
// could be `commitId: Provider<String> = project.provider { ... }`
|
||||||
|
val commitId: String by lazy {
|
||||||
|
// allow -DcommitId=abc123 for build environments that don't have git.
|
||||||
|
System.getProperty("commitId").let { if (it != null) return@lazy it }
|
||||||
|
// only run command once per build invocation
|
||||||
|
if (project.path == project.rootProject.path) {
|
||||||
|
val process =
|
||||||
|
ProcessBuilder()
|
||||||
|
.command("git", "rev-parse", "--short", "HEAD")
|
||||||
|
.directory(project.rootDir)
|
||||||
|
.start()
|
||||||
|
process.waitFor().also { exitCode ->
|
||||||
|
if (exitCode == -1) throw RuntimeException(process.errorStream.reader().readText())
|
||||||
|
}
|
||||||
|
process.inputStream.reader().readText().trim()
|
||||||
|
} else {
|
||||||
|
project.rootProject.extensions.getByType(BuildInfo::class.java).commitId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val commitish: String by lazy { if (isReleaseBuild) project.version.toString() else commitId }
|
||||||
|
|
||||||
|
val pklVersion: String by lazy {
|
||||||
|
if (isReleaseBuild) {
|
||||||
|
project.version.toString()
|
||||||
|
} else {
|
||||||
|
project.version.toString().replace("-SNAPSHOT", "-dev+$commitId")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val pklVersionNonUnique: String by lazy {
|
||||||
|
if (isReleaseBuild) {
|
||||||
|
project.version.toString()
|
||||||
|
} else {
|
||||||
|
project.version.toString().replace("-SNAPSHOT", "-dev")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://melix.github.io/blog/2021/03/version-catalogs-faq.html#_but_how_can_i_use_the_catalog_in_em_plugins_em_defined_in_code_buildsrc_code
|
||||||
|
val libs: VersionCatalog by lazy {
|
||||||
|
project.extensions.getByType<VersionCatalogsExtension>().named("libs")
|
||||||
|
}
|
||||||
|
|
||||||
|
init {
|
||||||
|
if (!isReleaseBuild) {
|
||||||
|
project.version = "${project.version}-SNAPSHOT"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Shape of a function which is applied to configure multi-JDK testing.
|
||||||
|
private typealias MultiJdkTestConfigurator =
|
||||||
|
Test.(Pair<JavaLanguageVersion, Provider<JavaLauncher>>) -> Unit
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import org.gradle.api.DefaultTask
|
||||||
|
import org.gradle.api.file.RegularFileProperty
|
||||||
|
import org.gradle.api.provider.ListProperty
|
||||||
|
import org.gradle.api.tasks.Input
|
||||||
|
import org.gradle.api.tasks.InputFile
|
||||||
|
import org.gradle.api.tasks.OutputFile
|
||||||
|
import org.gradle.api.tasks.TaskAction
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds a self-contained Pkl CLI Jar that is directly executable on Windows, macOS, and Linux.
|
||||||
|
*
|
||||||
|
* For direct execution, the `java` command must be on the PATH.
|
||||||
|
*
|
||||||
|
* Technique borrowed from [Mill](https://mill-build.org/blog/5-executable-jars.html).
|
||||||
|
*/
|
||||||
|
abstract class ExecutableJar : DefaultTask() {
|
||||||
|
@get:InputFile abstract val inJar: RegularFileProperty
|
||||||
|
|
||||||
|
@get:OutputFile abstract val outJar: RegularFileProperty
|
||||||
|
|
||||||
|
@get:Input abstract val jvmArgs: ListProperty<String>
|
||||||
|
|
||||||
|
@TaskAction
|
||||||
|
@Suppress("unused")
|
||||||
|
fun buildJar() {
|
||||||
|
val inFile = inJar.get().asFile
|
||||||
|
val outFile = outJar.get().asFile
|
||||||
|
val escapedJvmArgs = jvmArgs.get().joinToString(separator = " ") { "\"$it\"" }
|
||||||
|
val unixStartScript =
|
||||||
|
"""
|
||||||
|
@ 2>/dev/null # 2>nul & echo off & goto BOF
|
||||||
|
:
|
||||||
|
exec java $escapedJvmArgs -jar "$0" "$@"
|
||||||
|
exit
|
||||||
|
"""
|
||||||
|
.trimIndent()
|
||||||
|
val windowsStartScript =
|
||||||
|
"""
|
||||||
|
:BOF
|
||||||
|
setlocal
|
||||||
|
@echo off
|
||||||
|
java $escapedJvmArgs -jar "%~dpnx0" %*
|
||||||
|
endlocal
|
||||||
|
exit /B %errorlevel%
|
||||||
|
"""
|
||||||
|
.trimIndent()
|
||||||
|
// need crlf endings for Windows portion of script
|
||||||
|
.replace("\n", "\r\n")
|
||||||
|
val startScript = unixStartScript + "\r\n" + windowsStartScript + "\r\n".repeat(3)
|
||||||
|
outFile.outputStream().use { outStream ->
|
||||||
|
startScript.byteInputStream().use { it.copyTo(outStream) }
|
||||||
|
inFile.inputStream().use { it.copyTo(outStream) }
|
||||||
|
}
|
||||||
|
|
||||||
|
// chmod a+x
|
||||||
|
outFile.setExecutable(true, false)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2025-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import org.gradle.api.provider.Property
|
||||||
|
|
||||||
|
abstract class ExecutableSpec {
|
||||||
|
/** The main entrypoint Java class of the executable. */
|
||||||
|
abstract val mainClass: Property<String>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the native executable.
|
||||||
|
*
|
||||||
|
* Not required if not building a native executable.
|
||||||
|
*/
|
||||||
|
abstract val name: Property<String>
|
||||||
|
|
||||||
|
/** The name of the Java executable. */
|
||||||
|
abstract val javaName: Property<String>
|
||||||
|
|
||||||
|
/** The name of the executable that shows in the description when published to Maven. */
|
||||||
|
abstract val documentationName: Property<String>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The base name of the Maven publication.
|
||||||
|
*
|
||||||
|
* This becomes the base name of the Artifact ID, with the os and arch suffixed.
|
||||||
|
*
|
||||||
|
* For example, `pkl` becomes `pkl-macos-aarch` for the macOS/aarch64 variant.
|
||||||
|
*/
|
||||||
|
abstract val publicationName: Property<String>
|
||||||
|
|
||||||
|
/** The name of the artifact ID for the Java executable. */
|
||||||
|
abstract val javaPublicationName: Property<String>
|
||||||
|
|
||||||
|
/** The website for this executable. */
|
||||||
|
abstract val website: Property<String>
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import org.gradle.util.GradleVersion
|
||||||
|
|
||||||
|
open class GradlePluginTests {
|
||||||
|
lateinit var minGradleVersion: GradleVersion
|
||||||
|
lateinit var maxGradleVersion: GradleVersion
|
||||||
|
var skippedGradleVersions: List<GradleVersion> = listOf()
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import groovy.json.JsonSlurper
|
||||||
|
import java.net.URI
|
||||||
|
import org.gradle.util.GradleVersion
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
class GradleVersionInfo(json: Map<String, Any>) {
|
||||||
|
val version: String by json
|
||||||
|
|
||||||
|
val gradleVersion: GradleVersion by lazy { GradleVersion.version(version) }
|
||||||
|
|
||||||
|
val isReleaseVersion: Boolean by lazy {
|
||||||
|
// for some reason, `gradleVersion == gradleVersion.baseVersion` is a compile error
|
||||||
|
gradleVersion.version == gradleVersion.baseVersion.version
|
||||||
|
}
|
||||||
|
|
||||||
|
val buildTime: String by json
|
||||||
|
|
||||||
|
val current: Boolean by json
|
||||||
|
|
||||||
|
val snapshot: Boolean by json
|
||||||
|
|
||||||
|
val nightly: Boolean by json
|
||||||
|
|
||||||
|
val releaseNightly: Boolean by json
|
||||||
|
|
||||||
|
val activeRc: Boolean by json
|
||||||
|
|
||||||
|
val rcFor: String by json
|
||||||
|
|
||||||
|
val milestoneFor: String by json
|
||||||
|
|
||||||
|
val broken: Boolean by json
|
||||||
|
|
||||||
|
val downloadUrl: String by json
|
||||||
|
|
||||||
|
val checksumUrl: String by json
|
||||||
|
|
||||||
|
val wrapperChecksumUrl: String by json
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private fun fetchAll(): List<GradleVersionInfo> =
|
||||||
|
fetchMultiple("https://services.gradle.org/versions/all")
|
||||||
|
|
||||||
|
fun fetchReleases(): List<GradleVersionInfo> = fetchAll().filter { it.isReleaseVersion }
|
||||||
|
|
||||||
|
fun fetchCurrent(): GradleVersionInfo =
|
||||||
|
fetchSingle("https://services.gradle.org/versions/current")
|
||||||
|
|
||||||
|
fun fetchRc(): GradleVersionInfo? =
|
||||||
|
fetchSingleOrNull("https://services.gradle.org/versions/release-candidate")
|
||||||
|
|
||||||
|
fun fetchNightly(): GradleVersionInfo =
|
||||||
|
fetchSingle("https://services.gradle.org/versions/nightly")
|
||||||
|
|
||||||
|
private fun fetchSingle(url: String): GradleVersionInfo {
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
return GradleVersionInfo(JsonSlurper().parse(URI(url).toURL()) as Map<String, Any>)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun fetchSingleOrNull(url: String): GradleVersionInfo? {
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
val json = JsonSlurper().parse(URI(url).toURL()) as Map<String, Any>
|
||||||
|
return if (json.isEmpty()) null else GradleVersionInfo(json)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun fetchMultiple(url: String): List<GradleVersionInfo> {
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
return (JsonSlurper().parse(URI(url).toURL()) as List<Map<String, Any>>).map {
|
||||||
|
GradleVersionInfo(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import org.gradle.api.Project
|
||||||
|
import org.gradle.api.file.FileCollection
|
||||||
|
|
||||||
|
open class HtmlValidator(project: Project) {
|
||||||
|
var sources: FileCollection = project.files()
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import java.nio.file.Files
|
||||||
|
import java.nio.file.Paths
|
||||||
|
import java.nio.file.StandardCopyOption
|
||||||
|
import java.util.*
|
||||||
|
import javax.inject.Inject
|
||||||
|
import kotlin.io.path.createDirectories
|
||||||
|
import org.gradle.api.DefaultTask
|
||||||
|
import org.gradle.api.internal.file.FileOperations
|
||||||
|
import org.gradle.api.provider.Property
|
||||||
|
import org.gradle.api.tasks.Input
|
||||||
|
import org.gradle.api.tasks.TaskAction
|
||||||
|
import org.gradle.process.ExecOperations
|
||||||
|
|
||||||
|
abstract class InstallGraalVm
|
||||||
|
@Inject
|
||||||
|
constructor(
|
||||||
|
private val fileOperations: FileOperations,
|
||||||
|
private val execOperations: ExecOperations,
|
||||||
|
) : DefaultTask() {
|
||||||
|
@get:Input abstract val graalVm: Property<BuildInfo.GraalVm>
|
||||||
|
|
||||||
|
init {
|
||||||
|
@Suppress("LeakingThis") onlyIf("GraalVM not installed") { !graalVm.get().installDir.exists() }
|
||||||
|
}
|
||||||
|
|
||||||
|
@TaskAction
|
||||||
|
@Suppress("unused")
|
||||||
|
fun run() {
|
||||||
|
// minimize chance of corruption by extract-to-random-dir-and-flip-symlink
|
||||||
|
val distroDir = Paths.get(graalVm.get().homeDir, UUID.randomUUID().toString())
|
||||||
|
try {
|
||||||
|
distroDir.createDirectories()
|
||||||
|
println("Extracting ${graalVm.get().downloadFile} into $distroDir")
|
||||||
|
// faster and more reliable than Gradle's `copy { from tarTree() }`
|
||||||
|
execOperations.exec {
|
||||||
|
workingDir = distroDir.toFile()
|
||||||
|
executable = "tar"
|
||||||
|
args("--strip-components=1", "-xzf", graalVm.get().downloadFile)
|
||||||
|
}
|
||||||
|
|
||||||
|
val os = org.gradle.internal.os.OperatingSystem.current()
|
||||||
|
val distroBinDir =
|
||||||
|
if (os.isMacOsX) distroDir.resolve("Contents/Home/bin") else distroDir.resolve("bin")
|
||||||
|
|
||||||
|
println("Installing native-image into $distroDir")
|
||||||
|
val gvmVersionMajor =
|
||||||
|
requireNotNull(graalVm.get().version.split(".").first().toIntOrNull()) {
|
||||||
|
"Invalid GraalVM JDK version: ${graalVm.get().graalVmJdkVersion}"
|
||||||
|
}
|
||||||
|
if (gvmVersionMajor < 24) {
|
||||||
|
execOperations.exec {
|
||||||
|
val executableName = if (os.isWindows) "gu.cmd" else "gu"
|
||||||
|
executable = distroBinDir.resolve(executableName).toString()
|
||||||
|
args("install", "--no-progress", "native-image")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
println("Creating symlink ${graalVm.get().installDir} for $distroDir")
|
||||||
|
val tempLink = Paths.get(graalVm.get().homeDir, UUID.randomUUID().toString())
|
||||||
|
Files.createSymbolicLink(tempLink, distroDir)
|
||||||
|
try {
|
||||||
|
Files.move(tempLink, graalVm.get().installDir.toPath(), StandardCopyOption.ATOMIC_MOVE)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
try {
|
||||||
|
fileOperations.delete(tempLink.toFile())
|
||||||
|
} catch (ignored: Exception) {}
|
||||||
|
throw e
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
try {
|
||||||
|
fileOperations.delete(distroDir)
|
||||||
|
} catch (ignored: Exception) {}
|
||||||
|
throw e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
@file:Suppress("MemberVisibilityCanBePrivate")
|
||||||
|
|
||||||
|
import java.util.*
|
||||||
|
import org.gradle.jvm.toolchain.JavaLanguageVersion
|
||||||
|
|
||||||
|
typealias JavaVersionPair = Pair<JavaLanguageVersion, JavaLanguageVersion>
|
||||||
|
|
||||||
|
// All LTS releases.
|
||||||
|
private val ltsReleases =
|
||||||
|
sortedSetOf(
|
||||||
|
JavaLanguageVersion.of(8),
|
||||||
|
JavaLanguageVersion.of(11),
|
||||||
|
JavaLanguageVersion.of(17),
|
||||||
|
JavaLanguageVersion.of(21),
|
||||||
|
JavaLanguageVersion.of(25),
|
||||||
|
)
|
||||||
|
|
||||||
|
/** Describes an inclusive range of JVM versions, based on the [JavaLanguageVersion] type. */
|
||||||
|
@JvmInline
|
||||||
|
value class JavaVersionRange private constructor(private val bounds: JavaVersionPair) :
|
||||||
|
Iterable<JavaLanguageVersion> {
|
||||||
|
@Suppress("unused")
|
||||||
|
companion object {
|
||||||
|
fun isLTS(version: JavaLanguageVersion): Boolean = version in ltsReleases
|
||||||
|
|
||||||
|
fun inclusive(floor: JavaLanguageVersion, ceiling: JavaLanguageVersion): JavaVersionRange =
|
||||||
|
JavaVersionRange(floor to ceiling)
|
||||||
|
|
||||||
|
fun startingAt(floor: JavaLanguageVersion): JavaVersionRange =
|
||||||
|
inclusive(floor, JavaLanguageVersion.of(PKL_TEST_JDK_MAXIMUM))
|
||||||
|
|
||||||
|
fun upTo(ceiling: JavaLanguageVersion): JavaVersionRange =
|
||||||
|
inclusive(JavaLanguageVersion.of(PKL_TEST_JDK_MINIMUM), ceiling)
|
||||||
|
}
|
||||||
|
|
||||||
|
operator fun contains(version: JavaLanguageVersion): Boolean =
|
||||||
|
version >= bounds.first && version <= bounds.second
|
||||||
|
|
||||||
|
fun asSequence(): Sequence<JavaLanguageVersion> = sequence {
|
||||||
|
var current = bounds.first
|
||||||
|
while (current <= bounds.second) {
|
||||||
|
yield(current)
|
||||||
|
current = JavaLanguageVersion.of(current.asInt() + 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun asSortedSet(): SortedSet<JavaLanguageVersion> = asSequence().toSortedSet()
|
||||||
|
|
||||||
|
override fun iterator(): Iterator<JavaLanguageVersion> = asSortedSet().iterator()
|
||||||
|
}
|
||||||
+29
-14
@@ -1,3 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.regex.Matcher
|
import java.util.regex.Matcher
|
||||||
import java.util.regex.Pattern
|
import java.util.regex.Pattern
|
||||||
@@ -15,21 +30,18 @@ import org.gradle.kotlin.dsl.listProperty
|
|||||||
import org.gradle.kotlin.dsl.mapProperty
|
import org.gradle.kotlin.dsl.mapProperty
|
||||||
|
|
||||||
open class MergeSourcesJars : DefaultTask() {
|
open class MergeSourcesJars : DefaultTask() {
|
||||||
@get:InputFiles
|
@get:InputFiles val inputJars: ConfigurableFileCollection = project.objects.fileCollection()
|
||||||
val inputJars: ConfigurableFileCollection = project.objects.fileCollection()
|
|
||||||
|
|
||||||
@get:InputFiles
|
@get:InputFiles
|
||||||
val mergedBinaryJars: ConfigurableFileCollection = project.objects.fileCollection()
|
val mergedBinaryJars: ConfigurableFileCollection = project.objects.fileCollection()
|
||||||
|
|
||||||
@get:Input
|
@get:Input val relocatedPackages: MapProperty<String, String> = project.objects.mapProperty()
|
||||||
val relocatedPackages: MapProperty<String, String> = project.objects.mapProperty()
|
|
||||||
|
|
||||||
@get:Input
|
@get:Input
|
||||||
var sourceFileExtensions: ListProperty<String> = project.objects.listProperty<String>()
|
var sourceFileExtensions: ListProperty<String> =
|
||||||
.convention(listOf(".java", ".kt"))
|
project.objects.listProperty<String>().convention(listOf(".java", ".kt"))
|
||||||
|
|
||||||
@get:OutputFile
|
@get:OutputFile val outputJar: RegularFileProperty = project.objects.fileProperty()
|
||||||
val outputJar: RegularFileProperty = project.objects.fileProperty()
|
|
||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
@@ -38,12 +50,15 @@ open class MergeSourcesJars : DefaultTask() {
|
|||||||
|
|
||||||
val relocatedPkgs = relocatedPackages.get()
|
val relocatedPkgs = relocatedPackages.get()
|
||||||
|
|
||||||
val relocatedPaths = relocatedPkgs.entries.associate { (key, value) -> toPath(key) to toPath(value) }
|
val relocatedPaths =
|
||||||
|
relocatedPkgs.entries.associate { (key, value) -> toPath(key) to toPath(value) }
|
||||||
|
|
||||||
// use negative lookbehind to match any that don't precede with
|
// use negative lookbehind to match any that don't precede with
|
||||||
// a word or a period character. should catch most cases.
|
// a word or a period character. should catch most cases.
|
||||||
val importPattern = Pattern.compile("(?<!(\\w|\\.))(" +
|
val importPattern =
|
||||||
relocatedPkgs.keys.joinToString("|") { it.replace(".", "\\.") } + ")")
|
Pattern.compile(
|
||||||
|
"(?<!([\\w.]))(" + relocatedPkgs.keys.joinToString("|") { it.replace(".", "\\.") } + ")"
|
||||||
|
)
|
||||||
|
|
||||||
val sourceFileExts = sourceFileExtensions.get()
|
val sourceFileExts = sourceFileExtensions.get()
|
||||||
|
|
||||||
@@ -55,7 +70,7 @@ open class MergeSourcesJars : DefaultTask() {
|
|||||||
val details = this
|
val details = this
|
||||||
if (details.isDirectory) return@visit
|
if (details.isDirectory) return@visit
|
||||||
|
|
||||||
var path = details.relativePath.parent.pathString
|
var path = details.relativePath.parent!!.pathString
|
||||||
val relocatedPath = relocatedPaths.keys.find { path.startsWith(it) }
|
val relocatedPath = relocatedPaths.keys.find { path.startsWith(it) }
|
||||||
if (relocatedPath != null) {
|
if (relocatedPath != null) {
|
||||||
path = path.replace(relocatedPath, relocatedPaths.getValue(relocatedPath))
|
path = path.replace(relocatedPath, relocatedPaths.getValue(relocatedPath))
|
||||||
@@ -86,7 +101,7 @@ open class MergeSourcesJars : DefaultTask() {
|
|||||||
project.zipTree(jar).visit {
|
project.zipTree(jar).visit {
|
||||||
val details = this
|
val details = this
|
||||||
if (details.isDirectory) return@visit // avoid adding empty dirs
|
if (details.isDirectory) return@visit // avoid adding empty dirs
|
||||||
result.add(details.relativePath.parent.pathString)
|
result.add(details.relativePath.parent!!.pathString)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
@@ -96,7 +111,7 @@ open class MergeSourcesJars : DefaultTask() {
|
|||||||
relocatedPkgs: Map<String, String>,
|
relocatedPkgs: Map<String, String>,
|
||||||
details: FileVisitDetails,
|
details: FileVisitDetails,
|
||||||
sourceText: String,
|
sourceText: String,
|
||||||
importPattern: Pattern
|
importPattern: Pattern,
|
||||||
): String {
|
): String {
|
||||||
val matcher = importPattern.matcher(sourceText)
|
val matcher = importPattern.matcher(sourceText)
|
||||||
val buffer = StringBuffer()
|
val buffer = StringBuffer()
|
||||||
@@ -0,0 +1,170 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2025-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import javax.inject.Inject
|
||||||
|
import org.gradle.api.DefaultTask
|
||||||
|
import org.gradle.api.file.ConfigurableFileCollection
|
||||||
|
import org.gradle.api.provider.ListProperty
|
||||||
|
import org.gradle.api.provider.Property
|
||||||
|
import org.gradle.api.provider.Provider
|
||||||
|
import org.gradle.api.services.BuildService
|
||||||
|
import org.gradle.api.services.BuildServiceParameters
|
||||||
|
import org.gradle.api.tasks.ClasspathNormalizer
|
||||||
|
import org.gradle.api.tasks.Input
|
||||||
|
import org.gradle.api.tasks.InputFiles
|
||||||
|
import org.gradle.api.tasks.OutputFile
|
||||||
|
import org.gradle.api.tasks.PathSensitivity
|
||||||
|
import org.gradle.api.tasks.TaskAction
|
||||||
|
import org.gradle.kotlin.dsl.registerIfAbsent
|
||||||
|
import org.gradle.kotlin.dsl.withNormalizer
|
||||||
|
import org.gradle.process.ExecOperations
|
||||||
|
|
||||||
|
enum class Architecture {
|
||||||
|
AMD64,
|
||||||
|
AARCH64,
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class NativeImageBuildService : BuildService<BuildServiceParameters.None>
|
||||||
|
|
||||||
|
abstract class NativeImageBuild : DefaultTask() {
|
||||||
|
@get:Input abstract val imageName: Property<String>
|
||||||
|
|
||||||
|
@get:Input abstract val extraNativeImageArgs: ListProperty<String>
|
||||||
|
|
||||||
|
@get:Input abstract val arch: Property<Architecture>
|
||||||
|
|
||||||
|
@get:Input abstract val mainClass: Property<String>
|
||||||
|
|
||||||
|
@get:InputFiles abstract val classpath: ConfigurableFileCollection
|
||||||
|
|
||||||
|
private val outputDir = project.layout.buildDirectory.dir("executable")
|
||||||
|
|
||||||
|
@get:OutputFile val outputFile = outputDir.flatMap { it.file(imageName) }
|
||||||
|
|
||||||
|
@get:Inject protected abstract val execOperations: ExecOperations
|
||||||
|
|
||||||
|
private val graalVm: Provider<BuildInfo.GraalVm> = arch.map { a ->
|
||||||
|
when (a) {
|
||||||
|
Architecture.AMD64 -> buildInfo.graalVmAmd64
|
||||||
|
Architecture.AARCH64 -> buildInfo.graalVmAarch64
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private val buildInfo: BuildInfo = project.extensions.getByType(BuildInfo::class.java)
|
||||||
|
|
||||||
|
private val nativeImageCommandName =
|
||||||
|
if (buildInfo.os.isWindows) "native-image.cmd" else "native-image"
|
||||||
|
|
||||||
|
private val nativeImageExecutable = graalVm.map { "${it.baseDir}/bin/$nativeImageCommandName" }
|
||||||
|
|
||||||
|
private val extraArgsFromProperties by lazy {
|
||||||
|
System.getProperties()
|
||||||
|
.filter { it.key.toString().startsWith("pkl.native") }
|
||||||
|
.map { "${it.key}=${it.value}".substring("pkl.native".length) }
|
||||||
|
}
|
||||||
|
|
||||||
|
private val buildService =
|
||||||
|
project.gradle.sharedServices.registerIfAbsent(
|
||||||
|
"nativeImageBuildService",
|
||||||
|
NativeImageBuildService::class,
|
||||||
|
) {
|
||||||
|
maxParallelUsages.set(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
init {
|
||||||
|
// ensure native-image builds run in serial (prevent `gw buildNative` from consuming all host
|
||||||
|
// CPU resources).
|
||||||
|
usesService(buildService)
|
||||||
|
|
||||||
|
group = "build"
|
||||||
|
|
||||||
|
inputs
|
||||||
|
.files(classpath)
|
||||||
|
.withPropertyName("runtimeClasspath")
|
||||||
|
.withNormalizer(ClasspathNormalizer::class)
|
||||||
|
inputs
|
||||||
|
.files(nativeImageExecutable)
|
||||||
|
.withPropertyName("graalVmNativeImage")
|
||||||
|
.withPathSensitivity(PathSensitivity.ABSOLUTE)
|
||||||
|
}
|
||||||
|
|
||||||
|
@TaskAction
|
||||||
|
@Suppress("unused")
|
||||||
|
protected fun run() {
|
||||||
|
execOperations.exec {
|
||||||
|
val exclusions =
|
||||||
|
listOf(buildInfo.libs.findLibrary("graalSdk").get()).map { it.get().module.name }
|
||||||
|
|
||||||
|
executable = nativeImageExecutable.get()
|
||||||
|
workingDir(outputDir)
|
||||||
|
|
||||||
|
args = buildList {
|
||||||
|
// must be emitted before any experimental options are used
|
||||||
|
add("-H:+UnlockExperimentalVMOptions")
|
||||||
|
// currently gives a deprecation warning, but we've been told
|
||||||
|
// that the "initialize everything at build time" *CLI* option is likely here to stay
|
||||||
|
add("--initialize-at-build-time=")
|
||||||
|
// needed for messagepack-java (see https://github.com/msgpack/msgpack-java/issues/600)
|
||||||
|
add("--initialize-at-run-time=org.msgpack.core.buffer.DirectBufferAccess")
|
||||||
|
// needed for jline-terminal-jni
|
||||||
|
add("--initialize-at-run-time=org.jline.nativ,org.jline.terminal.impl.jni")
|
||||||
|
add("--no-fallback")
|
||||||
|
add("-H:IncludeResources=org/pkl/core/stdlib/.*\\.pkl")
|
||||||
|
add("-H:IncludeResources=org/jline/utils/.*")
|
||||||
|
add("-H:IncludeResourceBundles=org.pkl.core.errorMessages")
|
||||||
|
add("-H:IncludeResourceBundles=org.pkl.parser.errorMessages")
|
||||||
|
add("-H:IncludeResources=org/pkl/commons/cli/PklCARoots.pem")
|
||||||
|
add("-H:Class=${mainClass.get()}")
|
||||||
|
add("-o")
|
||||||
|
add(imageName.get())
|
||||||
|
// the actual limit (currently) used by native-image is this number + 1400 (idea is to
|
||||||
|
// compensate for Truffle's own nodes)
|
||||||
|
add("-H:MaxRuntimeCompileMethods=1800")
|
||||||
|
add("-H:+EnforceMaxRuntimeCompileMethods")
|
||||||
|
add("--enable-url-protocols=http,https")
|
||||||
|
add("-H:+ReportExceptionStackTraces")
|
||||||
|
// disable automatic support for JVM CLI options (puts our main class in full control of
|
||||||
|
// argument parsing)
|
||||||
|
add("-H:-ParseRuntimeOptions")
|
||||||
|
// quick build mode: 40% faster compilation, 20% smaller (but presumably also slower)
|
||||||
|
// executable
|
||||||
|
if (!buildInfo.isReleaseBuild) {
|
||||||
|
add("-Ob")
|
||||||
|
}
|
||||||
|
if (buildInfo.isNativeArch) {
|
||||||
|
add("-march=native")
|
||||||
|
} else {
|
||||||
|
add("-march=compatibility")
|
||||||
|
}
|
||||||
|
// native-image rejects non-existing class path entries -> filter
|
||||||
|
add("--class-path")
|
||||||
|
val pathInput = classpath.filter {
|
||||||
|
it.exists() && !exclusions.any { exclude -> it.name.contains(exclude) }
|
||||||
|
}
|
||||||
|
add(pathInput.asPath)
|
||||||
|
// make sure dev machine stays responsive (15% slowdown on my laptop)
|
||||||
|
val processors =
|
||||||
|
Runtime.getRuntime().availableProcessors() /
|
||||||
|
if (buildInfo.os.isMacOsX && !buildInfo.isCiBuild) 4 else 1
|
||||||
|
add("-J-XX:ActiveProcessorCount=${processors}")
|
||||||
|
// Pass through all `HOMEBREW_` prefixed environment variables to allow build with shimmed
|
||||||
|
// tools.
|
||||||
|
addAll(environment.keys.filter { it.startsWith("HOMEBREW_") }.map { "-E$it" })
|
||||||
|
addAll(extraNativeImageArgs.get())
|
||||||
|
addAll(extraArgsFromProperties)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2025-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import com.diffplug.spotless.FormatterFunc
|
||||||
|
import com.diffplug.spotless.FormatterStep
|
||||||
|
import java.io.Serial
|
||||||
|
import java.io.Serializable
|
||||||
|
import java.net.URLClassLoader
|
||||||
|
import org.gradle.api.artifacts.Configuration
|
||||||
|
|
||||||
|
class PklFormatterStep(@Transient private val configuration: Configuration) : Serializable {
|
||||||
|
companion object {
|
||||||
|
@Serial private const val serialVersionUID: Long = 1L
|
||||||
|
}
|
||||||
|
|
||||||
|
fun create(): FormatterStep {
|
||||||
|
return FormatterStep.createLazy(
|
||||||
|
"pkl",
|
||||||
|
{ PklFormatterStep(configuration) },
|
||||||
|
{ PklFormatterFunc(configuration) },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class PklFormatterFunc(@Transient private val configuration: Configuration) :
|
||||||
|
FormatterFunc, Serializable {
|
||||||
|
companion object {
|
||||||
|
@Serial private const val serialVersionUID: Long = 1L
|
||||||
|
}
|
||||||
|
|
||||||
|
private val classLoader by lazy {
|
||||||
|
val urls = configuration.files.map { it.toURI().toURL() }
|
||||||
|
// Use the platform classloader as parent to isolate from Gradle's classloader
|
||||||
|
URLClassLoader(urls.toTypedArray(), ClassLoader.getPlatformClassLoader())
|
||||||
|
}
|
||||||
|
|
||||||
|
private val formatterClass by lazy { classLoader.loadClass("org.pkl.formatter.Formatter") }
|
||||||
|
|
||||||
|
private val formatMethod by lazy { formatterClass.getMethod("format", String::class.java) }
|
||||||
|
|
||||||
|
private val formatterInstance by lazy { formatterClass.getConstructor().newInstance() }
|
||||||
|
|
||||||
|
override fun apply(input: String): String {
|
||||||
|
return formatMethod(formatterInstance, input) as String
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,146 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import java.nio.charset.StandardCharsets
|
||||||
|
import java.util.Base64
|
||||||
|
import org.gradle.api.Project
|
||||||
|
import org.gradle.api.publish.PublishingExtension
|
||||||
|
import org.gradle.api.publish.maven.MavenPublication
|
||||||
|
import org.gradle.api.publish.maven.tasks.AbstractPublishToMaven
|
||||||
|
import org.gradle.api.publish.maven.tasks.GenerateMavenPom
|
||||||
|
import org.gradle.kotlin.dsl.*
|
||||||
|
import org.gradle.plugins.signing.SigningExtension
|
||||||
|
|
||||||
|
/** Configures common POM metadata (licenses, developers, SCM, etc.) for all Pkl publications. */
|
||||||
|
fun Project.configurePklPomMetadata() {
|
||||||
|
extensions.configure<PublishingExtension> {
|
||||||
|
publications.withType<MavenPublication>().configureEach {
|
||||||
|
pom {
|
||||||
|
name.set(artifactId)
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name.set("The Apache Software License, Version 2.0")
|
||||||
|
url.set("https://github.com/apple/pkl/blob/main/LICENSE.txt")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
id.set("pkl-authors")
|
||||||
|
name.set("The Pkl Authors")
|
||||||
|
email.set("pkl-oss@group.apple.com")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scm {
|
||||||
|
connection.set("scm:git:git://github.com/apple/pkl.git")
|
||||||
|
developerConnection.set("scm:git:ssh://github.com/apple/pkl.git")
|
||||||
|
val buildInfo = extensions.getByType<BuildInfo>()
|
||||||
|
url.set("https://github.com/apple/pkl/tree/${buildInfo.commitish}")
|
||||||
|
}
|
||||||
|
issueManagement {
|
||||||
|
system.set("GitHub Issues")
|
||||||
|
url.set("https://github.com/apple/pkl/issues")
|
||||||
|
}
|
||||||
|
ciManagement {
|
||||||
|
system.set("GitHub Actions")
|
||||||
|
url.set("https://github.com/apple/pkl/actions")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Configures POM validation task to check for unresolved versions and snapshots in releases. */
|
||||||
|
fun Project.configurePomValidation() {
|
||||||
|
val validatePom by tasks.registering {
|
||||||
|
if (tasks.findByName("generatePomFileForLibraryPublication") == null) {
|
||||||
|
return@registering
|
||||||
|
}
|
||||||
|
val generatePomFileForLibraryPublication by tasks.existing(GenerateMavenPom::class)
|
||||||
|
val outputFile =
|
||||||
|
layout.buildDirectory.file("validatePom") // dummy output to satisfy up-to-date check
|
||||||
|
|
||||||
|
dependsOn(generatePomFileForLibraryPublication)
|
||||||
|
inputs.file(generatePomFileForLibraryPublication.get().destination)
|
||||||
|
outputs.file(outputFile)
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
outputFile.get().asFile.delete()
|
||||||
|
|
||||||
|
val pomFile = generatePomFileForLibraryPublication.get().destination
|
||||||
|
assert(pomFile.exists())
|
||||||
|
|
||||||
|
val text = pomFile.readText()
|
||||||
|
|
||||||
|
run {
|
||||||
|
val unresolvedVersion = Regex("<version>.*[+,()\\[\\]].*</version>")
|
||||||
|
val matches = unresolvedVersion.findAll(text).toList()
|
||||||
|
if (matches.isNotEmpty()) {
|
||||||
|
throw org.gradle.api.GradleException(
|
||||||
|
"""
|
||||||
|
Found unresolved version selector(s) in generated POM:
|
||||||
|
${matches.joinToString("\n") { it.groupValues[0] }}
|
||||||
|
"""
|
||||||
|
.trimIndent()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val buildInfo = project.extensions.getByType<BuildInfo>()
|
||||||
|
if (buildInfo.isReleaseBuild) {
|
||||||
|
val snapshotVersion = Regex("<version>.*-SNAPSHOT</version>")
|
||||||
|
val matches = snapshotVersion.findAll(text).toList()
|
||||||
|
if (matches.isNotEmpty()) {
|
||||||
|
throw org.gradle.api.GradleException(
|
||||||
|
"""
|
||||||
|
Found snapshot version(s) in generated POM of Pkl release version:
|
||||||
|
${matches.joinToString("\n") { it.groupValues[0] }}
|
||||||
|
"""
|
||||||
|
.trimIndent()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
outputFile.get().asFile.writeText("OK")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named("publish") { dependsOn(validatePom) }
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Configures signing for Pkl publications. */
|
||||||
|
fun Project.configurePklSigning() {
|
||||||
|
// Workaround for maven publish plugin not setting up dependencies correctly.
|
||||||
|
// Taken from https://github.com/gradle/gradle/issues/26091#issuecomment-1798137734
|
||||||
|
val dependsOnTasks = mutableListOf<String>()
|
||||||
|
|
||||||
|
tasks.withType<AbstractPublishToMaven>().configureEach {
|
||||||
|
dependsOnTasks.add(name.replace("publish", "sign").replaceAfter("Publication", ""))
|
||||||
|
dependsOn(dependsOnTasks)
|
||||||
|
}
|
||||||
|
|
||||||
|
extensions.configure<SigningExtension> {
|
||||||
|
// provided as env vars `ORG_GRADLE_PROJECT_signingKey` and
|
||||||
|
// `ORG_GRADLE_PROJECT_signingPassword` in CI.
|
||||||
|
val signingKey =
|
||||||
|
(findProperty("signingKey") as String?)?.let {
|
||||||
|
Base64.getDecoder().decode(it).toString(StandardCharsets.US_ASCII)
|
||||||
|
}
|
||||||
|
val signingPassword = findProperty("signingPassword") as String?
|
||||||
|
if (signingKey != null && signingPassword != null) {
|
||||||
|
useInMemoryPgpKeys(signingKey, signingPassword)
|
||||||
|
}
|
||||||
|
extensions.getByType<PublishingExtension>().publications.findByName("library")?.let { sign(it) }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import org.gradle.api.DefaultTask
|
||||||
|
import org.gradle.api.artifacts.Configuration
|
||||||
|
import org.gradle.api.artifacts.result.ResolvedArtifactResult
|
||||||
|
import org.gradle.api.artifacts.result.ResolvedDependencyResult
|
||||||
|
import org.gradle.api.file.DirectoryProperty
|
||||||
|
import org.gradle.api.provider.Property
|
||||||
|
import org.gradle.api.tasks.InputFiles
|
||||||
|
import org.gradle.api.tasks.OutputDirectory
|
||||||
|
import org.gradle.api.tasks.TaskAction
|
||||||
|
import org.gradle.jvm.JvmLibrary
|
||||||
|
import org.gradle.kotlin.dsl.property
|
||||||
|
import org.gradle.language.base.artifact.SourcesArtifact
|
||||||
|
|
||||||
|
open class ResolveSourcesJars : DefaultTask() {
|
||||||
|
@get:InputFiles val configuration: Property<Configuration> = project.objects.property()
|
||||||
|
|
||||||
|
@get:OutputDirectory val outputDir: DirectoryProperty = project.objects.directoryProperty()
|
||||||
|
|
||||||
|
@TaskAction
|
||||||
|
@Suppress("UnstableApiUsage", "unused")
|
||||||
|
fun resolve() {
|
||||||
|
val componentIds =
|
||||||
|
configuration.get().incoming.resolutionResult.allDependencies.map {
|
||||||
|
(it as ResolvedDependencyResult).selected.id
|
||||||
|
}
|
||||||
|
|
||||||
|
val resolutionResult =
|
||||||
|
project.dependencies
|
||||||
|
.createArtifactResolutionQuery()
|
||||||
|
.forComponents(componentIds)
|
||||||
|
.withArtifacts(JvmLibrary::class.java, SourcesArtifact::class.java)
|
||||||
|
.execute()
|
||||||
|
|
||||||
|
val resolvedJars =
|
||||||
|
resolutionResult.resolvedComponents
|
||||||
|
.flatMap { it.getArtifacts(SourcesArtifact::class.java) }
|
||||||
|
.map { (it as ResolvedArtifactResult).file }
|
||||||
|
|
||||||
|
// copying to an output dir because I don't know how else to describe task outputs
|
||||||
|
project.sync {
|
||||||
|
from(resolvedJars)
|
||||||
|
into(outputDir)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import com.diffplug.spotless.FormatterFunc
|
||||||
|
import com.diffplug.spotless.FormatterStep
|
||||||
|
import java.io.File
|
||||||
|
import java.io.Serial
|
||||||
|
import java.io.Serializable
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Spotless [FormatterStep] that suppresses formatting changes where the only difference between
|
||||||
|
* the formatted output and the file's content in the upstream base ref is the license header year.
|
||||||
|
*
|
||||||
|
* Avoids an issue where, in the process of working on the codebase:
|
||||||
|
* 1. A file is modified.
|
||||||
|
* 2. Spotless formats the file, and also updates the copyright year.
|
||||||
|
* 3. The original modification is reverted.
|
||||||
|
* 4. Spotless formats the file again, but now the copyright year is the updated year.
|
||||||
|
*/
|
||||||
|
class RevertYearOnlyChangesStep(private val repoRoot: File, private val ratchetFrom: String) :
|
||||||
|
Serializable {
|
||||||
|
companion object {
|
||||||
|
@Serial private const val serialVersionUID: Long = 1L
|
||||||
|
}
|
||||||
|
|
||||||
|
fun create(): FormatterStep =
|
||||||
|
FormatterStep.createLazy(
|
||||||
|
"revertYearOnlyChanges",
|
||||||
|
{ this },
|
||||||
|
{ RevertYearOnlyChangesFunc(repoRoot, ratchetFrom) },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
class RevertYearOnlyChangesFunc(private val repoRoot: File, private val ratchetFrom: String) :
|
||||||
|
FormatterFunc.NeedsFile, Serializable {
|
||||||
|
companion object {
|
||||||
|
@Serial private const val serialVersionUID: Long = 1L
|
||||||
|
|
||||||
|
// Matches "Copyright © 2024" or "Copyright © 2024-2025"
|
||||||
|
private val YEAR_REGEX = Regex("""(Copyright © )\d{4}(-\d{4})?""")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun applyWithFile(unix: String, file: File): String {
|
||||||
|
val relativePath = repoRoot.toPath().relativize(file.toPath()).toString()
|
||||||
|
val upstreamContent = gitShow(ratchetFrom, relativePath) ?: return unix
|
||||||
|
val normalizedRaw = YEAR_REGEX.replace(unix, "\$1YEAR")
|
||||||
|
val normalizedUpstream = YEAR_REGEX.replace(upstreamContent, "\$1YEAR")
|
||||||
|
return if (normalizedRaw == normalizedUpstream) {
|
||||||
|
// Only the year changed — return the upstream content
|
||||||
|
upstreamContent
|
||||||
|
} else {
|
||||||
|
unix
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun gitShow(ref: String, path: String): String? {
|
||||||
|
val process =
|
||||||
|
ProcessBuilder("git", "show", "$ref:$path")
|
||||||
|
.directory(repoRoot)
|
||||||
|
.redirectErrorStream(true)
|
||||||
|
.start()
|
||||||
|
val output = process.inputStream.readBytes().toString(Charsets.UTF_8)
|
||||||
|
return if (process.waitFor() == 0) output.replace("\r\n", "\n") else null
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import com.diffplug.gradle.spotless.KotlinGradleExtension
|
||||||
|
import org.gradle.accessors.dm.LibrariesForLibs
|
||||||
|
|
||||||
|
plugins { id("com.diffplug.spotless") }
|
||||||
|
|
||||||
|
val buildInfo = extensions.create<BuildInfo>("buildInfo", project)
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
val rejectedVersionSuffix = Regex("-alpha|-beta|-eap|-m|-rc|-snapshot", RegexOption.IGNORE_CASE)
|
||||||
|
configureEach {
|
||||||
|
resolutionStrategy {
|
||||||
|
// forbid dependencies whose pom.xml's include version ranges, because this will lead to
|
||||||
|
// unreproducible builds.
|
||||||
|
|
||||||
|
failOnDynamicVersions()
|
||||||
|
componentSelection {
|
||||||
|
all {
|
||||||
|
if (rejectedVersionSuffix.containsMatchIn(candidate.version)) {
|
||||||
|
reject(
|
||||||
|
"Rejected dependency $candidate " +
|
||||||
|
"because it has a prelease version suffix matching `$rejectedVersionSuffix`."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<JavaCompile>().configureEach {
|
||||||
|
javaCompiler = buildInfo.javaCompiler
|
||||||
|
options.release = buildInfo.jvmTarget
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins.withType(IdeaPlugin::class).configureEach {
|
||||||
|
val errorMessage =
|
||||||
|
"Use IntelliJ Gradle import instead of running the `idea` task. See README for more information."
|
||||||
|
|
||||||
|
tasks.named("idea") { doFirst { throw GradleException(errorMessage) } }
|
||||||
|
tasks.named("ideaModule") { doFirst { throw GradleException(errorMessage) } }
|
||||||
|
if (project == rootProject) {
|
||||||
|
tasks.named("ideaProject") { doFirst { throw GradleException(errorMessage) } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins.withType(MavenPublishPlugin::class).configureEach {
|
||||||
|
configure<PublishingExtension> {
|
||||||
|
// CI builds pick up artifacts from this repo.
|
||||||
|
// It's important that this repo is only declared once per project.
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
name = "projectLocal" // affects task names
|
||||||
|
url = rootDir.resolve("build/m2").toURI()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// use resolved/locked (e.g., `1.15`)
|
||||||
|
// instead of declared (e.g., `1.+`)
|
||||||
|
// dependency versions in generated POMs
|
||||||
|
publications {
|
||||||
|
withType(MavenPublication::class.java) {
|
||||||
|
versionMapping { allVariants { fromResolutionResult() } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val allDependencies by tasks.registering(DependencyReportTask::class)
|
||||||
|
|
||||||
|
tasks.withType(Test::class).configureEach {
|
||||||
|
System.getProperty("testReportsDir")?.let { reportsDir ->
|
||||||
|
reports.junitXml.outputLocation.set(file(reportsDir).resolve(project.name).resolve(name))
|
||||||
|
}
|
||||||
|
debugOptions {
|
||||||
|
enabled = System.getProperty("jvmdebug")?.toBoolean() ?: false
|
||||||
|
host = "*"
|
||||||
|
port = 5005
|
||||||
|
suspend = true
|
||||||
|
server = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaExec::class).configureEach {
|
||||||
|
debugOptions {
|
||||||
|
enabled = System.getProperty("jvmdebug")?.toBoolean() ?: false
|
||||||
|
host = "*"
|
||||||
|
port = 5005
|
||||||
|
suspend = true
|
||||||
|
server = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Version Catalog library symbols.
|
||||||
|
private val libs = the<LibrariesForLibs>()
|
||||||
|
|
||||||
|
private val licenseHeaderFile by lazy {
|
||||||
|
rootProject.file("build-logic/src/main/resources/license-header.star-block.txt")
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun KotlinGradleExtension.configureFormatter() {
|
||||||
|
ktfmt(libs.versions.ktfmt.get()).googleStyle()
|
||||||
|
licenseHeaderFile(licenseHeaderFile, "([a-zA-Z]|@file|//)")
|
||||||
|
}
|
||||||
|
|
||||||
|
val originalRemoteName = System.getenv("PKL_ORIGINAL_REMOTE_NAME") ?: "origin"
|
||||||
|
// if we're running against a release branch (or a PR targeted at one), use that branch for
|
||||||
|
// ratcheting
|
||||||
|
// these env vars are set by GitHub actions:
|
||||||
|
// https://docs.github.com/en/actions/reference/workflows-and-actions/variables#default-environment-variables
|
||||||
|
val ratchetBranchName =
|
||||||
|
(System.getenv("GITHUB_BASE_REF") ?: System.getenv("GITHUB_REF_NAME"))?.let {
|
||||||
|
if (it.startsWith("release/")) it else null
|
||||||
|
} ?: "main"
|
||||||
|
|
||||||
|
spotless {
|
||||||
|
ratchetFrom = "$originalRemoteName/$ratchetBranchName"
|
||||||
|
|
||||||
|
val revertYearOnlyChangesStep =
|
||||||
|
RevertYearOnlyChangesStep(rootProject.rootDir, ratchetFrom!!).create()
|
||||||
|
|
||||||
|
// When building root project, format build-logic files too.
|
||||||
|
// We need this because build-logic is not a subproject of the root project, so a top-level
|
||||||
|
// `spotlessApply` will not trigger `build-logic:spotlessApply`.
|
||||||
|
if (project.path == rootProject.path) {
|
||||||
|
kotlinGradle {
|
||||||
|
configureFormatter()
|
||||||
|
addStep(revertYearOnlyChangesStep)
|
||||||
|
target("*.kts", "build-logic/*.kts", "build-logic/src/*/kotlin/**/*.kts")
|
||||||
|
}
|
||||||
|
kotlin {
|
||||||
|
ktfmt(libs.versions.ktfmt.get()).googleStyle()
|
||||||
|
target("build-logic/src/*/kotlin/**/*.kt")
|
||||||
|
licenseHeaderFile(licenseHeaderFile)
|
||||||
|
addStep(revertYearOnlyChangesStep)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
kotlinGradle {
|
||||||
|
configureFormatter()
|
||||||
|
addStep(revertYearOnlyChangesStep)
|
||||||
|
target("*.kts")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,222 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import org.gradle.api.GradleException
|
||||||
|
import org.gradle.api.artifacts.Configuration
|
||||||
|
import org.gradle.api.publish.maven.MavenPublication
|
||||||
|
import org.gradle.api.tasks.bundling.Jar
|
||||||
|
import org.gradle.api.tasks.testing.Test
|
||||||
|
import org.gradle.kotlin.dsl.*
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
`java-library`
|
||||||
|
`maven-publish`
|
||||||
|
id("com.gradleup.shadow")
|
||||||
|
}
|
||||||
|
|
||||||
|
// make fat Jar available to other subprojects
|
||||||
|
val fatJarConfiguration: Configuration = configurations.create("fatJar")
|
||||||
|
|
||||||
|
val fatJarPublication: MavenPublication = publishing.publications.create<MavenPublication>("fatJar")
|
||||||
|
|
||||||
|
// ideally we'd configure this automatically based on project dependencies
|
||||||
|
val firstPartySourcesJarsConfiguration: Configuration =
|
||||||
|
configurations.create("firstPartySourcesJars")
|
||||||
|
|
||||||
|
val relocations =
|
||||||
|
mapOf(
|
||||||
|
// pkl-core dependencies
|
||||||
|
"org.organicdesign.fp." to "org.pkl.thirdparty.paguro.",
|
||||||
|
"org.snakeyaml.engine." to "org.pkl.thirdparty.snakeyaml.engine.",
|
||||||
|
"org.msgpack." to "org.pkl.thirdparty.msgpack.",
|
||||||
|
"org.w3c.dom." to "org.pkl.thirdparty.w3c.dom.",
|
||||||
|
"com.oracle.svm.core." to "org.pkl.thirdparty.svm.",
|
||||||
|
|
||||||
|
// pkl-cli dependencies
|
||||||
|
"org.jline." to "org.pkl.thirdparty.jline.",
|
||||||
|
"com.github.ajalt.clikt." to "org.pkl.thirdparty.clikt.",
|
||||||
|
"com.github.ajalt.colormath." to "org.pkl.thirdparty.colormath.",
|
||||||
|
"com.github.ajalt.mordant." to "org.pkl.thirdparty.mordant.",
|
||||||
|
"com.sun.jna." to "org.pkl.thirdparty.jna.",
|
||||||
|
"kotlin." to "org.pkl.thirdparty.kotlin.",
|
||||||
|
"kotlinx." to "org.pkl.thirdparty.kotlinx.",
|
||||||
|
"org.intellij." to "org.pkl.thirdparty.intellij.",
|
||||||
|
"org.fusesource.jansi." to "org.pkl.thirdparty.jansi.",
|
||||||
|
"org.fusesource.hawtjni." to "org.pkl.thirdparty.hawtjni.",
|
||||||
|
|
||||||
|
// pkl-doc dependencies
|
||||||
|
"org.commonmark." to "org.pkl.thirdparty.commonmark.",
|
||||||
|
"org.jetbrains." to "org.pkl.thirdparty.jetbrains.",
|
||||||
|
"_COROUTINE." to "org.pkl.thirdparty.kotlinx._COROUTINE.",
|
||||||
|
|
||||||
|
// pkl-config-java dependencies
|
||||||
|
"io.leangen.geantyref." to "org.pkl.thirdparty.geantyref.",
|
||||||
|
|
||||||
|
// pkl-codegen-java dependencies
|
||||||
|
"com.palantir.javapoet." to "org.pkl.thirdparty.javapoet.",
|
||||||
|
|
||||||
|
// pkl-codegen-kotlin dependencies
|
||||||
|
"com.squareup.kotlinpoet." to "org.pkl.thirdparty.kotlinpoet.",
|
||||||
|
)
|
||||||
|
|
||||||
|
for ((key, value) in relocations) {
|
||||||
|
if (!key.endsWith(".")) {
|
||||||
|
throw GradleException(
|
||||||
|
"Invalid relocation `\"$key\" to \"$value\"`: `$key` should end with a dot"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (!value.endsWith(".")) {
|
||||||
|
throw GradleException(
|
||||||
|
"Invalid relocation `\"$key\" to \"$value\"`: `$value` should end with a dot"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val nonRelocations = listOf("com/oracle/truffle/", "org/graalvm/", "org/jspecify")
|
||||||
|
|
||||||
|
tasks.shadowJar {
|
||||||
|
inputs.property("relocations", relocations)
|
||||||
|
|
||||||
|
archiveClassifier.set(null as String?)
|
||||||
|
|
||||||
|
configurations = listOf(project.configurations.runtimeClasspath.get())
|
||||||
|
|
||||||
|
addMultiReleaseAttribute = true
|
||||||
|
|
||||||
|
// not required at runtime / fat JARs can't be used in native-image builds anyway
|
||||||
|
exclude("org/pkl/cli/svm/**")
|
||||||
|
|
||||||
|
exclude("META-INF/maven/**")
|
||||||
|
exclude("META-INF/upgrade/**")
|
||||||
|
|
||||||
|
exclude("DebugProbesKt.bin")
|
||||||
|
|
||||||
|
val info = project.extensions.getByType<BuildInfo>()
|
||||||
|
val minimumJvmTarget = JavaVersion.toVersion(info.jvmTarget)
|
||||||
|
|
||||||
|
manifest.attributes(
|
||||||
|
// Certain exports need to be added to the Java modulepath for Java 17 to work properly with
|
||||||
|
// shaded JARs. See the following link for an explanation of this syntax:
|
||||||
|
// https://bugs.openjdk.org/browse/JDK-8335225
|
||||||
|
"Add-Exports" to info.jpmsExportsForJarManifest
|
||||||
|
)
|
||||||
|
|
||||||
|
// effectively, this results in calls excluding:
|
||||||
|
// `META-INF/versions/{18-25}/**`
|
||||||
|
// at the time of this writing; multi-release JARs beyond JDK 21 break the current
|
||||||
|
// version of the Shadow plugin, and aren't needed for Truffle's use by Pkl.
|
||||||
|
JavaVersionRange.startingAt(JavaLanguageVersion.of(minimumJvmTarget.majorVersion.toInt() + 1))
|
||||||
|
.forEach { exclude("META-INF/versions/${it.asInt()}/**") }
|
||||||
|
|
||||||
|
exclude("module-info.*")
|
||||||
|
|
||||||
|
for ((from, to) in relocations) {
|
||||||
|
relocate(from, to)
|
||||||
|
}
|
||||||
|
|
||||||
|
// necessary for service files to be adapted to relocation
|
||||||
|
mergeServiceFiles()
|
||||||
|
}
|
||||||
|
|
||||||
|
shadow { addShadowVariantIntoJavaComponent = false }
|
||||||
|
|
||||||
|
val testFatJar by
|
||||||
|
tasks.registering(Test::class) {
|
||||||
|
testClassesDirs = files(tasks.test.get().testClassesDirs)
|
||||||
|
classpath =
|
||||||
|
// compiled test classes
|
||||||
|
sourceSets.test.get().output +
|
||||||
|
// fat Jar
|
||||||
|
tasks.shadowJar.get().outputs.files +
|
||||||
|
// test-only dependencies
|
||||||
|
// (test dependencies that are also main dependencies must already be contained in fat Jar;
|
||||||
|
// to verify that, we don't want to include them here)
|
||||||
|
(configurations.testRuntimeClasspath.get() - configurations.runtimeClasspath.get())
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.check { dependsOn(testFatJar) }
|
||||||
|
|
||||||
|
val validateFatJar by tasks.registering {
|
||||||
|
val outputFile = layout.buildDirectory.file("validateFatJar/result.txt")
|
||||||
|
inputs.files(tasks.shadowJar)
|
||||||
|
inputs.property("nonRelocations", nonRelocations)
|
||||||
|
outputs.file(outputFile)
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
val unshadowedFiles = mutableListOf<String>()
|
||||||
|
zipTree(tasks.shadowJar.get().outputs.files.singleFile).visit {
|
||||||
|
val fileDetails = this
|
||||||
|
val path = fileDetails.relativePath.pathString
|
||||||
|
if (
|
||||||
|
!(fileDetails.isDirectory ||
|
||||||
|
path.startsWith("org/pkl/") ||
|
||||||
|
path.startsWith("META-INF/") ||
|
||||||
|
nonRelocations.any { path.startsWith(it) })
|
||||||
|
) {
|
||||||
|
// don't throw exception inside `visit`
|
||||||
|
// as this gives a misleading "Could not expand ZIP" error message
|
||||||
|
unshadowedFiles.add(path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (unshadowedFiles.isEmpty()) {
|
||||||
|
outputFile.get().asFile.writeText("SUCCESS")
|
||||||
|
} else {
|
||||||
|
outputFile.get().asFile.writeText("FAILURE")
|
||||||
|
throw GradleException("Found unshadowed files:\n" + unshadowedFiles.joinToString("\n"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.check { dependsOn(validateFatJar) }
|
||||||
|
|
||||||
|
val resolveSourcesJars by
|
||||||
|
tasks.registering(ResolveSourcesJars::class) {
|
||||||
|
configuration.set(configurations.runtimeClasspath)
|
||||||
|
outputDir.set(layout.buildDirectory.dir("resolveSourcesJars"))
|
||||||
|
}
|
||||||
|
|
||||||
|
val fatSourcesJar by
|
||||||
|
tasks.registering(MergeSourcesJars::class) {
|
||||||
|
plugins.withId("pklJavaLibrary") { inputJars.from(tasks.named("sourcesJar")) }
|
||||||
|
inputJars.from(firstPartySourcesJarsConfiguration)
|
||||||
|
inputJars.from(resolveSourcesJars.map { fileTree(it.outputDir) })
|
||||||
|
|
||||||
|
mergedBinaryJars.from(tasks.shadowJar)
|
||||||
|
relocatedPackages.set(relocations)
|
||||||
|
outputJar.fileProvider(
|
||||||
|
provider {
|
||||||
|
file(tasks.shadowJar.get().archiveFile.get().asFile.path.replace(".jar", "-sources.jar"))
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
artifacts { add("fatJar", tasks.shadowJar) }
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
named<MavenPublication>("fatJar") {
|
||||||
|
from(components["shadow"])
|
||||||
|
|
||||||
|
// sources Jar is fat
|
||||||
|
artifact(fatSourcesJar.flatMap { it.outputJar.asFile }) { classifier = "sources" }
|
||||||
|
|
||||||
|
plugins.withId("pklJavaLibrary") {
|
||||||
|
val javadocJar by tasks.existing(Jar::class)
|
||||||
|
// Javadoc Jar is not fat (didn't invest effort)
|
||||||
|
artifact(javadocJar.flatMap { it.archiveFile }) { classifier = "javadoc" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import de.undercouch.gradle.tasks.download.Download
|
||||||
|
import de.undercouch.gradle.tasks.download.Verify
|
||||||
|
|
||||||
|
plugins { id("de.undercouch.download") }
|
||||||
|
|
||||||
|
val buildInfo = project.extensions.getByType<BuildInfo>()
|
||||||
|
|
||||||
|
// tries to minimize chance of corruption by download-to-temp-file-and-move
|
||||||
|
val downloadGraalVmAarch64 by
|
||||||
|
tasks.registering(Download::class) { configureDownloadGraalVm(buildInfo.graalVmAarch64) }
|
||||||
|
|
||||||
|
val downloadGraalVmAmd64 by
|
||||||
|
tasks.registering(Download::class) { configureDownloadGraalVm(buildInfo.graalVmAmd64) }
|
||||||
|
|
||||||
|
fun Download.configureDownloadGraalVm(graalvm: BuildInfo.GraalVm) {
|
||||||
|
onlyIf { !graalvm.installDir.exists() }
|
||||||
|
doLast { println("Downloaded GraalVm to ${graalvm.downloadFile}") }
|
||||||
|
|
||||||
|
src(graalvm.downloadUrl)
|
||||||
|
dest(graalvm.downloadFile)
|
||||||
|
overwrite(false)
|
||||||
|
tempAndMove(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
val verifyGraalVmAarch64 by
|
||||||
|
tasks.registering(Verify::class) {
|
||||||
|
configureVerifyGraalVm(buildInfo.graalVmAarch64)
|
||||||
|
dependsOn(downloadGraalVmAarch64)
|
||||||
|
}
|
||||||
|
|
||||||
|
val verifyGraalVmAmd64 by
|
||||||
|
tasks.registering(Verify::class) {
|
||||||
|
configureVerifyGraalVm(buildInfo.graalVmAmd64)
|
||||||
|
dependsOn(downloadGraalVmAmd64)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Verify.configureVerifyGraalVm(graalvm: BuildInfo.GraalVm) {
|
||||||
|
onlyIf { !graalvm.installDir.exists() }
|
||||||
|
|
||||||
|
src(graalvm.downloadFile)
|
||||||
|
checksum(
|
||||||
|
buildInfo.libs.findVersion("graalVmSha256-${graalvm.osName}-${graalvm.arch}").get().toString()
|
||||||
|
)
|
||||||
|
algorithm("SHA-256")
|
||||||
|
}
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
val installGraalVmAarch64 by
|
||||||
|
tasks.registering(InstallGraalVm::class) {
|
||||||
|
dependsOn(verifyGraalVmAarch64)
|
||||||
|
graalVm = buildInfo.graalVmAarch64
|
||||||
|
}
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
val installGraalVmAmd64 by
|
||||||
|
tasks.registering(InstallGraalVm::class) {
|
||||||
|
dependsOn(verifyGraalVmAmd64)
|
||||||
|
graalVm = buildInfo.graalVmAmd64
|
||||||
|
}
|
||||||
+35
-25
@@ -1,19 +1,19 @@
|
|||||||
/**
|
/*
|
||||||
* Allows to run Gradle plugin tests against different Gradle versions.
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
*
|
*
|
||||||
* Adds a `compatibilityTestX` task for every Gradle version X
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* between `ext.minSupportedGradleVersion` and `ext.maxSupportedGradleVersion`
|
* you may not use this file except in compliance with the License.
|
||||||
* that is not in `ext.gradleVersionsExcludedFromTesting`.
|
* You may obtain a copy of the License at
|
||||||
* The list of available Gradle versions is obtained from services.gradle.org.
|
*
|
||||||
* Adds lifecycle tasks to test against multiple Gradle versions at once, for example all Gradle release versions.
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Compatibility test tasks run the same tests and use the same task configuration as the project's `test` task.
|
*
|
||||||
* They set system properties for the Gradle version and distribution URL to be used.
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* These properties are consumed by the `AbstractTest` class.
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
plugins { java }
|
||||||
plugins {
|
|
||||||
java
|
|
||||||
}
|
|
||||||
|
|
||||||
val gradlePluginTests = extensions.create<GradlePluginTests>("gradlePluginTests")
|
val gradlePluginTests = extensions.create<GradlePluginTests>("gradlePluginTests")
|
||||||
|
|
||||||
@@ -21,21 +21,31 @@ tasks.addRule("Pattern: compatibilityTest[All|Releases|Latest|Candidate|Nightly|
|
|||||||
val taskName = this
|
val taskName = this
|
||||||
val matchResult = Regex("compatibilityTest(.+)").matchEntire(taskName) ?: return@addRule
|
val matchResult = Regex("compatibilityTest(.+)").matchEntire(taskName) ?: return@addRule
|
||||||
|
|
||||||
|
// https://github.com/gradle/gradle/issues/32599
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
when (val taskNameSuffix = matchResult.groupValues[1]) {
|
when (val taskNameSuffix = matchResult.groupValues[1]) {
|
||||||
"All" ->
|
"All" ->
|
||||||
task("compatibilityTestAll") {
|
task("compatibilityTestAll") {
|
||||||
dependsOn("compatibilityTestReleases", "compatibilityTestCandidate", "compatibilityTestNightly")
|
dependsOn(
|
||||||
|
"compatibilityTestReleases",
|
||||||
|
"compatibilityTestCandidate",
|
||||||
|
"compatibilityTestNightly",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
// releases in configured range
|
// releases in configured range
|
||||||
"Releases" ->
|
"Releases" ->
|
||||||
task("compatibilityTestReleases") {
|
task("compatibilityTestReleases") {
|
||||||
val versionInfos = GradleVersionInfo.fetchReleases()
|
val versionInfos = GradleVersionInfo.fetchReleases()
|
||||||
val versionsToTestAgainst = versionInfos.filter { versionInfo ->
|
val allVersions =
|
||||||
|
versionInfos
|
||||||
|
.filter { versionInfo ->
|
||||||
val v = versionInfo.gradleVersion
|
val v = versionInfo.gradleVersion
|
||||||
!versionInfo.broken &&
|
!versionInfo.broken &&
|
||||||
v in gradlePluginTests.minGradleVersion..gradlePluginTests.maxGradleVersion &&
|
v in gradlePluginTests.minGradleVersion..gradlePluginTests.maxGradleVersion &&
|
||||||
v !in gradlePluginTests.skippedGradleVersions
|
v !in gradlePluginTests.skippedGradleVersions
|
||||||
}
|
}
|
||||||
|
.sortedBy { it.gradleVersion }
|
||||||
|
val versionsToTestAgainst = listOf(allVersions.first(), allVersions.last())
|
||||||
|
|
||||||
dependsOn(versionsToTestAgainst.map { createCompatibilityTestTask(it) })
|
dependsOn(versionsToTestAgainst.map { createCompatibilityTestTask(it) })
|
||||||
}
|
}
|
||||||
@@ -45,8 +55,10 @@ tasks.addRule("Pattern: compatibilityTest[All|Releases|Latest|Candidate|Nightly|
|
|||||||
val versionInfo = GradleVersionInfo.fetchCurrent()
|
val versionInfo = GradleVersionInfo.fetchCurrent()
|
||||||
if (versionInfo.version == gradle.gradleVersion) {
|
if (versionInfo.version == gradle.gradleVersion) {
|
||||||
doLast {
|
doLast {
|
||||||
println("No new Gradle release available. " +
|
println(
|
||||||
"(Run `gradlew test` to test against ${versionInfo.version}.)")
|
"No new Gradle release available. " +
|
||||||
|
"(Run `gradlew test` to test against ${versionInfo.version}.)"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dependsOn(createCompatibilityTestTask(versionInfo))
|
dependsOn(createCompatibilityTestTask(versionInfo))
|
||||||
@@ -59,9 +71,7 @@ tasks.addRule("Pattern: compatibilityTest[All|Releases|Latest|Candidate|Nightly|
|
|||||||
if (versionInfo?.activeRc == true) {
|
if (versionInfo?.activeRc == true) {
|
||||||
dependsOn(createCompatibilityTestTask(versionInfo))
|
dependsOn(createCompatibilityTestTask(versionInfo))
|
||||||
} else {
|
} else {
|
||||||
doLast {
|
doLast { println("No active Gradle release candidate available.") }
|
||||||
println("No active Gradle release candidate available.")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// latest nightly
|
// latest nightly
|
||||||
@@ -74,16 +84,16 @@ tasks.addRule("Pattern: compatibilityTest[All|Releases|Latest|Candidate|Nightly|
|
|||||||
else ->
|
else ->
|
||||||
createCompatibilityTestTask(
|
createCompatibilityTestTask(
|
||||||
taskNameSuffix,
|
taskNameSuffix,
|
||||||
"https://services.gradle.org/distributions-snapshots/gradle-$taskNameSuffix-bin.zip"
|
"https://services.gradle.org/distributions-snapshots/gradle-$taskNameSuffix-bin.zip",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun createCompatibilityTestTask(versionInfo: GradleVersionInfo): Task =
|
fun createCompatibilityTestTask(versionInfo: GradleVersionInfo): TaskProvider<Test> =
|
||||||
createCompatibilityTestTask(versionInfo.version, versionInfo.downloadUrl)
|
createCompatibilityTestTask(versionInfo.version, versionInfo.downloadUrl)
|
||||||
|
|
||||||
fun createCompatibilityTestTask(version: String, downloadUrl: String): Task {
|
fun createCompatibilityTestTask(version: String, downloadUrl: String): TaskProvider<Test> {
|
||||||
return tasks.create("compatibilityTest$version", Test::class.java) {
|
return tasks.register("compatibilityTest$version", Test::class.java) {
|
||||||
mustRunAfter(tasks.test)
|
mustRunAfter(tasks.test)
|
||||||
|
|
||||||
maxHeapSize = tasks.test.get().maxHeapSize
|
maxHeapSize = tasks.test.get().maxHeapSize
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
plugins { base }
|
||||||
|
|
||||||
|
val htmlValidator = extensions.create<HtmlValidator>("htmlValidator", project)
|
||||||
|
|
||||||
|
val buildInfo = project.extensions.getByType<BuildInfo>()
|
||||||
|
|
||||||
|
val validatorConfiguration: Configuration =
|
||||||
|
configurations.create("validator") {
|
||||||
|
resolutionStrategy.eachDependency {
|
||||||
|
if (requested.group == "log4j" && requested.name == "log4j") {
|
||||||
|
useTarget(buildInfo.libs.findLibrary("log4j12Api").get())
|
||||||
|
because("mitigate critical security vulnerabilities")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
validatorConfiguration(buildInfo.libs.findLibrary("nuValidator").get()) {
|
||||||
|
// remove unnecessary dependencies
|
||||||
|
// (some of the requested versions don't even exist on Maven Central)
|
||||||
|
exclude(group = "org.eclipse.jetty", module = "jetty-alpn-client")
|
||||||
|
exclude(group = "org.eclipse.jetty", module = "jetty-continuation")
|
||||||
|
exclude(group = "org.eclipse.jetty", module = "jetty-http")
|
||||||
|
exclude(group = "org.eclipse.jetty", module = "jetty-security")
|
||||||
|
exclude(group = "org.eclipse.jetty", module = "jetty-server")
|
||||||
|
exclude(group = "org.eclipse.jetty", module = "jetty-servlets")
|
||||||
|
exclude(group = "org.eclipse.jetty", module = "jetty-jakarta-servlet-api")
|
||||||
|
exclude(group = "org.eclipse.jetty.toolchain")
|
||||||
|
exclude(group = "javax.servlet")
|
||||||
|
exclude(group = "org.apache.commons", module = "commons-fileupload2-core")
|
||||||
|
exclude(group = "org.apache.commons", module = "commons-fileupload2-jakarta-servlet5")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val validateHtml by
|
||||||
|
tasks.registering(JavaExec::class) {
|
||||||
|
val resultFile = layout.buildDirectory.file("validateHtml/result.txt")
|
||||||
|
inputs.files(htmlValidator.sources)
|
||||||
|
outputs.file(resultFile)
|
||||||
|
|
||||||
|
classpath = validatorConfiguration
|
||||||
|
mainClass.set("nu.validator.client.SimpleCommandLineValidator")
|
||||||
|
args(
|
||||||
|
"--skip-non-html"
|
||||||
|
) // --also-check-css doesn't work (still checks css as html), so limit to html files
|
||||||
|
args("--filterpattern", "(.*)Consider adding “lang=(.*)")
|
||||||
|
args("--filterpattern", "(.*)Consider adding a “lang” attribute(.*)")
|
||||||
|
args("--filterpattern", "(.*)unrecognized media “amzn-kf8”(.*)") // kindle
|
||||||
|
// for debugging
|
||||||
|
// args "--verbose"
|
||||||
|
args(htmlValidator.sources)
|
||||||
|
|
||||||
|
// write a basic result file s.t. gradle can consider task up-to-date
|
||||||
|
// writing a result file in case validation fails is not easily possible with JavaExec, but also
|
||||||
|
// not strictly necessary
|
||||||
|
doFirst { project.delete(resultFile) }
|
||||||
|
doLast { resultFile.get().asFile.writeText("Success.") }
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.check { dependsOn(validateHtml) }
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2025-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import net.ltgt.gradle.errorprone.errorprone
|
||||||
|
import net.ltgt.gradle.nullaway.nullaway
|
||||||
|
import org.gradle.accessors.dm.LibrariesForLibs
|
||||||
|
import org.gradle.api.tasks.compile.JavaCompile
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
`java-library`
|
||||||
|
id("net.ltgt.errorprone")
|
||||||
|
id("net.ltgt.nullaway")
|
||||||
|
}
|
||||||
|
|
||||||
|
val libs = the<LibrariesForLibs>()
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
api(libs.jspecify)
|
||||||
|
errorprone(libs.errorProne)
|
||||||
|
errorprone(libs.nullaway)
|
||||||
|
}
|
||||||
|
|
||||||
|
nullaway { onlyNullMarked = true }
|
||||||
|
|
||||||
|
tasks.withType<JavaCompile>().configureEach {
|
||||||
|
options.errorprone.disableAllChecks = true
|
||||||
|
options.errorprone.nullaway {
|
||||||
|
error()
|
||||||
|
onlyNullMarked = true
|
||||||
|
jspecifyMode = true
|
||||||
|
// honor assert x != null in addition to Objects.requireNonNull(x)
|
||||||
|
assertsEnabled = true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,130 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2025-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import kotlin.io.path.createDirectories
|
||||||
|
import kotlin.io.path.writeText
|
||||||
|
import org.gradle.kotlin.dsl.support.serviceOf
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id("pklJavaLibrary")
|
||||||
|
// id("pklPublishLibrary")
|
||||||
|
id("com.gradleup.shadow")
|
||||||
|
}
|
||||||
|
|
||||||
|
val executableSpec = project.extensions.create("executable", ExecutableSpec::class.java)
|
||||||
|
val buildInfo = project.extensions.getByType<BuildInfo>()
|
||||||
|
|
||||||
|
val javaExecutable by
|
||||||
|
tasks.registering(ExecutableJar::class) {
|
||||||
|
group = "build"
|
||||||
|
dependsOn(tasks.jar)
|
||||||
|
inJar = tasks.shadowJar.flatMap { it.archiveFile }
|
||||||
|
val effectiveJavaName =
|
||||||
|
executableSpec.javaName.map { name -> if (buildInfo.os.isWindows) "$name.bat" else name }
|
||||||
|
outJar = layout.buildDirectory.dir("executable").flatMap { it.file(effectiveJavaName) }
|
||||||
|
|
||||||
|
// uncomment for debugging
|
||||||
|
// jvmArgs.addAll("-ea", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Task.setupTestStartJavaExecutable(launcher: Provider<JavaLauncher>? = null) {
|
||||||
|
group = "verification"
|
||||||
|
dependsOn(javaExecutable)
|
||||||
|
|
||||||
|
// dummy output to satisfy up-to-date check
|
||||||
|
val outputFile = layout.buildDirectory.file("testStartJavaExecutable/$name")
|
||||||
|
outputs.file(outputFile)
|
||||||
|
|
||||||
|
val execOutput = providers.exec {
|
||||||
|
val executablePath = javaExecutable.get().outputs.files.singleFile
|
||||||
|
if (launcher?.isPresent == true) {
|
||||||
|
commandLine(
|
||||||
|
launcher.get().executablePath.asFile.absolutePath,
|
||||||
|
"-jar",
|
||||||
|
executablePath.absolutePath,
|
||||||
|
"--version",
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
commandLine(executablePath.absolutePath, "--version")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
val outputText = execOutput.standardOutput.asText.get()
|
||||||
|
if (!outputText.contains(buildInfo.pklVersionNonUnique)) {
|
||||||
|
throw GradleException(
|
||||||
|
"Expected version output to contain current version (${buildInfo.pklVersionNonUnique}), but got '$outputText'"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
outputFile.get().asFile.toPath().apply {
|
||||||
|
try {
|
||||||
|
parent.createDirectories()
|
||||||
|
} catch (_: java.nio.file.FileAlreadyExistsException) {}
|
||||||
|
writeText("OK")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val testStartJavaExecutable by tasks.registering { setupTestStartJavaExecutable() }
|
||||||
|
|
||||||
|
// Setup `testStartJavaExecutable` tasks for multi-JDK testing.
|
||||||
|
val testStartJavaExecutableOnOtherJdks =
|
||||||
|
buildInfo.jdkTestRange.map { jdkTarget ->
|
||||||
|
tasks.register("testStartJavaExecutableJdk${jdkTarget.asInt()}") {
|
||||||
|
enabled = buildInfo.isVersionEnabled(jdkTarget)
|
||||||
|
val toolChainService: JavaToolchainService = serviceOf()
|
||||||
|
val launcher = toolChainService.launcherFor { languageVersion = jdkTarget }
|
||||||
|
setupTestStartJavaExecutable(launcher)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.assemble { dependsOn(javaExecutable) }
|
||||||
|
|
||||||
|
tasks.check {
|
||||||
|
dependsOn(testStartJavaExecutable)
|
||||||
|
dependsOn(testStartJavaExecutableOnOtherJdks)
|
||||||
|
}
|
||||||
|
|
||||||
|
// publishing {
|
||||||
|
// publications {
|
||||||
|
// // need to put in `afterEvaluate` because `artifactId` cannot be set lazily.
|
||||||
|
// project.afterEvaluate {
|
||||||
|
// register<MavenPublication>("javaExecutable") {
|
||||||
|
// artifactId = executableSpec.javaPublicationName.get()
|
||||||
|
//
|
||||||
|
// artifact(javaExecutable.map { it.outputs.files.singleFile }) {
|
||||||
|
// classifier = null
|
||||||
|
// extension = "bin"
|
||||||
|
// builtBy(javaExecutable)
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// pom {
|
||||||
|
// url = executableSpec.website
|
||||||
|
// description =
|
||||||
|
// executableSpec.documentationName.map { name ->
|
||||||
|
// """
|
||||||
|
// $name executable for Java.
|
||||||
|
// Can be executed directly, or with `java -jar <path/to/jpkl>`.
|
||||||
|
// Requires Java 17 or higher.
|
||||||
|
// """
|
||||||
|
// .trimIndent()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// signing { project.afterEvaluate { sign(publishing.publications["javaExecutable"]) } }
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
@file:Suppress("HttpUrlsUsage", "unused")
|
||||||
|
|
||||||
|
import org.gradle.accessors.dm.LibrariesForLibs
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
`java-library`
|
||||||
|
`jvm-toolchains`
|
||||||
|
`jvm-test-suite`
|
||||||
|
id("pklKotlinTest")
|
||||||
|
id("com.diffplug.spotless")
|
||||||
|
}
|
||||||
|
|
||||||
|
// make sources Jar available to other subprojects
|
||||||
|
val sourcesJarConfiguration: Provider<Configuration> = configurations.register("sourcesJar")
|
||||||
|
|
||||||
|
// Version Catalog library symbols.
|
||||||
|
val libs = the<LibrariesForLibs>()
|
||||||
|
|
||||||
|
// Build configuration.
|
||||||
|
val info = project.extensions.getByType<BuildInfo>()
|
||||||
|
|
||||||
|
java {
|
||||||
|
withSourcesJar() // creates `sourcesJar` task
|
||||||
|
withJavadocJar()
|
||||||
|
|
||||||
|
toolchain {
|
||||||
|
languageVersion = info.jdkToolchainVersion
|
||||||
|
vendor = info.jdkVendor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
artifacts {
|
||||||
|
// make sources Jar available to other subprojects
|
||||||
|
add("sourcesJar", tasks["sourcesJar"])
|
||||||
|
}
|
||||||
|
|
||||||
|
spotless {
|
||||||
|
val revertYearOnlyChanges = RevertYearOnlyChangesStep(rootProject.rootDir, ratchetFrom!!).create()
|
||||||
|
|
||||||
|
java {
|
||||||
|
addStep(revertYearOnlyChanges)
|
||||||
|
googleJavaFormat(libs.versions.googleJavaFormat.get())
|
||||||
|
target("src/*/java/**/*.java")
|
||||||
|
licenseHeaderFile(
|
||||||
|
rootProject.file("build-logic/src/main/resources/license-header.star-block.txt")
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.jar {
|
||||||
|
manifest {
|
||||||
|
attributes +=
|
||||||
|
mapOf(
|
||||||
|
"Automatic-Module-Name" to "org.${project.name.replace("-", ".")}",
|
||||||
|
"Add-Exports" to info.jpmsExportsForJarManifest,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.javadoc {
|
||||||
|
classpath = sourceSets.main.get().output + sourceSets.main.get().compileClasspath
|
||||||
|
source = sourceSets.main.get().allJava
|
||||||
|
title = "${project.name} ${project.version} API"
|
||||||
|
(options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet")
|
||||||
|
}
|
||||||
|
|
||||||
|
val truffleJavacArgs =
|
||||||
|
listOf(
|
||||||
|
// TODO: determine correct limits for Truffle specializations
|
||||||
|
// (see https://graalvm.slack.com/archives/CNQSB2DHD/p1712380902746829)
|
||||||
|
"-Atruffle.dsl.SuppressWarnings=truffle-limit"
|
||||||
|
)
|
||||||
|
|
||||||
|
tasks.compileJava {
|
||||||
|
javaCompiler = info.javaCompiler
|
||||||
|
options.compilerArgs.addAll(truffleJavacArgs + info.jpmsAddModulesFlags)
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<JavaCompile>().configureEach {
|
||||||
|
javaCompiler = info.javaCompiler
|
||||||
|
options.release = info.jvmTarget
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<JavaExec>().configureEach { jvmArgs(info.jpmsAddModulesFlags) }
|
||||||
|
|
||||||
|
fun Test.configureJdkTestTask(launcher: Provider<JavaLauncher>) {
|
||||||
|
useJUnitPlatform()
|
||||||
|
javaLauncher = launcher
|
||||||
|
systemProperties.putAll(info.testProperties)
|
||||||
|
jvmArgs.addAll(info.jpmsAddModulesFlags)
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.test { configureJdkTestTask(info.javaTestLauncher) }
|
||||||
|
|
||||||
|
// Prepare test tasks for each JDK version which is within the test target suite for Pkl. Each task
|
||||||
|
// uses a pinned JDK toolchain version, and is named for the major version which is tested.
|
||||||
|
//
|
||||||
|
// Test tasks configured in this manner are executed manually by name, e.g. `./gradlew testJdk11`,
|
||||||
|
// and automatically as dependencies of `check`.
|
||||||
|
//
|
||||||
|
// We omit the current JDK from this list because it is already tested, in effect, by the default
|
||||||
|
// `test` task.
|
||||||
|
//
|
||||||
|
// Pkl subprojects may elect to further configure these tasks as needed; by default, each task
|
||||||
|
// inherits the configuration of the default `test` task (aside from an overridden launcher).
|
||||||
|
val jdkTestTasks = info.multiJdkTestingWith(tasks.test) { (_, jdk) -> configureJdkTestTask(jdk) }
|
||||||
|
|
||||||
|
tasks.check { dependsOn(jdkTestTasks) }
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import org.gradle.accessors.dm.LibrariesForLibs
|
||||||
|
import org.gradle.api.GradleException
|
||||||
|
import org.gradle.kotlin.dsl.getByType
|
||||||
|
import org.gradle.kotlin.dsl.kotlin
|
||||||
|
import org.gradle.kotlin.dsl.the
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
java
|
||||||
|
kotlin("jvm")
|
||||||
|
id("com.diffplug.spotless")
|
||||||
|
}
|
||||||
|
|
||||||
|
val buildInfo = project.extensions.getByType<BuildInfo>()
|
||||||
|
|
||||||
|
val libs = the<LibrariesForLibs>()
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
jvmToolchain {
|
||||||
|
languageVersion.set(buildInfo.jdkToolchainVersion)
|
||||||
|
vendor.set(buildInfo.jdkVendor)
|
||||||
|
}
|
||||||
|
compilerOptions {
|
||||||
|
val kotlinTarget = KotlinVersion.fromVersion(libs.versions.kotlinTarget.get())
|
||||||
|
languageVersion.set(kotlinTarget)
|
||||||
|
apiVersion.set(kotlinTarget)
|
||||||
|
jvmTarget = JvmTarget.fromTarget(buildInfo.jvmTarget.toString())
|
||||||
|
freeCompilerArgs.addAll(
|
||||||
|
"-jvm-default=no-compatibility", // was: -Xjvm-default=all
|
||||||
|
"-Xjdk-release=${buildInfo.jvmTarget}",
|
||||||
|
"-Xjsr305=strict",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spotless {
|
||||||
|
val revertYearOnlyChanges = RevertYearOnlyChangesStep(rootProject.rootDir, ratchetFrom!!).create()
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
addStep(revertYearOnlyChanges)
|
||||||
|
ktfmt(libs.versions.ktfmt.get()).googleStyle()
|
||||||
|
target("src/*/kotlin/**/*.kt")
|
||||||
|
licenseHeaderFile(
|
||||||
|
rootProject.file("build-logic/src/main/resources/license-header.star-block.txt")
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Kotlin modules to guard: fail the build if any dependency resolves to a version higher than
|
||||||
|
* `libs.versions.kotlinTarget`. This includes versions introduced via direct declarations, BOMs,
|
||||||
|
* version catalogs, or constraints.
|
||||||
|
*/
|
||||||
|
val guardedKotlinModules = setOf(libs.kotlinStdLib.get().module, libs.kotlinReflect.get().module)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Classpath configurations where the above rule applies. Kept narrow to avoid interfering with
|
||||||
|
* Gradle/Kotlin plugin internal configurations.
|
||||||
|
*/
|
||||||
|
val guardedConfigurations =
|
||||||
|
setOf(
|
||||||
|
configurations.compileClasspath,
|
||||||
|
configurations.runtimeClasspath,
|
||||||
|
configurations.testCompileClasspath,
|
||||||
|
configurations.testRuntimeClasspath,
|
||||||
|
)
|
||||||
|
|
||||||
|
guardedConfigurations.forEach { configuration ->
|
||||||
|
configuration.configure {
|
||||||
|
incoming.afterResolve {
|
||||||
|
resolutionResult.allComponents.forEach { component ->
|
||||||
|
val moduleVersion = component.moduleVersion ?: return@forEach
|
||||||
|
if (
|
||||||
|
moduleVersion.module in guardedKotlinModules &&
|
||||||
|
moduleVersion.version.exceedsKotlinTarget()
|
||||||
|
) {
|
||||||
|
throw GradleException(
|
||||||
|
"Resolved ${moduleVersion.module}:${moduleVersion.version} on configuration $name, " +
|
||||||
|
"which exceeds the allowed Kotlin version ($kotlinTargetVersion)"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// also works for version ranges like: [2.3.0,)
|
||||||
|
val kotlinVersionRegex = Regex("""(\d+)\.(\d+)(?:\.\d+)?""")
|
||||||
|
val kotlinTargetVersion = libs.versions.kotlinTarget.get()
|
||||||
|
val targetMajor = kotlinTargetVersion.substringBefore('.').toInt()
|
||||||
|
val targetMinor = kotlinTargetVersion.substringAfter('.').toInt()
|
||||||
|
|
||||||
|
fun String.exceedsKotlinTarget(): Boolean {
|
||||||
|
val version =
|
||||||
|
kotlinVersionRegex.find(this) ?: throw GradleException("Could not parse Kotlin version: $this")
|
||||||
|
val major = version.groupValues[1].toInt()
|
||||||
|
val minor = version.groupValues[2].toInt()
|
||||||
|
return major > targetMajor || (major == targetMajor && minor > targetMinor)
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import org.gradle.accessors.dm.LibrariesForLibs
|
||||||
|
|
||||||
|
plugins { id("pklJavaLibrary") }
|
||||||
|
|
||||||
|
val buildInfo = project.extensions.getByType<BuildInfo>()
|
||||||
|
|
||||||
|
val libs = the<LibrariesForLibs>()
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
// Kotlin libraries typically expose stdlib types in their public APIs.
|
||||||
|
// Therefore, the stdlib must be available on the consumer's compile classpath,
|
||||||
|
// and "implementation" is not sufficient.
|
||||||
|
api(libs.kotlinStdLib)
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import java.net.URI
|
||||||
|
import org.gradle.accessors.dm.LibrariesForLibs
|
||||||
|
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
`jvm-test-suite`
|
||||||
|
id("pklKotlinBase")
|
||||||
|
}
|
||||||
|
|
||||||
|
val buildInfo = project.extensions.getByType<BuildInfo>()
|
||||||
|
|
||||||
|
val libs = the<LibrariesForLibs>()
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
testImplementation(libs.kotlinStdLib)
|
||||||
|
|
||||||
|
testImplementation(libs.assertj)
|
||||||
|
testImplementation(libs.junitApi)
|
||||||
|
testImplementation(libs.junitParams)
|
||||||
|
|
||||||
|
testRuntimeOnly(libs.junitEngine)
|
||||||
|
testRuntimeOnly(libs.junitLauncher)
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<Test>().configureEach {
|
||||||
|
val testTask = this
|
||||||
|
|
||||||
|
useJUnitPlatform()
|
||||||
|
|
||||||
|
// enable checking of stdlib return types
|
||||||
|
systemProperty("org.pkl.testMode", "true")
|
||||||
|
|
||||||
|
reports.named("html") { required = true }
|
||||||
|
|
||||||
|
testLogging { exceptionFormat = TestExceptionFormat.FULL }
|
||||||
|
|
||||||
|
addTestListener(
|
||||||
|
object : TestListener {
|
||||||
|
override fun beforeSuite(suite: TestDescriptor) {}
|
||||||
|
|
||||||
|
override fun beforeTest(testDescriptor: TestDescriptor) {}
|
||||||
|
|
||||||
|
override fun afterTest(testDescriptor: TestDescriptor, result: TestResult) {}
|
||||||
|
|
||||||
|
// print report link at end of task, not just at end of build
|
||||||
|
override fun afterSuite(descriptor: TestDescriptor, result: TestResult) {
|
||||||
|
if (descriptor.parent != null) return // only interested in overall result
|
||||||
|
|
||||||
|
if (result.resultType == TestResult.ResultType.FAILURE) {
|
||||||
|
println(
|
||||||
|
"\nThere were failing tests. See the report at: ${fixFileUri(testTask.reports.html.entryPoint.toURI())}"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// makes links clickable on macOS
|
||||||
|
private fun fixFileUri(uri: URI): URI {
|
||||||
|
if ("file" == uri.scheme && !uri.schemeSpecificPart.startsWith("//")) {
|
||||||
|
return URI.create("file://" + uri.schemeSpecificPart)
|
||||||
|
}
|
||||||
|
return uri
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,338 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2025-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import java.lang.Runtime.Version
|
||||||
|
import kotlin.io.path.createDirectories
|
||||||
|
import kotlin.io.path.writeText
|
||||||
|
import org.gradle.accessors.dm.LibrariesForLibs
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id("pklGraalVm")
|
||||||
|
id("pklJavaLibrary")
|
||||||
|
id("pklNativeLifecycle")
|
||||||
|
id("pklPublishLibrary")
|
||||||
|
id("com.gradleup.shadow")
|
||||||
|
}
|
||||||
|
|
||||||
|
// assumes that `pklJavaExecutable` is also applied
|
||||||
|
val executableSpec = project.extensions.getByType<ExecutableSpec>()
|
||||||
|
val buildInfo = project.extensions.getByType<BuildInfo>()
|
||||||
|
|
||||||
|
val stagedMacAmd64Executable: Configuration by configurations.creating
|
||||||
|
val stagedMacAarch64Executable: Configuration by configurations.creating
|
||||||
|
val stagedLinuxAmd64Executable: Configuration by configurations.creating
|
||||||
|
val stagedLinuxAarch64Executable: Configuration by configurations.creating
|
||||||
|
val stagedAlpineLinuxAmd64Executable: Configuration by configurations.creating
|
||||||
|
val stagedWindowsAmd64Executable: Configuration by configurations.creating
|
||||||
|
|
||||||
|
val nativeImageClasspath by configurations.creating {
|
||||||
|
extendsFrom(configurations.runtimeClasspath.get())
|
||||||
|
// Ensure native-image version uses GraalVM C SDKs instead of Java FFI or JNA
|
||||||
|
// (comes from artifact `mordant-jvm-graal-ffi`).
|
||||||
|
exclude("com.github.ajalt.mordant", "mordant-jvm-ffm")
|
||||||
|
exclude("com.github.ajalt.mordant", "mordant-jvm-ffm-jvm")
|
||||||
|
exclude("com.github.ajalt.mordant", "mordant-jvm-jna")
|
||||||
|
exclude("com.github.ajalt.mordant", "mordant-jvm-jna-jvm")
|
||||||
|
}
|
||||||
|
|
||||||
|
val libs = the<LibrariesForLibs>()
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
fun executableFile(suffix: String) =
|
||||||
|
files(
|
||||||
|
layout.buildDirectory.dir("executable").map { dir ->
|
||||||
|
dir.file(executableSpec.name.map { "$it-$suffix" })
|
||||||
|
}
|
||||||
|
)
|
||||||
|
nativeImageClasspath(libs.truffleRuntime)
|
||||||
|
nativeImageClasspath(libs.graalSdk)
|
||||||
|
|
||||||
|
stagedMacAarch64Executable(executableFile("macos-aarch64"))
|
||||||
|
stagedMacAmd64Executable(executableFile("macos-amd64"))
|
||||||
|
stagedLinuxAmd64Executable(executableFile("linux-amd64"))
|
||||||
|
stagedLinuxAarch64Executable(executableFile("linux-aarch64"))
|
||||||
|
stagedAlpineLinuxAmd64Executable(executableFile("alpine-linux-amd64"))
|
||||||
|
stagedWindowsAmd64Executable(executableFile("windows-amd64.exe"))
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun NativeImageBuild.amd64() {
|
||||||
|
arch = Architecture.AMD64
|
||||||
|
dependsOn(":installGraalVmAmd64")
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun NativeImageBuild.aarch64() {
|
||||||
|
arch = Architecture.AARCH64
|
||||||
|
dependsOn(":installGraalVmAarch64")
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun NativeImageBuild.setClasspath() {
|
||||||
|
classpath.from(sourceSets.main.map { it.output })
|
||||||
|
classpath.from(
|
||||||
|
project(":pkl-commons-cli").extensions.getByType(SourceSetContainer::class)["svm"].output
|
||||||
|
)
|
||||||
|
classpath.from(nativeImageClasspath)
|
||||||
|
}
|
||||||
|
|
||||||
|
val macExecutableAmd64 by
|
||||||
|
tasks.registering(NativeImageBuild::class) {
|
||||||
|
imageName = executableSpec.name.map { "$it-macos-amd64" }
|
||||||
|
mainClass = executableSpec.mainClass
|
||||||
|
amd64()
|
||||||
|
setClasspath()
|
||||||
|
}
|
||||||
|
|
||||||
|
val macExecutableAarch64 by
|
||||||
|
tasks.registering(NativeImageBuild::class) {
|
||||||
|
imageName = executableSpec.name.map { "$it-macos-aarch64" }
|
||||||
|
mainClass = executableSpec.mainClass
|
||||||
|
aarch64()
|
||||||
|
setClasspath()
|
||||||
|
}
|
||||||
|
|
||||||
|
val linuxExecutableAmd64 by
|
||||||
|
tasks.registering(NativeImageBuild::class) {
|
||||||
|
imageName = executableSpec.name.map { "$it-linux-amd64" }
|
||||||
|
mainClass = executableSpec.mainClass
|
||||||
|
amd64()
|
||||||
|
setClasspath()
|
||||||
|
}
|
||||||
|
|
||||||
|
val linuxExecutableAarch64 by
|
||||||
|
tasks.registering(NativeImageBuild::class) {
|
||||||
|
imageName = executableSpec.name.map { "$it-linux-aarch64" }
|
||||||
|
mainClass = executableSpec.mainClass
|
||||||
|
aarch64()
|
||||||
|
setClasspath()
|
||||||
|
// Ensure compatibility for kernels with page size set to 4k, 16k and 64k
|
||||||
|
// (e.g. Raspberry Pi 5, Asahi Linux)
|
||||||
|
extraNativeImageArgs.add("-H:PageSize=65536")
|
||||||
|
}
|
||||||
|
|
||||||
|
val alpineExecutableAmd64 by
|
||||||
|
tasks.registering(NativeImageBuild::class) {
|
||||||
|
imageName = executableSpec.name.map { "$it-alpine-linux-amd64" }
|
||||||
|
mainClass = executableSpec.mainClass
|
||||||
|
amd64()
|
||||||
|
setClasspath()
|
||||||
|
extraNativeImageArgs.addAll(listOf("--static", "--libc=musl"))
|
||||||
|
}
|
||||||
|
|
||||||
|
val windowsExecutableAmd64 by
|
||||||
|
tasks.registering(NativeImageBuild::class) {
|
||||||
|
imageName = executableSpec.name.map { "$it-windows-amd64" }
|
||||||
|
mainClass = executableSpec.mainClass
|
||||||
|
amd64()
|
||||||
|
setClasspath()
|
||||||
|
}
|
||||||
|
|
||||||
|
val assembleNative by tasks.existing
|
||||||
|
|
||||||
|
val testStartNativeExecutable by tasks.registering {
|
||||||
|
dependsOn(assembleNative)
|
||||||
|
|
||||||
|
// dummy file for up-to-date checking
|
||||||
|
val outputFile = project.layout.buildDirectory.file("testStartNativeExecutable/output.txt")
|
||||||
|
outputs.file(outputFile)
|
||||||
|
|
||||||
|
val execOutput = providers.exec {
|
||||||
|
commandLine(assembleNative.get().outputs.files.singleFile, "--version")
|
||||||
|
}
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
val outputText = execOutput.standardOutput.asText.get()
|
||||||
|
if (!outputText.contains(buildInfo.pklVersionNonUnique)) {
|
||||||
|
throw GradleException(
|
||||||
|
"Expected version output to contain current version (${buildInfo.pklVersionNonUnique}), but got '$outputText'"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
outputFile.get().asFile.toPath().apply {
|
||||||
|
try {
|
||||||
|
parent.createDirectories()
|
||||||
|
} catch (_: java.nio.file.FileAlreadyExistsException) {}
|
||||||
|
writeText("OK")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val requiredGlibcVersion: Version = Version.parse("2.17")
|
||||||
|
|
||||||
|
val checkGlibc by tasks.registering {
|
||||||
|
enabled = buildInfo.os.isLinux && !buildInfo.musl
|
||||||
|
dependsOn(assembleNative)
|
||||||
|
doLast {
|
||||||
|
val exec = providers.exec {
|
||||||
|
commandLine("objdump", "-T", assembleNative.get().outputs.files.singleFile)
|
||||||
|
}
|
||||||
|
val output = exec.standardOutput.asText.get()
|
||||||
|
val minimumGlibcVersion =
|
||||||
|
output
|
||||||
|
.split("\n")
|
||||||
|
.mapNotNull { line ->
|
||||||
|
val match = Regex("GLIBC_([.0-9]*)").find(line)
|
||||||
|
match?.groups[1]?.let { Version.parse(it.value) }
|
||||||
|
}
|
||||||
|
.maxOrNull()
|
||||||
|
if (minimumGlibcVersion == null) {
|
||||||
|
throw GradleException(
|
||||||
|
"Could not determine glibc version from executable. objdump output: $output"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (minimumGlibcVersion > requiredGlibcVersion) {
|
||||||
|
throw GradleException(
|
||||||
|
"Incorrect glibc version. Found: $minimumGlibcVersion, required: $requiredGlibcVersion"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Expose underlying task's outputs
|
||||||
|
private fun <T : Task> Task.wraps(other: TaskProvider<T>) {
|
||||||
|
dependsOn(other)
|
||||||
|
outputs.files(other)
|
||||||
|
}
|
||||||
|
|
||||||
|
val testNative by tasks.existing { dependsOn(testStartNativeExecutable, checkGlibc) }
|
||||||
|
|
||||||
|
val assembleNativeMacOsAarch64 by tasks.existing { wraps(macExecutableAarch64) }
|
||||||
|
|
||||||
|
val assembleNativeMacOsAmd64 by tasks.existing { wraps(macExecutableAmd64) }
|
||||||
|
|
||||||
|
val assembleNativeLinuxAarch64 by tasks.existing { wraps(linuxExecutableAarch64) }
|
||||||
|
|
||||||
|
val assembleNativeLinuxAmd64 by tasks.existing { wraps(linuxExecutableAmd64) }
|
||||||
|
|
||||||
|
val assembleNativeAlpineLinuxAmd64 by tasks.existing { wraps(alpineExecutableAmd64) }
|
||||||
|
|
||||||
|
val assembleNativeWindowsAmd64 by tasks.existing { wraps(windowsExecutableAmd64) }
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
// need to put in `afterEvaluate` because `artifactId` cannot be set lazily.
|
||||||
|
project.afterEvaluate {
|
||||||
|
create<MavenPublication>("macExecutableAmd64") {
|
||||||
|
artifactId = "${executableSpec.publicationName.get()}-macos-amd64"
|
||||||
|
artifact(stagedMacAmd64Executable.singleFile) {
|
||||||
|
classifier = null
|
||||||
|
extension = "bin"
|
||||||
|
builtBy(stagedMacAmd64Executable)
|
||||||
|
}
|
||||||
|
pom {
|
||||||
|
name = "${executableSpec.publicationName.get()}-macos-amd64"
|
||||||
|
url = executableSpec.website
|
||||||
|
description =
|
||||||
|
executableSpec.documentationName.map { name ->
|
||||||
|
"Native $name executable for macOS/amd64."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
create<MavenPublication>("macExecutableAarch64") {
|
||||||
|
artifactId = "${executableSpec.publicationName.get()}-macos-aarch64"
|
||||||
|
artifact(stagedMacAarch64Executable.singleFile) {
|
||||||
|
classifier = null
|
||||||
|
extension = "bin"
|
||||||
|
builtBy(stagedMacAarch64Executable)
|
||||||
|
}
|
||||||
|
pom {
|
||||||
|
name = "${executableSpec.publicationName.get()}-macos-aarch64"
|
||||||
|
url = executableSpec.website
|
||||||
|
description =
|
||||||
|
executableSpec.documentationName.map { name ->
|
||||||
|
"Native $name executable for macOS/aarch64."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
create<MavenPublication>("linuxExecutableAmd64") {
|
||||||
|
artifactId = "${executableSpec.publicationName.get()}-linux-amd64"
|
||||||
|
artifact(stagedLinuxAmd64Executable.singleFile) {
|
||||||
|
classifier = null
|
||||||
|
extension = "bin"
|
||||||
|
builtBy(stagedLinuxAmd64Executable)
|
||||||
|
}
|
||||||
|
pom {
|
||||||
|
name = "${executableSpec.publicationName.get()}-linux-amd64"
|
||||||
|
url = executableSpec.website
|
||||||
|
description =
|
||||||
|
executableSpec.documentationName.map { name ->
|
||||||
|
"Native $name executable for linux/amd64."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
create<MavenPublication>("linuxExecutableAarch64") {
|
||||||
|
artifactId = "${executableSpec.publicationName.get()}-linux-aarch64"
|
||||||
|
artifact(stagedLinuxAarch64Executable.singleFile) {
|
||||||
|
classifier = null
|
||||||
|
extension = "bin"
|
||||||
|
builtBy(stagedLinuxAarch64Executable)
|
||||||
|
}
|
||||||
|
pom {
|
||||||
|
name = "${executableSpec.publicationName.get()}-linux-aarch64"
|
||||||
|
url = executableSpec.website
|
||||||
|
description =
|
||||||
|
executableSpec.documentationName.map { name ->
|
||||||
|
"Native $name executable for linux/aarch64."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
create<MavenPublication>("alpineLinuxExecutableAmd64") {
|
||||||
|
artifactId = "${executableSpec.publicationName.get()}-alpine-linux-amd64"
|
||||||
|
artifact(stagedAlpineLinuxAmd64Executable.singleFile) {
|
||||||
|
classifier = null
|
||||||
|
extension = "bin"
|
||||||
|
builtBy(stagedAlpineLinuxAmd64Executable)
|
||||||
|
}
|
||||||
|
pom {
|
||||||
|
name = "${executableSpec.publicationName.get()}-alpine-linux-amd64"
|
||||||
|
url = executableSpec.website
|
||||||
|
description =
|
||||||
|
executableSpec.documentationName.map { name ->
|
||||||
|
"Native $name executable for linux/amd64 and statically linked to musl."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
create<MavenPublication>("windowsExecutableAmd64") {
|
||||||
|
artifactId = "${executableSpec.publicationName.get()}-windows-amd64"
|
||||||
|
artifact(stagedWindowsAmd64Executable.singleFile) {
|
||||||
|
classifier = null
|
||||||
|
extension = "exe"
|
||||||
|
builtBy(stagedWindowsAmd64Executable)
|
||||||
|
}
|
||||||
|
pom {
|
||||||
|
name = "${executableSpec.publicationName.get()}-windows-amd64"
|
||||||
|
url = executableSpec.website
|
||||||
|
description =
|
||||||
|
executableSpec.documentationName.map { name ->
|
||||||
|
"Native $name executable for windows/amd64."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
signing {
|
||||||
|
project.afterEvaluate {
|
||||||
|
sign(publishing.publications["linuxExecutableAarch64"])
|
||||||
|
sign(publishing.publications["linuxExecutableAmd64"])
|
||||||
|
sign(publishing.publications["macExecutableAarch64"])
|
||||||
|
sign(publishing.publications["macExecutableAmd64"])
|
||||||
|
sign(publishing.publications["alpineLinuxExecutableAmd64"])
|
||||||
|
sign(publishing.publications["windowsExecutableAmd64"])
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
val assembleNativeMacOsAarch64 by tasks.registering { group = "build" }
|
||||||
|
|
||||||
|
val assembleNativeMacOsAmd64 by tasks.registering { group = "build" }
|
||||||
|
|
||||||
|
val assembleNativeLinuxAarch64 by tasks.registering { group = "build" }
|
||||||
|
|
||||||
|
val assembleNativeLinuxAmd64 by tasks.registering { group = "build" }
|
||||||
|
|
||||||
|
val assembleNativeAlpineLinuxAmd64 by tasks.registering { group = "build" }
|
||||||
|
|
||||||
|
val assembleNativeWindowsAmd64 by tasks.registering { group = "build" }
|
||||||
|
|
||||||
|
val testNativeMacOsAarch64 by tasks.registering { group = "verification" }
|
||||||
|
|
||||||
|
val testNativeMacOsAmd64 by tasks.registering { group = "verification" }
|
||||||
|
|
||||||
|
val testNativeLinuxAarch64 by tasks.registering { group = "verification" }
|
||||||
|
|
||||||
|
val testNativeLinuxAmd64 by tasks.registering { group = "verification" }
|
||||||
|
|
||||||
|
val testNativeAlpineLinuxAmd64 by tasks.registering { group = "verification" }
|
||||||
|
|
||||||
|
val testNativeWindowsAmd64 by tasks.registering { group = "verification" }
|
||||||
|
|
||||||
|
val buildInfo = project.extensions.getByType<BuildInfo>()
|
||||||
|
|
||||||
|
private fun <T : Task> Task.wraps(other: TaskProvider<T>) {
|
||||||
|
dependsOn(other)
|
||||||
|
outputs.files(other)
|
||||||
|
}
|
||||||
|
|
||||||
|
val assembleNative by tasks.registering {
|
||||||
|
group = "build"
|
||||||
|
|
||||||
|
if (!buildInfo.isCrossArchSupported && buildInfo.isCrossArch) {
|
||||||
|
throw GradleException("Cross-arch builds are not supported on ${buildInfo.os.name}")
|
||||||
|
}
|
||||||
|
|
||||||
|
when {
|
||||||
|
buildInfo.os.isMacOsX && buildInfo.targetArch == "aarch64" -> {
|
||||||
|
wraps(assembleNativeMacOsAarch64)
|
||||||
|
}
|
||||||
|
buildInfo.os.isMacOsX && buildInfo.targetArch == "amd64" -> {
|
||||||
|
wraps(assembleNativeMacOsAmd64)
|
||||||
|
}
|
||||||
|
buildInfo.os.isLinux && buildInfo.targetArch == "aarch64" -> {
|
||||||
|
wraps(assembleNativeLinuxAarch64)
|
||||||
|
}
|
||||||
|
buildInfo.os.isLinux && buildInfo.targetArch == "amd64" -> {
|
||||||
|
if (buildInfo.musl) wraps(assembleNativeAlpineLinuxAmd64) else wraps(assembleNativeLinuxAmd64)
|
||||||
|
}
|
||||||
|
buildInfo.os.isWindows && buildInfo.targetArch == "amd64" -> {
|
||||||
|
wraps(assembleNativeWindowsAmd64)
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
doLast {
|
||||||
|
throw GradleException(
|
||||||
|
"Cannot build targeting ${buildInfo.os.name}/${buildInfo.targetArch} with musl=${buildInfo.musl}"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val testNative by tasks.registering {
|
||||||
|
group = "verification"
|
||||||
|
dependsOn(assembleNative)
|
||||||
|
|
||||||
|
if (!buildInfo.isCrossArchSupported && buildInfo.isCrossArch) {
|
||||||
|
throw GradleException("Cross-arch builds are not supported on ${buildInfo.os.name}")
|
||||||
|
}
|
||||||
|
|
||||||
|
when {
|
||||||
|
buildInfo.os.isMacOsX && buildInfo.targetArch == "aarch64" -> {
|
||||||
|
dependsOn(testNativeMacOsAarch64)
|
||||||
|
}
|
||||||
|
buildInfo.os.isMacOsX && buildInfo.targetArch == "amd64" -> {
|
||||||
|
dependsOn(testNativeMacOsAmd64)
|
||||||
|
}
|
||||||
|
buildInfo.os.isLinux && buildInfo.targetArch == "aarch64" -> {
|
||||||
|
dependsOn(testNativeLinuxAarch64)
|
||||||
|
}
|
||||||
|
buildInfo.os.isLinux && buildInfo.targetArch == "amd64" -> {
|
||||||
|
if (buildInfo.musl) dependsOn(testNativeAlpineLinuxAmd64) else dependsOn(testNativeLinuxAmd64)
|
||||||
|
}
|
||||||
|
buildInfo.os.isWindows && buildInfo.targetArch == "amd64" -> {
|
||||||
|
dependsOn(testNativeWindowsAmd64)
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
doLast {
|
||||||
|
throw GradleException(
|
||||||
|
"Cannot build targeting ${buildInfo.os.name}/${buildInfo.targetArch} with musl=${buildInfo.musl}"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val checkNative by tasks.registering {
|
||||||
|
group = "verification"
|
||||||
|
dependsOn(testNative)
|
||||||
|
}
|
||||||
|
|
||||||
|
val buildNative by tasks.registering {
|
||||||
|
group = "build"
|
||||||
|
dependsOn(checkNative)
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
plugins {
|
||||||
|
`maven-publish`
|
||||||
|
signing
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
components.findByName("java")?.let { javaComponent ->
|
||||||
|
create<MavenPublication>("library") { from(javaComponent) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
configurePklPomMetadata()
|
||||||
|
|
||||||
|
configurePomValidation()
|
||||||
|
|
||||||
|
configurePklSigning()
|
||||||
|
|
||||||
|
artifacts {
|
||||||
|
project.tasks.findByName("javadocJar")?.let { archives(it) }
|
||||||
|
project.tasks.findByName("sourcesJar")?.let { archives(it) }
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2025-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
plugins { id("com.diffplug.spotless") }
|
||||||
|
|
||||||
|
val pklFormatter by configurations.creating
|
||||||
|
|
||||||
|
dependencies { pklFormatter(rootProject.project("pkl-formatter")) }
|
||||||
|
|
||||||
|
spotless {
|
||||||
|
format("pkl") {
|
||||||
|
target("**/*.pkl")
|
||||||
|
addStep(PklFormatterStep(pklFormatter).create())
|
||||||
|
licenseHeaderFile(
|
||||||
|
rootProject.file("build-logic/src/main/resources/license-header.line-comment.txt"),
|
||||||
|
"/// ",
|
||||||
|
)
|
||||||
|
// disable ratcheting for Pkl sources
|
||||||
|
// make any change to pkl-formatter reformat the stdlib
|
||||||
|
ratchetFrom = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (taskName in
|
||||||
|
listOf("spotlessPkl", "spotlessPklApply", "spotlessPklCheck", "spotlessPklDiagnose")) {
|
||||||
|
tasks.named(taskName) { dependsOn(":pkl-formatter:assemble") }
|
||||||
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
// Copyright © $YEAR Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
//
|
//
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
* Copyright © $YEAR Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
+26
-18
@@ -1,14 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
// https://youtrack.jetbrains.com/issue/KTIJ-19369
|
// https://youtrack.jetbrains.com/issue/KTIJ-19369
|
||||||
@file:Suppress("DSL_SCOPE_VIOLATION")
|
|
||||||
|
|
||||||
import org.jetbrains.gradle.ext.ActionDelegationConfig
|
import org.jetbrains.gradle.ext.ActionDelegationConfig
|
||||||
import org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.PLATFORM
|
import org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.PLATFORM
|
||||||
import org.jetbrains.gradle.ext.ProjectSettings
|
import org.jetbrains.gradle.ext.ProjectSettings
|
||||||
import org.jetbrains.gradle.ext.TaskTriggersConfig
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
pklAllProjects
|
id("pklAllProjects")
|
||||||
pklGraalVm
|
id("pklGraalVm")
|
||||||
|
|
||||||
alias(libs.plugins.ideaExt)
|
alias(libs.plugins.ideaExt)
|
||||||
alias(libs.plugins.jmh) apply false
|
alias(libs.plugins.jmh) apply false
|
||||||
@@ -18,8 +30,8 @@ plugins {
|
|||||||
nexusPublishing {
|
nexusPublishing {
|
||||||
repositories {
|
repositories {
|
||||||
sonatype {
|
sonatype {
|
||||||
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
|
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
|
||||||
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
|
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,22 +45,16 @@ idea {
|
|||||||
delegateBuildRunToGradle = true
|
delegateBuildRunToGradle = true
|
||||||
testRunner = PLATFORM
|
testRunner = PLATFORM
|
||||||
}
|
}
|
||||||
configure<TaskTriggersConfig> {
|
|
||||||
afterSync(provider { project(":pkl-core").tasks.named("makeIntelliJAntlrPluginHappy") })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val clean by tasks.registering(Delete::class) {
|
val clean by tasks.existing { delete(layout.buildDirectory) }
|
||||||
delete(buildDir)
|
|
||||||
}
|
|
||||||
|
|
||||||
val printVersion by tasks.registering {
|
val printVersion by tasks.registering { doFirst { println(buildInfo.pklVersion) } }
|
||||||
doFirst { println(buildInfo.pklVersion) }
|
|
||||||
}
|
|
||||||
|
|
||||||
val message = """
|
val message =
|
||||||
|
"""
|
||||||
====
|
====
|
||||||
Gradle version : ${gradle.gradleVersion}
|
Gradle version : ${gradle.gradleVersion}
|
||||||
Java version : ${System.getProperty("java.version")}
|
Java version : ${System.getProperty("java.version")}
|
||||||
@@ -63,5 +69,7 @@ Git Commit ID : ${buildInfo.commitId}
|
|||||||
====
|
====
|
||||||
"""
|
"""
|
||||||
|
|
||||||
val formattedMessage = message.replace("\n====", "\n" + "=".repeat(message.lines().maxByOrNull { it.length }!!.length))
|
val formattedMessage =
|
||||||
|
message.replace("\n====", "\n" + "=".repeat(message.lines().maxByOrNull { it.length }!!.length))
|
||||||
|
|
||||||
logger.info(formattedMessage)
|
logger.info(formattedMessage)
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
plugins {
|
|
||||||
`kotlin-dsl`
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation(libs.downloadTaskPlugin)
|
|
||||||
implementation(libs.spotlessPlugin)
|
|
||||||
implementation(libs.kotlinPlugin) {
|
|
||||||
exclude(module = "kotlin-android-extensions")
|
|
||||||
}
|
|
||||||
implementation(libs.shadowPlugin)
|
|
||||||
}
|
|
||||||
|
|
||||||
java {
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
|
||||||
targetCompatibility = JavaVersion.VERSION_11
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
@file:Suppress("UnstableApiUsage")
|
|
||||||
|
|
||||||
pluginManagement {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
gradlePluginPortal()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// makes ~/.gradle/init.gradle unnecessary and ~/.gradle/gradle.properties optional
|
|
||||||
dependencyResolutionManagement {
|
|
||||||
// use same version catalog as main build
|
|
||||||
versionCatalogs {
|
|
||||||
register("libs") {
|
|
||||||
from(files("../gradle/libs.versions.toml"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
|
|
||||||
mavenCentral()
|
|
||||||
gradlePluginPortal()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,149 +0,0 @@
|
|||||||
@file:Suppress("MemberVisibilityCanBePrivate")
|
|
||||||
|
|
||||||
import java.io.File
|
|
||||||
import org.gradle.api.Project
|
|
||||||
import org.gradle.api.artifacts.VersionCatalog
|
|
||||||
import org.gradle.api.artifacts.VersionCatalogsExtension
|
|
||||||
import org.gradle.api.artifacts.VersionConstraint
|
|
||||||
import org.gradle.kotlin.dsl.getByType
|
|
||||||
|
|
||||||
// `buildInfo` in main build scripts
|
|
||||||
// `project.extensions.getByType<BuildInfo>()` in precompiled script plugins
|
|
||||||
open class BuildInfo(project: Project) {
|
|
||||||
val self = this
|
|
||||||
|
|
||||||
inner class GraalVm {
|
|
||||||
val homeDir: String by lazy {
|
|
||||||
System.getenv("GRAALVM_HOME") ?: "${System.getProperty("user.home")}/.graalvm"
|
|
||||||
}
|
|
||||||
|
|
||||||
val version: String by lazy {
|
|
||||||
libs.findVersion("graalVm").get().toString()
|
|
||||||
}
|
|
||||||
|
|
||||||
val isGraal22: Boolean by lazy {
|
|
||||||
version.startsWith("22")
|
|
||||||
}
|
|
||||||
|
|
||||||
val arch by lazy {
|
|
||||||
if (os.isMacOsX && isGraal22) {
|
|
||||||
"amd64"
|
|
||||||
} else {
|
|
||||||
self.arch
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val osName: String by lazy {
|
|
||||||
when {
|
|
||||||
os.isMacOsX && isGraal22 -> "darwin"
|
|
||||||
os.isMacOsX -> "macos"
|
|
||||||
os.isLinux -> "linux"
|
|
||||||
else -> throw RuntimeException("${os.familyName} is not supported.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val baseName: String by lazy {
|
|
||||||
if (graalVm.isGraal22) {
|
|
||||||
"graalvm-ce-java11-${osName}-${arch}-${version}"
|
|
||||||
} else {
|
|
||||||
"graalvm-jdk-${graalVM23JdkVersion}_${osName}-${arch}_bin"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val graalVM23JdkVersion: String by lazy {
|
|
||||||
libs.findVersion("graalVM23JdkVersion").get().requiredVersion
|
|
||||||
}
|
|
||||||
|
|
||||||
val downloadUrl: String by lazy {
|
|
||||||
if (isGraal22) {
|
|
||||||
"https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-" +
|
|
||||||
"${version}/$baseName.tar.gz"
|
|
||||||
} else {
|
|
||||||
val jdkMajor = graalVM23JdkVersion.takeWhile { it != '.' }
|
|
||||||
"https://download.oracle.com/graalvm/$jdkMajor/archive/$baseName.tar.gz"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val installDir: File by lazy {
|
|
||||||
File(homeDir, baseName)
|
|
||||||
}
|
|
||||||
|
|
||||||
val baseDir: String by lazy {
|
|
||||||
if (os.isMacOsX) "$installDir/Contents/Home" else installDir.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Same logic as [org.gradle.internal.os.OperatingSystem#arch], which is protected.
|
|
||||||
*/
|
|
||||||
val arch: String by lazy {
|
|
||||||
when (val arch = System.getProperty("os.arch")) {
|
|
||||||
"x86" -> "i386"
|
|
||||||
"x86_64" -> "amd64"
|
|
||||||
"powerpc" -> "ppc"
|
|
||||||
else -> arch
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val graalVm: GraalVm = GraalVm()
|
|
||||||
|
|
||||||
val isCiBuild: Boolean by lazy {
|
|
||||||
System.getenv("CI") != null
|
|
||||||
}
|
|
||||||
|
|
||||||
val isReleaseBuild: Boolean by lazy {
|
|
||||||
java.lang.Boolean.getBoolean("releaseBuild")
|
|
||||||
}
|
|
||||||
|
|
||||||
val hasMuslToolchain: Boolean by lazy {
|
|
||||||
// see "install musl" in .circleci/jobs/BuildNativeJob.pkl
|
|
||||||
File(System.getProperty("user.home"), "staticdeps/bin/x86_64-linux-musl-gcc").exists()
|
|
||||||
}
|
|
||||||
|
|
||||||
val os: org.gradle.internal.os.OperatingSystem by lazy {
|
|
||||||
org.gradle.internal.os.OperatingSystem.current()
|
|
||||||
}
|
|
||||||
|
|
||||||
// could be `commitId: Provider<String> = project.provider { ... }`
|
|
||||||
val commitId: String by lazy {
|
|
||||||
// only run command once per build invocation
|
|
||||||
if (project === project.rootProject) {
|
|
||||||
Runtime.getRuntime()
|
|
||||||
.exec("git rev-parse --short HEAD", arrayOf(), project.rootDir)
|
|
||||||
.inputStream.reader().readText().trim()
|
|
||||||
} else {
|
|
||||||
project.rootProject.extensions.getByType(BuildInfo::class.java).commitId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val commitish: String by lazy {
|
|
||||||
if (isReleaseBuild) project.version.toString() else commitId
|
|
||||||
}
|
|
||||||
|
|
||||||
val pklVersion: String by lazy {
|
|
||||||
if (isReleaseBuild) {
|
|
||||||
project.version.toString()
|
|
||||||
} else {
|
|
||||||
project.version.toString().replace("-SNAPSHOT", "-dev+$commitId")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val pklVersionNonUnique: String by lazy {
|
|
||||||
if (isReleaseBuild) {
|
|
||||||
project.version.toString()
|
|
||||||
} else {
|
|
||||||
project.version.toString().replace("-SNAPSHOT", "-dev")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// https://melix.github.io/blog/2021/03/version-catalogs-faq.html#_but_how_can_i_use_the_catalog_in_em_plugins_em_defined_in_code_buildsrc_code
|
|
||||||
val libs: VersionCatalog by lazy {
|
|
||||||
project.extensions.getByType<VersionCatalogsExtension>().named("libs")
|
|
||||||
}
|
|
||||||
|
|
||||||
init {
|
|
||||||
if (!isReleaseBuild) {
|
|
||||||
project.version = "${project.version}-SNAPSHOT"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
import org.gradle.api.DefaultTask
|
|
||||||
import org.gradle.api.file.RegularFileProperty
|
|
||||||
import org.gradle.api.provider.ListProperty
|
|
||||||
import org.gradle.api.tasks.Input
|
|
||||||
import org.gradle.api.tasks.InputFile
|
|
||||||
import org.gradle.api.tasks.OutputFile
|
|
||||||
import org.gradle.api.tasks.TaskAction
|
|
||||||
import org.gradle.kotlin.dsl.listProperty
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Builds a self-contained Pkl CLI Jar that is directly executable on *nix
|
|
||||||
* and executable with `java -jar` on Windows.
|
|
||||||
*
|
|
||||||
* For direct execution, the `java` command must be on the PATH.
|
|
||||||
*
|
|
||||||
* https://skife.org/java/unix/2011/06/20/really_executable_jars.html
|
|
||||||
*/
|
|
||||||
open class ExecutableJar : DefaultTask() {
|
|
||||||
@get:InputFile
|
|
||||||
val inJar: RegularFileProperty = project.objects.fileProperty()
|
|
||||||
|
|
||||||
@get:OutputFile
|
|
||||||
val outJar: RegularFileProperty = project.objects.fileProperty()
|
|
||||||
|
|
||||||
@get:Input
|
|
||||||
val jvmArgs: ListProperty<String> = project.objects.listProperty()
|
|
||||||
|
|
||||||
@TaskAction
|
|
||||||
fun buildJar() {
|
|
||||||
val inFile = inJar.get().asFile
|
|
||||||
val outFile = outJar.get().asFile
|
|
||||||
val escapedJvmArgs = jvmArgs.get().joinToString(separator = " ") { "\"$it\"" }
|
|
||||||
|
|
||||||
val startScript = """
|
|
||||||
#!/bin/sh
|
|
||||||
exec java $escapedJvmArgs -jar $0 "$@"
|
|
||||||
""".trim().trimMargin() + "\n\n\n"
|
|
||||||
|
|
||||||
outFile.outputStream().use { outStream ->
|
|
||||||
startScript.byteInputStream().use { it.copyTo(outStream) }
|
|
||||||
inFile.inputStream().use { it.copyTo(outStream) }
|
|
||||||
}
|
|
||||||
|
|
||||||
// chmod a+x
|
|
||||||
outFile.setExecutable(true, false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import org.gradle.util.GradleVersion
|
|
||||||
|
|
||||||
open class GradlePluginTests {
|
|
||||||
lateinit var minGradleVersion: GradleVersion
|
|
||||||
lateinit var maxGradleVersion: GradleVersion
|
|
||||||
var skippedGradleVersions: List<GradleVersion> = listOf()
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
import java.net.URL
|
|
||||||
import org.gradle.util.GradleVersion
|
|
||||||
import groovy.json.JsonSlurper
|
|
||||||
|
|
||||||
@Suppress("unused")
|
|
||||||
class GradleVersionInfo(json: Map<String, Any>) {
|
|
||||||
val version: String by json
|
|
||||||
|
|
||||||
val gradleVersion: GradleVersion by lazy { GradleVersion.version(version) }
|
|
||||||
|
|
||||||
val isReleaseVersion: Boolean by lazy {
|
|
||||||
// for some reason, `gradleVersion == gradleVersion.baseVersion` is a compile error
|
|
||||||
gradleVersion.version == gradleVersion.baseVersion.version
|
|
||||||
}
|
|
||||||
|
|
||||||
val buildTime: String by json
|
|
||||||
|
|
||||||
val current: Boolean by json
|
|
||||||
|
|
||||||
val snapshot: Boolean by json
|
|
||||||
|
|
||||||
val nightly: Boolean by json
|
|
||||||
|
|
||||||
val releaseNightly: Boolean by json
|
|
||||||
|
|
||||||
val activeRc: Boolean by json
|
|
||||||
|
|
||||||
val rcFor: String by json
|
|
||||||
|
|
||||||
val milestoneFor: String by json
|
|
||||||
|
|
||||||
val broken: Boolean by json
|
|
||||||
|
|
||||||
val downloadUrl: String by json
|
|
||||||
|
|
||||||
val checksumUrl: String by json
|
|
||||||
|
|
||||||
val wrapperChecksumUrl: String by json
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
private fun fetchAll(): List<GradleVersionInfo> = fetchMultiple("https://services.gradle.org/versions/all")
|
|
||||||
|
|
||||||
fun fetchReleases(): List<GradleVersionInfo> = fetchAll().filter { it.isReleaseVersion }
|
|
||||||
|
|
||||||
fun fetchCurrent(): GradleVersionInfo = fetchSingle("https://services.gradle.org/versions/current")
|
|
||||||
|
|
||||||
fun fetchRc(): GradleVersionInfo? = fetchSingleOrNull("https://services.gradle.org/versions/release-candidate")
|
|
||||||
|
|
||||||
fun fetchNightly(): GradleVersionInfo = fetchSingle("https://services.gradle.org/versions/nightly")
|
|
||||||
|
|
||||||
private fun fetchSingle(url: String): GradleVersionInfo {
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
|
||||||
return GradleVersionInfo(JsonSlurper().parse(URL(url)) as Map<String, Any>)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun fetchSingleOrNull(url: String): GradleVersionInfo? {
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
|
||||||
val json = JsonSlurper().parse(URL(url)) as Map<String, Any>
|
|
||||||
return if (json.isEmpty()) null else GradleVersionInfo(json)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun fetchMultiple(url: String): List<GradleVersionInfo> {
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
|
||||||
return (JsonSlurper().parse(URL(url)) as List<Map<String, Any>>)
|
|
||||||
.map { GradleVersionInfo(it) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import org.gradle.api.Project
|
|
||||||
import org.gradle.api.file.FileCollection
|
|
||||||
|
|
||||||
open class HtmlValidator(project: Project) {
|
|
||||||
var sources: FileCollection = project.files()
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
import org.gradle.api.DefaultTask
|
|
||||||
import org.gradle.api.artifacts.Configuration
|
|
||||||
import org.gradle.api.artifacts.result.ResolvedArtifactResult
|
|
||||||
import org.gradle.api.artifacts.result.ResolvedDependencyResult
|
|
||||||
import org.gradle.api.file.DirectoryProperty
|
|
||||||
import org.gradle.api.provider.Property
|
|
||||||
import org.gradle.api.tasks.InputFiles
|
|
||||||
import org.gradle.api.tasks.OutputDirectory
|
|
||||||
import org.gradle.api.tasks.TaskAction
|
|
||||||
import org.gradle.jvm.JvmLibrary
|
|
||||||
import org.gradle.kotlin.dsl.property
|
|
||||||
import org.gradle.language.base.artifact.SourcesArtifact
|
|
||||||
|
|
||||||
open class ResolveSourcesJars : DefaultTask() {
|
|
||||||
@get:InputFiles
|
|
||||||
val configuration: Property<Configuration> = project.objects.property()
|
|
||||||
|
|
||||||
@get:OutputDirectory
|
|
||||||
val outputDir: DirectoryProperty = project.objects.directoryProperty()
|
|
||||||
|
|
||||||
@TaskAction
|
|
||||||
@Suppress("UnstableApiUsage", "unused")
|
|
||||||
fun resolve() {
|
|
||||||
val componentIds = configuration.get().incoming.resolutionResult.allDependencies.map {
|
|
||||||
(it as ResolvedDependencyResult).selected.id
|
|
||||||
}
|
|
||||||
|
|
||||||
val resolutionResult = project.dependencies.createArtifactResolutionQuery()
|
|
||||||
.forComponents(componentIds)
|
|
||||||
.withArtifacts(JvmLibrary::class.java, SourcesArtifact::class.java)
|
|
||||||
.execute()
|
|
||||||
|
|
||||||
val resolvedJars = resolutionResult.resolvedComponents
|
|
||||||
.flatMap { it.getArtifacts(SourcesArtifact::class.java) }
|
|
||||||
.map { (it as ResolvedArtifactResult).file }
|
|
||||||
|
|
||||||
// copying to an output dir because I don't know how else to describe task outputs
|
|
||||||
project.sync {
|
|
||||||
from(resolvedJars)
|
|
||||||
into(outputDir)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
|
|
||||||
val buildInfo = extensions.create<BuildInfo>("buildInfo", project)
|
|
||||||
|
|
||||||
dependencyLocking {
|
|
||||||
lockAllConfigurations()
|
|
||||||
}
|
|
||||||
|
|
||||||
configurations {
|
|
||||||
val rejectedVersionSuffix = Regex("-alpha|-beta|-eap|-m|-rc|-snapshot", RegexOption.IGNORE_CASE)
|
|
||||||
configureEach {
|
|
||||||
resolutionStrategy {
|
|
||||||
componentSelection {
|
|
||||||
all {
|
|
||||||
if (rejectedVersionSuffix.containsMatchIn(candidate.version)) {
|
|
||||||
reject("Rejected dependency $candidate " +
|
|
||||||
"because it has a prelease version suffix matching `$rejectedVersionSuffix`.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
plugins.withType(JavaPlugin::class).configureEach {
|
|
||||||
val java = project.extensions.getByType<JavaPluginExtension>()
|
|
||||||
java.sourceCompatibility = JavaVersion.VERSION_11
|
|
||||||
java.targetCompatibility = JavaVersion.VERSION_11
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<KotlinCompile>().configureEach {
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = "11"
|
|
||||||
freeCompilerArgs = freeCompilerArgs + listOf("-Xjsr305=strict", "-Xjvm-default=all")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
plugins.withType(IdeaPlugin::class).configureEach {
|
|
||||||
val errorMessage = "Use IntelliJ Gradle import instead of running the `idea` task. See README for more information."
|
|
||||||
|
|
||||||
tasks.named("idea") {
|
|
||||||
doFirst {
|
|
||||||
throw GradleException(errorMessage)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tasks.named("ideaModule") {
|
|
||||||
doFirst {
|
|
||||||
throw GradleException(errorMessage)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (project == rootProject) {
|
|
||||||
tasks.named("ideaProject") {
|
|
||||||
doFirst {
|
|
||||||
throw GradleException(errorMessage)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
plugins.withType(MavenPublishPlugin::class).configureEach {
|
|
||||||
configure<PublishingExtension> {
|
|
||||||
// CI builds pick up artifacts from this repo.
|
|
||||||
// It's important that this repo is only declared once per project.
|
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
name = "projectLocal" // affects task names
|
|
||||||
url = uri("file:///$rootDir/build/m2")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// use resolved/locked (e.g., `1.15`)
|
|
||||||
// instead of declared (e.g., `1.+`)
|
|
||||||
// dependency versions in generated POMs
|
|
||||||
publications {
|
|
||||||
withType(MavenPublication::class.java) {
|
|
||||||
versionMapping {
|
|
||||||
allVariants {
|
|
||||||
fromResolutionResult()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// settings.gradle.kts sets `--write-locks`
|
|
||||||
// if Gradle command line contains this task name
|
|
||||||
val updateDependencyLocks by tasks.registering {
|
|
||||||
doLast {
|
|
||||||
configurations
|
|
||||||
.filter { it.isCanBeResolved }
|
|
||||||
.forEach { it.resolve() }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val allDependencies by tasks.registering(DependencyReportTask::class)
|
|
||||||
@@ -1,183 +0,0 @@
|
|||||||
import org.gradle.api.GradleException
|
|
||||||
import org.gradle.api.artifacts.Configuration
|
|
||||||
import org.gradle.api.component.AdhocComponentWithVariants
|
|
||||||
import org.gradle.api.publish.maven.MavenPublication
|
|
||||||
import org.gradle.api.tasks.bundling.Jar
|
|
||||||
import org.gradle.api.tasks.testing.Test
|
|
||||||
import org.gradle.kotlin.dsl.*
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
`java-library`
|
|
||||||
`maven-publish`
|
|
||||||
id("com.github.johnrengelman.shadow")
|
|
||||||
}
|
|
||||||
|
|
||||||
// make fat Jar available to other subprojects
|
|
||||||
val fatJarConfiguration: Configuration = configurations.create("fatJar")
|
|
||||||
|
|
||||||
val fatJarPublication: MavenPublication = publishing.publications.create<MavenPublication>("fatJar")
|
|
||||||
|
|
||||||
// ideally we'd configure this automatically based on project dependencies
|
|
||||||
val firstPartySourcesJarsConfiguration: Configuration = configurations.create("firstPartySourcesJars")
|
|
||||||
|
|
||||||
val relocations = mapOf(
|
|
||||||
// pkl-core dependencies
|
|
||||||
"org.antlr.v4." to "org.pkl.thirdparty.antlr.v4.",
|
|
||||||
// https://github.com/oracle/graal/issues/1644 has been fixed,
|
|
||||||
// but native-image still fails when shading com.oracle.truffle
|
|
||||||
//"com.oracle.truffle" to "org.pkl.thirdparty.truffle",
|
|
||||||
"org.graalvm." to "org.pkl.thirdparty.graalvm.",
|
|
||||||
"org.organicdesign.fp." to "org.pkl.thirdparty.paguro.",
|
|
||||||
"org.snakeyaml.engine." to "org.pkl.thirdparty.snakeyaml.engine.",
|
|
||||||
"org.msgpack." to "org.pkl.thirdparty.msgpack.",
|
|
||||||
"org.w3c.dom." to "org.pkl.thirdparty.w3c.dom",
|
|
||||||
"com.oracle.svm.core." to "org.pkl.thirdparty.svm.",
|
|
||||||
|
|
||||||
// pkl-cli dependencies
|
|
||||||
"org.jline." to "org.pkl.thirdparty.jline.",
|
|
||||||
"com.github.ajalt.clikt." to "org.pkl.thirdparty.clikt.",
|
|
||||||
"kotlin." to "org.pkl.thirdparty.kotlin.",
|
|
||||||
"kotlinx." to "org.pkl.thirdparty.kotlinx.",
|
|
||||||
"org.intellij." to "org.pkl.thirdparty.intellij.",
|
|
||||||
"org.fusesource.jansi." to "org.pkl.thirdparty.jansi",
|
|
||||||
"org.fusesource.hawtjni." to "org.pkl.thirdparty.hawtjni",
|
|
||||||
|
|
||||||
// pkl-doc dependencies
|
|
||||||
"org.commonmark." to "org.pkl.thirdparty.commonmark.",
|
|
||||||
"org.jetbrains." to "org.pkl.thirdparty.jetbrains.",
|
|
||||||
|
|
||||||
// pkl-config-java dependencies
|
|
||||||
"io.leangen.geantyref." to "org.pkl.thirdparty.geantyref.",
|
|
||||||
|
|
||||||
// pkl-codegen-java dependencies
|
|
||||||
"com.squareup.javapoet." to "org.pkl.thirdparty.javapoet.",
|
|
||||||
|
|
||||||
// pkl-codegen-kotlin dependencies
|
|
||||||
"com.squareup.kotlinpoet." to "org.pkl.thirdparty.kotlinpoet.",
|
|
||||||
)
|
|
||||||
|
|
||||||
val nonRelocations = listOf("com/oracle/truffle/")
|
|
||||||
|
|
||||||
tasks.shadowJar {
|
|
||||||
inputs.property("relocations", relocations)
|
|
||||||
|
|
||||||
archiveClassifier.set(null as String?)
|
|
||||||
|
|
||||||
configurations = listOf(project.configurations.runtimeClasspath.get())
|
|
||||||
|
|
||||||
exclude("META-INF/maven/**")
|
|
||||||
exclude("META-INF/upgrade/**")
|
|
||||||
exclude("META-INF/versions/19/**")
|
|
||||||
|
|
||||||
// org.antlr.v4.runtime.misc.RuleDependencyProcessor
|
|
||||||
exclude("META-INF/services/javax.annotation.processing.Processor")
|
|
||||||
|
|
||||||
exclude("module-info.*")
|
|
||||||
|
|
||||||
for ((from, to) in relocations) {
|
|
||||||
relocate(from, to)
|
|
||||||
}
|
|
||||||
|
|
||||||
// necessary for service files to be adapted to relocation
|
|
||||||
mergeServiceFiles()
|
|
||||||
}
|
|
||||||
|
|
||||||
// workaround for https://github.com/johnrengelman/shadow/issues/651
|
|
||||||
components.withType(AdhocComponentWithVariants::class.java).forEach { c ->
|
|
||||||
c.withVariantsFromConfiguration(project.configurations.shadowRuntimeElements.get()) {
|
|
||||||
skip()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val testFatJar by tasks.registering(Test::class) {
|
|
||||||
testClassesDirs = files(tasks.test.get().testClassesDirs)
|
|
||||||
classpath =
|
|
||||||
// compiled test classes
|
|
||||||
sourceSets.test.get().output +
|
|
||||||
// fat Jar
|
|
||||||
tasks.shadowJar.get().outputs.files +
|
|
||||||
// test-only dependencies
|
|
||||||
// (test dependencies that are also main dependencies must already be contained in fat Jar;
|
|
||||||
// to verify that, we don't want to include them here)
|
|
||||||
(configurations.testRuntimeClasspath.get() - configurations.runtimeClasspath.get())
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.check {
|
|
||||||
dependsOn(testFatJar)
|
|
||||||
}
|
|
||||||
|
|
||||||
val validateFatJar by tasks.registering {
|
|
||||||
val outputFile = file("$buildDir/validateFatJar/result.txt")
|
|
||||||
inputs.files(tasks.shadowJar)
|
|
||||||
inputs.property("nonRelocations", nonRelocations)
|
|
||||||
outputs.file(outputFile)
|
|
||||||
|
|
||||||
doLast {
|
|
||||||
val unshadowedFiles = mutableListOf<String>()
|
|
||||||
zipTree(tasks.shadowJar.get().outputs.files.singleFile).visit {
|
|
||||||
val fileDetails = this
|
|
||||||
val path = fileDetails.relativePath.pathString
|
|
||||||
if (!(fileDetails.isDirectory ||
|
|
||||||
path.startsWith("org/pkl/") ||
|
|
||||||
path.startsWith("META-INF/") ||
|
|
||||||
nonRelocations.any { path.startsWith(it) })) {
|
|
||||||
// don't throw exception inside `visit`
|
|
||||||
// as this gives a misleading "Could not expand ZIP" error message
|
|
||||||
unshadowedFiles.add(path)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (unshadowedFiles.isEmpty()) {
|
|
||||||
outputFile.writeText("SUCCESS")
|
|
||||||
} else {
|
|
||||||
outputFile.writeText("FAILURE")
|
|
||||||
throw GradleException("Found unshadowed files:\n" + unshadowedFiles.joinToString("\n"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tasks.check {
|
|
||||||
dependsOn(validateFatJar)
|
|
||||||
}
|
|
||||||
|
|
||||||
val resolveSourcesJars by tasks.registering(ResolveSourcesJars::class) {
|
|
||||||
configuration.set(configurations.runtimeClasspath)
|
|
||||||
outputDir.set(project.file("$buildDir/resolveSourcesJars"))
|
|
||||||
}
|
|
||||||
|
|
||||||
val fatSourcesJar by tasks.registering(MergeSourcesJars::class) {
|
|
||||||
plugins.withId("pklJavaLibrary") {
|
|
||||||
inputJars.from(tasks.named("sourcesJar"))
|
|
||||||
}
|
|
||||||
inputJars.from(firstPartySourcesJarsConfiguration)
|
|
||||||
inputJars.from(resolveSourcesJars.map { fileTree(it.outputDir) })
|
|
||||||
|
|
||||||
mergedBinaryJars.from(tasks.shadowJar)
|
|
||||||
relocatedPackages.set(relocations)
|
|
||||||
outputJar.fileProvider(provider {
|
|
||||||
file(tasks.shadowJar.get().archiveFile.get().asFile.path.replace(".jar", "-sources.jar"))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
artifacts {
|
|
||||||
add("fatJar", tasks.shadowJar)
|
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
named<MavenPublication>("fatJar") {
|
|
||||||
project.shadow.component(this)
|
|
||||||
|
|
||||||
// sources Jar is fat
|
|
||||||
artifact(fatSourcesJar.flatMap { it.outputJar.asFile }) {
|
|
||||||
classifier = "sources"
|
|
||||||
}
|
|
||||||
|
|
||||||
plugins.withId("pklJavaLibrary") {
|
|
||||||
val javadocJar by tasks.existing(Jar::class)
|
|
||||||
// Javadoc Jar is not fat (didn't invest effort)
|
|
||||||
artifact(javadocJar.flatMap { it.archiveFile }) {
|
|
||||||
classifier = "javadoc"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
import java.nio.file.*
|
|
||||||
import java.util.UUID
|
|
||||||
import de.undercouch.gradle.tasks.download.Download
|
|
||||||
import de.undercouch.gradle.tasks.download.Verify
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id("de.undercouch.download")
|
|
||||||
}
|
|
||||||
|
|
||||||
val buildInfo = project.extensions.getByType<BuildInfo>()
|
|
||||||
|
|
||||||
val homeDir = buildInfo.graalVm.homeDir
|
|
||||||
val baseName = buildInfo.graalVm.baseName
|
|
||||||
val installDir = buildInfo.graalVm.installDir
|
|
||||||
val downloadUrl = buildInfo.graalVm.downloadUrl
|
|
||||||
val downloadFile = file(homeDir).resolve("$baseName.tar.gz")
|
|
||||||
|
|
||||||
// tries to minimize chance of corruption by download-to-temp-file-and-move
|
|
||||||
val downloadGraalVm by tasks.registering(Download::class) {
|
|
||||||
onlyIf {
|
|
||||||
!installDir.exists()
|
|
||||||
}
|
|
||||||
|
|
||||||
src(downloadUrl)
|
|
||||||
dest(downloadFile)
|
|
||||||
overwrite(false)
|
|
||||||
tempAndMove(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
val verifyGraalVm by tasks.registering(Verify::class) {
|
|
||||||
onlyIf {
|
|
||||||
!installDir.exists()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependsOn(downloadGraalVm)
|
|
||||||
src(downloadFile)
|
|
||||||
checksum(buildInfo.libs.findVersion("graalVmSha256-${buildInfo.graalVm.osName}-${buildInfo.graalVm.arch}").get().toString())
|
|
||||||
algorithm("SHA-256")
|
|
||||||
}
|
|
||||||
|
|
||||||
// minimize chance of corruption by extract-to-random-dir-and-flip-symlink
|
|
||||||
val installGraalVm by tasks.registering {
|
|
||||||
dependsOn(verifyGraalVm)
|
|
||||||
|
|
||||||
onlyIf {
|
|
||||||
!installDir.exists()
|
|
||||||
}
|
|
||||||
|
|
||||||
doLast {
|
|
||||||
val distroDir = "$homeDir/${UUID.randomUUID()}"
|
|
||||||
|
|
||||||
try {
|
|
||||||
mkdir(distroDir)
|
|
||||||
|
|
||||||
println("Extracting $downloadFile into $distroDir")
|
|
||||||
// faster and more reliable than Gradle's `copy { from tarTree() }`
|
|
||||||
exec {
|
|
||||||
workingDir = file(distroDir)
|
|
||||||
executable = "tar"
|
|
||||||
args("--strip-components=1", "-xzf", downloadFile)
|
|
||||||
}
|
|
||||||
|
|
||||||
val distroBinDir = if (buildInfo.os.isMacOsX) "$distroDir/Contents/Home/bin" else "$distroDir/bin"
|
|
||||||
|
|
||||||
println("Installing native-image into $distroDir")
|
|
||||||
exec {
|
|
||||||
executable = "$distroBinDir/gu"
|
|
||||||
args("install", "--no-progress", "native-image")
|
|
||||||
}
|
|
||||||
|
|
||||||
println("Creating symlink $installDir for $distroDir")
|
|
||||||
val tempLink = Paths.get("$homeDir/${UUID.randomUUID()}")
|
|
||||||
Files.createSymbolicLink(tempLink, Paths.get(distroDir))
|
|
||||||
try {
|
|
||||||
Files.move(tempLink, installDir.toPath(), StandardCopyOption.ATOMIC_MOVE)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
try { delete(tempLink.toFile()) } catch (ignored: Exception) {}
|
|
||||||
throw e
|
|
||||||
}
|
|
||||||
} catch (e: Exception) {
|
|
||||||
try { delete(distroDir) } catch (ignored: Exception) {}
|
|
||||||
throw e
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
plugins {
|
|
||||||
base
|
|
||||||
}
|
|
||||||
|
|
||||||
val htmlValidator = extensions.create<HtmlValidator>("htmlValidator", project)
|
|
||||||
|
|
||||||
val buildInfo = project.extensions.getByType<BuildInfo>()
|
|
||||||
|
|
||||||
val validatorConfiguration: Configuration = configurations.create("validator") {
|
|
||||||
resolutionStrategy.eachDependency {
|
|
||||||
if (requested.group == "log4j" && requested.name == "log4j") {
|
|
||||||
@Suppress("UnstableApiUsage")
|
|
||||||
useTarget(buildInfo.libs.findLibrary("log4j12Api").get())
|
|
||||||
because("mitigate critical security vulnerabilities")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
@Suppress("UnstableApiUsage")
|
|
||||||
validatorConfiguration(buildInfo.libs.findLibrary("nuValidator").get()) {
|
|
||||||
// we only want jetty-util and jetty-util-ajax (with the right version)
|
|
||||||
// couldn't find a more robust way to express this
|
|
||||||
exclude(group = "org.eclipse.jetty", module = "jetty-continuation")
|
|
||||||
exclude(group = "org.eclipse.jetty", module = "jetty-http")
|
|
||||||
exclude(group = "org.eclipse.jetty", module = "jetty-io")
|
|
||||||
exclude(group = "org.eclipse.jetty", module = "jetty-security")
|
|
||||||
exclude(group = "org.eclipse.jetty", module = "jetty-server")
|
|
||||||
exclude(group = "org.eclipse.jetty", module = "jetty-servlets")
|
|
||||||
exclude(group = "javax.servlet")
|
|
||||||
exclude(group = "commons-fileupload")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val validateHtml by tasks.registering(JavaExec::class) {
|
|
||||||
val resultFile = file("$buildDir/validateHtml/result.txt")
|
|
||||||
inputs.files(htmlValidator.sources)
|
|
||||||
outputs.file(resultFile)
|
|
||||||
|
|
||||||
classpath = validatorConfiguration
|
|
||||||
mainClass.set("nu.validator.client.SimpleCommandLineValidator")
|
|
||||||
args("--skip-non-html") // --also-check-css doesn't work (still checks css as html), so limit to html files
|
|
||||||
args("--filterpattern", "(.*)Consider adding “lang=(.*)")
|
|
||||||
args("--filterpattern", "(.*)Consider adding a “lang” attribute(.*)")
|
|
||||||
args("--filterpattern", "(.*)unrecognized media “amzn-kf8”(.*)") // kindle
|
|
||||||
// for debugging
|
|
||||||
// args "--verbose"
|
|
||||||
args(htmlValidator.sources)
|
|
||||||
|
|
||||||
// write a basic result file s.t. gradle can consider task up-to-date
|
|
||||||
// writing a result file in case validation fails is not easily possible with JavaExec, but also not strictly necessary
|
|
||||||
doFirst { project.delete(resultFile) }
|
|
||||||
doLast { resultFile.writeText("Success.") }
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.check {
|
|
||||||
dependsOn(validateHtml)
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
@file:Suppress("HttpUrlsUsage")
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
`java-library`
|
|
||||||
id("pklKotlinTest")
|
|
||||||
id("com.diffplug.spotless")
|
|
||||||
}
|
|
||||||
|
|
||||||
// make sources Jar available to other subprojects
|
|
||||||
val sourcesJarConfiguration = configurations.register("sourcesJar")
|
|
||||||
|
|
||||||
java {
|
|
||||||
withSourcesJar() // creates `sourcesJar` task
|
|
||||||
withJavadocJar()
|
|
||||||
}
|
|
||||||
|
|
||||||
artifacts {
|
|
||||||
// make sources Jar available to other subprojects
|
|
||||||
add("sourcesJar", tasks["sourcesJar"])
|
|
||||||
}
|
|
||||||
|
|
||||||
spotless {
|
|
||||||
java {
|
|
||||||
googleJavaFormat("1.15.0")
|
|
||||||
targetExclude("**/generated/**", "**/build/**")
|
|
||||||
licenseHeaderFile(rootProject.file("buildSrc/src/main/resources/license-header.star-block.txt"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.compileKotlin {
|
|
||||||
enabled = false
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.jar {
|
|
||||||
manifest {
|
|
||||||
attributes += mapOf("Automatic-Module-Name" to "org.${project.name.replace("-", ".")}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.javadoc {
|
|
||||||
classpath = sourceSets.main.get().output + sourceSets.main.get().compileClasspath
|
|
||||||
source = sourceSets.main.get().allJava
|
|
||||||
title = "${project.name} ${project.version} API"
|
|
||||||
(options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet")
|
|
||||||
}
|
|
||||||
|
|
||||||
val workAroundKotlinGradlePluginBug by tasks.registering {
|
|
||||||
doLast {
|
|
||||||
// Works around this problem, which sporadically appears and disappears in different subprojects:
|
|
||||||
// A problem was found with the configuration of task ':pkl-executor:compileJava' (type 'JavaCompile').
|
|
||||||
// > Directory '[...]/pkl/pkl-executor/build/classes/kotlin/main'
|
|
||||||
// specified for property 'compileKotlinOutputClasses' does not exist.
|
|
||||||
file("$buildDir/classes/kotlin/main").mkdirs()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.compileJava {
|
|
||||||
dependsOn(workAroundKotlinGradlePluginBug)
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id("pklJavaLibrary")
|
|
||||||
|
|
||||||
kotlin("jvm")
|
|
||||||
}
|
|
||||||
|
|
||||||
val buildInfo = project.extensions.getByType<BuildInfo>()
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
// At least some of our kotlin APIs contain Kotlin stdlib types
|
|
||||||
// that aren't compiled away by kotlinc (e.g., `kotlin.Function`).
|
|
||||||
// So let's be conservative and default to `api` for now.
|
|
||||||
// For Kotlin APIs that only target Kotlin users (e.g., pkl-config-kotlin),
|
|
||||||
// it won't make a difference.
|
|
||||||
api(buildInfo.libs.findLibrary("kotlinStdLib").get())
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.compileKotlin {
|
|
||||||
enabled = true // disabled by pklJavaLibrary
|
|
||||||
}
|
|
||||||
|
|
||||||
spotless {
|
|
||||||
kotlin {
|
|
||||||
ktfmt("0.44").googleStyle()
|
|
||||||
targetExclude("**/generated/**", "**/build/**")
|
|
||||||
licenseHeaderFile(rootProject.file("buildSrc/src/main/resources/license-header.star-block.txt"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
|
||||||
import java.net.URI
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
kotlin("jvm")
|
|
||||||
}
|
|
||||||
|
|
||||||
val buildInfo = project.extensions.getByType<BuildInfo>()
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
testImplementation(buildInfo.libs.findLibrary("assertj").get())
|
|
||||||
testImplementation(buildInfo.libs.findLibrary("junitApi").get())
|
|
||||||
testImplementation(buildInfo.libs.findLibrary("junitParams").get())
|
|
||||||
testImplementation(buildInfo.libs.findLibrary("kotlinStdLib").get())
|
|
||||||
|
|
||||||
testRuntimeOnly(buildInfo.libs.findLibrary("junitEngine").get())
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<Test>().configureEach {
|
|
||||||
val testTask = this
|
|
||||||
|
|
||||||
useJUnitPlatform()
|
|
||||||
|
|
||||||
// enable checking of stdlib return types
|
|
||||||
systemProperty("org.pkl.testMode", "true")
|
|
||||||
|
|
||||||
reports.named("html") {
|
|
||||||
enabled = true
|
|
||||||
}
|
|
||||||
|
|
||||||
testLogging {
|
|
||||||
exceptionFormat = TestExceptionFormat.FULL
|
|
||||||
}
|
|
||||||
|
|
||||||
addTestListener(object : TestListener {
|
|
||||||
override fun beforeSuite(suite: TestDescriptor) {}
|
|
||||||
override fun beforeTest(testDescriptor: TestDescriptor) {}
|
|
||||||
override fun afterTest(testDescriptor: TestDescriptor, result: TestResult) {}
|
|
||||||
|
|
||||||
// print report link at end of task, not just at end of build
|
|
||||||
override fun afterSuite(descriptor: TestDescriptor, result: TestResult) {
|
|
||||||
if (descriptor.parent != null) return // only interested in overall result
|
|
||||||
|
|
||||||
if (result.resultType == TestResult.ResultType.FAILURE) {
|
|
||||||
println("\nThere were failing tests. See the report at: ${fixFileUri(testTask.reports.html.entryPoint.toURI())}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// makes links clickable on macOS
|
|
||||||
private fun fixFileUri(uri: URI): URI {
|
|
||||||
if ("file" == uri.scheme && !uri.schemeSpecificPart.startsWith("//")) {
|
|
||||||
return URI.create("file://" + uri.schemeSpecificPart)
|
|
||||||
}
|
|
||||||
return uri
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user