@invarn/cibuild 2.9.6 → 2.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (559) hide show
  1. package/dist/chunk-35SI42CD.mjs +1 -0
  2. package/dist/chunk-IC45KVLJ.mjs +1 -0
  3. package/dist/chunk-XDY4V23V.mjs +1 -0
  4. package/dist/cli.cjs +14 -14
  5. package/dist/commands.mjs +1 -0
  6. package/dist/lib.mjs +3934 -0
  7. package/package.json +6 -10
  8. package/dist/src/cli.d.ts +0 -3
  9. package/dist/src/cli.d.ts.map +0 -1
  10. package/dist/src/cli.js +0 -399
  11. package/dist/src/commands/a-credential-target-follows-the-flavor-source-set.test.d.ts +0 -38
  12. package/dist/src/commands/a-credential-target-follows-the-flavor-source-set.test.d.ts.map +0 -1
  13. package/dist/src/commands/a-credential-target-follows-the-flavor-source-set.test.js +0 -222
  14. package/dist/src/commands/a-credential-two-workflows-cannot-share-is-declared-per-workflow.test.d.ts +0 -41
  15. package/dist/src/commands/a-credential-two-workflows-cannot-share-is-declared-per-workflow.test.d.ts.map +0 -1
  16. package/dist/src/commands/a-credential-two-workflows-cannot-share-is-declared-per-workflow.test.js +0 -324
  17. package/dist/src/commands/a-properties-stand-in-declares-the-keys-the-build-reads.test.d.ts +0 -2
  18. package/dist/src/commands/a-properties-stand-in-declares-the-keys-the-build-reads.test.d.ts.map +0 -1
  19. package/dist/src/commands/a-properties-stand-in-declares-the-keys-the-build-reads.test.js +0 -382
  20. package/dist/src/commands/an-already-stored-value-does-not-answer-the-target-question.test.d.ts +0 -29
  21. package/dist/src/commands/an-already-stored-value-does-not-answer-the-target-question.test.d.ts.map +0 -1
  22. package/dist/src/commands/an-already-stored-value-does-not-answer-the-target-question.test.js +0 -160
  23. package/dist/src/commands/android-gms-guard.test.d.ts +0 -9
  24. package/dist/src/commands/android-gms-guard.test.d.ts.map +0 -1
  25. package/dist/src/commands/android-gms-guard.test.js +0 -78
  26. package/dist/src/commands/android-java-version.test.d.ts +0 -12
  27. package/dist/src/commands/android-java-version.test.d.ts.map +0 -1
  28. package/dist/src/commands/android-java-version.test.js +0 -209
  29. package/dist/src/commands/android-scanner-java.test.d.ts +0 -2
  30. package/dist/src/commands/android-scanner-java.test.d.ts.map +0 -1
  31. package/dist/src/commands/android-scanner-java.test.js +0 -130
  32. package/dist/src/commands/android-scanner.d.ts +0 -250
  33. package/dist/src/commands/android-scanner.d.ts.map +0 -1
  34. package/dist/src/commands/android-scanner.js +0 -1639
  35. package/dist/src/commands/build.d.ts +0 -215
  36. package/dist/src/commands/build.d.ts.map +0 -1
  37. package/dist/src/commands/build.js +0 -1433
  38. package/dist/src/commands/build.test.d.ts +0 -13
  39. package/dist/src/commands/build.test.d.ts.map +0 -1
  40. package/dist/src/commands/build.test.js +0 -121
  41. package/dist/src/commands/detect-platform.d.ts +0 -13
  42. package/dist/src/commands/detect-platform.d.ts.map +0 -1
  43. package/dist/src/commands/detect-platform.js +0 -51
  44. package/dist/src/commands/detect-project.d.ts +0 -7
  45. package/dist/src/commands/detect-project.d.ts.map +0 -1
  46. package/dist/src/commands/detect-project.js +0 -12
  47. package/dist/src/commands/each-flavor-is-asked-for-its-own-properties-file.test.d.ts +0 -26
  48. package/dist/src/commands/each-flavor-is-asked-for-its-own-properties-file.test.d.ts.map +0 -1
  49. package/dist/src/commands/each-flavor-is-asked-for-its-own-properties-file.test.js +0 -196
  50. package/dist/src/commands/edit.d.ts +0 -12
  51. package/dist/src/commands/edit.d.ts.map +0 -1
  52. package/dist/src/commands/edit.js +0 -652
  53. package/dist/src/commands/edit.test.d.ts +0 -6
  54. package/dist/src/commands/edit.test.d.ts.map +0 -1
  55. package/dist/src/commands/edit.test.js +0 -45
  56. package/dist/src/commands/fidelity-trim.d.ts +0 -13
  57. package/dist/src/commands/fidelity-trim.d.ts.map +0 -1
  58. package/dist/src/commands/fidelity-trim.js +0 -21
  59. package/dist/src/commands/fidelity-trim.test.d.ts +0 -8
  60. package/dist/src/commands/fidelity-trim.test.d.ts.map +0 -1
  61. package/dist/src/commands/fidelity-trim.test.js +0 -79
  62. package/dist/src/commands/file-secret-collector.d.ts +0 -50
  63. package/dist/src/commands/file-secret-collector.d.ts.map +0 -1
  64. package/dist/src/commands/file-secret-collector.js +0 -217
  65. package/dist/src/commands/flavors-a-convention-plugin-creates-are-still-found.test.d.ts +0 -38
  66. package/dist/src/commands/flavors-a-convention-plugin-creates-are-still-found.test.d.ts.map +0 -1
  67. package/dist/src/commands/flavors-a-convention-plugin-creates-are-still-found.test.js +0 -300
  68. package/dist/src/commands/github-workflow.d.ts +0 -5
  69. package/dist/src/commands/github-workflow.d.ts.map +0 -1
  70. package/dist/src/commands/github-workflow.js +0 -45
  71. package/dist/src/commands/index.d.ts +0 -33
  72. package/dist/src/commands/index.d.ts.map +0 -1
  73. package/dist/src/commands/index.js +0 -33
  74. package/dist/src/commands/init.d.ts +0 -20
  75. package/dist/src/commands/init.d.ts.map +0 -1
  76. package/dist/src/commands/init.js +0 -264
  77. package/dist/src/commands/ios-scanner.d.ts +0 -104
  78. package/dist/src/commands/ios-scanner.d.ts.map +0 -1
  79. package/dist/src/commands/ios-scanner.js +0 -492
  80. package/dist/src/commands/ios-scheme-ranking.test.d.ts +0 -2
  81. package/dist/src/commands/ios-scheme-ranking.test.d.ts.map +0 -1
  82. package/dist/src/commands/ios-scheme-ranking.test.js +0 -264
  83. package/dist/src/commands/local-properties-reaches-every-workflow.test.d.ts +0 -30
  84. package/dist/src/commands/local-properties-reaches-every-workflow.test.d.ts.map +0 -1
  85. package/dist/src/commands/local-properties-reaches-every-workflow.test.js +0 -146
  86. package/dist/src/commands/reset.d.ts +0 -7
  87. package/dist/src/commands/reset.d.ts.map +0 -1
  88. package/dist/src/commands/reset.js +0 -81
  89. package/dist/src/commands/run.d.ts +0 -22
  90. package/dist/src/commands/run.d.ts.map +0 -1
  91. package/dist/src/commands/run.js +0 -141
  92. package/dist/src/commands/secrets-sync-workflow.d.ts +0 -15
  93. package/dist/src/commands/secrets-sync-workflow.d.ts.map +0 -1
  94. package/dist/src/commands/secrets-sync-workflow.js +0 -255
  95. package/dist/src/commands/secrets-upload.d.ts +0 -21
  96. package/dist/src/commands/secrets-upload.d.ts.map +0 -1
  97. package/dist/src/commands/secrets-upload.js +0 -177
  98. package/dist/src/commands/secrets-upload.test.d.ts +0 -5
  99. package/dist/src/commands/secrets-upload.test.d.ts.map +0 -1
  100. package/dist/src/commands/secrets-upload.test.js +0 -60
  101. package/dist/src/commands/validate.d.ts +0 -10
  102. package/dist/src/commands/validate.d.ts.map +0 -1
  103. package/dist/src/commands/validate.js +0 -46
  104. package/dist/src/config.d.ts +0 -3
  105. package/dist/src/config.d.ts.map +0 -1
  106. package/dist/src/config.js +0 -47
  107. package/dist/src/envman/cli.d.ts +0 -21
  108. package/dist/src/envman/cli.d.ts.map +0 -1
  109. package/dist/src/envman/cli.js +0 -240
  110. package/dist/src/envman/envman.d.ts +0 -83
  111. package/dist/src/envman/envman.d.ts.map +0 -1
  112. package/dist/src/envman/envman.js +0 -361
  113. package/dist/src/envman/envman.test.d.ts +0 -5
  114. package/dist/src/envman/envman.test.d.ts.map +0 -1
  115. package/dist/src/envman/envman.test.js +0 -236
  116. package/dist/src/envman/envstore-round-trip.test.d.ts +0 -27
  117. package/dist/src/envman/envstore-round-trip.test.d.ts.map +0 -1
  118. package/dist/src/envman/envstore-round-trip.test.js +0 -130
  119. package/dist/src/envman/index.d.ts +0 -23
  120. package/dist/src/envman/index.d.ts.map +0 -1
  121. package/dist/src/envman/index.js +0 -23
  122. package/dist/src/envman/shim.d.ts +0 -16
  123. package/dist/src/envman/shim.d.ts.map +0 -1
  124. package/dist/src/envman/shim.js +0 -66
  125. package/dist/src/envman/types.d.ts +0 -55
  126. package/dist/src/envman/types.d.ts.map +0 -1
  127. package/dist/src/envman/types.js +0 -12
  128. package/dist/src/lib.d.ts +0 -33
  129. package/dist/src/lib.d.ts.map +0 -1
  130. package/dist/src/lib.js +0 -37
  131. package/dist/src/pipeline.d.ts +0 -3
  132. package/dist/src/pipeline.d.ts.map +0 -1
  133. package/dist/src/pipeline.js +0 -57
  134. package/dist/src/runner-node-step.test.d.ts +0 -12
  135. package/dist/src/runner-node-step.test.d.ts.map +0 -1
  136. package/dist/src/runner-node-step.test.js +0 -61
  137. package/dist/src/runner.d.ts +0 -31
  138. package/dist/src/runner.d.ts.map +0 -1
  139. package/dist/src/runner.js +0 -240
  140. package/dist/src/shared/detect-project.d.ts +0 -57
  141. package/dist/src/shared/detect-project.d.ts.map +0 -1
  142. package/dist/src/shared/detect-project.js +0 -219
  143. package/dist/src/shared/detect-project.test.d.ts +0 -2
  144. package/dist/src/shared/detect-project.test.d.ts.map +0 -1
  145. package/dist/src/shared/detect-project.test.js +0 -161
  146. package/dist/src/shared/git.d.ts +0 -25
  147. package/dist/src/shared/git.d.ts.map +0 -1
  148. package/dist/src/shared/git.js +0 -53
  149. package/dist/src/shared/git.test.d.ts +0 -9
  150. package/dist/src/shared/git.test.d.ts.map +0 -1
  151. package/dist/src/shared/git.test.js +0 -66
  152. package/dist/src/shared/gitignore.d.ts +0 -6
  153. package/dist/src/shared/gitignore.d.ts.map +0 -1
  154. package/dist/src/shared/gitignore.js +0 -26
  155. package/dist/src/shared/gradle-settings.d.ts +0 -49
  156. package/dist/src/shared/gradle-settings.d.ts.map +0 -1
  157. package/dist/src/shared/gradle-settings.js +0 -138
  158. package/dist/src/shared/gradle-settings.test.d.ts +0 -2
  159. package/dist/src/shared/gradle-settings.test.d.ts.map +0 -1
  160. package/dist/src/shared/gradle-settings.test.js +0 -65
  161. package/dist/src/shared/prompts.d.ts +0 -30
  162. package/dist/src/shared/prompts.d.ts.map +0 -1
  163. package/dist/src/shared/prompts.js +0 -121
  164. package/dist/src/shared/xcode-container.test.d.ts +0 -2
  165. package/dist/src/shared/xcode-container.test.d.ts.map +0 -1
  166. package/dist/src/shared/xcode-container.test.js +0 -123
  167. package/dist/src/step-marker.d.ts +0 -12
  168. package/dist/src/step-marker.d.ts.map +0 -1
  169. package/dist/src/step-marker.js +0 -29
  170. package/dist/src/step-marker.test.d.ts +0 -11
  171. package/dist/src/step-marker.test.d.ts.map +0 -1
  172. package/dist/src/step-marker.test.js +0 -45
  173. package/dist/src/types.d.ts +0 -58
  174. package/dist/src/types.d.ts.map +0 -1
  175. package/dist/src/types.js +0 -2
  176. package/dist/src/yaml/a-cache-path-must-not-swallow-a-credential.test.d.ts +0 -28
  177. package/dist/src/yaml/a-cache-path-must-not-swallow-a-credential.test.d.ts.map +0 -1
  178. package/dist/src/yaml/a-cache-path-must-not-swallow-a-credential.test.js +0 -223
  179. package/dist/src/yaml/a-declared-secret-reaches-the-file-step.test.d.ts +0 -20
  180. package/dist/src/yaml/a-declared-secret-reaches-the-file-step.test.d.ts.map +0 -1
  181. package/dist/src/yaml/a-declared-secret-reaches-the-file-step.test.js +0 -201
  182. package/dist/src/yaml/a-declared-slot-may-name-the-workflow-it-belongs-to.test.d.ts +0 -37
  183. package/dist/src/yaml/a-declared-slot-may-name-the-workflow-it-belongs-to.test.d.ts.map +0 -1
  184. package/dist/src/yaml/a-declared-slot-may-name-the-workflow-it-belongs-to.test.js +0 -255
  185. package/dist/src/yaml/a-missing-credential-is-loud.test.d.ts +0 -32
  186. package/dist/src/yaml/a-missing-credential-is-loud.test.d.ts.map +0 -1
  187. package/dist/src/yaml/a-missing-credential-is-loud.test.js +0 -301
  188. package/dist/src/yaml/a-runtime-requirement-names-a-real-provider.test.d.ts +0 -18
  189. package/dist/src/yaml/a-runtime-requirement-names-a-real-provider.test.d.ts.map +0 -1
  190. package/dist/src/yaml/a-runtime-requirement-names-a-real-provider.test.js +0 -66
  191. package/dist/src/yaml/a-scoped-slot-must-name-a-workflow-the-pipeline-has.test.d.ts +0 -34
  192. package/dist/src/yaml/a-scoped-slot-must-name-a-workflow-the-pipeline-has.test.d.ts.map +0 -1
  193. package/dist/src/yaml/a-scoped-slot-must-name-a-workflow-the-pipeline-has.test.js +0 -218
  194. package/dist/src/yaml/a-value-this-instance-stored-is-a-value-it-has.test.d.ts +0 -27
  195. package/dist/src/yaml/a-value-this-instance-stored-is-a-value-it-has.test.d.ts.map +0 -1
  196. package/dist/src/yaml/a-value-this-instance-stored-is-a-value-it-has.test.js +0 -126
  197. package/dist/src/yaml/bitrise-compat.d.ts +0 -65
  198. package/dist/src/yaml/bitrise-compat.d.ts.map +0 -1
  199. package/dist/src/yaml/bitrise-compat.js +0 -206
  200. package/dist/src/yaml/bitrise-compat.test.d.ts +0 -5
  201. package/dist/src/yaml/bitrise-compat.test.d.ts.map +0 -1
  202. package/dist/src/yaml/bitrise-compat.test.js +0 -347
  203. package/dist/src/yaml/cache-key-missing-file.test.d.ts +0 -12
  204. package/dist/src/yaml/cache-key-missing-file.test.d.ts.map +0 -1
  205. package/dist/src/yaml/cache-key-missing-file.test.js +0 -116
  206. package/dist/src/yaml/converter.d.ts +0 -103
  207. package/dist/src/yaml/converter.d.ts.map +0 -1
  208. package/dist/src/yaml/converter.js +0 -420
  209. package/dist/src/yaml/converter.test.d.ts +0 -5
  210. package/dist/src/yaml/converter.test.d.ts.map +0 -1
  211. package/dist/src/yaml/converter.test.js +0 -548
  212. package/dist/src/yaml/e2e.test.d.ts +0 -6
  213. package/dist/src/yaml/e2e.test.d.ts.map +0 -1
  214. package/dist/src/yaml/e2e.test.js +0 -446
  215. package/dist/src/yaml/env-resolver.d.ts +0 -218
  216. package/dist/src/yaml/env-resolver.d.ts.map +0 -1
  217. package/dist/src/yaml/env-resolver.js +0 -591
  218. package/dist/src/yaml/env-resolver.test.d.ts +0 -5
  219. package/dist/src/yaml/env-resolver.test.d.ts.map +0 -1
  220. package/dist/src/yaml/env-resolver.test.js +0 -502
  221. package/dist/src/yaml/every-build-log-witnesses-the-commit-on-disk.test.d.ts +0 -16
  222. package/dist/src/yaml/every-build-log-witnesses-the-commit-on-disk.test.d.ts.map +0 -1
  223. package/dist/src/yaml/every-build-log-witnesses-the-commit-on-disk.test.js +0 -126
  224. package/dist/src/yaml/fidelity-input-digest.d.ts +0 -37
  225. package/dist/src/yaml/fidelity-input-digest.d.ts.map +0 -1
  226. package/dist/src/yaml/fidelity-input-digest.js +0 -208
  227. package/dist/src/yaml/fidelity-input-digest.test.d.ts +0 -2
  228. package/dist/src/yaml/fidelity-input-digest.test.d.ts.map +0 -1
  229. package/dist/src/yaml/fidelity-input-digest.test.js +0 -167
  230. package/dist/src/yaml/fidelity-manifest.d.ts +0 -126
  231. package/dist/src/yaml/fidelity-manifest.d.ts.map +0 -1
  232. package/dist/src/yaml/fidelity-manifest.js +0 -134
  233. package/dist/src/yaml/fidelity-manifest.test.d.ts +0 -12
  234. package/dist/src/yaml/fidelity-manifest.test.d.ts.map +0 -1
  235. package/dist/src/yaml/fidelity-manifest.test.js +0 -251
  236. package/dist/src/yaml/interactive-prompts.d.ts +0 -71
  237. package/dist/src/yaml/interactive-prompts.d.ts.map +0 -1
  238. package/dist/src/yaml/interactive-prompts.js +0 -260
  239. package/dist/src/yaml/meta-helpers.d.ts +0 -28
  240. package/dist/src/yaml/meta-helpers.d.ts.map +0 -1
  241. package/dist/src/yaml/meta-helpers.js +0 -46
  242. package/dist/src/yaml/missing-env-handler.d.ts +0 -45
  243. package/dist/src/yaml/missing-env-handler.d.ts.map +0 -1
  244. package/dist/src/yaml/missing-env-handler.js +0 -64
  245. package/dist/src/yaml/parser.d.ts +0 -33
  246. package/dist/src/yaml/parser.d.ts.map +0 -1
  247. package/dist/src/yaml/parser.js +0 -148
  248. package/dist/src/yaml/parser.test.d.ts +0 -5
  249. package/dist/src/yaml/parser.test.d.ts.map +0 -1
  250. package/dist/src/yaml/parser.test.js +0 -83
  251. package/dist/src/yaml/pipeline-with-secrets.d.ts +0 -25
  252. package/dist/src/yaml/pipeline-with-secrets.d.ts.map +0 -1
  253. package/dist/src/yaml/pipeline-with-secrets.js +0 -76
  254. package/dist/src/yaml/platform-detector.d.ts +0 -83
  255. package/dist/src/yaml/platform-detector.d.ts.map +0 -1
  256. package/dist/src/yaml/platform-detector.js +0 -189
  257. package/dist/src/yaml/platform-detector.test.d.ts +0 -5
  258. package/dist/src/yaml/platform-detector.test.d.ts.map +0 -1
  259. package/dist/src/yaml/platform-detector.test.js +0 -525
  260. package/dist/src/yaml/preflight-validation.d.ts +0 -29
  261. package/dist/src/yaml/preflight-validation.d.ts.map +0 -1
  262. package/dist/src/yaml/preflight-validation.js +0 -21
  263. package/dist/src/yaml/secrets-manager.d.ts +0 -87
  264. package/dist/src/yaml/secrets-manager.d.ts.map +0 -1
  265. package/dist/src/yaml/secrets-manager.js +0 -230
  266. package/dist/src/yaml/shell-assignments.d.ts +0 -40
  267. package/dist/src/yaml/shell-assignments.d.ts.map +0 -1
  268. package/dist/src/yaml/shell-assignments.js +0 -77
  269. package/dist/src/yaml/step-validator-check-failure.test.d.ts +0 -24
  270. package/dist/src/yaml/step-validator-check-failure.test.d.ts.map +0 -1
  271. package/dist/src/yaml/step-validator-check-failure.test.js +0 -130
  272. package/dist/src/yaml/step-validator-self-assigned.test.d.ts +0 -23
  273. package/dist/src/yaml/step-validator-self-assigned.test.d.ts.map +0 -1
  274. package/dist/src/yaml/step-validator-self-assigned.test.js +0 -191
  275. package/dist/src/yaml/step-validator.d.ts +0 -67
  276. package/dist/src/yaml/step-validator.d.ts.map +0 -1
  277. package/dist/src/yaml/step-validator.js +0 -466
  278. package/dist/src/yaml/step-validator.test.d.ts +0 -18
  279. package/dist/src/yaml/step-validator.test.d.ts.map +0 -1
  280. package/dist/src/yaml/step-validator.test.js +0 -140
  281. package/dist/src/yaml/steps/a-missing-pinned-jdk-yields-for-every-gradle-run.test.d.ts +0 -2
  282. package/dist/src/yaml/steps/a-missing-pinned-jdk-yields-for-every-gradle-run.test.d.ts.map +0 -1
  283. package/dist/src/yaml/steps/a-missing-pinned-jdk-yields-for-every-gradle-run.test.js +0 -96
  284. package/dist/src/yaml/steps/android-sign.d.ts +0 -35
  285. package/dist/src/yaml/steps/android-sign.d.ts.map +0 -1
  286. package/dist/src/yaml/steps/android-sign.js +0 -147
  287. package/dist/src/yaml/steps/android-variant-resolution.test.d.ts +0 -2
  288. package/dist/src/yaml/steps/android-variant-resolution.test.d.ts.map +0 -1
  289. package/dist/src/yaml/steps/android-variant-resolution.test.js +0 -260
  290. package/dist/src/yaml/steps/android-version.d.ts +0 -26
  291. package/dist/src/yaml/steps/android-version.d.ts.map +0 -1
  292. package/dist/src/yaml/steps/android-version.js +0 -128
  293. package/dist/src/yaml/steps/android-version.test.d.ts +0 -5
  294. package/dist/src/yaml/steps/android-version.test.d.ts.map +0 -1
  295. package/dist/src/yaml/steps/android-version.test.js +0 -196
  296. package/dist/src/yaml/steps/android.d.ts +0 -156
  297. package/dist/src/yaml/steps/android.d.ts.map +0 -1
  298. package/dist/src/yaml/steps/android.js +0 -1100
  299. package/dist/src/yaml/steps/app-store-deploy.d.ts +0 -48
  300. package/dist/src/yaml/steps/app-store-deploy.d.ts.map +0 -1
  301. package/dist/src/yaml/steps/app-store-deploy.js +0 -167
  302. package/dist/src/yaml/steps/base.d.ts +0 -263
  303. package/dist/src/yaml/steps/base.d.ts.map +0 -1
  304. package/dist/src/yaml/steps/base.js +0 -380
  305. package/dist/src/yaml/steps/bitrise-android-tools.d.ts +0 -26
  306. package/dist/src/yaml/steps/bitrise-android-tools.d.ts.map +0 -1
  307. package/dist/src/yaml/steps/bitrise-android-tools.js +0 -200
  308. package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts +0 -5
  309. package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts.map +0 -1
  310. package/dist/src/yaml/steps/bitrise-android-tools.test.js +0 -280
  311. package/dist/src/yaml/steps/bitrise-apk-info.d.ts +0 -22
  312. package/dist/src/yaml/steps/bitrise-apk-info.d.ts.map +0 -1
  313. package/dist/src/yaml/steps/bitrise-apk-info.js +0 -144
  314. package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts +0 -5
  315. package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts.map +0 -1
  316. package/dist/src/yaml/steps/bitrise-apk-info.test.js +0 -331
  317. package/dist/src/yaml/steps/bitrise-slack.d.ts +0 -49
  318. package/dist/src/yaml/steps/bitrise-slack.d.ts.map +0 -1
  319. package/dist/src/yaml/steps/bitrise-slack.js +0 -280
  320. package/dist/src/yaml/steps/bitrise-slack.test.d.ts +0 -5
  321. package/dist/src/yaml/steps/bitrise-slack.test.d.ts.map +0 -1
  322. package/dist/src/yaml/steps/bitrise-slack.test.js +0 -484
  323. package/dist/src/yaml/steps/bitrise-ssh.d.ts +0 -27
  324. package/dist/src/yaml/steps/bitrise-ssh.d.ts.map +0 -1
  325. package/dist/src/yaml/steps/bitrise-ssh.js +0 -134
  326. package/dist/src/yaml/steps/bitrise-ssh.test.d.ts +0 -5
  327. package/dist/src/yaml/steps/bitrise-ssh.test.d.ts.map +0 -1
  328. package/dist/src/yaml/steps/bitrise-ssh.test.js +0 -205
  329. package/dist/src/yaml/steps/cache-pull-daemon.test.d.ts +0 -27
  330. package/dist/src/yaml/steps/cache-pull-daemon.test.d.ts.map +0 -1
  331. package/dist/src/yaml/steps/cache-pull-daemon.test.js +0 -212
  332. package/dist/src/yaml/steps/cache-pull-restore-roots.test.d.ts +0 -42
  333. package/dist/src/yaml/steps/cache-pull-restore-roots.test.d.ts.map +0 -1
  334. package/dist/src/yaml/steps/cache-pull-restore-roots.test.js +0 -209
  335. package/dist/src/yaml/steps/cache-push-daemon.test.d.ts +0 -27
  336. package/dist/src/yaml/steps/cache-push-daemon.test.d.ts.map +0 -1
  337. package/dist/src/yaml/steps/cache-push-daemon.test.js +0 -171
  338. package/dist/src/yaml/steps/cache.d.ts +0 -59
  339. package/dist/src/yaml/steps/cache.d.ts.map +0 -1
  340. package/dist/src/yaml/steps/cache.js +0 -1027
  341. package/dist/src/yaml/steps/capture-injection.d.ts +0 -30
  342. package/dist/src/yaml/steps/capture-injection.d.ts.map +0 -1
  343. package/dist/src/yaml/steps/capture-injection.js +0 -88
  344. package/dist/src/yaml/steps/capture-injection.test.d.ts +0 -2
  345. package/dist/src/yaml/steps/capture-injection.test.d.ts.map +0 -1
  346. package/dist/src/yaml/steps/capture-injection.test.js +0 -163
  347. package/dist/src/yaml/steps/cocoapods-deployment-floor.d.ts +0 -42
  348. package/dist/src/yaml/steps/cocoapods-deployment-floor.d.ts.map +0 -1
  349. package/dist/src/yaml/steps/cocoapods-deployment-floor.js +0 -140
  350. package/dist/src/yaml/steps/cocoapods-deployment-floor.test.d.ts +0 -11
  351. package/dist/src/yaml/steps/cocoapods-deployment-floor.test.d.ts.map +0 -1
  352. package/dist/src/yaml/steps/cocoapods-deployment-floor.test.js +0 -176
  353. package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.d.ts +0 -22
  354. package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.d.ts.map +0 -1
  355. package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.js +0 -97
  356. package/dist/src/yaml/steps/cocoapods-locked-bundler.test.d.ts +0 -17
  357. package/dist/src/yaml/steps/cocoapods-locked-bundler.test.d.ts.map +0 -1
  358. package/dist/src/yaml/steps/cocoapods-locked-bundler.test.js +0 -282
  359. package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.d.ts +0 -17
  360. package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.d.ts.map +0 -1
  361. package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.js +0 -132
  362. package/dist/src/yaml/steps/envstore-loader.test.d.ts +0 -15
  363. package/dist/src/yaml/steps/envstore-loader.test.d.ts.map +0 -1
  364. package/dist/src/yaml/steps/envstore-loader.test.js +0 -143
  365. package/dist/src/yaml/steps/fastlane.d.ts +0 -27
  366. package/dist/src/yaml/steps/fastlane.d.ts.map +0 -1
  367. package/dist/src/yaml/steps/fastlane.js +0 -79
  368. package/dist/src/yaml/steps/fidelity-aspect-guard.d.ts +0 -53
  369. package/dist/src/yaml/steps/fidelity-aspect-guard.d.ts.map +0 -1
  370. package/dist/src/yaml/steps/fidelity-aspect-guard.js +0 -72
  371. package/dist/src/yaml/steps/fidelity-aspect-guard.test.d.ts +0 -11
  372. package/dist/src/yaml/steps/fidelity-aspect-guard.test.d.ts.map +0 -1
  373. package/dist/src/yaml/steps/fidelity-aspect-guard.test.js +0 -50
  374. package/dist/src/yaml/steps/fidelity-reference-provenance.d.ts +0 -87
  375. package/dist/src/yaml/steps/fidelity-reference-provenance.d.ts.map +0 -1
  376. package/dist/src/yaml/steps/fidelity-reference-provenance.js +0 -111
  377. package/dist/src/yaml/steps/fidelity-reference-provenance.test.d.ts +0 -22
  378. package/dist/src/yaml/steps/fidelity-reference-provenance.test.d.ts.map +0 -1
  379. package/dist/src/yaml/steps/fidelity-reference-provenance.test.js +0 -118
  380. package/dist/src/yaml/steps/file.d.ts +0 -52
  381. package/dist/src/yaml/steps/file.d.ts.map +0 -1
  382. package/dist/src/yaml/steps/file.js +0 -108
  383. package/dist/src/yaml/steps/flutter.d.ts +0 -63
  384. package/dist/src/yaml/steps/flutter.d.ts.map +0 -1
  385. package/dist/src/yaml/steps/flutter.js +0 -215
  386. package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.d.ts +0 -16
  387. package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.d.ts.map +0 -1
  388. package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.js +0 -127
  389. package/dist/src/yaml/steps/git-clone.d.ts +0 -32
  390. package/dist/src/yaml/steps/git-clone.d.ts.map +0 -1
  391. package/dist/src/yaml/steps/git-clone.js +0 -171
  392. package/dist/src/yaml/steps/git-fetch-retry-exec.test.d.ts +0 -10
  393. package/dist/src/yaml/steps/git-fetch-retry-exec.test.d.ts.map +0 -1
  394. package/dist/src/yaml/steps/git-fetch-retry-exec.test.js +0 -162
  395. package/dist/src/yaml/steps/git-fetch-retry.d.ts +0 -62
  396. package/dist/src/yaml/steps/git-fetch-retry.d.ts.map +0 -1
  397. package/dist/src/yaml/steps/git-fetch-retry.js +0 -155
  398. package/dist/src/yaml/steps/git-fetch-retry.test.d.ts +0 -5
  399. package/dist/src/yaml/steps/git-fetch-retry.test.d.ts.map +0 -1
  400. package/dist/src/yaml/steps/git-fetch-retry.test.js +0 -86
  401. package/dist/src/yaml/steps/google-play-deploy.d.ts +0 -37
  402. package/dist/src/yaml/steps/google-play-deploy.d.ts.map +0 -1
  403. package/dist/src/yaml/steps/google-play-deploy.js +0 -193
  404. package/dist/src/yaml/steps/google-play-deploy.test.d.ts +0 -5
  405. package/dist/src/yaml/steps/google-play-deploy.test.d.ts.map +0 -1
  406. package/dist/src/yaml/steps/google-play-deploy.test.js +0 -310
  407. package/dist/src/yaml/steps/gradle-memory.d.ts +0 -91
  408. package/dist/src/yaml/steps/gradle-memory.d.ts.map +0 -1
  409. package/dist/src/yaml/steps/gradle-memory.js +0 -495
  410. package/dist/src/yaml/steps/gradle-memory.test.d.ts +0 -2
  411. package/dist/src/yaml/steps/gradle-memory.test.d.ts.map +0 -1
  412. package/dist/src/yaml/steps/gradle-memory.test.js +0 -344
  413. package/dist/src/yaml/steps/gradle-sdk-cmake.d.ts +0 -28
  414. package/dist/src/yaml/steps/gradle-sdk-cmake.d.ts.map +0 -1
  415. package/dist/src/yaml/steps/gradle-sdk-cmake.js +0 -107
  416. package/dist/src/yaml/steps/gradle-sdk-cmake.test.d.ts +0 -2
  417. package/dist/src/yaml/steps/gradle-sdk-cmake.test.d.ts.map +0 -1
  418. package/dist/src/yaml/steps/gradle-sdk-cmake.test.js +0 -183
  419. package/dist/src/yaml/steps/index.d.ts +0 -10
  420. package/dist/src/yaml/steps/index.d.ts.map +0 -1
  421. package/dist/src/yaml/steps/index.js +0 -1461
  422. package/dist/src/yaml/steps/ios-deps.d.ts +0 -78
  423. package/dist/src/yaml/steps/ios-deps.d.ts.map +0 -1
  424. package/dist/src/yaml/steps/ios-deps.js +0 -279
  425. package/dist/src/yaml/steps/ios-deps.test.d.ts +0 -5
  426. package/dist/src/yaml/steps/ios-deps.test.d.ts.map +0 -1
  427. package/dist/src/yaml/steps/ios-deps.test.js +0 -90
  428. package/dist/src/yaml/steps/ios-signing.d.ts +0 -31
  429. package/dist/src/yaml/steps/ios-signing.d.ts.map +0 -1
  430. package/dist/src/yaml/steps/ios-signing.js +0 -144
  431. package/dist/src/yaml/steps/ios-version.d.ts +0 -47
  432. package/dist/src/yaml/steps/ios-version.d.ts.map +0 -1
  433. package/dist/src/yaml/steps/ios-version.js +0 -151
  434. package/dist/src/yaml/steps/java-home-version-spec.test.d.ts +0 -10
  435. package/dist/src/yaml/steps/java-home-version-spec.test.d.ts.map +0 -1
  436. package/dist/src/yaml/steps/java-home-version-spec.test.js +0 -58
  437. package/dist/src/yaml/steps/kotlin-metadata-compiles-on-a-daemon.test.d.ts +0 -2
  438. package/dist/src/yaml/steps/kotlin-metadata-compiles-on-a-daemon.test.d.ts.map +0 -1
  439. package/dist/src/yaml/steps/kotlin-metadata-compiles-on-a-daemon.test.js +0 -139
  440. package/dist/src/yaml/steps/linting.d.ts +0 -47
  441. package/dist/src/yaml/steps/linting.d.ts.map +0 -1
  442. package/dist/src/yaml/steps/linting.js +0 -148
  443. package/dist/src/yaml/steps/phase2.test.d.ts +0 -6
  444. package/dist/src/yaml/steps/phase2.test.d.ts.map +0 -1
  445. package/dist/src/yaml/steps/phase2.test.js +0 -197
  446. package/dist/src/yaml/steps/phase3.test.d.ts +0 -5
  447. package/dist/src/yaml/steps/phase3.test.d.ts.map +0 -1
  448. package/dist/src/yaml/steps/phase3.test.js +0 -144
  449. package/dist/src/yaml/steps/phase4.test.d.ts +0 -5
  450. package/dist/src/yaml/steps/phase4.test.d.ts.map +0 -1
  451. package/dist/src/yaml/steps/phase4.test.js +0 -166
  452. package/dist/src/yaml/steps/phase5.test.d.ts +0 -6
  453. package/dist/src/yaml/steps/phase5.test.d.ts.map +0 -1
  454. package/dist/src/yaml/steps/phase5.test.js +0 -263
  455. package/dist/src/yaml/steps/registry.d.ts +0 -88
  456. package/dist/src/yaml/steps/registry.d.ts.map +0 -1
  457. package/dist/src/yaml/steps/registry.js +0 -125
  458. package/dist/src/yaml/steps/registry.test.d.ts +0 -5
  459. package/dist/src/yaml/steps/registry.test.d.ts.map +0 -1
  460. package/dist/src/yaml/steps/registry.test.js +0 -235
  461. package/dist/src/yaml/steps/release.d.ts +0 -50
  462. package/dist/src/yaml/steps/release.d.ts.map +0 -1
  463. package/dist/src/yaml/steps/release.js +0 -154
  464. package/dist/src/yaml/steps/render-post-processor.d.ts +0 -100
  465. package/dist/src/yaml/steps/render-post-processor.d.ts.map +0 -1
  466. package/dist/src/yaml/steps/render-post-processor.js +0 -270
  467. package/dist/src/yaml/steps/render-post-processor.test.d.ts +0 -13
  468. package/dist/src/yaml/steps/render-post-processor.test.d.ts.map +0 -1
  469. package/dist/src/yaml/steps/render-post-processor.test.js +0 -220
  470. package/dist/src/yaml/steps/script.d.ts +0 -23
  471. package/dist/src/yaml/steps/script.d.ts.map +0 -1
  472. package/dist/src/yaml/steps/script.js +0 -63
  473. package/dist/src/yaml/steps/spec-validation.test.d.ts +0 -6
  474. package/dist/src/yaml/steps/spec-validation.test.d.ts.map +0 -1
  475. package/dist/src/yaml/steps/spec-validation.test.js +0 -130
  476. package/dist/src/yaml/steps/steps.test.d.ts +0 -6
  477. package/dist/src/yaml/steps/steps.test.d.ts.map +0 -1
  478. package/dist/src/yaml/steps/steps.test.js +0 -881
  479. package/dist/src/yaml/steps/structural-facts.d.ts +0 -992
  480. package/dist/src/yaml/steps/structural-facts.d.ts.map +0 -1
  481. package/dist/src/yaml/steps/structural-facts.js +0 -3276
  482. package/dist/src/yaml/steps/structural-facts.test.d.ts +0 -12
  483. package/dist/src/yaml/steps/structural-facts.test.d.ts.map +0 -1
  484. package/dist/src/yaml/steps/structural-facts.test.js +0 -3039
  485. package/dist/src/yaml/steps/test-config.d.ts +0 -5
  486. package/dist/src/yaml/steps/test-config.d.ts.map +0 -1
  487. package/dist/src/yaml/steps/test-config.js +0 -25
  488. package/dist/src/yaml/steps/trim-align-corpus.test.d.ts +0 -28
  489. package/dist/src/yaml/steps/trim-align-corpus.test.d.ts.map +0 -1
  490. package/dist/src/yaml/steps/trim-align-corpus.test.js +0 -383
  491. package/dist/src/yaml/steps/trim-align.d.ts +0 -87
  492. package/dist/src/yaml/steps/trim-align.d.ts.map +0 -1
  493. package/dist/src/yaml/steps/trim-align.js +0 -367
  494. package/dist/src/yaml/steps/trim-align.test.d.ts +0 -11
  495. package/dist/src/yaml/steps/trim-align.test.d.ts.map +0 -1
  496. package/dist/src/yaml/steps/trim-align.test.js +0 -261
  497. package/dist/src/yaml/steps/ui-fidelity-preview-android.d.ts +0 -66
  498. package/dist/src/yaml/steps/ui-fidelity-preview-android.d.ts.map +0 -1
  499. package/dist/src/yaml/steps/ui-fidelity-preview-android.js +0 -251
  500. package/dist/src/yaml/steps/ui-fidelity-preview-android.test.d.ts +0 -13
  501. package/dist/src/yaml/steps/ui-fidelity-preview-android.test.d.ts.map +0 -1
  502. package/dist/src/yaml/steps/ui-fidelity-preview-android.test.js +0 -302
  503. package/dist/src/yaml/steps/ui-fidelity-preview.d.ts +0 -134
  504. package/dist/src/yaml/steps/ui-fidelity-preview.d.ts.map +0 -1
  505. package/dist/src/yaml/steps/ui-fidelity-preview.js +0 -173
  506. package/dist/src/yaml/steps/ui-fidelity-preview.test.d.ts +0 -11
  507. package/dist/src/yaml/steps/ui-fidelity-preview.test.d.ts.map +0 -1
  508. package/dist/src/yaml/steps/ui-fidelity-preview.test.js +0 -210
  509. package/dist/src/yaml/steps/ui-fidelity-render-android.d.ts +0 -155
  510. package/dist/src/yaml/steps/ui-fidelity-render-android.d.ts.map +0 -1
  511. package/dist/src/yaml/steps/ui-fidelity-render-android.js +0 -1389
  512. package/dist/src/yaml/steps/ui-fidelity-render-android.test.d.ts +0 -2
  513. package/dist/src/yaml/steps/ui-fidelity-render-android.test.d.ts.map +0 -1
  514. package/dist/src/yaml/steps/ui-fidelity-render-android.test.js +0 -1106
  515. package/dist/src/yaml/steps/ui-fidelity-render.d.ts +0 -230
  516. package/dist/src/yaml/steps/ui-fidelity-render.d.ts.map +0 -1
  517. package/dist/src/yaml/steps/ui-fidelity-render.js +0 -1597
  518. package/dist/src/yaml/steps/ui-fidelity-render.test.d.ts +0 -18
  519. package/dist/src/yaml/steps/ui-fidelity-render.test.d.ts.map +0 -1
  520. package/dist/src/yaml/steps/ui-fidelity-render.test.js +0 -1871
  521. package/dist/src/yaml/steps/xcode-app-product.d.ts +0 -90
  522. package/dist/src/yaml/steps/xcode-app-product.d.ts.map +0 -1
  523. package/dist/src/yaml/steps/xcode-app-product.js +0 -247
  524. package/dist/src/yaml/steps/xcode-app-product.test.d.ts +0 -2
  525. package/dist/src/yaml/steps/xcode-app-product.test.d.ts.map +0 -1
  526. package/dist/src/yaml/steps/xcode-app-product.test.js +0 -202
  527. package/dist/src/yaml/steps/xcode-derived-data.test.d.ts +0 -30
  528. package/dist/src/yaml/steps/xcode-derived-data.test.d.ts.map +0 -1
  529. package/dist/src/yaml/steps/xcode-derived-data.test.js +0 -279
  530. package/dist/src/yaml/steps/xcode-destination.d.ts +0 -47
  531. package/dist/src/yaml/steps/xcode-destination.d.ts.map +0 -1
  532. package/dist/src/yaml/steps/xcode-destination.js +0 -202
  533. package/dist/src/yaml/steps/xcode-destination.test.d.ts +0 -9
  534. package/dist/src/yaml/steps/xcode-destination.test.d.ts.map +0 -1
  535. package/dist/src/yaml/steps/xcode-destination.test.js +0 -227
  536. package/dist/src/yaml/steps/xcode-new.test.d.ts +0 -5
  537. package/dist/src/yaml/steps/xcode-new.test.d.ts.map +0 -1
  538. package/dist/src/yaml/steps/xcode-new.test.js +0 -211
  539. package/dist/src/yaml/steps/xcode-resolve-retry.test.d.ts +0 -9
  540. package/dist/src/yaml/steps/xcode-resolve-retry.test.d.ts.map +0 -1
  541. package/dist/src/yaml/steps/xcode-resolve-retry.test.js +0 -146
  542. package/dist/src/yaml/steps/xcode-simulator-archs.d.ts +0 -53
  543. package/dist/src/yaml/steps/xcode-simulator-archs.d.ts.map +0 -1
  544. package/dist/src/yaml/steps/xcode-simulator-archs.js +0 -98
  545. package/dist/src/yaml/steps/xcode-simulator-archs.test.d.ts +0 -21
  546. package/dist/src/yaml/steps/xcode-simulator-archs.test.d.ts.map +0 -1
  547. package/dist/src/yaml/steps/xcode-simulator-archs.test.js +0 -155
  548. package/dist/src/yaml/steps/xcode.d.ts +0 -230
  549. package/dist/src/yaml/steps/xcode.d.ts.map +0 -1
  550. package/dist/src/yaml/steps/xcode.js +0 -1350
  551. package/dist/src/yaml/types.d.ts +0 -76
  552. package/dist/src/yaml/types.d.ts.map +0 -1
  553. package/dist/src/yaml/types.js +0 -5
  554. package/dist/src/yaml/validation-types.d.ts +0 -102
  555. package/dist/src/yaml/validation-types.d.ts.map +0 -1
  556. package/dist/src/yaml/validation-types.js +0 -8
  557. package/dist/src/yaml/yaml-updater.d.ts +0 -24
  558. package/dist/src/yaml/yaml-updater.d.ts.map +0 -1
  559. package/dist/src/yaml/yaml-updater.js +0 -128
