@invarn/cibuild 2.9.5 → 2.9.7

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 (553) 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/android-sign.d.ts +0 -35
  282. package/dist/src/yaml/steps/android-sign.d.ts.map +0 -1
  283. package/dist/src/yaml/steps/android-sign.js +0 -147
  284. package/dist/src/yaml/steps/android-variant-resolution.test.d.ts +0 -2
  285. package/dist/src/yaml/steps/android-variant-resolution.test.d.ts.map +0 -1
  286. package/dist/src/yaml/steps/android-variant-resolution.test.js +0 -260
  287. package/dist/src/yaml/steps/android-version.d.ts +0 -26
  288. package/dist/src/yaml/steps/android-version.d.ts.map +0 -1
  289. package/dist/src/yaml/steps/android-version.js +0 -128
  290. package/dist/src/yaml/steps/android-version.test.d.ts +0 -5
  291. package/dist/src/yaml/steps/android-version.test.d.ts.map +0 -1
  292. package/dist/src/yaml/steps/android-version.test.js +0 -196
  293. package/dist/src/yaml/steps/android.d.ts +0 -156
  294. package/dist/src/yaml/steps/android.d.ts.map +0 -1
  295. package/dist/src/yaml/steps/android.js +0 -1092
  296. package/dist/src/yaml/steps/app-store-deploy.d.ts +0 -48
  297. package/dist/src/yaml/steps/app-store-deploy.d.ts.map +0 -1
  298. package/dist/src/yaml/steps/app-store-deploy.js +0 -167
  299. package/dist/src/yaml/steps/base.d.ts +0 -263
  300. package/dist/src/yaml/steps/base.d.ts.map +0 -1
  301. package/dist/src/yaml/steps/base.js +0 -380
  302. package/dist/src/yaml/steps/bitrise-android-tools.d.ts +0 -26
  303. package/dist/src/yaml/steps/bitrise-android-tools.d.ts.map +0 -1
  304. package/dist/src/yaml/steps/bitrise-android-tools.js +0 -200
  305. package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts +0 -5
  306. package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts.map +0 -1
  307. package/dist/src/yaml/steps/bitrise-android-tools.test.js +0 -280
  308. package/dist/src/yaml/steps/bitrise-apk-info.d.ts +0 -22
  309. package/dist/src/yaml/steps/bitrise-apk-info.d.ts.map +0 -1
  310. package/dist/src/yaml/steps/bitrise-apk-info.js +0 -144
  311. package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts +0 -5
  312. package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts.map +0 -1
  313. package/dist/src/yaml/steps/bitrise-apk-info.test.js +0 -331
  314. package/dist/src/yaml/steps/bitrise-slack.d.ts +0 -49
  315. package/dist/src/yaml/steps/bitrise-slack.d.ts.map +0 -1
  316. package/dist/src/yaml/steps/bitrise-slack.js +0 -280
  317. package/dist/src/yaml/steps/bitrise-slack.test.d.ts +0 -5
  318. package/dist/src/yaml/steps/bitrise-slack.test.d.ts.map +0 -1
  319. package/dist/src/yaml/steps/bitrise-slack.test.js +0 -484
  320. package/dist/src/yaml/steps/bitrise-ssh.d.ts +0 -27
  321. package/dist/src/yaml/steps/bitrise-ssh.d.ts.map +0 -1
  322. package/dist/src/yaml/steps/bitrise-ssh.js +0 -134
  323. package/dist/src/yaml/steps/bitrise-ssh.test.d.ts +0 -5
  324. package/dist/src/yaml/steps/bitrise-ssh.test.d.ts.map +0 -1
  325. package/dist/src/yaml/steps/bitrise-ssh.test.js +0 -205
  326. package/dist/src/yaml/steps/cache-pull-daemon.test.d.ts +0 -27
  327. package/dist/src/yaml/steps/cache-pull-daemon.test.d.ts.map +0 -1
  328. package/dist/src/yaml/steps/cache-pull-daemon.test.js +0 -212
  329. package/dist/src/yaml/steps/cache-pull-restore-roots.test.d.ts +0 -42
  330. package/dist/src/yaml/steps/cache-pull-restore-roots.test.d.ts.map +0 -1
  331. package/dist/src/yaml/steps/cache-pull-restore-roots.test.js +0 -209
  332. package/dist/src/yaml/steps/cache-push-daemon.test.d.ts +0 -27
  333. package/dist/src/yaml/steps/cache-push-daemon.test.d.ts.map +0 -1
  334. package/dist/src/yaml/steps/cache-push-daemon.test.js +0 -171
  335. package/dist/src/yaml/steps/cache.d.ts +0 -59
  336. package/dist/src/yaml/steps/cache.d.ts.map +0 -1
  337. package/dist/src/yaml/steps/cache.js +0 -1027
  338. package/dist/src/yaml/steps/capture-injection.d.ts +0 -30
  339. package/dist/src/yaml/steps/capture-injection.d.ts.map +0 -1
  340. package/dist/src/yaml/steps/capture-injection.js +0 -88
  341. package/dist/src/yaml/steps/capture-injection.test.d.ts +0 -2
  342. package/dist/src/yaml/steps/capture-injection.test.d.ts.map +0 -1
  343. package/dist/src/yaml/steps/capture-injection.test.js +0 -163
  344. package/dist/src/yaml/steps/cocoapods-deployment-floor.d.ts +0 -42
  345. package/dist/src/yaml/steps/cocoapods-deployment-floor.d.ts.map +0 -1
  346. package/dist/src/yaml/steps/cocoapods-deployment-floor.js +0 -140
  347. package/dist/src/yaml/steps/cocoapods-deployment-floor.test.d.ts +0 -11
  348. package/dist/src/yaml/steps/cocoapods-deployment-floor.test.d.ts.map +0 -1
  349. package/dist/src/yaml/steps/cocoapods-deployment-floor.test.js +0 -176
  350. package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.d.ts +0 -22
  351. package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.d.ts.map +0 -1
  352. package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.js +0 -97
  353. package/dist/src/yaml/steps/cocoapods-locked-bundler.test.d.ts +0 -17
  354. package/dist/src/yaml/steps/cocoapods-locked-bundler.test.d.ts.map +0 -1
  355. package/dist/src/yaml/steps/cocoapods-locked-bundler.test.js +0 -282
  356. package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.d.ts +0 -17
  357. package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.d.ts.map +0 -1
  358. package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.js +0 -132
  359. package/dist/src/yaml/steps/envstore-loader.test.d.ts +0 -15
  360. package/dist/src/yaml/steps/envstore-loader.test.d.ts.map +0 -1
  361. package/dist/src/yaml/steps/envstore-loader.test.js +0 -143
  362. package/dist/src/yaml/steps/fastlane.d.ts +0 -27
  363. package/dist/src/yaml/steps/fastlane.d.ts.map +0 -1
  364. package/dist/src/yaml/steps/fastlane.js +0 -79
  365. package/dist/src/yaml/steps/fidelity-aspect-guard.d.ts +0 -53
  366. package/dist/src/yaml/steps/fidelity-aspect-guard.d.ts.map +0 -1
  367. package/dist/src/yaml/steps/fidelity-aspect-guard.js +0 -72
  368. package/dist/src/yaml/steps/fidelity-aspect-guard.test.d.ts +0 -11
  369. package/dist/src/yaml/steps/fidelity-aspect-guard.test.d.ts.map +0 -1
  370. package/dist/src/yaml/steps/fidelity-aspect-guard.test.js +0 -50
  371. package/dist/src/yaml/steps/fidelity-reference-provenance.d.ts +0 -87
  372. package/dist/src/yaml/steps/fidelity-reference-provenance.d.ts.map +0 -1
  373. package/dist/src/yaml/steps/fidelity-reference-provenance.js +0 -111
  374. package/dist/src/yaml/steps/fidelity-reference-provenance.test.d.ts +0 -22
  375. package/dist/src/yaml/steps/fidelity-reference-provenance.test.d.ts.map +0 -1
  376. package/dist/src/yaml/steps/fidelity-reference-provenance.test.js +0 -118
  377. package/dist/src/yaml/steps/file.d.ts +0 -52
  378. package/dist/src/yaml/steps/file.d.ts.map +0 -1
  379. package/dist/src/yaml/steps/file.js +0 -108
  380. package/dist/src/yaml/steps/flutter.d.ts +0 -63
  381. package/dist/src/yaml/steps/flutter.d.ts.map +0 -1
  382. package/dist/src/yaml/steps/flutter.js +0 -215
  383. package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.d.ts +0 -16
  384. package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.d.ts.map +0 -1
  385. package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.js +0 -127
  386. package/dist/src/yaml/steps/git-clone.d.ts +0 -32
  387. package/dist/src/yaml/steps/git-clone.d.ts.map +0 -1
  388. package/dist/src/yaml/steps/git-clone.js +0 -171
  389. package/dist/src/yaml/steps/git-fetch-retry-exec.test.d.ts +0 -10
  390. package/dist/src/yaml/steps/git-fetch-retry-exec.test.d.ts.map +0 -1
  391. package/dist/src/yaml/steps/git-fetch-retry-exec.test.js +0 -162
  392. package/dist/src/yaml/steps/git-fetch-retry.d.ts +0 -62
  393. package/dist/src/yaml/steps/git-fetch-retry.d.ts.map +0 -1
  394. package/dist/src/yaml/steps/git-fetch-retry.js +0 -155
  395. package/dist/src/yaml/steps/git-fetch-retry.test.d.ts +0 -5
  396. package/dist/src/yaml/steps/git-fetch-retry.test.d.ts.map +0 -1
  397. package/dist/src/yaml/steps/git-fetch-retry.test.js +0 -86
  398. package/dist/src/yaml/steps/google-play-deploy.d.ts +0 -37
  399. package/dist/src/yaml/steps/google-play-deploy.d.ts.map +0 -1
  400. package/dist/src/yaml/steps/google-play-deploy.js +0 -193
  401. package/dist/src/yaml/steps/google-play-deploy.test.d.ts +0 -5
  402. package/dist/src/yaml/steps/google-play-deploy.test.d.ts.map +0 -1
  403. package/dist/src/yaml/steps/google-play-deploy.test.js +0 -310
  404. package/dist/src/yaml/steps/gradle-memory.d.ts +0 -61
  405. package/dist/src/yaml/steps/gradle-memory.d.ts.map +0 -1
  406. package/dist/src/yaml/steps/gradle-memory.js +0 -386
  407. package/dist/src/yaml/steps/gradle-memory.test.d.ts +0 -2
  408. package/dist/src/yaml/steps/gradle-memory.test.d.ts.map +0 -1
  409. package/dist/src/yaml/steps/gradle-memory.test.js +0 -344
  410. package/dist/src/yaml/steps/gradle-sdk-cmake.d.ts +0 -28
  411. package/dist/src/yaml/steps/gradle-sdk-cmake.d.ts.map +0 -1
  412. package/dist/src/yaml/steps/gradle-sdk-cmake.js +0 -107
  413. package/dist/src/yaml/steps/gradle-sdk-cmake.test.d.ts +0 -2
  414. package/dist/src/yaml/steps/gradle-sdk-cmake.test.d.ts.map +0 -1
  415. package/dist/src/yaml/steps/gradle-sdk-cmake.test.js +0 -183
  416. package/dist/src/yaml/steps/index.d.ts +0 -10
  417. package/dist/src/yaml/steps/index.d.ts.map +0 -1
  418. package/dist/src/yaml/steps/index.js +0 -1461
  419. package/dist/src/yaml/steps/ios-deps.d.ts +0 -78
  420. package/dist/src/yaml/steps/ios-deps.d.ts.map +0 -1
  421. package/dist/src/yaml/steps/ios-deps.js +0 -279
  422. package/dist/src/yaml/steps/ios-deps.test.d.ts +0 -5
  423. package/dist/src/yaml/steps/ios-deps.test.d.ts.map +0 -1
  424. package/dist/src/yaml/steps/ios-deps.test.js +0 -90
  425. package/dist/src/yaml/steps/ios-signing.d.ts +0 -31
  426. package/dist/src/yaml/steps/ios-signing.d.ts.map +0 -1
  427. package/dist/src/yaml/steps/ios-signing.js +0 -144
  428. package/dist/src/yaml/steps/ios-version.d.ts +0 -47
  429. package/dist/src/yaml/steps/ios-version.d.ts.map +0 -1
  430. package/dist/src/yaml/steps/ios-version.js +0 -151
  431. package/dist/src/yaml/steps/java-home-version-spec.test.d.ts +0 -10
  432. package/dist/src/yaml/steps/java-home-version-spec.test.d.ts.map +0 -1
  433. package/dist/src/yaml/steps/java-home-version-spec.test.js +0 -58
  434. package/dist/src/yaml/steps/linting.d.ts +0 -47
  435. package/dist/src/yaml/steps/linting.d.ts.map +0 -1
  436. package/dist/src/yaml/steps/linting.js +0 -148
  437. package/dist/src/yaml/steps/phase2.test.d.ts +0 -6
  438. package/dist/src/yaml/steps/phase2.test.d.ts.map +0 -1
  439. package/dist/src/yaml/steps/phase2.test.js +0 -197
  440. package/dist/src/yaml/steps/phase3.test.d.ts +0 -5
  441. package/dist/src/yaml/steps/phase3.test.d.ts.map +0 -1
  442. package/dist/src/yaml/steps/phase3.test.js +0 -144
  443. package/dist/src/yaml/steps/phase4.test.d.ts +0 -5
  444. package/dist/src/yaml/steps/phase4.test.d.ts.map +0 -1
  445. package/dist/src/yaml/steps/phase4.test.js +0 -166
  446. package/dist/src/yaml/steps/phase5.test.d.ts +0 -6
  447. package/dist/src/yaml/steps/phase5.test.d.ts.map +0 -1
  448. package/dist/src/yaml/steps/phase5.test.js +0 -263
  449. package/dist/src/yaml/steps/registry.d.ts +0 -88
  450. package/dist/src/yaml/steps/registry.d.ts.map +0 -1
  451. package/dist/src/yaml/steps/registry.js +0 -125
  452. package/dist/src/yaml/steps/registry.test.d.ts +0 -5
  453. package/dist/src/yaml/steps/registry.test.d.ts.map +0 -1
  454. package/dist/src/yaml/steps/registry.test.js +0 -235
  455. package/dist/src/yaml/steps/release.d.ts +0 -50
  456. package/dist/src/yaml/steps/release.d.ts.map +0 -1
  457. package/dist/src/yaml/steps/release.js +0 -154
  458. package/dist/src/yaml/steps/render-post-processor.d.ts +0 -100
  459. package/dist/src/yaml/steps/render-post-processor.d.ts.map +0 -1
  460. package/dist/src/yaml/steps/render-post-processor.js +0 -270
  461. package/dist/src/yaml/steps/render-post-processor.test.d.ts +0 -13
  462. package/dist/src/yaml/steps/render-post-processor.test.d.ts.map +0 -1
  463. package/dist/src/yaml/steps/render-post-processor.test.js +0 -220
  464. package/dist/src/yaml/steps/script.d.ts +0 -23
  465. package/dist/src/yaml/steps/script.d.ts.map +0 -1
  466. package/dist/src/yaml/steps/script.js +0 -63
  467. package/dist/src/yaml/steps/spec-validation.test.d.ts +0 -6
  468. package/dist/src/yaml/steps/spec-validation.test.d.ts.map +0 -1
  469. package/dist/src/yaml/steps/spec-validation.test.js +0 -130
  470. package/dist/src/yaml/steps/steps.test.d.ts +0 -6
  471. package/dist/src/yaml/steps/steps.test.d.ts.map +0 -1
  472. package/dist/src/yaml/steps/steps.test.js +0 -881
  473. package/dist/src/yaml/steps/structural-facts.d.ts +0 -992
  474. package/dist/src/yaml/steps/structural-facts.d.ts.map +0 -1
  475. package/dist/src/yaml/steps/structural-facts.js +0 -3276
  476. package/dist/src/yaml/steps/structural-facts.test.d.ts +0 -12
  477. package/dist/src/yaml/steps/structural-facts.test.d.ts.map +0 -1
  478. package/dist/src/yaml/steps/structural-facts.test.js +0 -3039
  479. package/dist/src/yaml/steps/test-config.d.ts +0 -5
  480. package/dist/src/yaml/steps/test-config.d.ts.map +0 -1
  481. package/dist/src/yaml/steps/test-config.js +0 -25
  482. package/dist/src/yaml/steps/trim-align-corpus.test.d.ts +0 -28
  483. package/dist/src/yaml/steps/trim-align-corpus.test.d.ts.map +0 -1
  484. package/dist/src/yaml/steps/trim-align-corpus.test.js +0 -383
  485. package/dist/src/yaml/steps/trim-align.d.ts +0 -87
  486. package/dist/src/yaml/steps/trim-align.d.ts.map +0 -1
  487. package/dist/src/yaml/steps/trim-align.js +0 -367
  488. package/dist/src/yaml/steps/trim-align.test.d.ts +0 -11
  489. package/dist/src/yaml/steps/trim-align.test.d.ts.map +0 -1
  490. package/dist/src/yaml/steps/trim-align.test.js +0 -261
  491. package/dist/src/yaml/steps/ui-fidelity-preview-android.d.ts +0 -66
  492. package/dist/src/yaml/steps/ui-fidelity-preview-android.d.ts.map +0 -1
  493. package/dist/src/yaml/steps/ui-fidelity-preview-android.js +0 -251
  494. package/dist/src/yaml/steps/ui-fidelity-preview-android.test.d.ts +0 -13
  495. package/dist/src/yaml/steps/ui-fidelity-preview-android.test.d.ts.map +0 -1
  496. package/dist/src/yaml/steps/ui-fidelity-preview-android.test.js +0 -302
  497. package/dist/src/yaml/steps/ui-fidelity-preview.d.ts +0 -134
  498. package/dist/src/yaml/steps/ui-fidelity-preview.d.ts.map +0 -1
  499. package/dist/src/yaml/steps/ui-fidelity-preview.js +0 -173
  500. package/dist/src/yaml/steps/ui-fidelity-preview.test.d.ts +0 -11
  501. package/dist/src/yaml/steps/ui-fidelity-preview.test.d.ts.map +0 -1
  502. package/dist/src/yaml/steps/ui-fidelity-preview.test.js +0 -210
  503. package/dist/src/yaml/steps/ui-fidelity-render-android.d.ts +0 -155
  504. package/dist/src/yaml/steps/ui-fidelity-render-android.d.ts.map +0 -1
  505. package/dist/src/yaml/steps/ui-fidelity-render-android.js +0 -1389
  506. package/dist/src/yaml/steps/ui-fidelity-render-android.test.d.ts +0 -2
  507. package/dist/src/yaml/steps/ui-fidelity-render-android.test.d.ts.map +0 -1
  508. package/dist/src/yaml/steps/ui-fidelity-render-android.test.js +0 -1106
  509. package/dist/src/yaml/steps/ui-fidelity-render.d.ts +0 -230
  510. package/dist/src/yaml/steps/ui-fidelity-render.d.ts.map +0 -1
  511. package/dist/src/yaml/steps/ui-fidelity-render.js +0 -1597
  512. package/dist/src/yaml/steps/ui-fidelity-render.test.d.ts +0 -18
  513. package/dist/src/yaml/steps/ui-fidelity-render.test.d.ts.map +0 -1
  514. package/dist/src/yaml/steps/ui-fidelity-render.test.js +0 -1871
  515. package/dist/src/yaml/steps/xcode-app-product.d.ts +0 -90
  516. package/dist/src/yaml/steps/xcode-app-product.d.ts.map +0 -1
  517. package/dist/src/yaml/steps/xcode-app-product.js +0 -247
  518. package/dist/src/yaml/steps/xcode-app-product.test.d.ts +0 -2
  519. package/dist/src/yaml/steps/xcode-app-product.test.d.ts.map +0 -1
  520. package/dist/src/yaml/steps/xcode-app-product.test.js +0 -202
  521. package/dist/src/yaml/steps/xcode-derived-data.test.d.ts +0 -30
  522. package/dist/src/yaml/steps/xcode-derived-data.test.d.ts.map +0 -1
  523. package/dist/src/yaml/steps/xcode-derived-data.test.js +0 -279
  524. package/dist/src/yaml/steps/xcode-destination.d.ts +0 -47
  525. package/dist/src/yaml/steps/xcode-destination.d.ts.map +0 -1
  526. package/dist/src/yaml/steps/xcode-destination.js +0 -202
  527. package/dist/src/yaml/steps/xcode-destination.test.d.ts +0 -9
  528. package/dist/src/yaml/steps/xcode-destination.test.d.ts.map +0 -1
  529. package/dist/src/yaml/steps/xcode-destination.test.js +0 -227
  530. package/dist/src/yaml/steps/xcode-new.test.d.ts +0 -5
  531. package/dist/src/yaml/steps/xcode-new.test.d.ts.map +0 -1
  532. package/dist/src/yaml/steps/xcode-new.test.js +0 -211
  533. package/dist/src/yaml/steps/xcode-resolve-retry.test.d.ts +0 -9
  534. package/dist/src/yaml/steps/xcode-resolve-retry.test.d.ts.map +0 -1
  535. package/dist/src/yaml/steps/xcode-resolve-retry.test.js +0 -146
  536. package/dist/src/yaml/steps/xcode-simulator-archs.d.ts +0 -53
  537. package/dist/src/yaml/steps/xcode-simulator-archs.d.ts.map +0 -1
  538. package/dist/src/yaml/steps/xcode-simulator-archs.js +0 -98
  539. package/dist/src/yaml/steps/xcode-simulator-archs.test.d.ts +0 -21
  540. package/dist/src/yaml/steps/xcode-simulator-archs.test.d.ts.map +0 -1
  541. package/dist/src/yaml/steps/xcode-simulator-archs.test.js +0 -155
  542. package/dist/src/yaml/steps/xcode.d.ts +0 -230
  543. package/dist/src/yaml/steps/xcode.d.ts.map +0 -1
  544. package/dist/src/yaml/steps/xcode.js +0 -1350
  545. package/dist/src/yaml/types.d.ts +0 -76
  546. package/dist/src/yaml/types.d.ts.map +0 -1
  547. package/dist/src/yaml/types.js +0 -5
  548. package/dist/src/yaml/validation-types.d.ts +0 -102
  549. package/dist/src/yaml/validation-types.d.ts.map +0 -1
  550. package/dist/src/yaml/validation-types.js +0 -8
  551. package/dist/src/yaml/yaml-updater.d.ts +0 -24
  552. package/dist/src/yaml/yaml-updater.d.ts.map +0 -1
  553. package/dist/src/yaml/yaml-updater.js +0 -128
