@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.
- package/dist/chunk-35SI42CD.mjs +1 -0
- package/dist/chunk-IC45KVLJ.mjs +1 -0
- package/dist/chunk-XDY4V23V.mjs +1 -0
- package/dist/cli.cjs +14 -14
- package/dist/commands.mjs +1 -0
- package/dist/lib.mjs +3934 -0
- package/package.json +6 -10
- package/dist/src/cli.d.ts +0 -3
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/cli.js +0 -399
- package/dist/src/commands/a-credential-target-follows-the-flavor-source-set.test.d.ts +0 -38
- package/dist/src/commands/a-credential-target-follows-the-flavor-source-set.test.d.ts.map +0 -1
- package/dist/src/commands/a-credential-target-follows-the-flavor-source-set.test.js +0 -222
- package/dist/src/commands/a-credential-two-workflows-cannot-share-is-declared-per-workflow.test.d.ts +0 -41
- package/dist/src/commands/a-credential-two-workflows-cannot-share-is-declared-per-workflow.test.d.ts.map +0 -1
- package/dist/src/commands/a-credential-two-workflows-cannot-share-is-declared-per-workflow.test.js +0 -324
- package/dist/src/commands/a-properties-stand-in-declares-the-keys-the-build-reads.test.d.ts +0 -2
- package/dist/src/commands/a-properties-stand-in-declares-the-keys-the-build-reads.test.d.ts.map +0 -1
- package/dist/src/commands/a-properties-stand-in-declares-the-keys-the-build-reads.test.js +0 -382
- package/dist/src/commands/an-already-stored-value-does-not-answer-the-target-question.test.d.ts +0 -29
- package/dist/src/commands/an-already-stored-value-does-not-answer-the-target-question.test.d.ts.map +0 -1
- package/dist/src/commands/an-already-stored-value-does-not-answer-the-target-question.test.js +0 -160
- package/dist/src/commands/android-gms-guard.test.d.ts +0 -9
- package/dist/src/commands/android-gms-guard.test.d.ts.map +0 -1
- package/dist/src/commands/android-gms-guard.test.js +0 -78
- package/dist/src/commands/android-java-version.test.d.ts +0 -12
- package/dist/src/commands/android-java-version.test.d.ts.map +0 -1
- package/dist/src/commands/android-java-version.test.js +0 -209
- package/dist/src/commands/android-scanner-java.test.d.ts +0 -2
- package/dist/src/commands/android-scanner-java.test.d.ts.map +0 -1
- package/dist/src/commands/android-scanner-java.test.js +0 -130
- package/dist/src/commands/android-scanner.d.ts +0 -250
- package/dist/src/commands/android-scanner.d.ts.map +0 -1
- package/dist/src/commands/android-scanner.js +0 -1639
- package/dist/src/commands/build.d.ts +0 -215
- package/dist/src/commands/build.d.ts.map +0 -1
- package/dist/src/commands/build.js +0 -1433
- package/dist/src/commands/build.test.d.ts +0 -13
- package/dist/src/commands/build.test.d.ts.map +0 -1
- package/dist/src/commands/build.test.js +0 -121
- package/dist/src/commands/detect-platform.d.ts +0 -13
- package/dist/src/commands/detect-platform.d.ts.map +0 -1
- package/dist/src/commands/detect-platform.js +0 -51
- package/dist/src/commands/detect-project.d.ts +0 -7
- package/dist/src/commands/detect-project.d.ts.map +0 -1
- package/dist/src/commands/detect-project.js +0 -12
- package/dist/src/commands/each-flavor-is-asked-for-its-own-properties-file.test.d.ts +0 -26
- package/dist/src/commands/each-flavor-is-asked-for-its-own-properties-file.test.d.ts.map +0 -1
- package/dist/src/commands/each-flavor-is-asked-for-its-own-properties-file.test.js +0 -196
- package/dist/src/commands/edit.d.ts +0 -12
- package/dist/src/commands/edit.d.ts.map +0 -1
- package/dist/src/commands/edit.js +0 -652
- package/dist/src/commands/edit.test.d.ts +0 -6
- package/dist/src/commands/edit.test.d.ts.map +0 -1
- package/dist/src/commands/edit.test.js +0 -45
- package/dist/src/commands/fidelity-trim.d.ts +0 -13
- package/dist/src/commands/fidelity-trim.d.ts.map +0 -1
- package/dist/src/commands/fidelity-trim.js +0 -21
- package/dist/src/commands/fidelity-trim.test.d.ts +0 -8
- package/dist/src/commands/fidelity-trim.test.d.ts.map +0 -1
- package/dist/src/commands/fidelity-trim.test.js +0 -79
- package/dist/src/commands/file-secret-collector.d.ts +0 -50
- package/dist/src/commands/file-secret-collector.d.ts.map +0 -1
- package/dist/src/commands/file-secret-collector.js +0 -217
- package/dist/src/commands/flavors-a-convention-plugin-creates-are-still-found.test.d.ts +0 -38
- package/dist/src/commands/flavors-a-convention-plugin-creates-are-still-found.test.d.ts.map +0 -1
- package/dist/src/commands/flavors-a-convention-plugin-creates-are-still-found.test.js +0 -300
- package/dist/src/commands/github-workflow.d.ts +0 -5
- package/dist/src/commands/github-workflow.d.ts.map +0 -1
- package/dist/src/commands/github-workflow.js +0 -45
- package/dist/src/commands/index.d.ts +0 -33
- package/dist/src/commands/index.d.ts.map +0 -1
- package/dist/src/commands/index.js +0 -33
- package/dist/src/commands/init.d.ts +0 -20
- package/dist/src/commands/init.d.ts.map +0 -1
- package/dist/src/commands/init.js +0 -264
- package/dist/src/commands/ios-scanner.d.ts +0 -104
- package/dist/src/commands/ios-scanner.d.ts.map +0 -1
- package/dist/src/commands/ios-scanner.js +0 -492
- package/dist/src/commands/ios-scheme-ranking.test.d.ts +0 -2
- package/dist/src/commands/ios-scheme-ranking.test.d.ts.map +0 -1
- package/dist/src/commands/ios-scheme-ranking.test.js +0 -264
- package/dist/src/commands/local-properties-reaches-every-workflow.test.d.ts +0 -30
- package/dist/src/commands/local-properties-reaches-every-workflow.test.d.ts.map +0 -1
- package/dist/src/commands/local-properties-reaches-every-workflow.test.js +0 -146
- package/dist/src/commands/reset.d.ts +0 -7
- package/dist/src/commands/reset.d.ts.map +0 -1
- package/dist/src/commands/reset.js +0 -81
- package/dist/src/commands/run.d.ts +0 -22
- package/dist/src/commands/run.d.ts.map +0 -1
- package/dist/src/commands/run.js +0 -141
- package/dist/src/commands/secrets-sync-workflow.d.ts +0 -15
- package/dist/src/commands/secrets-sync-workflow.d.ts.map +0 -1
- package/dist/src/commands/secrets-sync-workflow.js +0 -255
- package/dist/src/commands/secrets-upload.d.ts +0 -21
- package/dist/src/commands/secrets-upload.d.ts.map +0 -1
- package/dist/src/commands/secrets-upload.js +0 -177
- package/dist/src/commands/secrets-upload.test.d.ts +0 -5
- package/dist/src/commands/secrets-upload.test.d.ts.map +0 -1
- package/dist/src/commands/secrets-upload.test.js +0 -60
- package/dist/src/commands/validate.d.ts +0 -10
- package/dist/src/commands/validate.d.ts.map +0 -1
- package/dist/src/commands/validate.js +0 -46
- package/dist/src/config.d.ts +0 -3
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/config.js +0 -47
- package/dist/src/envman/cli.d.ts +0 -21
- package/dist/src/envman/cli.d.ts.map +0 -1
- package/dist/src/envman/cli.js +0 -240
- package/dist/src/envman/envman.d.ts +0 -83
- package/dist/src/envman/envman.d.ts.map +0 -1
- package/dist/src/envman/envman.js +0 -361
- package/dist/src/envman/envman.test.d.ts +0 -5
- package/dist/src/envman/envman.test.d.ts.map +0 -1
- package/dist/src/envman/envman.test.js +0 -236
- package/dist/src/envman/envstore-round-trip.test.d.ts +0 -27
- package/dist/src/envman/envstore-round-trip.test.d.ts.map +0 -1
- package/dist/src/envman/envstore-round-trip.test.js +0 -130
- package/dist/src/envman/index.d.ts +0 -23
- package/dist/src/envman/index.d.ts.map +0 -1
- package/dist/src/envman/index.js +0 -23
- package/dist/src/envman/shim.d.ts +0 -16
- package/dist/src/envman/shim.d.ts.map +0 -1
- package/dist/src/envman/shim.js +0 -66
- package/dist/src/envman/types.d.ts +0 -55
- package/dist/src/envman/types.d.ts.map +0 -1
- package/dist/src/envman/types.js +0 -12
- package/dist/src/lib.d.ts +0 -33
- package/dist/src/lib.d.ts.map +0 -1
- package/dist/src/lib.js +0 -37
- package/dist/src/pipeline.d.ts +0 -3
- package/dist/src/pipeline.d.ts.map +0 -1
- package/dist/src/pipeline.js +0 -57
- package/dist/src/runner-node-step.test.d.ts +0 -12
- package/dist/src/runner-node-step.test.d.ts.map +0 -1
- package/dist/src/runner-node-step.test.js +0 -61
- package/dist/src/runner.d.ts +0 -31
- package/dist/src/runner.d.ts.map +0 -1
- package/dist/src/runner.js +0 -240
- package/dist/src/shared/detect-project.d.ts +0 -57
- package/dist/src/shared/detect-project.d.ts.map +0 -1
- package/dist/src/shared/detect-project.js +0 -219
- package/dist/src/shared/detect-project.test.d.ts +0 -2
- package/dist/src/shared/detect-project.test.d.ts.map +0 -1
- package/dist/src/shared/detect-project.test.js +0 -161
- package/dist/src/shared/git.d.ts +0 -25
- package/dist/src/shared/git.d.ts.map +0 -1
- package/dist/src/shared/git.js +0 -53
- package/dist/src/shared/git.test.d.ts +0 -9
- package/dist/src/shared/git.test.d.ts.map +0 -1
- package/dist/src/shared/git.test.js +0 -66
- package/dist/src/shared/gitignore.d.ts +0 -6
- package/dist/src/shared/gitignore.d.ts.map +0 -1
- package/dist/src/shared/gitignore.js +0 -26
- package/dist/src/shared/gradle-settings.d.ts +0 -49
- package/dist/src/shared/gradle-settings.d.ts.map +0 -1
- package/dist/src/shared/gradle-settings.js +0 -138
- package/dist/src/shared/gradle-settings.test.d.ts +0 -2
- package/dist/src/shared/gradle-settings.test.d.ts.map +0 -1
- package/dist/src/shared/gradle-settings.test.js +0 -65
- package/dist/src/shared/prompts.d.ts +0 -30
- package/dist/src/shared/prompts.d.ts.map +0 -1
- package/dist/src/shared/prompts.js +0 -121
- package/dist/src/shared/xcode-container.test.d.ts +0 -2
- package/dist/src/shared/xcode-container.test.d.ts.map +0 -1
- package/dist/src/shared/xcode-container.test.js +0 -123
- package/dist/src/step-marker.d.ts +0 -12
- package/dist/src/step-marker.d.ts.map +0 -1
- package/dist/src/step-marker.js +0 -29
- package/dist/src/step-marker.test.d.ts +0 -11
- package/dist/src/step-marker.test.d.ts.map +0 -1
- package/dist/src/step-marker.test.js +0 -45
- package/dist/src/types.d.ts +0 -58
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -2
- package/dist/src/yaml/a-cache-path-must-not-swallow-a-credential.test.d.ts +0 -28
- package/dist/src/yaml/a-cache-path-must-not-swallow-a-credential.test.d.ts.map +0 -1
- package/dist/src/yaml/a-cache-path-must-not-swallow-a-credential.test.js +0 -223
- package/dist/src/yaml/a-declared-secret-reaches-the-file-step.test.d.ts +0 -20
- package/dist/src/yaml/a-declared-secret-reaches-the-file-step.test.d.ts.map +0 -1
- package/dist/src/yaml/a-declared-secret-reaches-the-file-step.test.js +0 -201
- package/dist/src/yaml/a-declared-slot-may-name-the-workflow-it-belongs-to.test.d.ts +0 -37
- package/dist/src/yaml/a-declared-slot-may-name-the-workflow-it-belongs-to.test.d.ts.map +0 -1
- package/dist/src/yaml/a-declared-slot-may-name-the-workflow-it-belongs-to.test.js +0 -255
- package/dist/src/yaml/a-missing-credential-is-loud.test.d.ts +0 -32
- package/dist/src/yaml/a-missing-credential-is-loud.test.d.ts.map +0 -1
- package/dist/src/yaml/a-missing-credential-is-loud.test.js +0 -301
- package/dist/src/yaml/a-runtime-requirement-names-a-real-provider.test.d.ts +0 -18
- package/dist/src/yaml/a-runtime-requirement-names-a-real-provider.test.d.ts.map +0 -1
- package/dist/src/yaml/a-runtime-requirement-names-a-real-provider.test.js +0 -66
- package/dist/src/yaml/a-scoped-slot-must-name-a-workflow-the-pipeline-has.test.d.ts +0 -34
- package/dist/src/yaml/a-scoped-slot-must-name-a-workflow-the-pipeline-has.test.d.ts.map +0 -1
- package/dist/src/yaml/a-scoped-slot-must-name-a-workflow-the-pipeline-has.test.js +0 -218
- package/dist/src/yaml/a-value-this-instance-stored-is-a-value-it-has.test.d.ts +0 -27
- package/dist/src/yaml/a-value-this-instance-stored-is-a-value-it-has.test.d.ts.map +0 -1
- package/dist/src/yaml/a-value-this-instance-stored-is-a-value-it-has.test.js +0 -126
- package/dist/src/yaml/bitrise-compat.d.ts +0 -65
- package/dist/src/yaml/bitrise-compat.d.ts.map +0 -1
- package/dist/src/yaml/bitrise-compat.js +0 -206
- package/dist/src/yaml/bitrise-compat.test.d.ts +0 -5
- package/dist/src/yaml/bitrise-compat.test.d.ts.map +0 -1
- package/dist/src/yaml/bitrise-compat.test.js +0 -347
- package/dist/src/yaml/cache-key-missing-file.test.d.ts +0 -12
- package/dist/src/yaml/cache-key-missing-file.test.d.ts.map +0 -1
- package/dist/src/yaml/cache-key-missing-file.test.js +0 -116
- package/dist/src/yaml/converter.d.ts +0 -103
- package/dist/src/yaml/converter.d.ts.map +0 -1
- package/dist/src/yaml/converter.js +0 -420
- package/dist/src/yaml/converter.test.d.ts +0 -5
- package/dist/src/yaml/converter.test.d.ts.map +0 -1
- package/dist/src/yaml/converter.test.js +0 -548
- package/dist/src/yaml/e2e.test.d.ts +0 -6
- package/dist/src/yaml/e2e.test.d.ts.map +0 -1
- package/dist/src/yaml/e2e.test.js +0 -446
- package/dist/src/yaml/env-resolver.d.ts +0 -218
- package/dist/src/yaml/env-resolver.d.ts.map +0 -1
- package/dist/src/yaml/env-resolver.js +0 -591
- package/dist/src/yaml/env-resolver.test.d.ts +0 -5
- package/dist/src/yaml/env-resolver.test.d.ts.map +0 -1
- package/dist/src/yaml/env-resolver.test.js +0 -502
- package/dist/src/yaml/every-build-log-witnesses-the-commit-on-disk.test.d.ts +0 -16
- package/dist/src/yaml/every-build-log-witnesses-the-commit-on-disk.test.d.ts.map +0 -1
- package/dist/src/yaml/every-build-log-witnesses-the-commit-on-disk.test.js +0 -126
- package/dist/src/yaml/fidelity-input-digest.d.ts +0 -37
- package/dist/src/yaml/fidelity-input-digest.d.ts.map +0 -1
- package/dist/src/yaml/fidelity-input-digest.js +0 -208
- package/dist/src/yaml/fidelity-input-digest.test.d.ts +0 -2
- package/dist/src/yaml/fidelity-input-digest.test.d.ts.map +0 -1
- package/dist/src/yaml/fidelity-input-digest.test.js +0 -167
- package/dist/src/yaml/fidelity-manifest.d.ts +0 -126
- package/dist/src/yaml/fidelity-manifest.d.ts.map +0 -1
- package/dist/src/yaml/fidelity-manifest.js +0 -134
- package/dist/src/yaml/fidelity-manifest.test.d.ts +0 -12
- package/dist/src/yaml/fidelity-manifest.test.d.ts.map +0 -1
- package/dist/src/yaml/fidelity-manifest.test.js +0 -251
- package/dist/src/yaml/interactive-prompts.d.ts +0 -71
- package/dist/src/yaml/interactive-prompts.d.ts.map +0 -1
- package/dist/src/yaml/interactive-prompts.js +0 -260
- package/dist/src/yaml/meta-helpers.d.ts +0 -28
- package/dist/src/yaml/meta-helpers.d.ts.map +0 -1
- package/dist/src/yaml/meta-helpers.js +0 -46
- package/dist/src/yaml/missing-env-handler.d.ts +0 -45
- package/dist/src/yaml/missing-env-handler.d.ts.map +0 -1
- package/dist/src/yaml/missing-env-handler.js +0 -64
- package/dist/src/yaml/parser.d.ts +0 -33
- package/dist/src/yaml/parser.d.ts.map +0 -1
- package/dist/src/yaml/parser.js +0 -148
- package/dist/src/yaml/parser.test.d.ts +0 -5
- package/dist/src/yaml/parser.test.d.ts.map +0 -1
- package/dist/src/yaml/parser.test.js +0 -83
- package/dist/src/yaml/pipeline-with-secrets.d.ts +0 -25
- package/dist/src/yaml/pipeline-with-secrets.d.ts.map +0 -1
- package/dist/src/yaml/pipeline-with-secrets.js +0 -76
- package/dist/src/yaml/platform-detector.d.ts +0 -83
- package/dist/src/yaml/platform-detector.d.ts.map +0 -1
- package/dist/src/yaml/platform-detector.js +0 -189
- package/dist/src/yaml/platform-detector.test.d.ts +0 -5
- package/dist/src/yaml/platform-detector.test.d.ts.map +0 -1
- package/dist/src/yaml/platform-detector.test.js +0 -525
- package/dist/src/yaml/preflight-validation.d.ts +0 -29
- package/dist/src/yaml/preflight-validation.d.ts.map +0 -1
- package/dist/src/yaml/preflight-validation.js +0 -21
- package/dist/src/yaml/secrets-manager.d.ts +0 -87
- package/dist/src/yaml/secrets-manager.d.ts.map +0 -1
- package/dist/src/yaml/secrets-manager.js +0 -230
- package/dist/src/yaml/shell-assignments.d.ts +0 -40
- package/dist/src/yaml/shell-assignments.d.ts.map +0 -1
- package/dist/src/yaml/shell-assignments.js +0 -77
- package/dist/src/yaml/step-validator-check-failure.test.d.ts +0 -24
- package/dist/src/yaml/step-validator-check-failure.test.d.ts.map +0 -1
- package/dist/src/yaml/step-validator-check-failure.test.js +0 -130
- package/dist/src/yaml/step-validator-self-assigned.test.d.ts +0 -23
- package/dist/src/yaml/step-validator-self-assigned.test.d.ts.map +0 -1
- package/dist/src/yaml/step-validator-self-assigned.test.js +0 -191
- package/dist/src/yaml/step-validator.d.ts +0 -67
- package/dist/src/yaml/step-validator.d.ts.map +0 -1
- package/dist/src/yaml/step-validator.js +0 -466
- package/dist/src/yaml/step-validator.test.d.ts +0 -18
- package/dist/src/yaml/step-validator.test.d.ts.map +0 -1
- package/dist/src/yaml/step-validator.test.js +0 -140
- package/dist/src/yaml/steps/android-sign.d.ts +0 -35
- package/dist/src/yaml/steps/android-sign.d.ts.map +0 -1
- package/dist/src/yaml/steps/android-sign.js +0 -147
- package/dist/src/yaml/steps/android-variant-resolution.test.d.ts +0 -2
- package/dist/src/yaml/steps/android-variant-resolution.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/android-variant-resolution.test.js +0 -260
- package/dist/src/yaml/steps/android-version.d.ts +0 -26
- package/dist/src/yaml/steps/android-version.d.ts.map +0 -1
- package/dist/src/yaml/steps/android-version.js +0 -128
- package/dist/src/yaml/steps/android-version.test.d.ts +0 -5
- package/dist/src/yaml/steps/android-version.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/android-version.test.js +0 -196
- package/dist/src/yaml/steps/android.d.ts +0 -156
- package/dist/src/yaml/steps/android.d.ts.map +0 -1
- package/dist/src/yaml/steps/android.js +0 -1084
- package/dist/src/yaml/steps/app-store-deploy.d.ts +0 -48
- package/dist/src/yaml/steps/app-store-deploy.d.ts.map +0 -1
- package/dist/src/yaml/steps/app-store-deploy.js +0 -167
- package/dist/src/yaml/steps/base.d.ts +0 -263
- package/dist/src/yaml/steps/base.d.ts.map +0 -1
- package/dist/src/yaml/steps/base.js +0 -380
- package/dist/src/yaml/steps/bitrise-android-tools.d.ts +0 -26
- package/dist/src/yaml/steps/bitrise-android-tools.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-android-tools.js +0 -200
- package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts +0 -5
- package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-android-tools.test.js +0 -280
- package/dist/src/yaml/steps/bitrise-apk-info.d.ts +0 -22
- package/dist/src/yaml/steps/bitrise-apk-info.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-apk-info.js +0 -144
- package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts +0 -5
- package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-apk-info.test.js +0 -331
- package/dist/src/yaml/steps/bitrise-slack.d.ts +0 -49
- package/dist/src/yaml/steps/bitrise-slack.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-slack.js +0 -280
- package/dist/src/yaml/steps/bitrise-slack.test.d.ts +0 -5
- package/dist/src/yaml/steps/bitrise-slack.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-slack.test.js +0 -484
- package/dist/src/yaml/steps/bitrise-ssh.d.ts +0 -27
- package/dist/src/yaml/steps/bitrise-ssh.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-ssh.js +0 -134
- package/dist/src/yaml/steps/bitrise-ssh.test.d.ts +0 -5
- package/dist/src/yaml/steps/bitrise-ssh.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-ssh.test.js +0 -205
- package/dist/src/yaml/steps/cache-pull-daemon.test.d.ts +0 -27
- package/dist/src/yaml/steps/cache-pull-daemon.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cache-pull-daemon.test.js +0 -212
- package/dist/src/yaml/steps/cache-pull-restore-roots.test.d.ts +0 -42
- package/dist/src/yaml/steps/cache-pull-restore-roots.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cache-pull-restore-roots.test.js +0 -209
- package/dist/src/yaml/steps/cache-push-daemon.test.d.ts +0 -27
- package/dist/src/yaml/steps/cache-push-daemon.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cache-push-daemon.test.js +0 -171
- package/dist/src/yaml/steps/cache.d.ts +0 -59
- package/dist/src/yaml/steps/cache.d.ts.map +0 -1
- package/dist/src/yaml/steps/cache.js +0 -1027
- package/dist/src/yaml/steps/cocoapods-deployment-floor.d.ts +0 -42
- package/dist/src/yaml/steps/cocoapods-deployment-floor.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-deployment-floor.js +0 -140
- package/dist/src/yaml/steps/cocoapods-deployment-floor.test.d.ts +0 -11
- package/dist/src/yaml/steps/cocoapods-deployment-floor.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-deployment-floor.test.js +0 -176
- package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.d.ts +0 -22
- package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.js +0 -97
- package/dist/src/yaml/steps/cocoapods-locked-bundler.test.d.ts +0 -17
- package/dist/src/yaml/steps/cocoapods-locked-bundler.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-locked-bundler.test.js +0 -282
- package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.d.ts +0 -17
- package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.js +0 -132
- package/dist/src/yaml/steps/envstore-loader.test.d.ts +0 -15
- package/dist/src/yaml/steps/envstore-loader.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/envstore-loader.test.js +0 -143
- package/dist/src/yaml/steps/fastlane.d.ts +0 -27
- package/dist/src/yaml/steps/fastlane.d.ts.map +0 -1
- package/dist/src/yaml/steps/fastlane.js +0 -79
- package/dist/src/yaml/steps/fidelity-aspect-guard.d.ts +0 -53
- package/dist/src/yaml/steps/fidelity-aspect-guard.d.ts.map +0 -1
- package/dist/src/yaml/steps/fidelity-aspect-guard.js +0 -72
- package/dist/src/yaml/steps/fidelity-aspect-guard.test.d.ts +0 -11
- package/dist/src/yaml/steps/fidelity-aspect-guard.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/fidelity-aspect-guard.test.js +0 -50
- package/dist/src/yaml/steps/fidelity-reference-provenance.d.ts +0 -87
- package/dist/src/yaml/steps/fidelity-reference-provenance.d.ts.map +0 -1
- package/dist/src/yaml/steps/fidelity-reference-provenance.js +0 -111
- package/dist/src/yaml/steps/fidelity-reference-provenance.test.d.ts +0 -22
- package/dist/src/yaml/steps/fidelity-reference-provenance.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/fidelity-reference-provenance.test.js +0 -118
- package/dist/src/yaml/steps/file.d.ts +0 -52
- package/dist/src/yaml/steps/file.d.ts.map +0 -1
- package/dist/src/yaml/steps/file.js +0 -108
- package/dist/src/yaml/steps/flutter.d.ts +0 -63
- package/dist/src/yaml/steps/flutter.d.ts.map +0 -1
- package/dist/src/yaml/steps/flutter.js +0 -215
- package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.d.ts +0 -16
- package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.js +0 -127
- package/dist/src/yaml/steps/git-clone.d.ts +0 -32
- package/dist/src/yaml/steps/git-clone.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-clone.js +0 -171
- package/dist/src/yaml/steps/git-fetch-retry-exec.test.d.ts +0 -10
- package/dist/src/yaml/steps/git-fetch-retry-exec.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-fetch-retry-exec.test.js +0 -162
- package/dist/src/yaml/steps/git-fetch-retry.d.ts +0 -62
- package/dist/src/yaml/steps/git-fetch-retry.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-fetch-retry.js +0 -155
- package/dist/src/yaml/steps/git-fetch-retry.test.d.ts +0 -5
- package/dist/src/yaml/steps/git-fetch-retry.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-fetch-retry.test.js +0 -86
- package/dist/src/yaml/steps/google-play-deploy.d.ts +0 -37
- package/dist/src/yaml/steps/google-play-deploy.d.ts.map +0 -1
- package/dist/src/yaml/steps/google-play-deploy.js +0 -193
- package/dist/src/yaml/steps/google-play-deploy.test.d.ts +0 -5
- package/dist/src/yaml/steps/google-play-deploy.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/google-play-deploy.test.js +0 -310
- package/dist/src/yaml/steps/gradle-memory.d.ts +0 -61
- package/dist/src/yaml/steps/gradle-memory.d.ts.map +0 -1
- package/dist/src/yaml/steps/gradle-memory.js +0 -311
- package/dist/src/yaml/steps/gradle-memory.test.d.ts +0 -2
- package/dist/src/yaml/steps/gradle-memory.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/gradle-memory.test.js +0 -297
- package/dist/src/yaml/steps/gradle-sdk-cmake.d.ts +0 -28
- package/dist/src/yaml/steps/gradle-sdk-cmake.d.ts.map +0 -1
- package/dist/src/yaml/steps/gradle-sdk-cmake.js +0 -107
- package/dist/src/yaml/steps/gradle-sdk-cmake.test.d.ts +0 -2
- package/dist/src/yaml/steps/gradle-sdk-cmake.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/gradle-sdk-cmake.test.js +0 -183
- package/dist/src/yaml/steps/index.d.ts +0 -10
- package/dist/src/yaml/steps/index.d.ts.map +0 -1
- package/dist/src/yaml/steps/index.js +0 -1461
- package/dist/src/yaml/steps/ios-deps.d.ts +0 -78
- package/dist/src/yaml/steps/ios-deps.d.ts.map +0 -1
- package/dist/src/yaml/steps/ios-deps.js +0 -279
- package/dist/src/yaml/steps/ios-deps.test.d.ts +0 -5
- package/dist/src/yaml/steps/ios-deps.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ios-deps.test.js +0 -90
- package/dist/src/yaml/steps/ios-signing.d.ts +0 -31
- package/dist/src/yaml/steps/ios-signing.d.ts.map +0 -1
- package/dist/src/yaml/steps/ios-signing.js +0 -144
- package/dist/src/yaml/steps/ios-version.d.ts +0 -47
- package/dist/src/yaml/steps/ios-version.d.ts.map +0 -1
- package/dist/src/yaml/steps/ios-version.js +0 -151
- package/dist/src/yaml/steps/java-home-version-spec.test.d.ts +0 -10
- package/dist/src/yaml/steps/java-home-version-spec.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/java-home-version-spec.test.js +0 -58
- package/dist/src/yaml/steps/linting.d.ts +0 -47
- package/dist/src/yaml/steps/linting.d.ts.map +0 -1
- package/dist/src/yaml/steps/linting.js +0 -148
- package/dist/src/yaml/steps/phase2.test.d.ts +0 -6
- package/dist/src/yaml/steps/phase2.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/phase2.test.js +0 -197
- package/dist/src/yaml/steps/phase3.test.d.ts +0 -5
- package/dist/src/yaml/steps/phase3.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/phase3.test.js +0 -144
- package/dist/src/yaml/steps/phase4.test.d.ts +0 -5
- package/dist/src/yaml/steps/phase4.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/phase4.test.js +0 -166
- package/dist/src/yaml/steps/phase5.test.d.ts +0 -6
- package/dist/src/yaml/steps/phase5.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/phase5.test.js +0 -263
- package/dist/src/yaml/steps/registry.d.ts +0 -88
- package/dist/src/yaml/steps/registry.d.ts.map +0 -1
- package/dist/src/yaml/steps/registry.js +0 -125
- package/dist/src/yaml/steps/registry.test.d.ts +0 -5
- package/dist/src/yaml/steps/registry.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/registry.test.js +0 -235
- package/dist/src/yaml/steps/release.d.ts +0 -50
- package/dist/src/yaml/steps/release.d.ts.map +0 -1
- package/dist/src/yaml/steps/release.js +0 -154
- package/dist/src/yaml/steps/render-post-processor.d.ts +0 -100
- package/dist/src/yaml/steps/render-post-processor.d.ts.map +0 -1
- package/dist/src/yaml/steps/render-post-processor.js +0 -270
- package/dist/src/yaml/steps/render-post-processor.test.d.ts +0 -13
- package/dist/src/yaml/steps/render-post-processor.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/render-post-processor.test.js +0 -220
- package/dist/src/yaml/steps/script.d.ts +0 -23
- package/dist/src/yaml/steps/script.d.ts.map +0 -1
- package/dist/src/yaml/steps/script.js +0 -63
- package/dist/src/yaml/steps/spec-validation.test.d.ts +0 -6
- package/dist/src/yaml/steps/spec-validation.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/spec-validation.test.js +0 -130
- package/dist/src/yaml/steps/steps.test.d.ts +0 -6
- package/dist/src/yaml/steps/steps.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/steps.test.js +0 -881
- package/dist/src/yaml/steps/structural-facts.d.ts +0 -992
- package/dist/src/yaml/steps/structural-facts.d.ts.map +0 -1
- package/dist/src/yaml/steps/structural-facts.js +0 -3276
- package/dist/src/yaml/steps/structural-facts.test.d.ts +0 -12
- package/dist/src/yaml/steps/structural-facts.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/structural-facts.test.js +0 -3039
- package/dist/src/yaml/steps/test-config.d.ts +0 -5
- package/dist/src/yaml/steps/test-config.d.ts.map +0 -1
- package/dist/src/yaml/steps/test-config.js +0 -25
- package/dist/src/yaml/steps/trim-align-corpus.test.d.ts +0 -28
- package/dist/src/yaml/steps/trim-align-corpus.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/trim-align-corpus.test.js +0 -383
- package/dist/src/yaml/steps/trim-align.d.ts +0 -87
- package/dist/src/yaml/steps/trim-align.d.ts.map +0 -1
- package/dist/src/yaml/steps/trim-align.js +0 -367
- package/dist/src/yaml/steps/trim-align.test.d.ts +0 -11
- package/dist/src/yaml/steps/trim-align.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/trim-align.test.js +0 -261
- package/dist/src/yaml/steps/ui-fidelity-preview-android.d.ts +0 -66
- package/dist/src/yaml/steps/ui-fidelity-preview-android.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-preview-android.js +0 -251
- package/dist/src/yaml/steps/ui-fidelity-preview-android.test.d.ts +0 -13
- package/dist/src/yaml/steps/ui-fidelity-preview-android.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-preview-android.test.js +0 -302
- package/dist/src/yaml/steps/ui-fidelity-preview.d.ts +0 -134
- package/dist/src/yaml/steps/ui-fidelity-preview.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-preview.js +0 -173
- package/dist/src/yaml/steps/ui-fidelity-preview.test.d.ts +0 -11
- package/dist/src/yaml/steps/ui-fidelity-preview.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-preview.test.js +0 -210
- package/dist/src/yaml/steps/ui-fidelity-render-android.d.ts +0 -155
- package/dist/src/yaml/steps/ui-fidelity-render-android.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-render-android.js +0 -1389
- package/dist/src/yaml/steps/ui-fidelity-render-android.test.d.ts +0 -2
- package/dist/src/yaml/steps/ui-fidelity-render-android.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-render-android.test.js +0 -1106
- package/dist/src/yaml/steps/ui-fidelity-render.d.ts +0 -230
- package/dist/src/yaml/steps/ui-fidelity-render.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-render.js +0 -1597
- package/dist/src/yaml/steps/ui-fidelity-render.test.d.ts +0 -18
- package/dist/src/yaml/steps/ui-fidelity-render.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-render.test.js +0 -1871
- package/dist/src/yaml/steps/xcode-app-product.d.ts +0 -90
- package/dist/src/yaml/steps/xcode-app-product.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-app-product.js +0 -247
- package/dist/src/yaml/steps/xcode-app-product.test.d.ts +0 -2
- package/dist/src/yaml/steps/xcode-app-product.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-app-product.test.js +0 -202
- package/dist/src/yaml/steps/xcode-derived-data.test.d.ts +0 -30
- package/dist/src/yaml/steps/xcode-derived-data.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-derived-data.test.js +0 -253
- package/dist/src/yaml/steps/xcode-destination.d.ts +0 -47
- package/dist/src/yaml/steps/xcode-destination.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-destination.js +0 -202
- package/dist/src/yaml/steps/xcode-destination.test.d.ts +0 -9
- package/dist/src/yaml/steps/xcode-destination.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-destination.test.js +0 -227
- package/dist/src/yaml/steps/xcode-new.test.d.ts +0 -5
- package/dist/src/yaml/steps/xcode-new.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-new.test.js +0 -211
- package/dist/src/yaml/steps/xcode-resolve-retry.test.d.ts +0 -9
- package/dist/src/yaml/steps/xcode-resolve-retry.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-resolve-retry.test.js +0 -146
- package/dist/src/yaml/steps/xcode-simulator-archs.d.ts +0 -53
- package/dist/src/yaml/steps/xcode-simulator-archs.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-simulator-archs.js +0 -98
- package/dist/src/yaml/steps/xcode-simulator-archs.test.d.ts +0 -21
- package/dist/src/yaml/steps/xcode-simulator-archs.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-simulator-archs.test.js +0 -155
- package/dist/src/yaml/steps/xcode.d.ts +0 -230
- package/dist/src/yaml/steps/xcode.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode.js +0 -1340
- package/dist/src/yaml/types.d.ts +0 -76
- package/dist/src/yaml/types.d.ts.map +0 -1
- package/dist/src/yaml/types.js +0 -5
- package/dist/src/yaml/validation-types.d.ts +0 -102
- package/dist/src/yaml/validation-types.d.ts.map +0 -1
- package/dist/src/yaml/validation-types.js +0 -8
- package/dist/src/yaml/yaml-updater.d.ts +0 -24
- package/dist/src/yaml/yaml-updater.d.ts.map +0 -1
- package/dist/src/yaml/yaml-updater.js +0 -128
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What makes a Gradle repository a Kotlin Multiplatform one.
|
|
3
|
-
*
|
|
4
|
-
* The old rule was three directory names — `iosApp`, `shared`, `composeApp`
|
|
5
|
-
* — and it was wrong in both directions. Two of the ten KMM apps in the
|
|
6
|
-
* thirty-app study use none of those names and were detected `android`
|
|
7
|
-
* (`joreilly/PeopleInSpace` keeps its iOS app in `PeopleInSpaceSwiftUI/` and
|
|
8
|
-
* its shared code in `common`; `openMF/mifos-pay` uses `cmp-ios` and
|
|
9
|
-
* `cmp-shared`). In the other direction, an Android-only project with a
|
|
10
|
-
* `shared` module was called KMM and handed a pipeline that builds an iOS app
|
|
11
|
-
* it does not have.
|
|
12
|
-
*/
|
|
13
|
-
import { mkdtempSync, rmSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
14
|
-
import { dirname, join } from "node:path";
|
|
15
|
-
import { tmpdir } from "node:os";
|
|
16
|
-
import { fileURLToPath } from "node:url";
|
|
17
|
-
import { detectMobileProjectRoot } from "./detect-project.js";
|
|
18
|
-
let root;
|
|
19
|
-
beforeEach(() => {
|
|
20
|
-
root = mkdtempSync(join(tmpdir(), "cibuild-detect-"));
|
|
21
|
-
});
|
|
22
|
-
afterEach(() => {
|
|
23
|
-
rmSync(root, { recursive: true, force: true });
|
|
24
|
-
});
|
|
25
|
-
function write(relative, content) {
|
|
26
|
-
const path = join(root, relative);
|
|
27
|
-
mkdirSync(join(path, ".."), { recursive: true });
|
|
28
|
-
writeFileSync(path, content);
|
|
29
|
-
}
|
|
30
|
-
function settings(...modules) {
|
|
31
|
-
write("settings.gradle.kts", `include(${modules.map((m) => `":${m}"`).join(", ")})\n`);
|
|
32
|
-
}
|
|
33
|
-
const KMP = 'plugins { kotlin("multiplatform") }\n';
|
|
34
|
-
const ANDROID_APP = 'plugins { id("com.android.application") }\n';
|
|
35
|
-
const ANDROID_LIB = 'plugins { id("com.android.library") }\n';
|
|
36
|
-
/** An Xcode project is a directory, not a file. */
|
|
37
|
-
function xcodeProject(dir, name) {
|
|
38
|
-
mkdirSync(join(root, dir, `${name}.xcodeproj`), { recursive: true });
|
|
39
|
-
writeFileSync(join(root, dir, `${name}.xcodeproj`, "project.pbxproj"), "// stub\n");
|
|
40
|
-
}
|
|
41
|
-
describe("detectMobileProjectRoot", () => {
|
|
42
|
-
describe("Kotlin Multiplatform", () => {
|
|
43
|
-
test("a multiplatform module and an iOS app one level down is KMM", () => {
|
|
44
|
-
settings("common", "app");
|
|
45
|
-
write("common/build.gradle.kts", KMP);
|
|
46
|
-
write("app/build.gradle.kts", ANDROID_APP);
|
|
47
|
-
xcodeProject("PeopleInSpaceSwiftUI", "PeopleInSpaceSwiftUI");
|
|
48
|
-
expect(detectMobileProjectRoot(root)).toBe("kmm");
|
|
49
|
-
});
|
|
50
|
-
test("a CocoaPods Podfile is an Apple consumer too", () => {
|
|
51
|
-
settings("cmp-shared", "cmp-android");
|
|
52
|
-
write("cmp-shared/build.gradle.kts", KMP);
|
|
53
|
-
write("cmp-android/build.gradle.kts", ANDROID_APP);
|
|
54
|
-
write("cmp-ios/Podfile", "pod 'cmp_shared', :path => '../cmp-shared'\n");
|
|
55
|
-
expect(detectMobileProjectRoot(root)).toBe("kmm");
|
|
56
|
-
});
|
|
57
|
-
test("an XcodeGen spec is an Apple consumer, project or no project", () => {
|
|
58
|
-
settings("shared", "androidApp");
|
|
59
|
-
write("shared/build.gradle.kts", KMP);
|
|
60
|
-
write("androidApp/build.gradle.kts", ANDROID_APP);
|
|
61
|
-
write("iosApp/project.yml", "name: FeedFlow\ntargets:\n FeedFlow:\n");
|
|
62
|
-
expect(detectMobileProjectRoot(root)).toBe("kmm");
|
|
63
|
-
});
|
|
64
|
-
test("the conventional names still work, when they are true", () => {
|
|
65
|
-
settings("shared", "androidApp");
|
|
66
|
-
write("shared/build.gradle.kts", KMP);
|
|
67
|
-
write("androidApp/build.gradle.kts", ANDROID_APP);
|
|
68
|
-
xcodeProject("iosApp", "iosApp");
|
|
69
|
-
expect(detectMobileProjectRoot(root)).toBe("kmm");
|
|
70
|
-
});
|
|
71
|
-
// The build files of garfiec/Librechat-Mobile's `:shared` and
|
|
72
|
-
// openMF/mifos-mobile's `:cmp-shared` at their pins. Each applies Kotlin
|
|
73
|
-
// Multiplatform only through a convention plugin, and declares Apple
|
|
74
|
-
// targets in its own file.
|
|
75
|
-
const APPLE_TARGETS = join(dirname(fileURLToPath(import.meta.url)), "../../test/fixtures/kotlin-native-apple-targets");
|
|
76
|
-
const appleTargets = (name) => readFileSync(join(APPLE_TARGETS, name), "utf-8");
|
|
77
|
-
test("Kotlin/Native Apple targets behind a convention plugin are KMM (Librechat-Mobile)", () => {
|
|
78
|
-
settings("app", "core:common", "shared");
|
|
79
|
-
write("shared/build.gradle.kts", appleTargets("librechat-mobile.shared.build.gradle.kts"));
|
|
80
|
-
write("app/build.gradle.kts", ANDROID_APP);
|
|
81
|
-
write("core/common/build.gradle.kts", 'plugins { id("librechat.kmp.library") }\n');
|
|
82
|
-
xcodeProject("iosApp", "iosApp");
|
|
83
|
-
expect(detectMobileProjectRoot(root)).toBe("kmm");
|
|
84
|
-
});
|
|
85
|
-
test("Kotlin/Native Apple targets behind a convention plugin are KMM (mifos-mobile)", () => {
|
|
86
|
-
settings("cmp-android", "cmp-shared");
|
|
87
|
-
write("cmp-shared/build.gradle.kts", appleTargets("mifos-mobile.cmp-shared.build.gradle.kts"));
|
|
88
|
-
write("cmp-android/build.gradle.kts", ANDROID_APP);
|
|
89
|
-
xcodeProject("cmp-ios", "iosApp");
|
|
90
|
-
expect(detectMobileProjectRoot(root)).toBe("kmm");
|
|
91
|
-
});
|
|
92
|
-
test("a nested multiplatform module counts", () => {
|
|
93
|
-
settings("core:domain", "app");
|
|
94
|
-
write("core/domain/build.gradle.kts", KMP);
|
|
95
|
-
write("app/build.gradle.kts", ANDROID_APP);
|
|
96
|
-
xcodeProject("iosApp", "iosApp");
|
|
97
|
-
expect(detectMobileProjectRoot(root)).toBe("kmm");
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
describe("Android", () => {
|
|
101
|
-
// The correction the closed study asked for (C3): a repository with
|
|
102
|
-
// multiplatform modules and no Apple side builds with the Android
|
|
103
|
-
// template, and a KMM pipeline would aim an xcodebuild step at nothing.
|
|
104
|
-
test("multiplatform modules with no Apple consumer is Android", () => {
|
|
105
|
-
settings("shared", "app");
|
|
106
|
-
write("shared/build.gradle.kts", 'plugins { kotlin("multiplatform") }\nkotlin { androidTarget()\n jvm() }\n');
|
|
107
|
-
write("app/build.gradle.kts", ANDROID_APP);
|
|
108
|
-
expect(detectMobileProjectRoot(root)).toBe("android");
|
|
109
|
-
});
|
|
110
|
-
// The false positive the three directory names caused.
|
|
111
|
-
test("an iosApp folder beside modules with no Apple target and no KMP plugin is Android", () => {
|
|
112
|
-
settings("app", "shared");
|
|
113
|
-
write("app/build.gradle.kts", ANDROID_APP);
|
|
114
|
-
write("shared/build.gradle.kts", 'plugins { id("com.android.library") }\n// iosArm64() once lived here\nval note = "iosX64()"\n');
|
|
115
|
-
xcodeProject("iosApp", "iosApp");
|
|
116
|
-
expect(detectMobileProjectRoot(root)).toBe("android");
|
|
117
|
-
});
|
|
118
|
-
test("an Apple target with no Apple consumer is still Android", () => {
|
|
119
|
-
settings("shared", "app");
|
|
120
|
-
write("shared/build.gradle.kts", "kotlin { iosArm64() }\n");
|
|
121
|
-
write("app/build.gradle.kts", ANDROID_APP);
|
|
122
|
-
expect(detectMobileProjectRoot(root)).toBe("android");
|
|
123
|
-
});
|
|
124
|
-
test("a module merely named shared is not multiplatform", () => {
|
|
125
|
-
settings("shared", "app");
|
|
126
|
-
write("shared/build.gradle.kts", ANDROID_LIB);
|
|
127
|
-
write("app/build.gradle.kts", ANDROID_APP);
|
|
128
|
-
xcodeProject("iosApp", "iosApp");
|
|
129
|
-
expect(detectMobileProjectRoot(root)).toBe("android");
|
|
130
|
-
});
|
|
131
|
-
test("a plain Android repository is unchanged", () => {
|
|
132
|
-
settings("app");
|
|
133
|
-
write("app/build.gradle.kts", ANDROID_APP);
|
|
134
|
-
write("gradlew", "#!/bin/sh\n");
|
|
135
|
-
expect(detectMobileProjectRoot(root)).toBe("android");
|
|
136
|
-
});
|
|
137
|
-
// Build output and dependency caches hold copies of Xcode projects.
|
|
138
|
-
test("an Xcode project in build output is not an Apple consumer", () => {
|
|
139
|
-
settings("shared", "app");
|
|
140
|
-
write("shared/build.gradle.kts", KMP);
|
|
141
|
-
write("app/build.gradle.kts", ANDROID_APP);
|
|
142
|
-
xcodeProject("build", "Stale");
|
|
143
|
-
xcodeProject("Pods", "Pods");
|
|
144
|
-
expect(detectMobileProjectRoot(root)).toBe("android");
|
|
145
|
-
});
|
|
146
|
-
});
|
|
147
|
-
describe("iOS and nothing", () => {
|
|
148
|
-
test("an Xcode project with no Gradle is iOS", () => {
|
|
149
|
-
xcodeProject(".", "App");
|
|
150
|
-
expect(detectMobileProjectRoot(root)).toBe("ios");
|
|
151
|
-
});
|
|
152
|
-
test("a Podfile with no Gradle is iOS", () => {
|
|
153
|
-
write("Podfile", "target 'App' do\nend\n");
|
|
154
|
-
expect(detectMobileProjectRoot(root)).toBe("ios");
|
|
155
|
-
});
|
|
156
|
-
test("an empty directory is nothing", () => {
|
|
157
|
-
expect(detectMobileProjectRoot(root)).toBeNull();
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
//# sourceMappingURL=detect-project.test.js.map
|
package/dist/src/shared/git.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Git probes used while scaffolding a pipeline.
|
|
3
|
-
*
|
|
4
|
-
* Scaffolding runs inside the user's checkout, so the repository itself is
|
|
5
|
-
* the best available source of truth for values the generated YAML has to
|
|
6
|
-
* hardcode. Everything here is best-effort: a scaffold must still succeed in
|
|
7
|
-
* a directory that is not a git repository at all.
|
|
8
|
-
*/
|
|
9
|
-
/** What we key a `trigger_map` to when git can't tell us anything better. */
|
|
10
|
-
export declare const FALLBACK_DEFAULT_BRANCH = "main";
|
|
11
|
-
/**
|
|
12
|
-
* The branch a generated `trigger_map` should build on push.
|
|
13
|
-
*
|
|
14
|
-
* Order matters. The remote's HEAD is what GitHub calls the repository's
|
|
15
|
-
* default branch, and it is what the webhook will report on a merge — so it
|
|
16
|
-
* wins over whatever happens to be checked out. Only when there is no remote
|
|
17
|
-
* (a repo that has not been pushed anywhere yet) do we fall back to the
|
|
18
|
-
* current branch, and only when that is unavailable too — no repo, or a
|
|
19
|
-
* detached HEAD — do we guess.
|
|
20
|
-
*
|
|
21
|
-
* Guessing wrong is not silent: the pipeline is written to disk where the
|
|
22
|
-
* user can read and correct the branch before committing it.
|
|
23
|
-
*/
|
|
24
|
-
export declare function detectDefaultBranch(cwd?: string): string;
|
|
25
|
-
//# sourceMappingURL=git.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../src/shared/git.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,6EAA6E;AAC7E,eAAO,MAAM,uBAAuB,SAAS,CAAC;AAc9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CAevE"}
|
package/dist/src/shared/git.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Git probes used while scaffolding a pipeline.
|
|
3
|
-
*
|
|
4
|
-
* Scaffolding runs inside the user's checkout, so the repository itself is
|
|
5
|
-
* the best available source of truth for values the generated YAML has to
|
|
6
|
-
* hardcode. Everything here is best-effort: a scaffold must still succeed in
|
|
7
|
-
* a directory that is not a git repository at all.
|
|
8
|
-
*/
|
|
9
|
-
import { execFileSync } from 'node:child_process';
|
|
10
|
-
/** What we key a `trigger_map` to when git can't tell us anything better. */
|
|
11
|
-
export const FALLBACK_DEFAULT_BRANCH = 'main';
|
|
12
|
-
function git(cwd, args) {
|
|
13
|
-
try {
|
|
14
|
-
return execFileSync('git', args, {
|
|
15
|
-
cwd,
|
|
16
|
-
encoding: 'utf8',
|
|
17
|
-
stdio: ['ignore', 'pipe', 'ignore'],
|
|
18
|
-
}).trim();
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* The branch a generated `trigger_map` should build on push.
|
|
26
|
-
*
|
|
27
|
-
* Order matters. The remote's HEAD is what GitHub calls the repository's
|
|
28
|
-
* default branch, and it is what the webhook will report on a merge — so it
|
|
29
|
-
* wins over whatever happens to be checked out. Only when there is no remote
|
|
30
|
-
* (a repo that has not been pushed anywhere yet) do we fall back to the
|
|
31
|
-
* current branch, and only when that is unavailable too — no repo, or a
|
|
32
|
-
* detached HEAD — do we guess.
|
|
33
|
-
*
|
|
34
|
-
* Guessing wrong is not silent: the pipeline is written to disk where the
|
|
35
|
-
* user can read and correct the branch before committing it.
|
|
36
|
-
*/
|
|
37
|
-
export function detectDefaultBranch(cwd = process.cwd()) {
|
|
38
|
-
// `origin/main` → `main`. Absent unless the remote HEAD ref is set locally,
|
|
39
|
-
// which `git clone` does and `git init` does not.
|
|
40
|
-
const remoteHead = git(cwd, ['symbolic-ref', '--short', 'refs/remotes/origin/HEAD']);
|
|
41
|
-
if (remoteHead) {
|
|
42
|
-
const branch = remoteHead.replace(/^origin\//, '').trim();
|
|
43
|
-
if (branch)
|
|
44
|
-
return branch;
|
|
45
|
-
}
|
|
46
|
-
// `--abbrev-ref HEAD` answers the literal string "HEAD" on a detached
|
|
47
|
-
// checkout, which is not a branch name and must not become one.
|
|
48
|
-
const current = git(cwd, ['rev-parse', '--abbrev-ref', 'HEAD']);
|
|
49
|
-
if (current && current !== 'HEAD')
|
|
50
|
-
return current;
|
|
51
|
-
return FALLBACK_DEFAULT_BRANCH;
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=git.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unit tests for the default-branch probe.
|
|
3
|
-
*
|
|
4
|
-
* The probe shells out to git, so these drive it against real throwaway
|
|
5
|
-
* repositories in a temp dir rather than mocking child_process — the whole
|
|
6
|
-
* point of the helper is that it agrees with what git actually reports.
|
|
7
|
-
*/
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=git.test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git.test.d.ts","sourceRoot":"","sources":["../../../src/shared/git.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unit tests for the default-branch probe.
|
|
3
|
-
*
|
|
4
|
-
* The probe shells out to git, so these drive it against real throwaway
|
|
5
|
-
* repositories in a temp dir rather than mocking child_process — the whole
|
|
6
|
-
* point of the helper is that it agrees with what git actually reports.
|
|
7
|
-
*/
|
|
8
|
-
import { describe, test, expect, beforeAll, afterAll } from '@jest/globals';
|
|
9
|
-
import { execFileSync } from 'node:child_process';
|
|
10
|
-
import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
11
|
-
import { tmpdir } from 'node:os';
|
|
12
|
-
import { join } from 'node:path';
|
|
13
|
-
import { detectDefaultBranch } from './git.js';
|
|
14
|
-
function git(cwd, ...args) {
|
|
15
|
-
execFileSync('git', args, { cwd, stdio: 'ignore' });
|
|
16
|
-
}
|
|
17
|
-
/** A repo with one commit on `branch`, and no remote. */
|
|
18
|
-
function makeRepo(root, name, branch) {
|
|
19
|
-
const dir = join(root, name);
|
|
20
|
-
execFileSync('mkdir', ['-p', dir]);
|
|
21
|
-
git(dir, 'init', '--quiet', `--initial-branch=${branch}`);
|
|
22
|
-
git(dir, 'config', 'user.email', 'test@example.com');
|
|
23
|
-
git(dir, 'config', 'user.name', 'Test');
|
|
24
|
-
writeFileSync(join(dir, 'README.md'), '# test\n');
|
|
25
|
-
git(dir, 'add', 'README.md');
|
|
26
|
-
git(dir, 'commit', '--quiet', '-m', 'init');
|
|
27
|
-
return dir;
|
|
28
|
-
}
|
|
29
|
-
describe('detectDefaultBranch', () => {
|
|
30
|
-
let root;
|
|
31
|
-
beforeAll(() => {
|
|
32
|
-
root = mkdtempSync(join(tmpdir(), 'cibuild-git-'));
|
|
33
|
-
});
|
|
34
|
-
afterAll(() => {
|
|
35
|
-
rmSync(root, { recursive: true, force: true });
|
|
36
|
-
});
|
|
37
|
-
test('reads the current branch when there is no remote', () => {
|
|
38
|
-
expect(detectDefaultBranch(makeRepo(root, 'plain', 'main'))).toBe('main');
|
|
39
|
-
});
|
|
40
|
-
test('reads a non-main current branch', () => {
|
|
41
|
-
expect(detectDefaultBranch(makeRepo(root, 'legacy', 'master'))).toBe('master');
|
|
42
|
-
});
|
|
43
|
-
test('prefers the remote HEAD over the checked-out branch', () => {
|
|
44
|
-
// A clone sitting on a topic branch must still key its trigger to the
|
|
45
|
-
// branch the remote considers default — otherwise the generated pipeline
|
|
46
|
-
// would only ever build whatever branch happened to be checked out at
|
|
47
|
-
// scaffold time.
|
|
48
|
-
const origin = makeRepo(root, 'origin-repo', 'develop');
|
|
49
|
-
const clone = join(root, 'cloned');
|
|
50
|
-
execFileSync('git', ['clone', '--quiet', origin, clone], { stdio: 'ignore' });
|
|
51
|
-
git(clone, 'checkout', '--quiet', '-b', 'feature/whatever');
|
|
52
|
-
expect(detectDefaultBranch(clone)).toBe('develop');
|
|
53
|
-
});
|
|
54
|
-
test('falls back to main outside a git repository', () => {
|
|
55
|
-
const notARepo = join(root, 'bare-dir');
|
|
56
|
-
execFileSync('mkdir', ['-p', notARepo]);
|
|
57
|
-
expect(detectDefaultBranch(notARepo)).toBe('main');
|
|
58
|
-
});
|
|
59
|
-
test('falls back to main on a detached HEAD with no remote', () => {
|
|
60
|
-
const dir = makeRepo(root, 'detached', 'main');
|
|
61
|
-
const sha = execFileSync('git', ['rev-parse', 'HEAD'], { cwd: dir, encoding: 'utf8' }).trim();
|
|
62
|
-
git(dir, 'checkout', '--quiet', sha);
|
|
63
|
-
expect(detectDefaultBranch(dir)).toBe('main');
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
//# sourceMappingURL=git.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gitignore.d.ts","sourceRoot":"","sources":["../../../src/shared/gitignore.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAiB/D"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { appendFileSync, existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { resolve } from "node:path";
|
|
3
|
-
/**
|
|
4
|
-
* Ensures CI Build runtime files are listed in .gitignore. Safe to call
|
|
5
|
-
* repeatedly — only appends entries that are missing.
|
|
6
|
-
*/
|
|
7
|
-
export function ensureCiBuildGitignoreEntries(cwd) {
|
|
8
|
-
const gitignorePath = resolve(cwd, ".gitignore");
|
|
9
|
-
const gitignoreEntries = [".cibuild-secrets.json", ".ci/.envstore.json", ".ci/keys/", "build/"];
|
|
10
|
-
if (existsSync(gitignorePath)) {
|
|
11
|
-
const contents = readFileSync(gitignorePath, "utf-8");
|
|
12
|
-
const lines = contents.split("\n").map((l) => l.trim());
|
|
13
|
-
const toAdd = gitignoreEntries.filter((e) => !lines.includes(e));
|
|
14
|
-
if (toAdd.length > 0) {
|
|
15
|
-
appendFileSync(gitignorePath, `\n${toAdd.join("\n")}\n`);
|
|
16
|
-
for (const entry of toAdd) {
|
|
17
|
-
console.log(`✅ Added ${entry} to .gitignore`);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
writeFileSync(gitignorePath, `${gitignoreEntries.join("\n")}\n`);
|
|
23
|
-
console.log(`✅ Created .gitignore with CI Build entries`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=gitignore.js.map
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reading a Gradle settings file, once.
|
|
3
|
-
*
|
|
4
|
-
* There were two parsers for the same sentence and they disagreed. The
|
|
5
|
-
* scanner's matched only the first argument of an `include`, so
|
|
6
|
-
* `include(":android", ":common", ":viewmodels")` — one call, eight modules
|
|
7
|
-
* in `SimonSchubert/LinuxCommandLibrary` — was read as one module, and the
|
|
8
|
-
* seven others were never opened. That is how a project declaring
|
|
9
|
-
* `jvmToolchain(21)` was scanned as Java 17 and died at configuration.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* The module paths an `include` names, as directories.
|
|
13
|
-
*
|
|
14
|
-
* Gradle writes project paths colon-separated (`:core:network`) and the
|
|
15
|
-
* directory is the same path with slashes. Every argument of every `include`
|
|
16
|
-
* counts, in both the Groovy (`include ':a', ':b'`) and Kotlin
|
|
17
|
-
* (`include(":a", ":b")`) forms, and a leading colon is not part of the name.
|
|
18
|
-
*/
|
|
19
|
-
export declare function parseSettingsModules(content: string): string[];
|
|
20
|
-
/**
|
|
21
|
-
* True when a build file applies the Kotlin Multiplatform plugin, in any of
|
|
22
|
-
* the forms a Gradle build uses for it — including a project-local
|
|
23
|
-
* convention plugin whose own id ends in `multiplatform`.
|
|
24
|
-
*/
|
|
25
|
-
export declare function declaresKotlinMultiplatformPlugin(content: string): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* True when a build file itself declares a Kotlin/Native Apple target.
|
|
28
|
-
*
|
|
29
|
-
* A convention plugin can hide the Kotlin Multiplatform plugin itself —
|
|
30
|
-
* garfiec/Librechat-Mobile's `:shared` applies `id("librechat.kmp.library")`
|
|
31
|
-
* and openMF/mifos-mobile's `:cmp-shared` a catalog alias — but the Apple
|
|
32
|
-
* targets are still declared in the module's own file. Only a call counts:
|
|
33
|
-
* the word in a comment or a string, or a source set named after a target
|
|
34
|
-
* (`iosArm64Main`), does not.
|
|
35
|
-
*/
|
|
36
|
-
export declare function declaresKotlinNativeAppleTarget(content: string): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* True when a build file makes its module Kotlin Multiplatform: it applies the
|
|
39
|
-
* plugin, or declares a Kotlin/Native Apple target. The KMM decision in
|
|
40
|
-
* `detect-project.ts` asks this, never the plugin test alone.
|
|
41
|
-
*/
|
|
42
|
-
export declare function declaresKotlinMultiplatform(content: string): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Every plugin identifier a build file declares: `id("x")`, `id 'x'`,
|
|
45
|
-
* `apply plugin: 'x'` / `apply(plugin = "x")`, and the version-catalog alias
|
|
46
|
-
* `alias(libs.plugins.x.y)`.
|
|
47
|
-
*/
|
|
48
|
-
export declare function declaredPluginIds(content: string): string[];
|
|
49
|
-
//# sourceMappingURL=gradle-settings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gradle-settings.d.ts","sourceRoot":"","sources":["../../../src/shared/gradle-settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAY9D;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAO1E;AAUD;;;;;;;;;GASG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGxE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEpE;AA4CD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAW3D"}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reading a Gradle settings file, once.
|
|
3
|
-
*
|
|
4
|
-
* There were two parsers for the same sentence and they disagreed. The
|
|
5
|
-
* scanner's matched only the first argument of an `include`, so
|
|
6
|
-
* `include(":android", ":common", ":viewmodels")` — one call, eight modules
|
|
7
|
-
* in `SimonSchubert/LinuxCommandLibrary` — was read as one module, and the
|
|
8
|
-
* seven others were never opened. That is how a project declaring
|
|
9
|
-
* `jvmToolchain(21)` was scanned as Java 17 and died at configuration.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* The module paths an `include` names, as directories.
|
|
13
|
-
*
|
|
14
|
-
* Gradle writes project paths colon-separated (`:core:network`) and the
|
|
15
|
-
* directory is the same path with slashes. Every argument of every `include`
|
|
16
|
-
* counts, in both the Groovy (`include ':a', ':b'`) and Kotlin
|
|
17
|
-
* (`include(":a", ":b")`) forms, and a leading colon is not part of the name.
|
|
18
|
-
*/
|
|
19
|
-
export function parseSettingsModules(content) {
|
|
20
|
-
if (!content || typeof content !== "string")
|
|
21
|
-
return [];
|
|
22
|
-
const modules = [];
|
|
23
|
-
const re = /include\s*[(]?\s*((?:['"][^'"]+['"]\s*,?\s*)+)/g;
|
|
24
|
-
let match;
|
|
25
|
-
while ((match = re.exec(content)) !== null) {
|
|
26
|
-
for (const quoted of match[1].matchAll(/['"]([^'"]+)['"]/g)) {
|
|
27
|
-
const name = quoted[1].replace(/^:/, "").replace(/:/g, "/");
|
|
28
|
-
if (name && !modules.includes(name))
|
|
29
|
-
modules.push(name);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return modules;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* True when a build file applies the Kotlin Multiplatform plugin, in any of
|
|
36
|
-
* the forms a Gradle build uses for it — including a project-local
|
|
37
|
-
* convention plugin whose own id ends in `multiplatform`.
|
|
38
|
-
*/
|
|
39
|
-
export function declaresKotlinMultiplatformPlugin(content) {
|
|
40
|
-
if (!content || typeof content !== "string")
|
|
41
|
-
return false;
|
|
42
|
-
if (/org\.jetbrains\.kotlin\.multiplatform/.test(content))
|
|
43
|
-
return true;
|
|
44
|
-
if (/kotlin\s*\(\s*["']multiplatform["']\s*\)/.test(content))
|
|
45
|
-
return true;
|
|
46
|
-
return declaredPluginIds(content).some((id) => /kotlin[._-]?multiplatform$/i.test(id));
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The Kotlin/Native Apple target functions of the Kotlin Multiplatform DSL.
|
|
50
|
-
* A call to one (`iosArm64()`, `iosX64 { … }`, `listOf(iosArm64(), …)`) exists
|
|
51
|
-
* only inside a multiplatform module.
|
|
52
|
-
*/
|
|
53
|
-
const KOTLIN_NATIVE_APPLE_TARGET_CALL = /(?<![A-Za-z0-9_$])(?:ios(?:Arm32|Arm64|X64|SimulatorArm64)|macos(?:Arm64|X64)|watchos(?:Arm32|Arm64|X64|SimulatorArm64|DeviceArm64)|tvos(?:Arm64|X64|SimulatorArm64))\s*[({]/;
|
|
54
|
-
/**
|
|
55
|
-
* True when a build file itself declares a Kotlin/Native Apple target.
|
|
56
|
-
*
|
|
57
|
-
* A convention plugin can hide the Kotlin Multiplatform plugin itself —
|
|
58
|
-
* garfiec/Librechat-Mobile's `:shared` applies `id("librechat.kmp.library")`
|
|
59
|
-
* and openMF/mifos-mobile's `:cmp-shared` a catalog alias — but the Apple
|
|
60
|
-
* targets are still declared in the module's own file. Only a call counts:
|
|
61
|
-
* the word in a comment or a string, or a source set named after a target
|
|
62
|
-
* (`iosArm64Main`), does not.
|
|
63
|
-
*/
|
|
64
|
-
export function declaresKotlinNativeAppleTarget(content) {
|
|
65
|
-
if (!content || typeof content !== "string")
|
|
66
|
-
return false;
|
|
67
|
-
return KOTLIN_NATIVE_APPLE_TARGET_CALL.test(codeOnly(content));
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* True when a build file makes its module Kotlin Multiplatform: it applies the
|
|
71
|
-
* plugin, or declares a Kotlin/Native Apple target. The KMM decision in
|
|
72
|
-
* `detect-project.ts` asks this, never the plugin test alone.
|
|
73
|
-
*/
|
|
74
|
-
export function declaresKotlinMultiplatform(content) {
|
|
75
|
-
return declaresKotlinMultiplatformPlugin(content) || declaresKotlinNativeAppleTarget(content);
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* A Kotlin or Groovy build file with its comments and string literals
|
|
79
|
-
* blanked, so what is left is code. Strings keep their quotes and lose their
|
|
80
|
-
* contents; a comment becomes a space.
|
|
81
|
-
*/
|
|
82
|
-
function codeOnly(content) {
|
|
83
|
-
let out = "";
|
|
84
|
-
let i = 0;
|
|
85
|
-
const n = content.length;
|
|
86
|
-
while (i < n) {
|
|
87
|
-
const c = content[i];
|
|
88
|
-
const next = content[i + 1];
|
|
89
|
-
if (c === "/" && next === "/") {
|
|
90
|
-
while (i < n && content[i] !== "\n")
|
|
91
|
-
i++;
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
if (c === "/" && next === "*") {
|
|
95
|
-
const end = content.indexOf("*/", i + 2);
|
|
96
|
-
i = end === -1 ? n : end + 2;
|
|
97
|
-
out += " ";
|
|
98
|
-
continue;
|
|
99
|
-
}
|
|
100
|
-
if (content.startsWith('"""', i) || content.startsWith("'''", i)) {
|
|
101
|
-
const quote = content.slice(i, i + 3);
|
|
102
|
-
const end = content.indexOf(quote, i + 3);
|
|
103
|
-
i = end === -1 ? n : end + 3;
|
|
104
|
-
out += quote + quote;
|
|
105
|
-
continue;
|
|
106
|
-
}
|
|
107
|
-
if (c === '"' || c === "'") {
|
|
108
|
-
let j = i + 1;
|
|
109
|
-
while (j < n && content[j] !== c && content[j] !== "\n")
|
|
110
|
-
j += content[j] === "\\" ? 2 : 1;
|
|
111
|
-
i = j + 1;
|
|
112
|
-
out += c + c;
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
out += c;
|
|
116
|
-
i++;
|
|
117
|
-
}
|
|
118
|
-
return out;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Every plugin identifier a build file declares: `id("x")`, `id 'x'`,
|
|
122
|
-
* `apply plugin: 'x'` / `apply(plugin = "x")`, and the version-catalog alias
|
|
123
|
-
* `alias(libs.plugins.x.y)`.
|
|
124
|
-
*/
|
|
125
|
-
export function declaredPluginIds(content) {
|
|
126
|
-
if (!content || typeof content !== "string")
|
|
127
|
-
return [];
|
|
128
|
-
const ids = [];
|
|
129
|
-
for (const m of content.matchAll(/\bid\s*(?:\(\s*)?["']([^"']+)["']/g))
|
|
130
|
-
ids.push(m[1]);
|
|
131
|
-
for (const m of content.matchAll(/\bapply\s*(?:plugin\s*[:=]|\(\s*plugin\s*=)\s*["']([^"']+)["']/g)) {
|
|
132
|
-
ids.push(m[1]);
|
|
133
|
-
}
|
|
134
|
-
for (const m of content.matchAll(/\balias\s*\(\s*([A-Za-z0-9_.]+)\s*\)/g))
|
|
135
|
-
ids.push(m[1]);
|
|
136
|
-
return ids;
|
|
137
|
-
}
|
|
138
|
-
//# sourceMappingURL=gradle-settings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gradle-settings.test.d.ts","sourceRoot":"","sources":["../../../src/shared/gradle-settings.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What in a module's own build file makes it Kotlin Multiplatform.
|
|
3
|
-
*
|
|
4
|
-
* The plugin is the first answer, but a convention plugin can hide it:
|
|
5
|
-
* garfiec/Librechat-Mobile's `:shared` applies `id("librechat.kmp.library")`
|
|
6
|
-
* and openMF/mifos-mobile's `:cmp-shared` applies
|
|
7
|
-
* `alias(libs.plugins.cmp.feature.convention)`. Both declare Kotlin/Native
|
|
8
|
-
* Apple targets in the module's own file, which only a multiplatform module
|
|
9
|
-
* can do, so that counts too. It has to be a call: the word in a comment or a
|
|
10
|
-
* string, or a source set named after a target, does not count.
|
|
11
|
-
*/
|
|
12
|
-
import { readFileSync } from "node:fs";
|
|
13
|
-
import { dirname, join } from "node:path";
|
|
14
|
-
import { fileURLToPath } from "node:url";
|
|
15
|
-
import { declaresKotlinMultiplatform, declaresKotlinMultiplatformPlugin, declaresKotlinNativeAppleTarget, } from "./gradle-settings.js";
|
|
16
|
-
const FIXTURES = join(dirname(fileURLToPath(import.meta.url)), "../../test/fixtures/kotlin-native-apple-targets");
|
|
17
|
-
const fixture = (name) => readFileSync(join(FIXTURES, name), "utf-8");
|
|
18
|
-
describe("declaresKotlinNativeAppleTarget", () => {
|
|
19
|
-
test("Librechat-Mobile: listOf(iosArm64(), iosSimulatorArm64()) behind a convention plugin", () => {
|
|
20
|
-
const content = fixture("librechat-mobile.shared.build.gradle.kts");
|
|
21
|
-
expect(declaresKotlinMultiplatformPlugin(content)).toBe(false);
|
|
22
|
-
expect(declaresKotlinNativeAppleTarget(content)).toBe(true);
|
|
23
|
-
expect(declaresKotlinMultiplatform(content)).toBe(true);
|
|
24
|
-
});
|
|
25
|
-
test("mifos-mobile: iosX64(), iosArm64(), iosSimulatorArm64() behind a convention plugin", () => {
|
|
26
|
-
const content = fixture("mifos-mobile.cmp-shared.build.gradle.kts");
|
|
27
|
-
expect(declaresKotlinMultiplatformPlugin(content)).toBe(false);
|
|
28
|
-
expect(declaresKotlinNativeAppleTarget(content)).toBe(true);
|
|
29
|
-
});
|
|
30
|
-
test.each([
|
|
31
|
-
"kotlin { iosArm64() }",
|
|
32
|
-
"kotlin {\n iosX64 {\n binaries.framework()\n }\n}",
|
|
33
|
-
'kotlin { iosSimulatorArm64("sim") }',
|
|
34
|
-
"kotlin { macosArm64() }",
|
|
35
|
-
"kotlin { macosX64() }",
|
|
36
|
-
"kotlin { watchosArm64(); watchosSimulatorArm64() }",
|
|
37
|
-
"kotlin { watchosDeviceArm64() }",
|
|
38
|
-
"kotlin { tvosArm64() }",
|
|
39
|
-
"kotlin { tvosSimulatorArm64 () }",
|
|
40
|
-
"kotlin {\n [iosArm64(), iosX64()].each { it.binaries.framework() }\n}",
|
|
41
|
-
])("a target call counts: %s", (content) => {
|
|
42
|
-
expect(declaresKotlinNativeAppleTarget(content)).toBe(true);
|
|
43
|
-
});
|
|
44
|
-
test.each([
|
|
45
|
-
"// iosArm64()\nplugins { id(\"com.android.application\") }",
|
|
46
|
-
"/* kotlin { iosArm64() } */\nandroid { }",
|
|
47
|
-
"/*\n * iosX64()\n */",
|
|
48
|
-
'val note = "call iosArm64() for iOS"',
|
|
49
|
-
"def note = 'iosArm64()'",
|
|
50
|
-
'val s = """\n iosArm64()\n"""',
|
|
51
|
-
"val iosArm64Main by getting { }",
|
|
52
|
-
"sourceSets { iosArm64Main.dependencies { } }",
|
|
53
|
-
"sourceSets { iosMain.dependencies { } }",
|
|
54
|
-
"val iosArm64 = 1",
|
|
55
|
-
"myiosArm64()",
|
|
56
|
-
"linuxX64()\nandroidTarget()\njvm()",
|
|
57
|
-
"",
|
|
58
|
-
])("not a target call: %j", (content) => {
|
|
59
|
-
expect(declaresKotlinNativeAppleTarget(content)).toBe(false);
|
|
60
|
-
});
|
|
61
|
-
test("a comment marker inside a string does not hide the call after it", () => {
|
|
62
|
-
expect(declaresKotlinNativeAppleTarget('val url = "https://example.com"\nkotlin { iosArm64() }')).toBe(true);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
//# sourceMappingURL=gradle-settings.test.js.map
|