@@ -1,91 +0,0 @@
1
- /**
2
- * Gradle's daemon heaps, fitted to the machine the build runs on.
3
- *
4
- * A project's `gradle.properties` sizes its heaps for a developer laptop. On a
5
- * 10 GiB build guest, `org.gradle.jvmargs=-Xmx8G` (which the Kotlin daemon
6
- * inherits) or `-Xmx6g` beside `kotlin.daemon.jvmargs=-Xmx8g` asks for more
7
- * than the machine has, and the kernel kills a daemon mid-build. All the log
8
- * then says is "Gradle build daemon disappeared unexpectedly". IacobIonut01/ReFra
9
- * and vitorpamplona/amethyst are the two measured cases; ReFra's own CI lowers
10
- * its heap to 4g before building.
11
- *
12
- * Two things, both at run time, in the Gradle project directory:
13
- *
14
- * 1. **Cap.** Read the machine's memory and the declared `-Xmx` of the Gradle
15
- * daemon and the Kotlin daemon. When their sum is past
16
- * `GRADLE_HEAP_SHARE_PERCENT` of memory, run one heap instead: the Gradle
17
- * daemon gets the whole budget (`-Dorg.gradle.jvmargs=`) and Kotlin
18
- * compiles in it (`-Pkotlin.compiler.execution.strategy=in-process`). One
19
- * line names the old values and the new. Two heaps did not fit: halved,
20
- * ReFra's Kotlin compile ran out of heap; split 60/40, its Kotlin daemon
21
- * was lost mid-compile, and mifos-mobile's Gradle daemon ran out of its
22
- * 40 % on a 6 GiB guest.
23
- * 2. **Say so.** When a Gradle run exits 137, its output says the daemon
24
- * disappeared, or the Kotlin daemon was lost mid-compile, print the
25
- * kernel's out-of-memory lines and one sentence with the machine's memory
26
- * and what the build asked for.
27
- * 3. **Workers.** A heap cap does not bound what runs beside the heaps:
28
- * off-heap memory, and native compilers run in parallel. IacobIonut01/ReFra
29
- * was killed again at a capped -Xmx3712m, one JVM holding ~5.1 GiB
30
- * resident; its own CI also sets `org.gradle.workers.max=2`. A pipeline
31
- * may ask for a worker count, passed as `--max-workers=<n>`.
32
- *
33
- * Precedence, measured with Gradle 8.14.3 and 9.5.0 (daemon and --no-daemon):
34
- * `-Dorg.gradle.jvmargs` on the command line beats both the Gradle user
35
- * home's and the project's `gradle.properties` for the daemon's heap, and
36
- * `-P` beats `gradle.properties` for a Gradle property, which is how the
37
- * Kotlin Gradle plugin reads `kotlin.daemon.jvmargs` and
38
- * `kotlin.compiler.execution.strategy`: with
39
- * `-Pkotlin.compiler.execution.strategy=in-process`, no Kotlin daemon starts
40
- * even where the project's file says `daemon`. `--max-workers` beats
41
- * `org.gradle.workers.max` in both files (`gradle.startParameter.maxWorkerCount`).
42
- * `GRADLE_OPTS` is not used: it sizes the client JVM, not the daemon.
43
- *
44
- * Written as shell functions so what ships is what the tests run. Its lines
45
- * start with "Gradle memory:", never with a step-progress marker.
46
- */
47
- /** The share of the machine's memory the two daemon heaps may take together. */
48
- export declare const GRADLE_HEAP_SHARE_PERCENT = 75;
49
- /**
50
- * Sends a Kotlin Multiplatform project's metadata compiles
51
- * (compile*KotlinMetadata, the KotlinCompileCommon tasks) to the Kotlin daemon
52
- * while every other Kotlin compile stays in-process. With
53
- * -Pkotlin.compiler.execution.strategy=in-process, Kotlin 2.2.0 compiled
54
- * DroidKaigi/conference-app-2025's common metadata in K1 mode and rejected its
55
- * context parameters; the same task on the daemon passed (nightly-baseline 95).
56
- *
57
- * The Kotlin plugin's classes are not on an init script's classpath, so the
58
- * task is matched by class name and the strategy enum is loaded through the
59
- * task's own classloader. A Kotlin plugin without the property (older than the
60
- * strategy API) is left alone: this script must never fail a build. Lazy
61
- * (configureEach where Gradle has it), so it is configuration-cache safe and
62
- * realizes no task. It runs once per build, included builds as well; they
63
- * have no metadata compiles to touch.
64
- */
65
- export declare const KOTLIN_METADATA_DAEMON_INIT_SCRIPT = "// cibuild: Kotlin metadata compiles run in the Kotlin daemon (nightly-baseline 95).\nallprojects {\n def hook = { t ->\n if (!t.class.name.startsWith('org.jetbrains.kotlin.gradle.tasks.KotlinCompileCommon')) return\n try {\n def strategy = t.class.classLoader.loadClass('org.jetbrains.kotlin.gradle.tasks.KotlinCompilerExecutionStrategy')\n t.compilerExecutionStrategy.set(strategy.enumConstants.find { it.name() == 'DAEMON' })\n } catch (Throwable ignored) {\n }\n }\n try {\n tasks.configureEach(hook)\n } catch (MissingMethodException ignored) {\n tasks.all(hook)\n }\n}\n";
66
- export declare const GRADLE_MEMORY_FUNCTIONS = "# This machine's memory in MiB, or nothing when it cannot be read.\ncibuild_mem_mib() {\n if [ -r /proc/meminfo ]; then\n awk '/^MemTotal:/ { print int($2 / 1024); exit }' /proc/meminfo\n else\n local bytes\n bytes=$(sysctl -n hw.memsize 2>/dev/null || true)\n if [ -n \"$bytes\" ]; then echo $(( bytes / 1048576 )); fi\n fi\n}\n\n# $1 a .properties file, $2 a key. Prints \"<line number><TAB><value>\" for the\n# last assignment of the key, or nothing.\ncibuild_prop_line() {\n [ -f \"$1\" ] || return 0\n awk -v key=\"$2\" '\n { line = $0; sub(/^[ \\t]+/, \"\", line) }\n line ~ /^[#!]/ { next }\n {\n k = line; sub(/[ \\t]*[=:].*$/, \"\", k)\n if (k == key) { v = line; sub(/^[^=:]*[=:][ \\t]*/, \"\", v); sub(/[ \\t\\r]+$/, \"\", v); found = NR \"\\t\" v }\n }\n END { if (found != \"\") print found }\n ' \"$1\"\n}\n\n# The -Xmx of a JVM argument string in MiB (the last one wins, as in the JVM),\n# or nothing when it has none.\ncibuild_xmx_mib() {\n printf '%s\\n' \"$1\" | tr ' \\t' '\\n\\n' | awk '\n /^-Xmx[0-9]+[kKmMgGtT]?$/ {\n n = substr($0, 5); u = substr(n, length(n))\n if (u ~ /[0-9]/) { v = n / 1048576 }\n else {\n n = substr(n, 1, length(n) - 1)\n if (u ~ /[kK]/) v = n / 1024\n else if (u ~ /[mM]/) v = n\n else if (u ~ /[gG]/) v = n * 1024\n else v = n * 1048576\n }\n r = int(v)\n }\n END { if (r != \"\") print r }'\n}\n\n# The -XX:MaxMetaspaceSize of a JVM argument string in MiB (the last one\n# wins), or nothing when it has none.\ncibuild_metaspace_mib() {\n printf '%s\\n' \"$1\" | tr ' \\t,' '\\n\\n\\n' | awk '\n /^-XX:MaxMetaspaceSize=[0-9]+[kKmMgGtT]?$/ {\n n = substr($0, 22); u = substr(n, length(n))\n if (u ~ /[0-9]/) { v = n / 1048576 }\n else {\n n = substr(n, 1, length(n) - 1)\n if (u ~ /[kK]/) v = n / 1024\n else if (u ~ /[mM]/) v = n\n else if (u ~ /[gG]/) v = n * 1024\n else v = n * 1048576\n }\n r = int(v)\n }\n END { if (r != \"\") print r }'\n}\n\n# $1 a JVM argument string, $2 a size in MiB: the same arguments with every\n# -XX:MaxMetaspaceSize replaced by that one.\ncibuild_with_metaspace() (\n set -f\n out=\"\"\n replaced=0\n for arg in $1; do\n case \"$arg\" in\n -XX:MaxMetaspaceSize=*) if [ \"$replaced\" -eq 0 ]; then out=\"$out -XX:MaxMetaspaceSize=${2}m\"; replaced=1; fi ;;\n *) out=\"$out $arg\" ;;\n esac\n done\n printf '%s' \"${out# }\"\n)\n\n# $1 a JVM argument string, $2 a heap in MiB: the same arguments with every\n# -Xmx replaced by that one (added in front when there was none).\ncibuild_with_xmx() (\n set -f\n out=\"\"\n replaced=0\n for arg in $1; do\n case \"$arg\" in\n -Xmx*) if [ \"$replaced\" -eq 0 ]; then out=\"$out -Xmx${2}m\"; replaced=1; fi ;;\n *) out=\"$out $arg\" ;;\n esac\n done\n [ \"$replaced\" -eq 1 ] || out=\" -Xmx${2}m$out\"\n printf '%s' \"${out# }\"\n)\n\n# MiB as GiB with one decimal.\ncibuild_gib() {\n awk -v m=\"$1\" 'BEGIN { printf \"%.1f\", m / 1024 }'\n}\n\n# A heap scaled by budget/total, rounded down to 64 MiB, never below 512 MiB.\ncibuild_scaled_heap() {\n local v=$(( $1 * $2 / $3 / 64 * 64 ))\n [ \"$v\" -ge 512 ] || v=512\n echo \"$v\"\n}\n\n# The Kotlin daemon heap a multiplatform project's metadata compiles get out\n# of a budget in MiB: an eighth, rounded down to 64 MiB, from 512 MiB to 1 GiB.\ncibuild_metadata_daemon_heap() {\n local v=$(( $1 / 8 / 64 * 64 ))\n [ \"$v\" -ge 512 ] || v=512\n [ \"$v\" -le 1024 ] || v=1024\n echo \"$v\"\n}\n\n# Whether the Gradle project here applies Kotlin Multiplatform: a build script\n# or version catalog that names the plugin. Convention plugins in buildSrc or\n# an included build sit a few directories down; build outputs are not read.\ncibuild_applies_kotlin_multiplatform() {\n local f\n while IFS= read -r -d '' f; do\n if grep -q -E 'kotlin\\(\"multiplatform\"\\)|org\\.jetbrains\\.kotlin\\.multiplatform|kotlin-multiplatform|kotlinMultiplatform' \"$f\" 2>/dev/null; then return 0; fi\n done < <(find . -maxdepth 6 \\( -name .git -o -name node_modules -o -name build -o -name .gradle \\) -prune -o -type f \\( -name '*.gradle' -o -name '*.gradle.kts' -o -name '*.versions.toml' \\) -print0 2>/dev/null)\n return 1\n}\n\n# The plan, from its inputs only, so a test can run it:\n# $1 this machine's memory in MiB (empty when unknown)\n# $2 the project's gradle.properties $3 the Gradle user home's\n# $4 JVM arguments the pipeline asks for instead (may be empty)\n# $5 the metadata init script, when the project applies Kotlin\n# Multiplatform (empty otherwise)\n# Sets CIBUILD_GRADLE_MEMORY_ARGS (extra Gradle arguments),\n# CIBUILD_GRADLE_MEMORY_LINE (what to print before Gradle runs; empty when\n# nothing changes) and CIBUILD_GRADLE_MEMORY_SENTENCE (what to print if a\n# daemon is killed).\n#\n# Precedence is Gradle's own: the command line beats GRADLE_USER_HOME's\n# gradle.properties, which beats the project's. A Kotlin daemon with no -Xmx of\n# its own inherits the Gradle daemon's, and in-process compilation has no\n# Kotlin daemon at all.\ncibuild_gradle_memory_plan() {\n local mem=\"$1\" project=\"$2\" user=\"$3\" preferred=\"$4\" init=\"${5:-}\" l\n local jvm=\"\" jvm_at=\"\" kd=\"\" kd_at=\"\" strategy=\"\"\n CIBUILD_GRADLE_MEMORY_ARGS=()\n CIBUILD_GRADLE_MEMORY_LINE=\"\"\n CIBUILD_GRADLE_MEMORY_SENTENCE=\"\"\n\n if [ -n \"$preferred\" ]; then jvm=\"$preferred\"; jvm_at=\"the pipeline\"; fi\n for f in \"$user\" \"$project\"; do\n if [ -z \"$jvm_at\" ]; then\n l=$(cibuild_prop_line \"$f\" org.gradle.jvmargs)\n if [ -n \"$l\" ]; then jvm=\"${l#*\t}\"; jvm_at=\"$f:${l%%\t*}\"; fi\n fi\n if [ -z \"$kd_at\" ]; then\n l=$(cibuild_prop_line \"$f\" kotlin.daemon.jvmargs)\n if [ -n \"$l\" ]; then kd=\"${l#*\t}\"; kd_at=\"$f:${l%%\t*}\"; fi\n fi\n if [ -z \"$strategy\" ]; then\n l=$(cibuild_prop_line \"$f\" kotlin.compiler.execution.strategy)\n strategy=\"${l#*\t}\"\n fi\n done\n\n local g k kd_own=\"\"\n g=$(cibuild_xmx_mib \"$jvm\")\n [ -n \"$g\" ] || g=512\n if [ \"$strategy\" = \"in-process\" ]; then\n k=0\n else\n kd_own=$(cibuild_xmx_mib \"$kd\")\n k=\"${kd_own:-$g}\"\n fi\n local total=$(( g + k ))\n\n local asked\n if [ -n \"$jvm_at\" ]; then asked=\"org.gradle.jvmargs=$jvm at ${jvm_at}\"; else asked=\"Gradle's default -Xmx512m\"; fi\n if [ \"$k\" -eq 0 ]; then\n asked=\"$asked; Kotlin compiles in-process\"\n elif [ -n \"$kd_own\" ]; then\n asked=\"$asked, kotlin.daemon.jvmargs=$kd at ${kd_at}\"\n else\n asked=\"$asked; the Kotlin daemon inherits its -Xmx\"\n fi\n\n if [ -z \"$mem\" ]; then\n CIBUILD_GRADLE_MEMORY_SENTENCE=\"This build's Gradle and Kotlin daemons asked for $(cibuild_gib \"$total\") GiB ($asked); this machine's memory could not be read.\"\n if [ -n \"$preferred\" ]; then CIBUILD_GRADLE_MEMORY_ARGS=(\"-Dorg.gradle.jvmargs=$preferred\"); fi\n return 0\n fi\n\n local budget=$(( mem * 75 / 100 ))\n CIBUILD_GRADLE_MEMORY_SENTENCE=\"The build machine has $(cibuild_gib \"$mem\") GiB; this build's Gradle and Kotlin daemons asked for $(cibuild_gib \"$total\") GiB ($asked).\"\n\n if [ \"$total\" -le \"$budget\" ]; then\n if [ -n \"$preferred\" ]; then\n CIBUILD_GRADLE_MEMORY_ARGS=(\"-Dorg.gradle.jvmargs=$preferred\")\n CIBUILD_GRADLE_MEMORY_LINE=\"Gradle memory: org.gradle.jvmargs=$preferred, as the pipeline asks (-Dorg.gradle.jvmargs on the command line).\"\n fi\n return 0\n fi\n\n case \"$jvm\" in\n *\\\\)\n CIBUILD_GRADLE_MEMORY_LINE=\"Gradle memory: the declared heaps ask for $(cibuild_gib \"$total\") GiB of this machine's $(cibuild_gib \"$mem\") GiB, but org.gradle.jvmargs at ${jvm_at} continues onto another line, so it is left as it is.\"\n return 0\n ;;\n esac\n\n # One heap, the whole budget. Two did not fit: ReFra's Kotlin daemon was\n # lost mid-compile at a 60/40 split, and mifos-mobile's Gradle daemon ran out\n # of its 40 %. In-process, Kotlin compiles in the Gradle daemon's heap.\n # A multiplatform project's metadata compiles are the exception: they go to\n # a small Kotlin daemon (the init script), carved out of the same budget.\n local ng now newjvm mg mk md=\"\"\n if [ \"$k\" -gt 0 ] && [ -n \"$init\" ]; then md=$(cibuild_metadata_daemon_heap \"$budget\"); fi\n ng=$(cibuild_scaled_heap $(( budget - ${md:-0} )) 1 1)\n newjvm=$(cibuild_with_xmx \"$jvm\" \"$ng\")\n now=\"Gradle -Xmx${ng}m\"\n if [ \"$k\" -gt 0 ]; then\n # One JVM now holds what two did, so a Metaspace cap Gradle declared must\n # hold Kotlin's too: the Kotlin daemon's own (kotlin.daemon.jvmargs, or\n # -Dkotlin.daemon.jvm.options in Gradle's), else the Gradle one it\n # inherits. GetStream/whatsApp-clone-compose capped Gradle at 512m and gave\n # Kotlin 1g, and in-process compileDebugKotlin ran out of Metaspace\n # (nightly-baseline 79). No Gradle cap, nothing to raise.\n mg=$(cibuild_metaspace_mib \"$jvm\")\n if [ -n \"$mg\" ]; then\n mk=$(cibuild_metaspace_mib \"$kd\")\n [ -n \"$mk\" ] || mk=$(cibuild_metaspace_mib \"$(printf '%s\\n' \"$jvm\" | tr ' \\t' '\\n\\n' | sed -n 's/^-Dkotlin\\.daemon\\.jvm\\.options=//p')\")\n [ -n \"$mk\" ] || mk=\"$mg\"\n newjvm=$(cibuild_with_metaspace \"$newjvm\" $(( mg + mk )))\n now=\"$now with -XX:MaxMetaspaceSize=$(( mg + mk ))m (Gradle's ${mg}m and Kotlin's ${mk}m, in one JVM now)\"\n fi\n now=\"$now and Kotlin compiled in-process in it (kotlin.compiler.execution.strategy=in-process: one heap, not a Gradle and a Kotlin daemon)\"\n fi\n if [ -n \"$md\" ]; then\n now=\"$now, and Kotlin metadata compiles (compile*KotlinMetadata) in a Kotlin daemon of -Xmx${md}m beside it (in-process, Kotlin 2.2 compiled them in K1 mode)\"\n fi\n CIBUILD_GRADLE_MEMORY_ARGS=(\"-Dorg.gradle.jvmargs=$newjvm\")\n if [ \"$k\" -gt 0 ]; then\n CIBUILD_GRADLE_MEMORY_ARGS+=(\"-Pkotlin.compiler.execution.strategy=in-process\")\n fi\n if [ -n \"$md\" ]; then\n CIBUILD_GRADLE_MEMORY_ARGS+=(\"-Pkotlin.daemon.jvmargs=-Xmx${md}m\" --init-script \"$init\")\n fi\n CIBUILD_GRADLE_MEMORY_LINE=\"Gradle memory: this machine has $(cibuild_gib \"$mem\") GiB and the declared heaps ask for $(cibuild_gib \"$total\") GiB ($asked), past the $(cibuild_gib \"$budget\") GiB this build allows them. Running with $now, set on the command line.\"\n CIBUILD_GRADLE_MEMORY_SENTENCE=\"$CIBUILD_GRADLE_MEMORY_SENTENCE This build ran them capped: $now.\"\n}\n\n# $1 the project's gradle.properties, $2 the Gradle user home's. A JDK path the\n# project pins with org.gradle.java.home that is not on this machine \u2014 a\n# developer's own, like SEAbdulbasit/MusicApp-KMP's\n# /Users/abdulbasit/Library/Java/... (nightly-baseline 83) \u2014 stops Gradle\n# before it starts: \"given for org.gradle.java.home Gradle property is\n# invalid\". On the command line, -Dorg.gradle.java.home beats both files\n# (measured, Gradle 8.14.3), so the build's own JDK is passed instead. A path\n# that exists is left alone. Sets CIBUILD_GRADLE_JAVA_HOME_LINE.\ncibuild_gradle_java_home_plan() {\n local l v=\"\" at=\"\"\n CIBUILD_GRADLE_JAVA_HOME_LINE=\"\"\n for f in \"$2\" \"$1\"; do\n l=$(cibuild_prop_line \"$f\" org.gradle.java.home)\n if [ -n \"$l\" ]; then v=\"${l#*\t}\"; at=\"$f:${l%%\t*}\"; break; fi\n done\n [ -n \"$v\" ] || return 0\n [ -d \"$v\" ] && return 0\n [ -n \"${JAVA_HOME:-}\" ] && [ -d \"$JAVA_HOME\" ] || return 0\n CIBUILD_GRADLE_MEMORY_ARGS+=(\"-Dorg.gradle.java.home=$JAVA_HOME\")\n CIBUILD_GRADLE_JAVA_HOME_LINE=\"Gradle: org.gradle.java.home=$v at $at is not on this machine; running with this build's JDK, $JAVA_HOME (-Dorg.gradle.java.home on the command line).\"\n}\n\n# $1 the number of Gradle workers the pipeline asks for (may be empty). Adds\n# --max-workers to the plan's arguments; run after cibuild_gradle_memory_plan.\n# Sets CIBUILD_GRADLE_WORKERS_LINE (what to print; empty when nothing asked).\ncibuild_gradle_workers_plan() {\n CIBUILD_GRADLE_WORKERS_LINE=\"\"\n [ -n \"$1\" ] || return 0\n case \"$1\" in\n *[!0-9]*|0*)\n CIBUILD_GRADLE_WORKERS_LINE=\"Gradle memory: max_workers=$1 is not a positive whole number, so it is not passed and Gradle picks its own worker count.\"\n return 0\n ;;\n esac\n CIBUILD_GRADLE_MEMORY_ARGS+=(\"--max-workers=$1\")\n CIBUILD_GRADLE_WORKERS_LINE=\"Gradle memory: running with --max-workers=$1, as the pipeline asks (set on the command line, over any org.gradle.workers.max).\"\n CIBUILD_GRADLE_MEMORY_SENTENCE=\"$CIBUILD_GRADLE_MEMORY_SENTENCE Gradle ran with --max-workers=$1.\"\n}\n\n# The kernel's out-of-memory lines, if this user may read the kernel log.\n# Linux guests restrict dmesg to root by default; their build user has\n# non-interactive sudo, so that is the second try.\ncibuild_kernel_oom_lines() {\n { dmesg 2>/dev/null || sudo -n dmesg 2>/dev/null || true; } |\n grep -i -E 'out of memory|oom-kill|oom_reaper|killed process' | tail -n 20 || true\n}\n\n# $1 Gradle's exit status, $2 a file holding its output. Says so when the\n# failure is a killed daemon rather than a failed build.\ncibuild_gradle_memory_report() {\n local kotlin_lost=\"\"\n if grep -q \"Connection to the Kotlin daemon has been unexpectedly lost\" \"$2\" 2>/dev/null; then kotlin_lost=1; fi\n if [ \"$1\" -ne 137 ] && [ -z \"$kotlin_lost\" ] && ! grep -q \"daemon disappeared unexpectedly\" \"$2\" 2>/dev/null; then\n return 0\n fi\n local oom\n oom=$(cibuild_kernel_oom_lines)\n echo \"\"\n if [ -n \"$kotlin_lost\" ]; then\n echo \"Gradle memory: the Kotlin daemon was lost mid-compile rather than the build failing (exit $1). Kotlin then compiled without it, in the Gradle daemon's heap.\"\n else\n echo \"Gradle memory: a Gradle daemon was killed rather than failing the build (exit $1).\"\n fi\n if [ -n \"$oom\" ]; then\n echo \"The kernel's out-of-memory lines:\"\n printf '%s\\n' \"$oom\" | sed 's/^/ /'\n else\n echo \"The kernel log shows no out-of-memory kill, or this machine does not let the build read it.\"\n fi\n if [ -n \"$CIBUILD_GRADLE_MEMORY_SENTENCE\" ]; then echo \"$CIBUILD_GRADLE_MEMORY_SENTENCE\"; fi\n}\n\n# Runs Gradle with the plan's arguments, and reports a killed daemon.\ncibuild_gradle() {\n local log rc\n log=$(mktemp)\n set +e\n \"$CIBUILD_GRADLE_BIN\" \"${CIBUILD_GRADLE_MEMORY_ARGS[@]}\" \"$@\" 2>&1 | tee \"$log\"\n rc=${PIPESTATUS[0]}\n set -e\n if [ \"$rc\" -ne 0 ]; then cibuild_gradle_memory_report \"$rc\" \"$log\" || true; fi\n rm -f \"$log\"\n return \"$rc\"\n}\n\n# $1 JVM arguments the pipeline asks for, $2 the Gradle workers it asks for\n# (either may be empty). Run in the Gradle project directory, after GRADLE_CMD\n# is chosen.\ncibuild_gradle_memory_cap() {\n local metadata_init=\"\"\n if cibuild_applies_kotlin_multiplatform; then\n metadata_init=\"$(mktemp -d)/cibuild-kotlin-metadata-daemon.init.gradle\"\n cat > \"$metadata_init\" <<'CIBUILD_KOTLIN_METADATA_INIT'\n// cibuild: Kotlin metadata compiles run in the Kotlin daemon (nightly-baseline 95).\nallprojects {\n def hook = { t ->\n if (!t.class.name.startsWith('org.jetbrains.kotlin.gradle.tasks.KotlinCompileCommon')) return\n try {\n def strategy = t.class.classLoader.loadClass('org.jetbrains.kotlin.gradle.tasks.KotlinCompilerExecutionStrategy')\n t.compilerExecutionStrategy.set(strategy.enumConstants.find { it.name() == 'DAEMON' })\n } catch (Throwable ignored) {\n }\n }\n try {\n tasks.configureEach(hook)\n } catch (MissingMethodException ignored) {\n tasks.all(hook)\n }\n}\nCIBUILD_KOTLIN_METADATA_INIT\n fi\n cibuild_gradle_memory_plan \"$(cibuild_mem_mib || true)\" \"gradle.properties\" \\\n \"${GRADLE_USER_HOME:-$HOME/.gradle}/gradle.properties\" \"$1\" \"$metadata_init\"\n cibuild_gradle_workers_plan \"$2\"\n cibuild_gradle_java_home_plan \"gradle.properties\" \"${GRADLE_USER_HOME:-$HOME/.gradle}/gradle.properties\"\n if [ -n \"$CIBUILD_GRADLE_MEMORY_LINE\" ]; then echo \"$CIBUILD_GRADLE_MEMORY_LINE\"; fi\n if [ -n \"$CIBUILD_GRADLE_WORKERS_LINE\" ]; then echo \"$CIBUILD_GRADLE_WORKERS_LINE\"; fi\n if [ -n \"$CIBUILD_GRADLE_JAVA_HOME_LINE\" ]; then echo \"$CIBUILD_GRADLE_JAVA_HOME_LINE\"; fi\n CIBUILD_GRADLE_BIN=\"$GRADLE_CMD\"\n GRADLE_CMD=cibuild_gradle\n}";
67
- /**
68
- * The commands a Gradle step runs once it has chosen `GRADLE_CMD` and is in
69
- * the project directory. Afterwards `$GRADLE_CMD` runs Gradle with the plan's
70
- * arguments and reports a killed daemon.
71
- *
72
- * `jvmargs` is what the pipeline asks for instead of the project's
73
- * `org.gradle.jvmargs` (a value the repository's own CI sets, say); the cap
74
- * still applies to it. `maxWorkers` is the worker count it asks for (the
75
- * repository CI's `org.gradle.workers.max`), passed as `--max-workers`.
76
- */
77
- export declare function gradleMemoryCommands(jvmargs: string, escape: (value: string) => string, maxWorkers?: string): string[];
78
- /**
79
- * A pinned org.gradle.java.home that is not on this machine, made to name the
80
- * build's JDK for every Gradle run in the build. The Gradle steps already pass
81
- * -Dorg.gradle.java.home on their own command line; a script step's
82
- * ./gradlew and a build phase Xcode runs do not, and they read the checkout's
83
- * gradle.properties. SEAbdulbasit/MusicApp-KMP's Android step went on with the
84
- * override and its KMM "Prepare the iOS build" script stopped on the same
85
- * "given for org.gradle.java.home Gradle property is invalid"
86
- * (nightly-baseline 92). So the line itself is rewritten, in every
87
- * gradle.properties of the checkout, once the build's JDK is chosen. A path
88
- * that exists, an empty value or a commented-out line is left alone.
89
- */
90
- export declare const GRADLE_JAVA_HOME_PIN_FUNCTIONS = "# $1 a .properties file, $2 a key. Prints \"<line number><TAB><value>\" for the\n# last assignment of the key, or nothing.\ncibuild_prop_line() {\n [ -f \"$1\" ] || return 0\n awk -v key=\"$2\" '\n { line = $0; sub(/^[ \\t]+/, \"\", line) }\n line ~ /^[#!]/ { next }\n {\n k = line; sub(/[ \\t]*[=:].*$/, \"\", k)\n if (k == key) { v = line; sub(/^[^=:]*[=:][ \\t]*/, \"\", v); sub(/[ \\t\\r]+$/, \"\", v); found = NR \"\\t\" v }\n }\n END { if (found != \"\") print found }\n ' \"$1\"\n}\n\n# Run once JAVA_HOME is the build's JDK. Searches the checkout\n# (CIBUILD_SOURCE_DIR, else the current directory) to the depth a nested\n# Gradle project sits at, and prints one line per file it rewrites.\ncibuild_gradle_java_home_pin() {\n [ -n \"${JAVA_HOME:-}\" ] && [ -d \"$JAVA_HOME\" ] || return 0\n local root f l v tmp\n root=\"${CIBUILD_SOURCE_DIR:-.}\"\n while IFS= read -r f; do\n l=$(cibuild_prop_line \"$f\" org.gradle.java.home)\n [ -n \"$l\" ] || continue\n v=\"${l#*\t}\"\n [ -n \"$v\" ] || continue\n [ -d \"$v\" ] && continue\n tmp=$(mktemp)\n awk -v key=org.gradle.java.home -v home=\"$JAVA_HOME\" '\n { line = $0; sub(/^[ \\t]+/, \"\", line) }\n line !~ /^[#!]/ { k = line; sub(/[ \\t]*[=:].*$/, \"\", k); if (k == key) { print key \"=\" home; next } }\n { print }\n ' \"$f\" > \"$tmp\" && cat \"$tmp\" > \"$f\"\n rm -f \"$tmp\"\n echo \"Gradle: org.gradle.java.home=$v at ${f#\"$root\"/}:${l%%\t*} is not on this machine; that line now names this build's JDK, $JAVA_HOME, so every Gradle run in this build uses it (a script's ./gradlew and Xcode's build phases as well as the Gradle steps).\"\n done < <(find \"$root\" -maxdepth 4 \\( -name .git -o -name node_modules -o -name build -o -name .gradle \\) -prune -o -type f -name gradle.properties -print 2>/dev/null)\n}";
91
- //# sourceMappingURL=gradle-memory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gradle-memory.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/gradle-memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,gFAAgF;AAChF,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAmB5C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kCAAkC,smBAgB9C,CAAC;AAEF,eAAO,MAAM,uBAAuB,gjgBAsVlC,CAAC;AAEH;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EACjC,UAAU,SAAK,GACd,MAAM,EAAE,CAOV;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,8BAA8B,y0DAwBzC,CAAC"}
@@ -1,495 +0,0 @@
1
- /**
2
- * Gradle's daemon heaps, fitted to the machine the build runs on.
3
- *
4
- * A project's `gradle.properties` sizes its heaps for a developer laptop. On a
5
- * 10 GiB build guest, `org.gradle.jvmargs=-Xmx8G` (which the Kotlin daemon
6
- * inherits) or `-Xmx6g` beside `kotlin.daemon.jvmargs=-Xmx8g` asks for more
7
- * than the machine has, and the kernel kills a daemon mid-build. All the log
8
- * then says is "Gradle build daemon disappeared unexpectedly". IacobIonut01/ReFra
9
- * and vitorpamplona/amethyst are the two measured cases; ReFra's own CI lowers
10
- * its heap to 4g before building.
11
- *
12
- * Two things, both at run time, in the Gradle project directory:
13
- *
14
- * 1. **Cap.** Read the machine's memory and the declared `-Xmx` of the Gradle
15
- * daemon and the Kotlin daemon. When their sum is past
16
- * `GRADLE_HEAP_SHARE_PERCENT` of memory, run one heap instead: the Gradle
17
- * daemon gets the whole budget (`-Dorg.gradle.jvmargs=`) and Kotlin
18
- * compiles in it (`-Pkotlin.compiler.execution.strategy=in-process`). One
19
- * line names the old values and the new. Two heaps did not fit: halved,
20
- * ReFra's Kotlin compile ran out of heap; split 60/40, its Kotlin daemon
21
- * was lost mid-compile, and mifos-mobile's Gradle daemon ran out of its
22
- * 40 % on a 6 GiB guest.
23
- * 2. **Say so.** When a Gradle run exits 137, its output says the daemon
24
- * disappeared, or the Kotlin daemon was lost mid-compile, print the
25
- * kernel's out-of-memory lines and one sentence with the machine's memory
26
- * and what the build asked for.
27
- * 3. **Workers.** A heap cap does not bound what runs beside the heaps:
28
- * off-heap memory, and native compilers run in parallel. IacobIonut01/ReFra
29
- * was killed again at a capped -Xmx3712m, one JVM holding ~5.1 GiB
30
- * resident; its own CI also sets `org.gradle.workers.max=2`. A pipeline
31
- * may ask for a worker count, passed as `--max-workers=<n>`.
32
- *
33
- * Precedence, measured with Gradle 8.14.3 and 9.5.0 (daemon and --no-daemon):
34
- * `-Dorg.gradle.jvmargs` on the command line beats both the Gradle user
35
- * home's and the project's `gradle.properties` for the daemon's heap, and
36
- * `-P` beats `gradle.properties` for a Gradle property, which is how the
37
- * Kotlin Gradle plugin reads `kotlin.daemon.jvmargs` and
38
- * `kotlin.compiler.execution.strategy`: with
39
- * `-Pkotlin.compiler.execution.strategy=in-process`, no Kotlin daemon starts
40
- * even where the project's file says `daemon`. `--max-workers` beats
41
- * `org.gradle.workers.max` in both files (`gradle.startParameter.maxWorkerCount`).
42
- * `GRADLE_OPTS` is not used: it sizes the client JVM, not the daemon.
43
- *
44
- * Written as shell functions so what ships is what the tests run. Its lines
45
- * start with "Gradle memory:", never with a step-progress marker.
46
- */
47
- /** The share of the machine's memory the two daemon heaps may take together. */
48
- export const GRADLE_HEAP_SHARE_PERCENT = 75;
49
- /** Reads one key of a .properties file, as Java does: the last assignment wins. */
50
- const GRADLE_PROP_LINE_FUNCTION = `# $1 a .properties file, $2 a key. Prints "<line number><TAB><value>" for the
51
- # last assignment of the key, or nothing.
52
- cibuild_prop_line() {
53
- [ -f "$1" ] || return 0
54
- awk -v key="$2" '
55
- { line = $0; sub(/^[ \\t]+/, "", line) }
56
- line ~ /^[#!]/ { next }
57
- {
58
- k = line; sub(/[ \\t]*[=:].*$/, "", k)
59
- if (k == key) { v = line; sub(/^[^=:]*[=:][ \\t]*/, "", v); sub(/[ \\t\\r]+$/, "", v); found = NR "\\t" v }
60
- }
61
- END { if (found != "") print found }
62
- ' "$1"
63
- }`;
64
- /**
65
- * Sends a Kotlin Multiplatform project's metadata compiles
66
- * (compile*KotlinMetadata, the KotlinCompileCommon tasks) to the Kotlin daemon
67
- * while every other Kotlin compile stays in-process. With
68
- * -Pkotlin.compiler.execution.strategy=in-process, Kotlin 2.2.0 compiled
69
- * DroidKaigi/conference-app-2025's common metadata in K1 mode and rejected its
70
- * context parameters; the same task on the daemon passed (nightly-baseline 95).
71
- *
72
- * The Kotlin plugin's classes are not on an init script's classpath, so the
73
- * task is matched by class name and the strategy enum is loaded through the
74
- * task's own classloader. A Kotlin plugin without the property (older than the
75
- * strategy API) is left alone: this script must never fail a build. Lazy
76
- * (configureEach where Gradle has it), so it is configuration-cache safe and
77
- * realizes no task. It runs once per build, included builds as well; they
78
- * have no metadata compiles to touch.
79
- */
80
- export const KOTLIN_METADATA_DAEMON_INIT_SCRIPT = `// cibuild: Kotlin metadata compiles run in the Kotlin daemon (nightly-baseline 95).
81
- allprojects {
82
- def hook = { t ->
83
- if (!t.class.name.startsWith('org.jetbrains.kotlin.gradle.tasks.KotlinCompileCommon')) return
84
- try {
85
- def strategy = t.class.classLoader.loadClass('org.jetbrains.kotlin.gradle.tasks.KotlinCompilerExecutionStrategy')
86
- t.compilerExecutionStrategy.set(strategy.enumConstants.find { it.name() == 'DAEMON' })
87
- } catch (Throwable ignored) {
88
- }
89
- }
90
- try {
91
- tasks.configureEach(hook)
92
- } catch (MissingMethodException ignored) {
93
- tasks.all(hook)
94
- }
95
- }
96
- `;
97
- export const GRADLE_MEMORY_FUNCTIONS = `# This machine's memory in MiB, or nothing when it cannot be read.
98
- cibuild_mem_mib() {
99
- if [ -r /proc/meminfo ]; then
100
- awk '/^MemTotal:/ { print int($2 / 1024); exit }' /proc/meminfo
101
- else
102
- local bytes
103
- bytes=$(sysctl -n hw.memsize 2>/dev/null || true)
104
- if [ -n "$bytes" ]; then echo $(( bytes / 1048576 )); fi
105
- fi
106
- }
107
-
108
- ${GRADLE_PROP_LINE_FUNCTION}
109
-
110
- # The -Xmx of a JVM argument string in MiB (the last one wins, as in the JVM),
111
- # or nothing when it has none.
112
- cibuild_xmx_mib() {
113
- printf '%s\\n' "$1" | tr ' \\t' '\\n\\n' | awk '
114
- /^-Xmx[0-9]+[kKmMgGtT]?$/ {
115
- n = substr($0, 5); u = substr(n, length(n))
116
- if (u ~ /[0-9]/) { v = n / 1048576 }
117
- else {
118
- n = substr(n, 1, length(n) - 1)
119
- if (u ~ /[kK]/) v = n / 1024
120
- else if (u ~ /[mM]/) v = n
121
- else if (u ~ /[gG]/) v = n * 1024
122
- else v = n * 1048576
123
- }
124
- r = int(v)
125
- }
126
- END { if (r != "") print r }'
127
- }
128
-
129
- # The -XX:MaxMetaspaceSize of a JVM argument string in MiB (the last one
130
- # wins), or nothing when it has none.
131
- cibuild_metaspace_mib() {
132
- printf '%s\\n' "$1" | tr ' \\t,' '\\n\\n\\n' | awk '
133
- /^-XX:MaxMetaspaceSize=[0-9]+[kKmMgGtT]?$/ {
134
- n = substr($0, 22); u = substr(n, length(n))
135
- if (u ~ /[0-9]/) { v = n / 1048576 }
136
- else {
137
- n = substr(n, 1, length(n) - 1)
138
- if (u ~ /[kK]/) v = n / 1024
139
- else if (u ~ /[mM]/) v = n
140
- else if (u ~ /[gG]/) v = n * 1024
141
- else v = n * 1048576
142
- }
143
- r = int(v)
144
- }
145
- END { if (r != "") print r }'
146
- }
147
-
148
- # $1 a JVM argument string, $2 a size in MiB: the same arguments with every
149
- # -XX:MaxMetaspaceSize replaced by that one.
150
- cibuild_with_metaspace() (
151
- set -f
152
- out=""
153
- replaced=0
154
- for arg in $1; do
155
- case "$arg" in
156
- -XX:MaxMetaspaceSize=*) if [ "$replaced" -eq 0 ]; then out="$out -XX:MaxMetaspaceSize=\${2}m"; replaced=1; fi ;;
157
- *) out="$out $arg" ;;
158
- esac
159
- done
160
- printf '%s' "\${out# }"
161
- )
162
-
163
- # $1 a JVM argument string, $2 a heap in MiB: the same arguments with every
164
- # -Xmx replaced by that one (added in front when there was none).
165
- cibuild_with_xmx() (
166
- set -f
167
- out=""
168
- replaced=0
169
- for arg in $1; do
170
- case "$arg" in
171
- -Xmx*) if [ "$replaced" -eq 0 ]; then out="$out -Xmx\${2}m"; replaced=1; fi ;;
172
- *) out="$out $arg" ;;
173
- esac
174
- done
175
- [ "$replaced" -eq 1 ] || out=" -Xmx\${2}m$out"
176
- printf '%s' "\${out# }"
177
- )
178
-
179
- # MiB as GiB with one decimal.
180
- cibuild_gib() {
181
- awk -v m="$1" 'BEGIN { printf "%.1f", m / 1024 }'
182
- }
183
-
184
- # A heap scaled by budget/total, rounded down to 64 MiB, never below 512 MiB.
185
- cibuild_scaled_heap() {
186
- local v=$(( $1 * $2 / $3 / 64 * 64 ))
187
- [ "$v" -ge 512 ] || v=512
188
- echo "$v"
189
- }
190
-
191
- # The Kotlin daemon heap a multiplatform project's metadata compiles get out
192
- # of a budget in MiB: an eighth, rounded down to 64 MiB, from 512 MiB to 1 GiB.
193
- cibuild_metadata_daemon_heap() {
194
- local v=$(( $1 / 8 / 64 * 64 ))
195
- [ "$v" -ge 512 ] || v=512
196
- [ "$v" -le 1024 ] || v=1024
197
- echo "$v"
198
- }
199
-
200
- # Whether the Gradle project here applies Kotlin Multiplatform: a build script
201
- # or version catalog that names the plugin. Convention plugins in buildSrc or
202
- # an included build sit a few directories down; build outputs are not read.
203
- cibuild_applies_kotlin_multiplatform() {
204
- local f
205
- while IFS= read -r -d '' f; do
206
- if grep -q -E 'kotlin\\("multiplatform"\\)|org\\.jetbrains\\.kotlin\\.multiplatform|kotlin-multiplatform|kotlinMultiplatform' "$f" 2>/dev/null; then return 0; fi
207
- done < <(find . -maxdepth 6 \\( -name .git -o -name node_modules -o -name build -o -name .gradle \\) -prune -o -type f \\( -name '*.gradle' -o -name '*.gradle.kts' -o -name '*.versions.toml' \\) -print0 2>/dev/null)
208
- return 1
209
- }
210
-
211
- # The plan, from its inputs only, so a test can run it:
212
- # $1 this machine's memory in MiB (empty when unknown)
213
- # $2 the project's gradle.properties $3 the Gradle user home's
214
- # $4 JVM arguments the pipeline asks for instead (may be empty)
215
- # $5 the metadata init script, when the project applies Kotlin
216
- # Multiplatform (empty otherwise)
217
- # Sets CIBUILD_GRADLE_MEMORY_ARGS (extra Gradle arguments),
218
- # CIBUILD_GRADLE_MEMORY_LINE (what to print before Gradle runs; empty when
219
- # nothing changes) and CIBUILD_GRADLE_MEMORY_SENTENCE (what to print if a
220
- # daemon is killed).
221
- #
222
- # Precedence is Gradle's own: the command line beats GRADLE_USER_HOME's
223
- # gradle.properties, which beats the project's. A Kotlin daemon with no -Xmx of
224
- # its own inherits the Gradle daemon's, and in-process compilation has no
225
- # Kotlin daemon at all.
226
- cibuild_gradle_memory_plan() {
227
- local mem="$1" project="$2" user="$3" preferred="$4" init="\${5:-}" l
228
- local jvm="" jvm_at="" kd="" kd_at="" strategy=""
229
- CIBUILD_GRADLE_MEMORY_ARGS=()
230
- CIBUILD_GRADLE_MEMORY_LINE=""
231
- CIBUILD_GRADLE_MEMORY_SENTENCE=""
232
-
233
- if [ -n "$preferred" ]; then jvm="$preferred"; jvm_at="the pipeline"; fi
234
- for f in "$user" "$project"; do
235
- if [ -z "$jvm_at" ]; then
236
- l=$(cibuild_prop_line "$f" org.gradle.jvmargs)
237
- if [ -n "$l" ]; then jvm="\${l#* }"; jvm_at="$f:\${l%% *}"; fi
238
- fi
239
- if [ -z "$kd_at" ]; then
240
- l=$(cibuild_prop_line "$f" kotlin.daemon.jvmargs)
241
- if [ -n "$l" ]; then kd="\${l#* }"; kd_at="$f:\${l%% *}"; fi
242
- fi
243
- if [ -z "$strategy" ]; then
244
- l=$(cibuild_prop_line "$f" kotlin.compiler.execution.strategy)
245
- strategy="\${l#* }"
246
- fi
247
- done
248
-
249
- local g k kd_own=""
250
- g=$(cibuild_xmx_mib "$jvm")
251
- [ -n "$g" ] || g=512
252
- if [ "$strategy" = "in-process" ]; then
253
- k=0
254
- else
255
- kd_own=$(cibuild_xmx_mib "$kd")
256
- k="\${kd_own:-$g}"
257
- fi
258
- local total=$(( g + k ))
259
-
260
- local asked
261
- if [ -n "$jvm_at" ]; then asked="org.gradle.jvmargs=$jvm at \${jvm_at}"; else asked="Gradle's default -Xmx512m"; fi
262
- if [ "$k" -eq 0 ]; then
263
- asked="$asked; Kotlin compiles in-process"
264
- elif [ -n "$kd_own" ]; then
265
- asked="$asked, kotlin.daemon.jvmargs=$kd at \${kd_at}"
266
- else
267
- asked="$asked; the Kotlin daemon inherits its -Xmx"
268
- fi
269
-
270
- if [ -z "$mem" ]; then
271
- CIBUILD_GRADLE_MEMORY_SENTENCE="This build's Gradle and Kotlin daemons asked for $(cibuild_gib "$total") GiB ($asked); this machine's memory could not be read."
272
- if [ -n "$preferred" ]; then CIBUILD_GRADLE_MEMORY_ARGS=("-Dorg.gradle.jvmargs=$preferred"); fi
273
- return 0
274
- fi
275
-
276
- local budget=$(( mem * ${GRADLE_HEAP_SHARE_PERCENT} / 100 ))
277
- CIBUILD_GRADLE_MEMORY_SENTENCE="The build machine has $(cibuild_gib "$mem") GiB; this build's Gradle and Kotlin daemons asked for $(cibuild_gib "$total") GiB ($asked)."
278
-
279
- if [ "$total" -le "$budget" ]; then
280
- if [ -n "$preferred" ]; then
281
- CIBUILD_GRADLE_MEMORY_ARGS=("-Dorg.gradle.jvmargs=$preferred")
282
- CIBUILD_GRADLE_MEMORY_LINE="Gradle memory: org.gradle.jvmargs=$preferred, as the pipeline asks (-Dorg.gradle.jvmargs on the command line)."
283
- fi
284
- return 0
285
- fi
286
-
287
- case "$jvm" in
288
- *\\\\)
289
- CIBUILD_GRADLE_MEMORY_LINE="Gradle memory: the declared heaps ask for $(cibuild_gib "$total") GiB of this machine's $(cibuild_gib "$mem") GiB, but org.gradle.jvmargs at \${jvm_at} continues onto another line, so it is left as it is."
290
- return 0
291
- ;;
292
- esac
293
-
294
- # One heap, the whole budget. Two did not fit: ReFra's Kotlin daemon was
295
- # lost mid-compile at a 60/40 split, and mifos-mobile's Gradle daemon ran out
296
- # of its 40 %. In-process, Kotlin compiles in the Gradle daemon's heap.
297
- # A multiplatform project's metadata compiles are the exception: they go to
298
- # a small Kotlin daemon (the init script), carved out of the same budget.
299
- local ng now newjvm mg mk md=""
300
- if [ "$k" -gt 0 ] && [ -n "$init" ]; then md=$(cibuild_metadata_daemon_heap "$budget"); fi
301
- ng=$(cibuild_scaled_heap $(( budget - \${md:-0} )) 1 1)
302
- newjvm=$(cibuild_with_xmx "$jvm" "$ng")
303
- now="Gradle -Xmx\${ng}m"
304
- if [ "$k" -gt 0 ]; then
305
- # One JVM now holds what two did, so a Metaspace cap Gradle declared must
306
- # hold Kotlin's too: the Kotlin daemon's own (kotlin.daemon.jvmargs, or
307
- # -Dkotlin.daemon.jvm.options in Gradle's), else the Gradle one it
308
- # inherits. GetStream/whatsApp-clone-compose capped Gradle at 512m and gave
309
- # Kotlin 1g, and in-process compileDebugKotlin ran out of Metaspace
310
- # (nightly-baseline 79). No Gradle cap, nothing to raise.
311
- mg=$(cibuild_metaspace_mib "$jvm")
312
- if [ -n "$mg" ]; then
313
- mk=$(cibuild_metaspace_mib "$kd")
314
- [ -n "$mk" ] || mk=$(cibuild_metaspace_mib "$(printf '%s\\n' "$jvm" | tr ' \\t' '\\n\\n' | sed -n 's/^-Dkotlin\\.daemon\\.jvm\\.options=//p')")
315
- [ -n "$mk" ] || mk="$mg"
316
- newjvm=$(cibuild_with_metaspace "$newjvm" $(( mg + mk )))
317
- now="$now with -XX:MaxMetaspaceSize=$(( mg + mk ))m (Gradle's \${mg}m and Kotlin's \${mk}m, in one JVM now)"
318
- fi
319
- now="$now and Kotlin compiled in-process in it (kotlin.compiler.execution.strategy=in-process: one heap, not a Gradle and a Kotlin daemon)"
320
- fi
321
- if [ -n "$md" ]; then
322
- now="$now, and Kotlin metadata compiles (compile*KotlinMetadata) in a Kotlin daemon of -Xmx\${md}m beside it (in-process, Kotlin 2.2 compiled them in K1 mode)"
323
- fi
324
- CIBUILD_GRADLE_MEMORY_ARGS=("-Dorg.gradle.jvmargs=$newjvm")
325
- if [ "$k" -gt 0 ]; then
326
- CIBUILD_GRADLE_MEMORY_ARGS+=("-Pkotlin.compiler.execution.strategy=in-process")
327
- fi
328
- if [ -n "$md" ]; then
329
- CIBUILD_GRADLE_MEMORY_ARGS+=("-Pkotlin.daemon.jvmargs=-Xmx\${md}m" --init-script "$init")
330
- fi
331
- CIBUILD_GRADLE_MEMORY_LINE="Gradle memory: this machine has $(cibuild_gib "$mem") GiB and the declared heaps ask for $(cibuild_gib "$total") GiB ($asked), past the $(cibuild_gib "$budget") GiB this build allows them. Running with $now, set on the command line."
332
- CIBUILD_GRADLE_MEMORY_SENTENCE="$CIBUILD_GRADLE_MEMORY_SENTENCE This build ran them capped: $now."
333
- }
334
-
335
- # $1 the project's gradle.properties, $2 the Gradle user home's. A JDK path the
336
- # project pins with org.gradle.java.home that is not on this machine — a
337
- # developer's own, like SEAbdulbasit/MusicApp-KMP's
338
- # /Users/abdulbasit/Library/Java/... (nightly-baseline 83) — stops Gradle
339
- # before it starts: "given for org.gradle.java.home Gradle property is
340
- # invalid". On the command line, -Dorg.gradle.java.home beats both files
341
- # (measured, Gradle 8.14.3), so the build's own JDK is passed instead. A path
342
- # that exists is left alone. Sets CIBUILD_GRADLE_JAVA_HOME_LINE.
343
- cibuild_gradle_java_home_plan() {
344
- local l v="" at=""
345
- CIBUILD_GRADLE_JAVA_HOME_LINE=""
346
- for f in "$2" "$1"; do
347
- l=$(cibuild_prop_line "$f" org.gradle.java.home)
348
- if [ -n "$l" ]; then v="\${l#* }"; at="$f:\${l%% *}"; break; fi
349
- done
350
- [ -n "$v" ] || return 0
351
- [ -d "$v" ] && return 0
352
- [ -n "\${JAVA_HOME:-}" ] && [ -d "$JAVA_HOME" ] || return 0
353
- CIBUILD_GRADLE_MEMORY_ARGS+=("-Dorg.gradle.java.home=$JAVA_HOME")
354
- CIBUILD_GRADLE_JAVA_HOME_LINE="Gradle: org.gradle.java.home=$v at $at is not on this machine; running with this build's JDK, $JAVA_HOME (-Dorg.gradle.java.home on the command line)."
355
- }
356
-
357
- # $1 the number of Gradle workers the pipeline asks for (may be empty). Adds
358
- # --max-workers to the plan's arguments; run after cibuild_gradle_memory_plan.
359
- # Sets CIBUILD_GRADLE_WORKERS_LINE (what to print; empty when nothing asked).
360
- cibuild_gradle_workers_plan() {
361
- CIBUILD_GRADLE_WORKERS_LINE=""
362
- [ -n "$1" ] || return 0
363
- case "$1" in
364
- *[!0-9]*|0*)
365
- CIBUILD_GRADLE_WORKERS_LINE="Gradle memory: max_workers=$1 is not a positive whole number, so it is not passed and Gradle picks its own worker count."
366
- return 0
367
- ;;
368
- esac
369
- CIBUILD_GRADLE_MEMORY_ARGS+=("--max-workers=$1")
370
- CIBUILD_GRADLE_WORKERS_LINE="Gradle memory: running with --max-workers=$1, as the pipeline asks (set on the command line, over any org.gradle.workers.max)."
371
- CIBUILD_GRADLE_MEMORY_SENTENCE="$CIBUILD_GRADLE_MEMORY_SENTENCE Gradle ran with --max-workers=$1."
372
- }
373
-
374
- # The kernel's out-of-memory lines, if this user may read the kernel log.
375
- # Linux guests restrict dmesg to root by default; their build user has
376
- # non-interactive sudo, so that is the second try.
377
- cibuild_kernel_oom_lines() {
378
- { dmesg 2>/dev/null || sudo -n dmesg 2>/dev/null || true; } |
379
- grep -i -E 'out of memory|oom-kill|oom_reaper|killed process' | tail -n 20 || true
380
- }
381
-
382
- # $1 Gradle's exit status, $2 a file holding its output. Says so when the
383
- # failure is a killed daemon rather than a failed build.
384
- cibuild_gradle_memory_report() {
385
- local kotlin_lost=""
386
- if grep -q "Connection to the Kotlin daemon has been unexpectedly lost" "$2" 2>/dev/null; then kotlin_lost=1; fi
387
- if [ "$1" -ne 137 ] && [ -z "$kotlin_lost" ] && ! grep -q "daemon disappeared unexpectedly" "$2" 2>/dev/null; then
388
- return 0
389
- fi
390
- local oom
391
- oom=$(cibuild_kernel_oom_lines)
392
- echo ""
393
- if [ -n "$kotlin_lost" ]; then
394
- echo "Gradle memory: the Kotlin daemon was lost mid-compile rather than the build failing (exit $1). Kotlin then compiled without it, in the Gradle daemon's heap."
395
- else
396
- echo "Gradle memory: a Gradle daemon was killed rather than failing the build (exit $1)."
397
- fi
398
- if [ -n "$oom" ]; then
399
- echo "The kernel's out-of-memory lines:"
400
- printf '%s\\n' "$oom" | sed 's/^/ /'
401
- else
402
- echo "The kernel log shows no out-of-memory kill, or this machine does not let the build read it."
403
- fi
404
- if [ -n "$CIBUILD_GRADLE_MEMORY_SENTENCE" ]; then echo "$CIBUILD_GRADLE_MEMORY_SENTENCE"; fi
405
- }
406
-
407
- # Runs Gradle with the plan's arguments, and reports a killed daemon.
408
- cibuild_gradle() {
409
- local log rc
410
- log=$(mktemp)
411
- set +e
412
- "$CIBUILD_GRADLE_BIN" "\${CIBUILD_GRADLE_MEMORY_ARGS[@]}" "$@" 2>&1 | tee "$log"
413
- rc=\${PIPESTATUS[0]}
414
- set -e
415
- if [ "$rc" -ne 0 ]; then cibuild_gradle_memory_report "$rc" "$log" || true; fi
416
- rm -f "$log"
417
- return "$rc"
418
- }
419
-
420
- # $1 JVM arguments the pipeline asks for, $2 the Gradle workers it asks for
421
- # (either may be empty). Run in the Gradle project directory, after GRADLE_CMD
422
- # is chosen.
423
- cibuild_gradle_memory_cap() {
424
- local metadata_init=""
425
- if cibuild_applies_kotlin_multiplatform; then
426
- metadata_init="$(mktemp -d)/cibuild-kotlin-metadata-daemon.init.gradle"
427
- cat > "$metadata_init" <<'CIBUILD_KOTLIN_METADATA_INIT'
428
- ${KOTLIN_METADATA_DAEMON_INIT_SCRIPT}CIBUILD_KOTLIN_METADATA_INIT
429
- fi
430
- cibuild_gradle_memory_plan "$(cibuild_mem_mib || true)" "gradle.properties" \\
431
- "\${GRADLE_USER_HOME:-$HOME/.gradle}/gradle.properties" "$1" "$metadata_init"
432
- cibuild_gradle_workers_plan "$2"
433
- cibuild_gradle_java_home_plan "gradle.properties" "\${GRADLE_USER_HOME:-$HOME/.gradle}/gradle.properties"
434
- if [ -n "$CIBUILD_GRADLE_MEMORY_LINE" ]; then echo "$CIBUILD_GRADLE_MEMORY_LINE"; fi
435
- if [ -n "$CIBUILD_GRADLE_WORKERS_LINE" ]; then echo "$CIBUILD_GRADLE_WORKERS_LINE"; fi
436
- if [ -n "$CIBUILD_GRADLE_JAVA_HOME_LINE" ]; then echo "$CIBUILD_GRADLE_JAVA_HOME_LINE"; fi
437
- CIBUILD_GRADLE_BIN="$GRADLE_CMD"
438
- GRADLE_CMD=cibuild_gradle
439
- }`;
440
- /**
441
- * The commands a Gradle step runs once it has chosen `GRADLE_CMD` and is in
442
- * the project directory. Afterwards `$GRADLE_CMD` runs Gradle with the plan's
443
- * arguments and reports a killed daemon.
444
- *
445
- * `jvmargs` is what the pipeline asks for instead of the project's
446
- * `org.gradle.jvmargs` (a value the repository's own CI sets, say); the cap
447
- * still applies to it. `maxWorkers` is the worker count it asks for (the
448
- * repository CI's `org.gradle.workers.max`), passed as `--max-workers`.
449
- */
450
- export function gradleMemoryCommands(jvmargs, escape, maxWorkers = '') {
451
- return [
452
- '',
453
- GRADLE_MEMORY_FUNCTIONS,
454
- '',
455
- `cibuild_gradle_memory_cap '${escape(jvmargs)}' '${escape(maxWorkers)}'`,
456
- ];
457
- }
458
- /**
459
- * A pinned org.gradle.java.home that is not on this machine, made to name the
460
- * build's JDK for every Gradle run in the build. The Gradle steps already pass
461
- * -Dorg.gradle.java.home on their own command line; a script step's
462
- * ./gradlew and a build phase Xcode runs do not, and they read the checkout's
463
- * gradle.properties. SEAbdulbasit/MusicApp-KMP's Android step went on with the
464
- * override and its KMM "Prepare the iOS build" script stopped on the same
465
- * "given for org.gradle.java.home Gradle property is invalid"
466
- * (nightly-baseline 92). So the line itself is rewritten, in every
467
- * gradle.properties of the checkout, once the build's JDK is chosen. A path
468
- * that exists, an empty value or a commented-out line is left alone.
469
- */
470
- export const GRADLE_JAVA_HOME_PIN_FUNCTIONS = `${GRADLE_PROP_LINE_FUNCTION}
471
-
472
- # Run once JAVA_HOME is the build's JDK. Searches the checkout
473
- # (CIBUILD_SOURCE_DIR, else the current directory) to the depth a nested
474
- # Gradle project sits at, and prints one line per file it rewrites.
475
- cibuild_gradle_java_home_pin() {
476
- [ -n "\${JAVA_HOME:-}" ] && [ -d "$JAVA_HOME" ] || return 0
477
- local root f l v tmp
478
- root="\${CIBUILD_SOURCE_DIR:-.}"
479
- while IFS= read -r f; do
480
- l=$(cibuild_prop_line "$f" org.gradle.java.home)
481
- [ -n "$l" ] || continue
482
- v="\${l#* }"
483
- [ -n "$v" ] || continue
484
- [ -d "$v" ] && continue
485
- tmp=$(mktemp)
486
- awk -v key=org.gradle.java.home -v home="$JAVA_HOME" '
487
- { line = $0; sub(/^[ \\t]+/, "", line) }
488
- line !~ /^[#!]/ { k = line; sub(/[ \\t]*[=:].*$/, "", k); if (k == key) { print key "=" home; next } }
489
- { print }
490
- ' "$f" > "$tmp" && cat "$tmp" > "$f"
491
- rm -f "$tmp"
492
- echo "Gradle: org.gradle.java.home=$v at \${f#"$root"/}:\${l%% *} is not on this machine; that line now names this build's JDK, $JAVA_HOME, so every Gradle run in this build uses it (a script's ./gradlew and Xcode's build phases as well as the Gradle steps)."
493
- done < <(find "$root" -maxdepth 4 \\( -name .git -o -name node_modules -o -name build -o -name .gradle \\) -prune -o -type f -name gradle.properties -print 2>/dev/null)
494
- }`;
495
- //# sourceMappingURL=gradle-memory.js.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=gradle-memory.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gradle-memory.test.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/gradle-memory.test.ts"],"names":[],"mappings":""}