@@ -1,1092 +0,0 @@
1
- /**
2
- * Android step implementations (set-java-version, gradle-build, android-lint, android-unit-test)
3
- */
4
- // Static, deliberately. The released macOS binary is built with `pkg`, which
5
- // cannot evaluate a dynamic `import()` of a builtin — esbuild leaves those
6
- // external, so they survive into the bundle as real imports and throw
7
- // `Invalid host defined options` at runtime. A validation check that reaches
8
- // for one never runs on a runner.
9
- import { existsSync, readFileSync } from 'node:fs';
10
- import { execSync } from 'node:child_process';
11
- import { BaseStepExecutor, javaHomeVersionSpec } from './base.js';
12
- import { gradleMemoryCommands } from './gradle-memory.js';
13
- import { gradleSdkCmakeCommands } from './gradle-sdk-cmake.js';
14
- import { appProjectOfTask, captureAssembleCommands, captureSetupCommands, isDebugAssembleTask } from './capture-injection.js';
15
- /**
16
- * Set Java version step executor
17
- * Sets the Java version to use for Android builds
18
- */
19
- export class SetJavaVersionStepExecutor extends BaseStepExecutor {
20
- getValidationRequirements(inputs, _env, _config) {
21
- const javaVersion = this.getInput(inputs, 'java_version', '17');
22
- return [
23
- {
24
- category: 'command',
25
- name: `java-${javaVersion}`,
26
- description: `Java ${javaVersion} JDK`,
27
- timing: 'pre-execution',
28
- // The step this validates ends in `exit 1` when it cannot find the
29
- // JDK, so a failed check is a build that is already lost. Reported as
30
- // info, it printed "Java <n> not found", let the run proceed, and the
31
- // pipeline died at the very next step — the same message, one VM
32
- // later. The check now looks in every place the step looks, so the
33
- // two can only disagree about a JDK that is genuinely absent.
34
- severity: 'error',
35
- hint: process.platform === 'darwin'
36
- ? `Install: brew install openjdk@${javaVersion}`
37
- : `Install: sudo apt install openjdk-${javaVersion}-jdk`,
38
- check: async () => this.checkJavaVersionWithHomebrew(String(javaVersion)),
39
- },
40
- ];
41
- }
42
- /**
43
- * Check Java version including Homebrew installations
44
- * Matches the logic in execute() method
45
- */
46
- async checkJavaVersionWithHomebrew(version) {
47
- // Check Homebrew paths first (same order as execute())
48
- const homebrewPaths = [
49
- `/opt/homebrew/opt/openjdk@${version}`, // Apple Silicon
50
- `/usr/local/opt/openjdk@${version}`, // Intel Mac
51
- ];
52
- for (const path of homebrewPaths) {
53
- if (existsSync(path)) {
54
- return {
55
- passed: true,
56
- message: `Java ${version} found at: ${path}`,
57
- };
58
- }
59
- }
60
- // Check Android Studio JBR
61
- if (process.platform === 'darwin') {
62
- const jbrPath = '/Applications/Android Studio.app/Contents/jbr/Contents/Home';
63
- if (existsSync(jbrPath)) {
64
- try {
65
- const releaseContent = readFileSync(`${jbrPath}/release`, 'utf-8');
66
- const jbrVersionMatch = /JAVA_VERSION="(\d+)/.exec(releaseContent);
67
- if (jbrVersionMatch && jbrVersionMatch[1] === String(version)) {
68
- return { passed: true, message: `Java ${version} found at: ${jbrPath} (Android Studio JBR)` };
69
- }
70
- }
71
- catch {
72
- // Ignore — release file unreadable
73
- }
74
- }
75
- }
76
- // Try java_home utility on macOS
77
- if (process.platform === 'darwin') {
78
- // java_home wants `1.8` for Java 8, and answers a wrong request with the
79
- // newest JDK rather than an error -- see javaHomeVersionSpec.
80
- const spec = javaHomeVersionSpec(version);
81
- try {
82
- execSync(`/usr/libexec/java_home -v "${spec}"`, { stdio: 'pipe' });
83
- return { passed: true, message: `Java ${version} is available` };
84
- }
85
- catch {
86
- // Try with pattern
87
- try {
88
- execSync(`/usr/libexec/java_home -v "${spec}.*"`, { stdio: 'pipe' });
89
- return { passed: true, message: `Java ${version} is available` };
90
- }
91
- catch {
92
- // Continue to Linux paths
93
- }
94
- }
95
- }
96
- // GitHub Actions publishes each preinstalled JDK as JAVA_HOME_<ver>_X64.
97
- // The step reads it; without this the check could fail a build that the
98
- // step itself would have run perfectly well.
99
- const actionsHome = process.env[`JAVA_HOME_${version}_X64`];
100
- if (actionsHome && existsSync(actionsHome)) {
101
- return {
102
- passed: true,
103
- message: `Java ${version} found at: ${actionsHome} (GitHub Actions)`,
104
- };
105
- }
106
- // Check Linux paths
107
- const linuxPaths = [
108
- `/usr/lib/jvm/java-${version}-openjdk-amd64`,
109
- `/usr/lib/jvm/java-${version}-openjdk`,
110
- `/usr/lib/jvm/temurin-${version}-jdk-amd64`,
111
- ];
112
- for (const path of linuxPaths) {
113
- if (existsSync(path)) {
114
- return {
115
- passed: true,
116
- message: `Java ${version} found at: ${path}`,
117
- };
118
- }
119
- }
120
- return {
121
- passed: false,
122
- message: `Java ${version} not found`,
123
- details: process.platform === 'darwin'
124
- ? `Install: brew install openjdk@${version}`
125
- : `Install: sudo apt install openjdk-${version}-jdk`,
126
- };
127
- }
128
- getOutputs() {
129
- return [
130
- {
131
- name: 'JAVA_HOME',
132
- type: 'environment',
133
- description: 'Path to Java installation',
134
- },
135
- ];
136
- }
137
- async execute(inputs, env, config) {
138
- const stepName = 'set-java-version';
139
- // Get Java version - defaults to 17
140
- const javaVersion = this.getInput(inputs, 'java_version', '17');
141
- const commands = [];
142
- commands.push('# Set Java Version');
143
- commands.push(`echo "Setting Java version to: ${javaVersion}"`);
144
- // Set JAVA_HOME based on version
145
- commands.push('');
146
- commands.push('# Set JAVA_HOME');
147
- // Common Java installation paths
148
- commands.push(`JAVA_VERSION="${javaVersion}"`);
149
- commands.push('');
150
- commands.push('# Try to locate Java installation');
151
- commands.push('JAVA_HOME=""');
152
- commands.push('');
153
- commands.push('# 1. Homebrew Apple Silicon');
154
- commands.push('if [ -d "/opt/homebrew/opt/openjdk@${JAVA_VERSION}" ]; then');
155
- commands.push(' JAVA_HOME="/opt/homebrew/opt/openjdk@${JAVA_VERSION}"');
156
- commands.push(' echo "Found Java at: $JAVA_HOME (Homebrew Apple Silicon)"');
157
- commands.push('fi');
158
- commands.push('');
159
- commands.push('# 2. Homebrew Intel');
160
- commands.push('if [ -z "$JAVA_HOME" ] && [ -d "/usr/local/opt/openjdk@${JAVA_VERSION}" ]; then');
161
- commands.push(' JAVA_HOME="/usr/local/opt/openjdk@${JAVA_VERSION}"');
162
- commands.push(' echo "Found Java at: $JAVA_HOME (Homebrew Intel)"');
163
- commands.push('fi');
164
- commands.push('');
165
- commands.push('# 3. Android Studio JBR');
166
- commands.push('if [ -z "$JAVA_HOME" ] && [ -d "/Applications/Android Studio.app/Contents/jbr/Contents/Home" ]; then');
167
- commands.push(' JBR_PATH="/Applications/Android Studio.app/Contents/jbr/Contents/Home"');
168
- commands.push(' JBR_MAJOR=$(grep "^JAVA_VERSION=" "$JBR_PATH/release" 2>/dev/null | grep -oE \'"[0-9]+\' | tr -d \'"\' || echo "")');
169
- commands.push(' if [ "$JBR_MAJOR" = "$JAVA_VERSION" ]; then');
170
- commands.push(' JAVA_HOME="$JBR_PATH"');
171
- commands.push(' echo "Found Java at: $JAVA_HOME (Android Studio JBR)"');
172
- commands.push(' fi');
173
- commands.push('fi');
174
- commands.push('');
175
- commands.push('# 4. macOS java_home utility');
176
- commands.push('# java_home matches Java 8 only as 1.8 (it predates JEP 223), and it is');
177
- commands.push('# permissive: an unmatched -v N returns the NEWEST JDK >= N instead of');
178
- commands.push('# failing. Asking as "8" therefore does not miss, it silently returns the');
179
- commands.push('# wrong JDK -- measured as OpenJDK 25 on an image where Corretto 8 was');
180
- commands.push('# installed and found correctly by -v 1.8.');
181
- commands.push('JAVA_HOME_SPEC="$JAVA_VERSION"');
182
- commands.push('case "$JAVA_VERSION" in');
183
- commands.push(' 1|2|3|4|5|6|7|8) JAVA_HOME_SPEC="1.$JAVA_VERSION" ;;');
184
- commands.push('esac');
185
- commands.push('if [ -z "$JAVA_HOME" ] && [ -x "/usr/libexec/java_home" ]; then');
186
- commands.push(' JAVA_HOME=$(/usr/libexec/java_home -v "$JAVA_HOME_SPEC" 2>/dev/null || true)');
187
- commands.push(' if [ -z "$JAVA_HOME" ]; then');
188
- commands.push(' JAVA_HOME=$(/usr/libexec/java_home -v "${JAVA_HOME_SPEC}.*" 2>/dev/null || true)');
189
- commands.push(' fi');
190
- commands.push(' if [ -n "$JAVA_HOME" ]; then');
191
- commands.push(' echo "Found Java at: $JAVA_HOME (java_home)"');
192
- commands.push(' fi');
193
- commands.push('fi');
194
- commands.push('');
195
- commands.push('# 5. GitHub Actions runner (JAVA_HOME_<ver>_X64 env var)');
196
- commands.push('JAVA_HOME_VAR="JAVA_HOME_${JAVA_VERSION}_X64"');
197
- commands.push('if [ -z "$JAVA_HOME" ] && [ -n "${!JAVA_HOME_VAR:-}" ]; then');
198
- commands.push(' JAVA_HOME="${!JAVA_HOME_VAR}"');
199
- commands.push(' echo "Found Java at: $JAVA_HOME (GitHub Actions)"');
200
- commands.push('fi');
201
- commands.push('');
202
- commands.push('# 6. Linux paths');
203
- commands.push('if [ -z "$JAVA_HOME" ] && [ -d "/usr/lib/jvm/temurin-${JAVA_VERSION}-jdk-amd64" ]; then');
204
- commands.push(' JAVA_HOME="/usr/lib/jvm/temurin-${JAVA_VERSION}-jdk-amd64"');
205
- commands.push(' echo "Found Java at: $JAVA_HOME (Temurin)"');
206
- commands.push('fi');
207
- commands.push('if [ -z "$JAVA_HOME" ] && [ -d "/usr/lib/jvm/java-${JAVA_VERSION}-openjdk-amd64" ]; then');
208
- commands.push(' JAVA_HOME="/usr/lib/jvm/java-${JAVA_VERSION}-openjdk-amd64"');
209
- commands.push(' echo "Found Java at: $JAVA_HOME (Linux)"');
210
- commands.push('fi');
211
- commands.push('if [ -z "$JAVA_HOME" ] && [ -d "/usr/lib/jvm/java-${JAVA_VERSION}-openjdk" ]; then');
212
- commands.push(' JAVA_HOME="/usr/lib/jvm/java-${JAVA_VERSION}-openjdk"');
213
- commands.push(' echo "Found Java at: $JAVA_HOME (Linux alt)"');
214
- commands.push('fi');
215
- commands.push('');
216
- commands.push('# Validate JAVA_HOME was found');
217
- commands.push('if [ -z "$JAVA_HOME" ] || [ ! -d "$JAVA_HOME" ]; then');
218
- commands.push(' echo "⚠️ Java $JAVA_VERSION not found"');
219
- commands.push(' echo ""');
220
- commands.push(' echo "Available versions:"');
221
- commands.push(' if [ -x "/usr/libexec/java_home" ]; then');
222
- commands.push(' /usr/libexec/java_home -V 2>&1 | grep -E "^[[:space:]]+[0-9]" || echo " No Java installations found via java_home"');
223
- commands.push(' fi');
224
- commands.push(' if [ -d "/Applications/Android Studio.app/Contents/jbr/Contents/Home" ]; then');
225
- commands.push(' JBR_VER=$(grep "^JAVA_VERSION=" "/Applications/Android Studio.app/Contents/jbr/Contents/Home/release" 2>/dev/null | grep -oE \'"[0-9.]+\' | tr -d \'"\' || echo "unknown")');
226
- commands.push(' echo " Android Studio JBR: $JBR_VER (/Applications/Android Studio.app/Contents/jbr/Contents/Home)"');
227
- commands.push(' fi');
228
- commands.push(' if [ -x "/usr/libexec/java_home" ]; then');
229
- commands.push(' echo ""');
230
- commands.push(' echo "Install Java $JAVA_VERSION:"');
231
- commands.push(' echo " brew install openjdk@$JAVA_VERSION"');
232
- commands.push(' else');
233
- commands.push(' echo "Install Java $JAVA_VERSION (Ubuntu/Debian):"');
234
- commands.push(' echo " sudo apt-get install openjdk-${JAVA_VERSION}-jdk"');
235
- commands.push(' fi');
236
- commands.push(' exit 1');
237
- commands.push('fi');
238
- commands.push('');
239
- commands.push('export JAVA_HOME');
240
- commands.push('');
241
- commands.push('# Update PATH');
242
- commands.push('export PATH="$JAVA_HOME/bin:$PATH"');
243
- commands.push('');
244
- commands.push('# Verify Java version');
245
- commands.push('echo "JAVA_HOME: $JAVA_HOME"');
246
- commands.push('java -version');
247
- commands.push('');
248
- commands.push('# Persist JAVA_HOME to envman for subsequent steps');
249
- commands.push('envman add --key JAVA_HOME --value "$JAVA_HOME"');
250
- const script = this.createBashScriptFromCommands(commands, stepName);
251
- return this.createScriptStep(script, stepName);
252
- }
253
- }
254
- /**
255
- * Gradle build step executor
256
- * Builds Android projects using Gradle
257
- */
258
- export class GradleBuildStepExecutor extends BaseStepExecutor {
259
- getOutputs() {
260
- return [
261
- {
262
- name: 'CIBUILD_APK_PATH',
263
- type: 'environment',
264
- description: 'Path to the built APK file',
265
- },
266
- {
267
- name: 'CIBUILD_AAB_PATH',
268
- type: 'environment',
269
- description: 'Path to the built AAB file',
270
- },
271
- ];
272
- }
273
- getValidationRequirements(_inputs, env, _config) {
274
- return [
275
- this.requireEnvVar('JAVA_HOME', 'Java installation directory', env, 'Add a set-java-version step before gradle-build, or set JAVA_HOME env var'),
276
- this.runtimeRequirement('gradlew', 'Gradle wrapper (./gradlew) or gradle command', 'file', 'the checkout'),
277
- ];
278
- }
279
- async execute(inputs, env, config) {
280
- const stepName = 'gradle-build';
281
- // Get project location from YAML input (if explicitly specified)
282
- const explicitLocation = this.getInput(inputs, 'project_location', '');
283
- // Handle both gradle-build and android-build (Bitrise) inputs
284
- // Bitrise android-build uses: variant (debug/release), module (app)
285
- // Our gradle-build uses: build_type (Debug/Release)
286
- const variant = this.getInput(inputs, 'variant', '');
287
- const module = this.getInput(inputs, 'module', '');
288
- const buildType = this.getInput(inputs, 'build_type', '');
289
- // Determine build type from variant or build_type
290
- let finalBuildType = 'Release';
291
- if (variant && variant.length > 0) {
292
- // Bitrise android-build: use variant (e.g., "debug" -> "Debug", "release" -> "Release")
293
- finalBuildType = variant.charAt(0).toUpperCase() + variant.slice(1).toLowerCase();
294
- }
295
- else if (buildType && buildType.length > 0) {
296
- // gradle-build: use build_type
297
- finalBuildType = buildType;
298
- }
299
- // Build gradle task name
300
- let defaultTask;
301
- if (module && module.length > 0 && variant && variant.length > 0) {
302
- // Bitrise android-build: :module:assembleVariant (e.g., :app:assembleDebug)
303
- const variantCapitalized = variant.charAt(0).toUpperCase() + variant.slice(1).toLowerCase();
304
- defaultTask = `:${module}:assemble${variantCapitalized}`;
305
- }
306
- else {
307
- // gradle-build: assembleRelease/assembleDebug
308
- defaultTask = finalBuildType.toLowerCase() === 'debug' ? 'assembleDebug' : 'assembleRelease';
309
- }
310
- const gradleTask = this.getInput(inputs, 'gradle_task', defaultTask);
311
- // Get gradle options - optional
312
- const gradleOptions = this.getInput(inputs, 'gradle_options', '');
313
- const commands = [];
314
- commands.push('# Gradle Build');
315
- commands.push('');
316
- // Add JAVA_HOME validation and auto-detection
317
- commands.push('# Validate and auto-detect JAVA_HOME if needed');
318
- commands.push('if [ -n "$JAVA_HOME" ] && [ ! -d "$JAVA_HOME" ]; then');
319
- commands.push(' echo "⚠️ JAVA_HOME is set but points to invalid directory: $JAVA_HOME"');
320
- commands.push(' ');
321
- commands.push(' # Extract Java version from invalid path (e.g., "11" from /usr/lib/jvm/java-11-openjdk-amd64)');
322
- commands.push(' REQUESTED_VERSION=$(echo "$JAVA_HOME" | grep -oE "java-[0-9]+" | grep -oE "[0-9]+" || echo "")');
323
- commands.push(' if [ -z "$REQUESTED_VERSION" ]; then');
324
- commands.push(' # Try alternative patterns (e.g., openjdk@17, openjdk-17)');
325
- commands.push(' REQUESTED_VERSION=$(echo "$JAVA_HOME" | grep -oE "(openjdk[@-])[0-9]+" | grep -oE "[0-9]+" || echo "")');
326
- commands.push(' fi');
327
- commands.push(' ');
328
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
329
- commands.push(' echo "Detected requested Java version: $REQUESTED_VERSION"');
330
- commands.push(' echo "Attempting to find Java $REQUESTED_VERSION on this system..."');
331
- commands.push(' else');
332
- commands.push(' echo "Could not detect Java version from path, will try to find any Java..."');
333
- commands.push(' fi');
334
- commands.push(' echo ""');
335
- commands.push(' ');
336
- commands.push(' # Try to auto-detect Java for the requested version');
337
- commands.push(' DETECTED_JAVA_HOME=""');
338
- commands.push(' ');
339
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
340
- commands.push(' # Check Homebrew installation paths for specific version (Apple Silicon)');
341
- commands.push(' if [ -d "/opt/homebrew/opt/openjdk@${REQUESTED_VERSION}" ]; then');
342
- commands.push(' DETECTED_JAVA_HOME="/opt/homebrew/opt/openjdk@${REQUESTED_VERSION}"');
343
- commands.push(' echo "✅ Found Java $REQUESTED_VERSION at: $DETECTED_JAVA_HOME (Homebrew Apple Silicon)"');
344
- commands.push(' # Check Homebrew installation paths (Intel Mac)');
345
- commands.push(' elif [ -d "/usr/local/opt/openjdk@${REQUESTED_VERSION}" ]; then');
346
- commands.push(' DETECTED_JAVA_HOME="/usr/local/opt/openjdk@${REQUESTED_VERSION}"');
347
- commands.push(' echo "✅ Found Java $REQUESTED_VERSION at: $DETECTED_JAVA_HOME (Homebrew Intel)"');
348
- commands.push(' # Check Android Studio JBR');
349
- commands.push(' elif [ -d "/Applications/Android Studio.app/Contents/jbr/Contents/Home" ]; then');
350
- commands.push(' JBR_PATH="/Applications/Android Studio.app/Contents/jbr/Contents/Home"');
351
- commands.push(' JBR_MAJOR=$(grep "^JAVA_VERSION=" "$JBR_PATH/release" 2>/dev/null | grep -oE \'"[0-9]+\' | tr -d \'"\' || echo "")');
352
- commands.push(' if [ "$JBR_MAJOR" = "$REQUESTED_VERSION" ]; then');
353
- commands.push(' DETECTED_JAVA_HOME="$JBR_PATH"');
354
- commands.push(' echo "✅ Found Java $REQUESTED_VERSION at: $DETECTED_JAVA_HOME (Android Studio JBR)"');
355
- commands.push(' fi');
356
- commands.push(' # Try macOS java_home utility for specific version');
357
- commands.push(' elif [ -x "/usr/libexec/java_home" ]; then');
358
- commands.push(' # java_home names Java 8 as 1.8, and answers an unmatched request');
359
- commands.push(' # with the newest JDK rather than failing -- ask the right way or');
360
- commands.push(' # silently get the wrong JDK.');
361
- commands.push(' REQ_SPEC="$REQUESTED_VERSION"');
362
- commands.push(' case "$REQUESTED_VERSION" in 1|2|3|4|5|6|7|8) REQ_SPEC="1.$REQUESTED_VERSION" ;; esac');
363
- commands.push(' DETECTED_JAVA_HOME=$(/usr/libexec/java_home -v "$REQ_SPEC" 2>/dev/null || true)');
364
- commands.push(' if [ -z "$DETECTED_JAVA_HOME" ]; then');
365
- commands.push(' DETECTED_JAVA_HOME=$(/usr/libexec/java_home -v "${REQ_SPEC}.*" 2>/dev/null || true)');
366
- commands.push(' fi');
367
- commands.push(' if [ -n "$DETECTED_JAVA_HOME" ]; then');
368
- commands.push(' echo "✅ Found Java $REQUESTED_VERSION at: $DETECTED_JAVA_HOME (java_home utility)"');
369
- commands.push(' fi');
370
- commands.push(' fi');
371
- commands.push(' fi');
372
- commands.push(' ');
373
- commands.push(' # If specific version not found, try any Java as fallback');
374
- commands.push(' if [ -z "$DETECTED_JAVA_HOME" ]; then');
375
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
376
- commands.push(' echo "⚠️ Java $REQUESTED_VERSION not found, checking for other versions..."');
377
- commands.push(' fi');
378
- commands.push(' ');
379
- commands.push(' if [ -x "/usr/libexec/java_home" ]; then');
380
- commands.push(' DETECTED_JAVA_HOME=$(/usr/libexec/java_home 2>/dev/null || true)');
381
- commands.push(' if [ -n "$DETECTED_JAVA_HOME" ]; then');
382
- commands.push(' FALLBACK_VERSION=$("$DETECTED_JAVA_HOME/bin/java" -version 2>&1 | head -n 1 | grep -oE "[0-9]+" | head -n 1)');
383
- commands.push(' echo "⚠️ Found Java $FALLBACK_VERSION instead of requested version $REQUESTED_VERSION"');
384
- commands.push(' echo " Location: $DETECTED_JAVA_HOME"');
385
- commands.push(' echo " ⚠️ WARNING: This may cause build issues if Java $REQUESTED_VERSION is required"');
386
- commands.push(' fi');
387
- commands.push(' fi');
388
- commands.push(' fi');
389
- commands.push(' ');
390
- commands.push(' if [ -n "$DETECTED_JAVA_HOME" ] && [ -d "$DETECTED_JAVA_HOME" ]; then');
391
- commands.push(' export JAVA_HOME="$DETECTED_JAVA_HOME"');
392
- commands.push(' echo "✅ Auto-corrected JAVA_HOME to: $JAVA_HOME"');
393
- commands.push(' echo ""');
394
- commands.push(' else');
395
- commands.push(' echo ""');
396
- commands.push(' echo "❌ Could not auto-detect valid Java installation"');
397
- commands.push(' echo ""');
398
- commands.push(' echo "JAVA_HOME is set to: $JAVA_HOME"');
399
- commands.push(' echo "But this directory does not exist on your system."');
400
- commands.push(' echo ""');
401
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
402
- commands.push(' echo "Required Java version: $REQUESTED_VERSION"');
403
- commands.push(' echo ""');
404
- commands.push(' fi');
405
- commands.push(' echo "To fix this issue:"');
406
- commands.push(' if [ -x "/usr/libexec/java_home" ]; then');
407
- commands.push(' echo " 1. Check available Java versions:"');
408
- commands.push(' echo " /usr/libexec/java_home -V"');
409
- commands.push(' echo ""');
410
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
411
- commands.push(' echo " 2. Install Java $REQUESTED_VERSION via Homebrew:"');
412
- commands.push(' echo " brew install openjdk@$REQUESTED_VERSION"');
413
- commands.push(' else');
414
- commands.push(' echo " 2. Install Java via Homebrew:"');
415
- commands.push(' echo " brew install openjdk@17"');
416
- commands.push(' fi');
417
- commands.push(' echo ""');
418
- commands.push(' echo " 3. Update JAVA_HOME in your secrets or add set-java-version step"');
419
- commands.push(' else');
420
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
421
- commands.push(' echo " 1. Install Java $REQUESTED_VERSION (Ubuntu/Debian):"');
422
- commands.push(' echo " sudo apt-get install openjdk-${REQUESTED_VERSION}-jdk"');
423
- commands.push(' else');
424
- commands.push(' echo " 1. Install Java (Ubuntu/Debian):"');
425
- commands.push(' echo " sudo apt-get install openjdk-17-jdk"');
426
- commands.push(' fi');
427
- commands.push(' echo ""');
428
- commands.push(' echo " 2. Update JAVA_HOME in your secrets or add set-java-version step"');
429
- commands.push(' fi');
430
- commands.push(' echo ""');
431
- commands.push(' exit 1');
432
- commands.push(' fi');
433
- commands.push('fi');
434
- commands.push('');
435
- // Determine project location at runtime: explicit > CIBUILD_SOURCE_DIR > current dir
436
- if (explicitLocation && explicitLocation !== '.') {
437
- commands.push(`PROJECT_DIR='${this.escapeBash(explicitLocation)}'`);
438
- }
439
- else {
440
- commands.push('PROJECT_DIR="${CIBUILD_SOURCE_DIR:-.}"');
441
- }
442
- commands.push('echo "Building Android project: $PROJECT_DIR"');
443
- commands.push(`echo "Build type: ${this.escapeBash(finalBuildType)}"`);
444
- if (module) {
445
- commands.push(`echo "Module: ${this.escapeBash(module)}"`);
446
- }
447
- commands.push(`echo "Gradle task: ${this.escapeBash(gradleTask)}"`);
448
- // Change to project directory
449
- commands.push('');
450
- commands.push('if [ "$PROJECT_DIR" != "." ]; then');
451
- commands.push(' cd "$PROJECT_DIR"');
452
- commands.push('fi');
453
- // Make gradlew executable
454
- commands.push('');
455
- commands.push('# Make gradlew executable');
456
- commands.push('if [ -f "./gradlew" ]; then');
457
- commands.push(' chmod +x ./gradlew');
458
- commands.push(' GRADLE_CMD="./gradlew"');
459
- commands.push('elif command -v gradle &> /dev/null; then');
460
- commands.push(' GRADLE_CMD="gradle"');
461
- commands.push('else');
462
- commands.push(' echo "Error: Neither ./gradlew nor gradle command found"');
463
- commands.push(' exit 1');
464
- commands.push('fi');
465
- commands.push(...gradleMemoryCommands(this.getInput(inputs, 'jvmargs', ''), (v) => this.escapeBash(v), String(this.getInput(inputs, 'max_workers', '')).trim()));
466
- commands.push(...gradleSdkCmakeCommands());
467
- // Build gradle command
468
- commands.push('');
469
- commands.push('# Timestamp marker — used to collect only artifacts from this build');
470
- commands.push('touch /tmp/.cibuild-build-marker');
471
- commands.push('');
472
- commands.push('# Run Gradle build');
473
- let gradleArgs = this.escapeBash(gradleTask);
474
- if (gradleOptions && gradleOptions.trim() !== '') {
475
- gradleArgs += ` ${gradleOptions}`;
476
- }
477
- if (isDebugAssembleTask(gradleTask)) {
478
- // A debug assemble may carry the Invarn capture agent; see capture-injection.ts.
479
- commands.push(...captureSetupCommands(appProjectOfTask(gradleTask), (v) => `'${this.escapeBash(v)}'`));
480
- commands.push(...captureAssembleCommands(gradleArgs));
481
- }
482
- else {
483
- commands.push(`$GRADLE_CMD ${gradleArgs}`);
484
- }
485
- commands.push('');
486
- commands.push('# Build completed');
487
- commands.push('echo "Gradle build completed successfully"');
488
- commands.push('');
489
- // Copy artifacts to artifacts directory for deploy step
490
- commands.push('# Copy build artifacts to artifacts directory');
491
- commands.push('ARTIFACTS_DIR="${CIBUILD_ARTIFACTS_DIR:-.ci/artifacts}"');
492
- commands.push('mkdir -p "$ARTIFACTS_DIR"');
493
- commands.push('');
494
- commands.push('# Find and copy only APK/AAB files produced by this build (newer than marker)');
495
- commands.push('echo "Collecting build artifacts..."');
496
- commands.push('if find . -newer /tmp/.cibuild-build-marker \\( -path "*/build/outputs/apk/*/*.apk" -o -path "*/build/outputs/bundle/*/*.aab" \\) 2>/dev/null | grep -q .; then');
497
- commands.push(' find . -newer /tmp/.cibuild-build-marker \\( -path "*/build/outputs/apk/*/*.apk" -o -path "*/build/outputs/bundle/*/*.aab" \\) 2>/dev/null | while read -r artifact; do');
498
- commands.push(' ARTIFACT_NAME=$(basename "$artifact")');
499
- commands.push(' cp "$artifact" "$ARTIFACTS_DIR/$ARTIFACT_NAME"');
500
- commands.push(' echo " → Copied: $ARTIFACT_NAME"');
501
- commands.push(' echo " From: $artifact"');
502
- commands.push(' echo " To: $ARTIFACTS_DIR/$ARTIFACT_NAME"');
503
- commands.push(' done');
504
- commands.push(' echo ""');
505
- commands.push(' echo "✅ Artifacts copied to: $ARTIFACTS_DIR"');
506
- commands.push(' ls -lh "$ARTIFACTS_DIR"');
507
- commands.push('else');
508
- commands.push(' echo "⚠️ No APK or AAB files found in build/outputs/"');
509
- commands.push('fi');
510
- commands.push('rm -f /tmp/.cibuild-build-marker');
511
- commands.push('');
512
- commands.push('# Export artifact paths for subsequent steps (e.g. google-play-deploy)');
513
- commands.push('FIRST_APK=$(find "$ARTIFACTS_DIR" -name "*.apk" -type f | sort | head -n 1)');
514
- commands.push('FIRST_AAB=$(find "$ARTIFACTS_DIR" -name "*.aab" -type f | sort | head -n 1)');
515
- commands.push('if [ -n "$FIRST_APK" ]; then');
516
- commands.push(' envman add --key CIBUILD_APK_PATH --value "$FIRST_APK"');
517
- commands.push(' echo "Exported CIBUILD_APK_PATH=$FIRST_APK"');
518
- commands.push('fi');
519
- commands.push('if [ -n "$FIRST_AAB" ]; then');
520
- commands.push(' envman add --key CIBUILD_AAB_PATH --value "$FIRST_AAB"');
521
- commands.push(' echo "Exported CIBUILD_AAB_PATH=$FIRST_AAB"');
522
- commands.push('fi');
523
- const script = this.createBashScriptFromCommands(commands, stepName);
524
- return this.createScriptStep(script, stepName);
525
- }
526
- }
527
- /**
528
- * Android lint step executor
529
- * Runs Android lint checks
530
- */
531
- /**
532
- * Bash that picks a real variant task out of Gradle's own ambiguity error.
533
- *
534
- * `android/nowinandroid` declares its product flavors as an enum in
535
- * `build-logic/convention/…/NiaFlavor.kt` and applies them through a
536
- * convention plugin, so `app/build.gradle.kts` has no `productFlavors {}`
537
- * block for the literal scan to find. `VARIANT` stayed `debug` and Gradle
538
- * refused the very first Android step:
539
- *
540
- * Cannot locate tasks that match ':app:lintDebug' as task 'lintDebug' is
541
- * ambiguous in project ':app'. Candidates are: 'lintDemoDebug',
542
- * 'lintProdDebug', …
543
- *
544
- * Gradle has just listed the answer. Reading it back costs one extra
545
- * invocation on the failing case and nothing at all on a flavourless project,
546
- * which is why this is the fallback rather than an up-front `tasks --all`.
547
- *
548
- * Written as a shell function so what ships is what the test runs.
549
- */
550
- export const PICK_VARIANT_TASK_FUNCTION = `cibuild_pick_variant_task() {
551
- # $1 task prefix (lint, test), $2 task suffix (empty, UnitTest),
552
- # $3 the build type to prefer (Debug). Gradle's output arrives on stdin.
553
- awk '/Candidates are:/ { sub(/.*Candidates are:/, ""); print; exit }' |
554
- tr ',' '\\n' |
555
- tr -d " '\\"." |
556
- grep -E "^\${1}[A-Za-z0-9]*\${3}\${2}$" |
557
- head -1
558
- }`;
559
- /**
560
- * Whether a `module` input names the root project. Gradle's own path for the
561
- * root is `:`; an explicit empty string is taken to mean the same, since it
562
- * would otherwise compose `::<task>`. An absent input never reaches here —
563
- * the steps default it to `app`.
564
- */
565
- function isRootProject(module) {
566
- return module === ':' || module === '';
567
- }
568
- /**
569
- * The Gradle path of a task in a module: `:app:lintDebug`, or `:lintDebug`
570
- * for an app whose root project is the application. The leading `:` keeps it
571
- * the root project's own task rather than every project's task of that name.
572
- */
573
- export function gradleTaskPath(module, task) {
574
- return isRootProject(module) ? `:${task}` : `:${module}:${task}`;
575
- }
576
- /** A module's directory with a trailing slash, or `''` for the root project. */
577
- export function gradleProjectDir(module) {
578
- return isRootProject(module) ? '' : `${module}/`;
579
- }
580
- /** How a log line names the project a step runs on. */
581
- function gradleProjectLabel(module) {
582
- return isRootProject(module) ? 'the root project' : `module: ${module}`;
583
- }
584
- /**
585
- * The commands that run a variant-specific Gradle task and, if the variant
586
- * turns out to be a guess Gradle cannot resolve, resolve it and retry once.
587
- *
588
- * The resolved variant is exported with `envman`, so the *other*
589
- * variant-specific step in the same pipeline does not repeat the discovery —
590
- * whichever of lint and unit tests runs first pays for it.
591
- */
592
- export function variantTaskCommands(options) {
593
- const { module, variant, prefix, suffix, gradleArgs = '', escape } = options;
594
- const capitalized = variant.charAt(0).toUpperCase() + variant.slice(1);
595
- const task = gradleTaskPath(escape(module), `${prefix}${capitalized}${suffix}`);
596
- const args = gradleArgs === '' ? '' : ` ${gradleArgs}`;
597
- return [
598
- '',
599
- PICK_VARIANT_TASK_FUNCTION,
600
- '',
601
- `VARIANT_LOG=$(mktemp)`,
602
- 'set +e',
603
- `$GRADLE_CMD ${task}${args} 2>&1 | tee "$VARIANT_LOG"`,
604
- 'VARIANT_STATUS=${PIPESTATUS[0]}',
605
- 'set -e',
606
- '',
607
- 'if [ "$VARIANT_STATUS" -ne 0 ] && grep -q "is ambiguous in project" "$VARIANT_LOG"; then',
608
- ` echo ""`,
609
- ` echo "Gradle says ${task} is ambiguous, so this project has product flavors the pipeline did not know about."`,
610
- ` BUILD_TYPE_WANTED="\${BUILD_TYPE:-${capitalized}}"`,
611
- ` RESOLVED_TASK=$(cibuild_pick_variant_task "${prefix}" "${suffix}" "$BUILD_TYPE_WANTED" < "$VARIANT_LOG")`,
612
- ' if [ -z "$RESOLVED_TASK" ]; then',
613
- ' echo "None of the candidates Gradle listed ends in $BUILD_TYPE_WANTED, so there is nothing safe to retry with."',
614
- ' rm -f "$VARIANT_LOG"',
615
- ' exit "$VARIANT_STATUS"',
616
- ' fi',
617
- ` RESOLVED_VARIANT=\${RESOLVED_TASK#${prefix}}`,
618
- ...(suffix === '' ? [] : [` RESOLVED_VARIANT=\${RESOLVED_VARIANT%${suffix}}`]),
619
- ` RESOLVED_VARIANT="$(echo "\${RESOLVED_VARIANT:0:1}" | tr '[:upper:]' '[:lower:]')\${RESOLVED_VARIANT:1}"`,
620
- ` echo "Using ${gradleTaskPath(escape(module), '$RESOLVED_TASK')} — resolved VARIANT=$RESOLVED_VARIANT"`,
621
- // Best-effort: the discovery is worth having even where envman is not.
622
- ' envman add --key VARIANT --value "$RESOLVED_VARIANT" || true',
623
- ` $GRADLE_CMD ${gradleTaskPath(escape(module), '$RESOLVED_TASK')}${args}`,
624
- 'elif [ "$VARIANT_STATUS" -ne 0 ]; then',
625
- ' rm -f "$VARIANT_LOG"',
626
- ' exit "$VARIANT_STATUS"',
627
- 'fi',
628
- 'rm -f "$VARIANT_LOG"',
629
- ];
630
- }
631
- export class AndroidLintStepExecutor extends BaseStepExecutor {
632
- getValidationRequirements(_inputs, env, _config) {
633
- return [
634
- this.requireEnvVar('JAVA_HOME', 'Java installation directory', env, 'Add a set-java-version step before android-lint, or set JAVA_HOME env var'),
635
- this.runtimeRequirement('gradlew', 'Gradle wrapper (./gradlew) or gradle command', 'file', 'the checkout'),
636
- ];
637
- }
638
- async execute(inputs, env, config) {
639
- const stepName = 'android-lint';
640
- // Get project location from YAML input (if explicitly specified)
641
- const explicitLocation = this.getInput(inputs, 'project_location', '');
642
- // Get module - defaults to app
643
- const module = this.getInput(inputs, 'module', 'app');
644
- // Get variant - defaults to debug
645
- const variant = this.getInput(inputs, 'variant', 'debug');
646
- const commands = [];
647
- commands.push('# Android Lint');
648
- commands.push('');
649
- // Add JAVA_HOME validation and auto-detection
650
- commands.push('# Validate and auto-detect JAVA_HOME if needed');
651
- commands.push('if [ -n "$JAVA_HOME" ] && [ ! -d "$JAVA_HOME" ]; then');
652
- commands.push(' echo "⚠️ JAVA_HOME is set but points to invalid directory: $JAVA_HOME"');
653
- commands.push(' ');
654
- commands.push(' # Extract Java version from invalid path (e.g., "11" from /usr/lib/jvm/java-11-openjdk-amd64)');
655
- commands.push(' REQUESTED_VERSION=$(echo "$JAVA_HOME" | grep -oE "java-[0-9]+" | grep -oE "[0-9]+" || echo "")');
656
- commands.push(' if [ -z "$REQUESTED_VERSION" ]; then');
657
- commands.push(' # Try alternative patterns (e.g., openjdk@17, openjdk-17)');
658
- commands.push(' REQUESTED_VERSION=$(echo "$JAVA_HOME" | grep -oE "(openjdk[@-])[0-9]+" | grep -oE "[0-9]+" || echo "")');
659
- commands.push(' fi');
660
- commands.push(' ');
661
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
662
- commands.push(' echo "Detected requested Java version: $REQUESTED_VERSION"');
663
- commands.push(' echo "Attempting to find Java $REQUESTED_VERSION on this system..."');
664
- commands.push(' else');
665
- commands.push(' echo "Could not detect Java version from path, will try to find any Java..."');
666
- commands.push(' fi');
667
- commands.push(' echo ""');
668
- commands.push(' ');
669
- commands.push(' # Try to auto-detect Java for the requested version');
670
- commands.push(' DETECTED_JAVA_HOME=""');
671
- commands.push(' ');
672
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
673
- commands.push(' # Check Homebrew installation paths for specific version (Apple Silicon)');
674
- commands.push(' if [ -d "/opt/homebrew/opt/openjdk@${REQUESTED_VERSION}" ]; then');
675
- commands.push(' DETECTED_JAVA_HOME="/opt/homebrew/opt/openjdk@${REQUESTED_VERSION}"');
676
- commands.push(' echo "✅ Found Java $REQUESTED_VERSION at: $DETECTED_JAVA_HOME (Homebrew Apple Silicon)"');
677
- commands.push(' # Check Homebrew installation paths (Intel Mac)');
678
- commands.push(' elif [ -d "/usr/local/opt/openjdk@${REQUESTED_VERSION}" ]; then');
679
- commands.push(' DETECTED_JAVA_HOME="/usr/local/opt/openjdk@${REQUESTED_VERSION}"');
680
- commands.push(' echo "✅ Found Java $REQUESTED_VERSION at: $DETECTED_JAVA_HOME (Homebrew Intel)"');
681
- commands.push(' # Check Android Studio JBR');
682
- commands.push(' elif [ -d "/Applications/Android Studio.app/Contents/jbr/Contents/Home" ]; then');
683
- commands.push(' JBR_PATH="/Applications/Android Studio.app/Contents/jbr/Contents/Home"');
684
- commands.push(' JBR_MAJOR=$(grep "^JAVA_VERSION=" "$JBR_PATH/release" 2>/dev/null | grep -oE \'"[0-9]+\' | tr -d \'"\' || echo "")');
685
- commands.push(' if [ "$JBR_MAJOR" = "$REQUESTED_VERSION" ]; then');
686
- commands.push(' DETECTED_JAVA_HOME="$JBR_PATH"');
687
- commands.push(' echo "✅ Found Java $REQUESTED_VERSION at: $DETECTED_JAVA_HOME (Android Studio JBR)"');
688
- commands.push(' fi');
689
- commands.push(' # Try macOS java_home utility for specific version');
690
- commands.push(' elif [ -x "/usr/libexec/java_home" ]; then');
691
- commands.push(' # java_home names Java 8 as 1.8, and answers an unmatched request');
692
- commands.push(' # with the newest JDK rather than failing -- ask the right way or');
693
- commands.push(' # silently get the wrong JDK.');
694
- commands.push(' REQ_SPEC="$REQUESTED_VERSION"');
695
- commands.push(' case "$REQUESTED_VERSION" in 1|2|3|4|5|6|7|8) REQ_SPEC="1.$REQUESTED_VERSION" ;; esac');
696
- commands.push(' DETECTED_JAVA_HOME=$(/usr/libexec/java_home -v "$REQ_SPEC" 2>/dev/null || true)');
697
- commands.push(' if [ -z "$DETECTED_JAVA_HOME" ]; then');
698
- commands.push(' DETECTED_JAVA_HOME=$(/usr/libexec/java_home -v "${REQ_SPEC}.*" 2>/dev/null || true)');
699
- commands.push(' fi');
700
- commands.push(' if [ -n "$DETECTED_JAVA_HOME" ]; then');
701
- commands.push(' echo "✅ Found Java $REQUESTED_VERSION at: $DETECTED_JAVA_HOME (java_home utility)"');
702
- commands.push(' fi');
703
- commands.push(' fi');
704
- commands.push(' fi');
705
- commands.push(' ');
706
- commands.push(' # If specific version not found, try any Java as fallback');
707
- commands.push(' if [ -z "$DETECTED_JAVA_HOME" ]; then');
708
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
709
- commands.push(' echo "⚠️ Java $REQUESTED_VERSION not found, checking for other versions..."');
710
- commands.push(' fi');
711
- commands.push(' ');
712
- commands.push(' if [ -x "/usr/libexec/java_home" ]; then');
713
- commands.push(' DETECTED_JAVA_HOME=$(/usr/libexec/java_home 2>/dev/null || true)');
714
- commands.push(' if [ -n "$DETECTED_JAVA_HOME" ]; then');
715
- commands.push(' FALLBACK_VERSION=$("$DETECTED_JAVA_HOME/bin/java" -version 2>&1 | head -n 1 | grep -oE "[0-9]+" | head -n 1)');
716
- commands.push(' echo "⚠️ Found Java $FALLBACK_VERSION instead of requested version $REQUESTED_VERSION"');
717
- commands.push(' echo " Location: $DETECTED_JAVA_HOME"');
718
- commands.push(' echo " ⚠️ WARNING: This may cause build issues if Java $REQUESTED_VERSION is required"');
719
- commands.push(' fi');
720
- commands.push(' fi');
721
- commands.push(' fi');
722
- commands.push(' ');
723
- commands.push(' if [ -n "$DETECTED_JAVA_HOME" ] && [ -d "$DETECTED_JAVA_HOME" ]; then');
724
- commands.push(' export JAVA_HOME="$DETECTED_JAVA_HOME"');
725
- commands.push(' echo "✅ Auto-corrected JAVA_HOME to: $JAVA_HOME"');
726
- commands.push(' echo ""');
727
- commands.push(' else');
728
- commands.push(' echo ""');
729
- commands.push(' echo "❌ Could not auto-detect valid Java installation"');
730
- commands.push(' echo ""');
731
- commands.push(' echo "JAVA_HOME is set to: $JAVA_HOME"');
732
- commands.push(' echo "But this directory does not exist on your system."');
733
- commands.push(' echo ""');
734
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
735
- commands.push(' echo "Required Java version: $REQUESTED_VERSION"');
736
- commands.push(' echo ""');
737
- commands.push(' fi');
738
- commands.push(' echo "To fix this issue:"');
739
- commands.push(' if [ -x "/usr/libexec/java_home" ]; then');
740
- commands.push(' echo " 1. Check available Java versions:"');
741
- commands.push(' echo " /usr/libexec/java_home -V"');
742
- commands.push(' echo ""');
743
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
744
- commands.push(' echo " 2. Install Java $REQUESTED_VERSION via Homebrew:"');
745
- commands.push(' echo " brew install openjdk@$REQUESTED_VERSION"');
746
- commands.push(' else');
747
- commands.push(' echo " 2. Install Java via Homebrew:"');
748
- commands.push(' echo " brew install openjdk@17"');
749
- commands.push(' fi');
750
- commands.push(' echo ""');
751
- commands.push(' echo " 3. Update JAVA_HOME in your secrets or add set-java-version step"');
752
- commands.push(' else');
753
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
754
- commands.push(' echo " 1. Install Java $REQUESTED_VERSION (Ubuntu/Debian):"');
755
- commands.push(' echo " sudo apt-get install openjdk-${REQUESTED_VERSION}-jdk"');
756
- commands.push(' else');
757
- commands.push(' echo " 1. Install Java (Ubuntu/Debian):"');
758
- commands.push(' echo " sudo apt-get install openjdk-17-jdk"');
759
- commands.push(' fi');
760
- commands.push(' echo ""');
761
- commands.push(' echo " 2. Update JAVA_HOME in your secrets or add set-java-version step"');
762
- commands.push(' fi');
763
- commands.push(' echo ""');
764
- commands.push(' exit 1');
765
- commands.push(' fi');
766
- commands.push('fi');
767
- commands.push('');
768
- // Determine project location at runtime: explicit > CIBUILD_SOURCE_DIR > current dir
769
- if (explicitLocation && explicitLocation !== '.') {
770
- commands.push(`PROJECT_DIR='${this.escapeBash(explicitLocation)}'`);
771
- }
772
- else {
773
- commands.push('PROJECT_DIR="${CIBUILD_SOURCE_DIR:-.}"');
774
- }
775
- commands.push('echo "Project directory: $PROJECT_DIR"');
776
- commands.push(`echo "Running lint on ${gradleProjectLabel(this.escapeBash(module))}"`);
777
- commands.push(`echo "Variant: ${this.escapeBash(variant)}"`);
778
- // Change to project directory
779
- commands.push('');
780
- commands.push('if [ "$PROJECT_DIR" != "." ]; then');
781
- commands.push(' cd "$PROJECT_DIR"');
782
- commands.push('fi');
783
- // Make gradlew executable
784
- commands.push('');
785
- commands.push('# Make gradlew executable');
786
- commands.push('if [ -f "./gradlew" ]; then');
787
- commands.push(' chmod +x ./gradlew');
788
- commands.push(' GRADLE_CMD="./gradlew"');
789
- commands.push('elif command -v gradle &> /dev/null; then');
790
- commands.push(' GRADLE_CMD="gradle"');
791
- commands.push('else');
792
- commands.push(' echo "Error: Neither ./gradlew nor gradle command found"');
793
- commands.push(' exit 1');
794
- commands.push('fi');
795
- commands.push(...gradleMemoryCommands(this.getInput(inputs, 'jvmargs', ''), (v) => this.escapeBash(v), String(this.getInput(inputs, 'max_workers', '')).trim()));
796
- commands.push(...gradleSdkCmakeCommands());
797
- // Build lint task name
798
- commands.push('');
799
- commands.push('# Run lint');
800
- const variantCapitalized = variant.charAt(0).toUpperCase() + variant.slice(1);
801
- commands.push(...variantTaskCommands({
802
- module,
803
- variant,
804
- prefix: 'lint',
805
- suffix: '',
806
- escape: (value) => this.escapeBash(value),
807
- }));
808
- commands.push('');
809
- commands.push('# Lint completed');
810
- commands.push('echo "Lint analysis completed successfully"');
811
- commands.push(`echo "Lint report location: ${gradleProjectDir(this.escapeBash(module))}build/reports/lint-results-${this.escapeBash(variant)}.html"`);
812
- const script = this.createBashScriptFromCommands(commands, stepName);
813
- return this.createScriptStep(script, stepName);
814
- }
815
- }
816
- /**
817
- * Android unit test step executor
818
- * Runs Android unit tests
819
- */
820
- export class AndroidUnitTestStepExecutor extends BaseStepExecutor {
821
- getValidationRequirements(_inputs, env, _config) {
822
- return [
823
- this.requireEnvVar('JAVA_HOME', 'Java installation directory', env, 'Add a set-java-version step before android-unit-test, or set JAVA_HOME env var'),
824
- this.runtimeRequirement('gradlew', 'Gradle wrapper (./gradlew) or gradle command', 'file', 'the checkout'),
825
- ];
826
- }
827
- async execute(inputs, env, config) {
828
- const stepName = 'android-unit-test';
829
- // Get project location from YAML input (if explicitly specified)
830
- const explicitLocation = this.getInput(inputs, 'project_location', '');
831
- // Get module - defaults to app
832
- const module = this.getInput(inputs, 'module', 'app');
833
- // Get variant - defaults to debug
834
- const variant = this.getInput(inputs, 'variant', 'debug');
835
- // Get test filter - optional
836
- const testFilter = this.getInput(inputs, 'test_filter', '');
837
- const commands = [];
838
- commands.push('# Android Unit Tests');
839
- commands.push('');
840
- // Add JAVA_HOME validation and auto-detection
841
- commands.push('# Validate and auto-detect JAVA_HOME if needed');
842
- commands.push('if [ -n "$JAVA_HOME" ] && [ ! -d "$JAVA_HOME" ]; then');
843
- commands.push(' echo "⚠️ JAVA_HOME is set but points to invalid directory: $JAVA_HOME"');
844
- commands.push(' ');
845
- commands.push(' # Extract Java version from invalid path (e.g., "11" from /usr/lib/jvm/java-11-openjdk-amd64)');
846
- commands.push(' REQUESTED_VERSION=$(echo "$JAVA_HOME" | grep -oE "java-[0-9]+" | grep -oE "[0-9]+" || echo "")');
847
- commands.push(' if [ -z "$REQUESTED_VERSION" ]; then');
848
- commands.push(' # Try alternative patterns (e.g., openjdk@17, openjdk-17)');
849
- commands.push(' REQUESTED_VERSION=$(echo "$JAVA_HOME" | grep -oE "(openjdk[@-])[0-9]+" | grep -oE "[0-9]+" || echo "")');
850
- commands.push(' fi');
851
- commands.push(' ');
852
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
853
- commands.push(' echo "Detected requested Java version: $REQUESTED_VERSION"');
854
- commands.push(' echo "Attempting to find Java $REQUESTED_VERSION on this system..."');
855
- commands.push(' else');
856
- commands.push(' echo "Could not detect Java version from path, will try to find any Java..."');
857
- commands.push(' fi');
858
- commands.push(' echo ""');
859
- commands.push(' ');
860
- commands.push(' # Try to auto-detect Java for the requested version');
861
- commands.push(' DETECTED_JAVA_HOME=""');
862
- commands.push(' ');
863
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
864
- commands.push(' # Check Homebrew installation paths for specific version (Apple Silicon)');
865
- commands.push(' if [ -d "/opt/homebrew/opt/openjdk@${REQUESTED_VERSION}" ]; then');
866
- commands.push(' DETECTED_JAVA_HOME="/opt/homebrew/opt/openjdk@${REQUESTED_VERSION}"');
867
- commands.push(' echo "✅ Found Java $REQUESTED_VERSION at: $DETECTED_JAVA_HOME (Homebrew Apple Silicon)"');
868
- commands.push(' # Check Homebrew installation paths (Intel Mac)');
869
- commands.push(' elif [ -d "/usr/local/opt/openjdk@${REQUESTED_VERSION}" ]; then');
870
- commands.push(' DETECTED_JAVA_HOME="/usr/local/opt/openjdk@${REQUESTED_VERSION}"');
871
- commands.push(' echo "✅ Found Java $REQUESTED_VERSION at: $DETECTED_JAVA_HOME (Homebrew Intel)"');
872
- commands.push(' # Check Android Studio JBR');
873
- commands.push(' elif [ -d "/Applications/Android Studio.app/Contents/jbr/Contents/Home" ]; then');
874
- commands.push(' JBR_PATH="/Applications/Android Studio.app/Contents/jbr/Contents/Home"');
875
- commands.push(' JBR_MAJOR=$(grep "^JAVA_VERSION=" "$JBR_PATH/release" 2>/dev/null | grep -oE \'"[0-9]+\' | tr -d \'"\' || echo "")');
876
- commands.push(' if [ "$JBR_MAJOR" = "$REQUESTED_VERSION" ]; then');
877
- commands.push(' DETECTED_JAVA_HOME="$JBR_PATH"');
878
- commands.push(' echo "✅ Found Java $REQUESTED_VERSION at: $DETECTED_JAVA_HOME (Android Studio JBR)"');
879
- commands.push(' fi');
880
- commands.push(' # Try macOS java_home utility for specific version');
881
- commands.push(' elif [ -x "/usr/libexec/java_home" ]; then');
882
- commands.push(' # java_home names Java 8 as 1.8, and answers an unmatched request');
883
- commands.push(' # with the newest JDK rather than failing -- ask the right way or');
884
- commands.push(' # silently get the wrong JDK.');
885
- commands.push(' REQ_SPEC="$REQUESTED_VERSION"');
886
- commands.push(' case "$REQUESTED_VERSION" in 1|2|3|4|5|6|7|8) REQ_SPEC="1.$REQUESTED_VERSION" ;; esac');
887
- commands.push(' DETECTED_JAVA_HOME=$(/usr/libexec/java_home -v "$REQ_SPEC" 2>/dev/null || true)');
888
- commands.push(' if [ -z "$DETECTED_JAVA_HOME" ]; then');
889
- commands.push(' DETECTED_JAVA_HOME=$(/usr/libexec/java_home -v "${REQ_SPEC}.*" 2>/dev/null || true)');
890
- commands.push(' fi');
891
- commands.push(' if [ -n "$DETECTED_JAVA_HOME" ]; then');
892
- commands.push(' echo "✅ Found Java $REQUESTED_VERSION at: $DETECTED_JAVA_HOME (java_home utility)"');
893
- commands.push(' fi');
894
- commands.push(' fi');
895
- commands.push(' fi');
896
- commands.push(' ');
897
- commands.push(' # If specific version not found, try any Java as fallback');
898
- commands.push(' if [ -z "$DETECTED_JAVA_HOME" ]; then');
899
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
900
- commands.push(' echo "⚠️ Java $REQUESTED_VERSION not found, checking for other versions..."');
901
- commands.push(' fi');
902
- commands.push(' ');
903
- commands.push(' if [ -x "/usr/libexec/java_home" ]; then');
904
- commands.push(' DETECTED_JAVA_HOME=$(/usr/libexec/java_home 2>/dev/null || true)');
905
- commands.push(' if [ -n "$DETECTED_JAVA_HOME" ]; then');
906
- commands.push(' FALLBACK_VERSION=$("$DETECTED_JAVA_HOME/bin/java" -version 2>&1 | head -n 1 | grep -oE "[0-9]+" | head -n 1)');
907
- commands.push(' echo "⚠️ Found Java $FALLBACK_VERSION instead of requested version $REQUESTED_VERSION"');
908
- commands.push(' echo " Location: $DETECTED_JAVA_HOME"');
909
- commands.push(' echo " ⚠️ WARNING: This may cause build issues if Java $REQUESTED_VERSION is required"');
910
- commands.push(' fi');
911
- commands.push(' fi');
912
- commands.push(' fi');
913
- commands.push(' ');
914
- commands.push(' if [ -n "$DETECTED_JAVA_HOME" ] && [ -d "$DETECTED_JAVA_HOME" ]; then');
915
- commands.push(' export JAVA_HOME="$DETECTED_JAVA_HOME"');
916
- commands.push(' echo "✅ Auto-corrected JAVA_HOME to: $JAVA_HOME"');
917
- commands.push(' echo ""');
918
- commands.push(' else');
919
- commands.push(' echo ""');
920
- commands.push(' echo "❌ Could not auto-detect valid Java installation"');
921
- commands.push(' echo ""');
922
- commands.push(' echo "JAVA_HOME is set to: $JAVA_HOME"');
923
- commands.push(' echo "But this directory does not exist on your system."');
924
- commands.push(' echo ""');
925
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
926
- commands.push(' echo "Required Java version: $REQUESTED_VERSION"');
927
- commands.push(' echo ""');
928
- commands.push(' fi');
929
- commands.push(' echo "To fix this issue:"');
930
- commands.push(' if [ -x "/usr/libexec/java_home" ]; then');
931
- commands.push(' echo " 1. Check available Java versions:"');
932
- commands.push(' echo " /usr/libexec/java_home -V"');
933
- commands.push(' echo ""');
934
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
935
- commands.push(' echo " 2. Install Java $REQUESTED_VERSION via Homebrew:"');
936
- commands.push(' echo " brew install openjdk@$REQUESTED_VERSION"');
937
- commands.push(' else');
938
- commands.push(' echo " 2. Install Java via Homebrew:"');
939
- commands.push(' echo " brew install openjdk@17"');
940
- commands.push(' fi');
941
- commands.push(' echo ""');
942
- commands.push(' echo " 3. Update JAVA_HOME in your secrets or add set-java-version step"');
943
- commands.push(' else');
944
- commands.push(' if [ -n "$REQUESTED_VERSION" ]; then');
945
- commands.push(' echo " 1. Install Java $REQUESTED_VERSION (Ubuntu/Debian):"');
946
- commands.push(' echo " sudo apt-get install openjdk-${REQUESTED_VERSION}-jdk"');
947
- commands.push(' else');
948
- commands.push(' echo " 1. Install Java (Ubuntu/Debian):"');
949
- commands.push(' echo " sudo apt-get install openjdk-17-jdk"');
950
- commands.push(' fi');
951
- commands.push(' echo ""');
952
- commands.push(' echo " 2. Update JAVA_HOME in your secrets or add set-java-version step"');
953
- commands.push(' fi');
954
- commands.push(' echo ""');
955
- commands.push(' exit 1');
956
- commands.push(' fi');
957
- commands.push('fi');
958
- commands.push('');
959
- // Determine project location at runtime: explicit > CIBUILD_SOURCE_DIR > current dir
960
- if (explicitLocation && explicitLocation !== '.') {
961
- commands.push(`PROJECT_DIR='${this.escapeBash(explicitLocation)}'`);
962
- }
963
- else {
964
- commands.push('PROJECT_DIR="${CIBUILD_SOURCE_DIR:-.}"');
965
- }
966
- commands.push('echo "Project directory: $PROJECT_DIR"');
967
- commands.push(`echo "Running unit tests on ${gradleProjectLabel(this.escapeBash(module))}"`);
968
- commands.push(`echo "Variant: ${this.escapeBash(variant)}"`);
969
- // Change to project directory
970
- commands.push('');
971
- commands.push('if [ "$PROJECT_DIR" != "." ]; then');
972
- commands.push(' cd "$PROJECT_DIR"');
973
- commands.push('fi');
974
- // Make gradlew executable
975
- commands.push('');
976
- commands.push('# Make gradlew executable');
977
- commands.push('if [ -f "./gradlew" ]; then');
978
- commands.push(' chmod +x ./gradlew');
979
- commands.push(' GRADLE_CMD="./gradlew"');
980
- commands.push('elif command -v gradle &> /dev/null; then');
981
- commands.push(' GRADLE_CMD="gradle"');
982
- commands.push('else');
983
- commands.push(' echo "Error: Neither ./gradlew nor gradle command found"');
984
- commands.push(' exit 1');
985
- commands.push('fi');
986
- commands.push(...gradleMemoryCommands(this.getInput(inputs, 'jvmargs', ''), (v) => this.escapeBash(v), String(this.getInput(inputs, 'max_workers', '')).trim()));
987
- commands.push(...gradleSdkCmakeCommands());
988
- // Build test task name
989
- commands.push('');
990
- commands.push('# Run unit tests');
991
- const variantCapitalized = variant.charAt(0).toUpperCase() + variant.slice(1);
992
- // Add test filter if specified
993
- let gradleArgs = '';
994
- if (testFilter && testFilter.trim() !== '') {
995
- gradleArgs = `--tests '${this.escapeBash(testFilter)}'`;
996
- }
997
- commands.push(...variantTaskCommands({
998
- module,
999
- variant,
1000
- prefix: 'test',
1001
- suffix: 'UnitTest',
1002
- gradleArgs,
1003
- escape: (value) => this.escapeBash(value),
1004
- }));
1005
- commands.push('');
1006
- commands.push('# Tests completed');
1007
- commands.push('echo "Unit tests completed successfully"');
1008
- commands.push(`echo "Test report location: ${gradleProjectDir(this.escapeBash(module))}build/reports/tests/test${variantCapitalized}UnitTest/index.html"`);
1009
- const script = this.createBashScriptFromCommands(commands, stepName);
1010
- return this.createScriptStep(script, stepName);
1011
- }
1012
- }
1013
- /**
1014
- * Builds app APK and test APK for Android instrumented (UI) tests.
1015
- * Runs assembleVariant and assembleVariantAndroidTest gradle tasks.
1016
- */
1017
- export class AndroidBuildForUITestingStepExecutor extends BaseStepExecutor {
1018
- getValidationRequirements(_inputs, env, _config) {
1019
- return [
1020
- this.requireEnvVar('JAVA_HOME', 'Java installation directory', env, 'Add a set-java-version step before this step'),
1021
- ];
1022
- }
1023
- getOutputs() {
1024
- return [
1025
- { name: 'CIBUILD_APK_PATH', type: 'environment', description: 'Path to the app APK' },
1026
- { name: 'CIBUILD_TEST_APK_PATH', type: 'environment', description: 'Path to the test APK' },
1027
- ];
1028
- }
1029
- async execute(inputs, _env, _config) {
1030
- const stepName = 'android-build-for-ui-testing';
1031
- const projectLocation = this.getInput(inputs, 'project_location', '.');
1032
- const module = this.getInput(inputs, 'module', 'app');
1033
- const variant = this.getInput(inputs, 'variant', 'Debug');
1034
- const extraArgs = this.getInput(inputs, 'arguments', '');
1035
- const variantCap = variant.charAt(0).toUpperCase() + variant.slice(1);
1036
- const commands = [];
1037
- commands.push('# android-build-for-ui-testing');
1038
- commands.push('echo "🧪 Building for UI testing..."');
1039
- commands.push('');
1040
- // Navigate to project
1041
- if (projectLocation !== '.') {
1042
- commands.push(`cd '${this.escapeBash(projectLocation)}'`);
1043
- }
1044
- else {
1045
- commands.push('if [ -n "$CIBUILD_SOURCE_DIR" ]; then cd "$CIBUILD_SOURCE_DIR"; fi');
1046
- }
1047
- commands.push('');
1048
- // gradlew
1049
- commands.push('if [ -f "./gradlew" ]; then');
1050
- commands.push(' chmod +x ./gradlew');
1051
- commands.push(' GRADLE_CMD="./gradlew"');
1052
- commands.push('else');
1053
- commands.push(' GRADLE_CMD="gradle"');
1054
- commands.push('fi');
1055
- commands.push(...gradleMemoryCommands(this.getInput(inputs, 'jvmargs', ''), (v) => this.escapeBash(v), String(this.getInput(inputs, 'max_workers', '')).trim()));
1056
- commands.push(...gradleSdkCmakeCommands());
1057
- commands.push('');
1058
- // Build both app and test APKs
1059
- const appTask = gradleTaskPath(this.escapeBash(module), `assemble${variantCap}`);
1060
- const testTask = gradleTaskPath(this.escapeBash(module), `assemble${variantCap}AndroidTest`);
1061
- let cmd = `$GRADLE_CMD ${appTask} ${testTask}`;
1062
- if (extraArgs) {
1063
- cmd += ` ${extraArgs}`;
1064
- }
1065
- commands.push(`echo "Running: ${cmd}"`);
1066
- commands.push(cmd);
1067
- commands.push('');
1068
- // Locate APKs
1069
- commands.push('# Locate generated APKs');
1070
- commands.push(`APP_APK=$(find . -path "*/${gradleProjectDir(this.escapeBash(module))}build/outputs/apk/*/*.apk" ! -name "*androidTest*" | head -1)`);
1071
- commands.push(`TEST_APK=$(find . -path "*/${gradleProjectDir(this.escapeBash(module))}build/outputs/apk/*/*.apk" -name "*androidTest*" | head -1)`);
1072
- commands.push('');
1073
- commands.push('if [ -z "$APP_APK" ]; then');
1074
- commands.push(' echo "⚠️ App APK not found"');
1075
- commands.push('else');
1076
- commands.push(' echo "App APK: $APP_APK"');
1077
- commands.push(' envman add --key CIBUILD_APK_PATH --value "$APP_APK"');
1078
- commands.push('fi');
1079
- commands.push('');
1080
- commands.push('if [ -z "$TEST_APK" ]; then');
1081
- commands.push(' echo "⚠️ Test APK not found"');
1082
- commands.push('else');
1083
- commands.push(' echo "Test APK: $TEST_APK"');
1084
- commands.push(' envman add --key CIBUILD_TEST_APK_PATH --value "$TEST_APK"');
1085
- commands.push('fi');
1086
- commands.push('');
1087
- commands.push('echo "✅ UI testing build complete"');
1088
- const script = this.createBashScriptFromCommands(commands, stepName);
1089
- return this.createScriptStep(script, stepName);
1090
- }
1091
- }
1092
- //# sourceMappingURL=android.js.map