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