@sentry/wizard 3.42.1 → 4.0.1
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/CHANGELOG.md +30 -0
- package/dist/bin.js +44 -35
- package/dist/bin.js.map +1 -1
- package/dist/e2e-tests/jest.config.js +1 -1
- package/dist/e2e-tests/jest.config.js.map +1 -1
- package/dist/e2e-tests/tests/flutter.test.js +62 -147
- package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs.test.js +77 -175
- package/dist/e2e-tests/tests/nextjs.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-3.test.js +61 -162
- package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-4.test.js +62 -163
- package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
- package/dist/e2e-tests/tests/remix.test.js +147 -189
- package/dist/e2e-tests/tests/remix.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit.test.js +133 -187
- package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
- package/dist/e2e-tests/utils/index.d.ts +1 -1
- package/dist/e2e-tests/utils/index.js +113 -195
- package/dist/e2e-tests/utils/index.js.map +1 -1
- package/dist/lib/Constants.js +5 -5
- package/dist/lib/Constants.js.map +1 -1
- package/dist/lib/Helper/BottomBar.d.ts +1 -1
- package/dist/lib/Helper/BottomBar.js +14 -15
- package/dist/lib/Helper/BottomBar.js.map +1 -1
- package/dist/lib/Helper/Env.js +5 -2
- package/dist/lib/Helper/Env.js.map +1 -1
- package/dist/lib/Helper/File.js +14 -27
- package/dist/lib/Helper/File.js.map +1 -1
- package/dist/lib/Helper/Git.js +24 -59
- package/dist/lib/Helper/Git.js.map +1 -1
- package/dist/lib/Helper/Logging.js +2 -2
- package/dist/lib/Helper/Logging.js.map +1 -1
- package/dist/lib/Helper/MergeConfig.js +4 -4
- package/dist/lib/Helper/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/Package.d.ts +4 -1
- package/dist/lib/Helper/Package.js +12 -38
- package/dist/lib/Helper/Package.js.map +1 -1
- package/dist/lib/Helper/SentryCli.js +77 -149
- package/dist/lib/Helper/SentryCli.js.map +1 -1
- package/dist/lib/Helper/Wizard.js +29 -124
- package/dist/lib/Helper/Wizard.js.map +1 -1
- package/dist/lib/Helper/__tests__/File.js +4 -4
- package/dist/lib/Helper/__tests__/File.js.map +1 -1
- package/dist/lib/Helper/__tests__/MergeConfig.js +24 -24
- package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/__tests__/SentryCli.js +33 -23
- package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
- package/dist/lib/Setup.js +23 -85
- package/dist/lib/Setup.js.map +1 -1
- package/dist/lib/Steps/BaseStep.js +8 -8
- package/dist/lib/Steps/BaseStep.js.map +1 -1
- package/dist/lib/Steps/ChooseIntegration.js +80 -125
- package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
- package/dist/lib/Steps/ConfigureProject.js +6 -66
- package/dist/lib/Steps/ConfigureProject.js.map +1 -1
- package/dist/lib/Steps/Initial.js +16 -104
- package/dist/lib/Steps/Initial.js.map +1 -1
- package/dist/lib/Steps/Integrations/BaseIntegration.js +24 -118
- package/dist/lib/Steps/Integrations/BaseIntegration.js.map +1 -1
- package/dist/lib/Steps/Integrations/Cordova.js +95 -183
- package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
- package/dist/lib/Steps/Integrations/Electron.js +87 -145
- package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
- package/dist/lib/Steps/Integrations/MobileProject.js +40 -148
- package/dist/lib/Steps/Integrations/MobileProject.js.map +1 -1
- package/dist/lib/Steps/OpenSentry.js +63 -126
- package/dist/lib/Steps/OpenSentry.js.map +1 -1
- package/dist/lib/Steps/PromptForParameters.js +110 -206
- package/dist/lib/Steps/PromptForParameters.js.map +1 -1
- package/dist/lib/Steps/Result.js +19 -79
- package/dist/lib/Steps/Result.js.map +1 -1
- package/dist/lib/Steps/SentryProjectSelector.js +57 -148
- package/dist/lib/Steps/SentryProjectSelector.js.map +1 -1
- package/dist/lib/Steps/ShouldConfigure.js +6 -66
- package/dist/lib/Steps/ShouldConfigure.js.map +1 -1
- package/dist/lib/Steps/WaitForSentry.js +43 -120
- package/dist/lib/Steps/WaitForSentry.js.map +1 -1
- package/dist/lib/Steps/Welcome.js +17 -76
- package/dist/lib/Steps/Welcome.js.map +1 -1
- package/dist/lib/__tests__/Env.js +3 -3
- package/dist/lib/__tests__/Env.js.map +1 -1
- package/dist/src/android/android-wizard.js +100 -176
- package/dist/src/android/android-wizard.js.map +1 -1
- package/dist/src/android/code-tools.js +24 -33
- package/dist/src/android/code-tools.js.map +1 -1
- package/dist/src/android/gradle.js +106 -165
- package/dist/src/android/gradle.js.map +1 -1
- package/dist/src/android/manifest.js +26 -27
- package/dist/src/android/manifest.js.map +1 -1
- package/dist/src/android/templates.js +76 -23
- package/dist/src/android/templates.js.map +1 -1
- package/dist/src/apple/apple-wizard.js +129 -225
- package/dist/src/apple/apple-wizard.js.map +1 -1
- package/dist/src/apple/cocoapod.js +47 -109
- package/dist/src/apple/cocoapod.js.map +1 -1
- package/dist/src/apple/code-tools.js +32 -35
- package/dist/src/apple/code-tools.js.map +1 -1
- package/dist/src/apple/fastlane.js +51 -97
- package/dist/src/apple/fastlane.js.map +1 -1
- package/dist/src/apple/templates.js +41 -5
- package/dist/src/apple/templates.js.map +1 -1
- package/dist/src/apple/xcode-manager.d.ts +2 -2
- package/dist/src/apple/xcode-manager.js +93 -108
- package/dist/src/apple/xcode-manager.js.map +1 -1
- package/dist/src/flutter/code-tools.js +79 -127
- package/dist/src/flutter/code-tools.js.map +1 -1
- package/dist/src/flutter/flutter-wizard.js +75 -136
- package/dist/src/flutter/flutter-wizard.js.map +1 -1
- package/dist/src/flutter/templates.js +48 -12
- package/dist/src/flutter/templates.js.map +1 -1
- package/dist/src/nextjs/nextjs-wizard.js +527 -805
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
- package/dist/src/nextjs/templates.js +380 -40
- package/dist/src/nextjs/templates.js.map +1 -1
- package/dist/src/nextjs/utils.js +5 -5
- package/dist/src/nextjs/utils.js.map +1 -1
- package/dist/src/nuxt/nuxt-wizard.js +91 -188
- package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
- package/dist/src/nuxt/sdk-example.js +68 -137
- package/dist/src/nuxt/sdk-example.js.map +1 -1
- package/dist/src/nuxt/sdk-setup.d.ts +4 -4
- package/dist/src/nuxt/sdk-setup.js +180 -336
- package/dist/src/nuxt/sdk-setup.js.map +1 -1
- package/dist/src/nuxt/templates.js +195 -18
- package/dist/src/nuxt/templates.js.map +1 -1
- package/dist/src/nuxt/utils.js +29 -76
- package/dist/src/nuxt/utils.js.map +1 -1
- package/dist/src/react-native/expo-env-file.js +41 -94
- package/dist/src/react-native/expo-env-file.js.map +1 -1
- package/dist/src/react-native/expo-metro.d.ts +1 -1
- package/dist/src/react-native/expo-metro.js +75 -130
- package/dist/src/react-native/expo-metro.js.map +1 -1
- package/dist/src/react-native/expo.js +61 -114
- package/dist/src/react-native/expo.js.map +1 -1
- package/dist/src/react-native/git.js +23 -56
- package/dist/src/react-native/git.js.map +1 -1
- package/dist/src/react-native/glob.js +3 -3
- package/dist/src/react-native/glob.js.map +1 -1
- package/dist/src/react-native/gradle.js +4 -4
- package/dist/src/react-native/gradle.js.map +1 -1
- package/dist/src/react-native/javascript.js +51 -95
- package/dist/src/react-native/javascript.js.map +1 -1
- package/dist/src/react-native/metro.js +176 -296
- package/dist/src/react-native/metro.js.map +1 -1
- package/dist/src/react-native/react-native-wizard.js +267 -418
- package/dist/src/react-native/react-native-wizard.js.map +1 -1
- package/dist/src/react-native/uninstall.js +37 -80
- package/dist/src/react-native/uninstall.js.map +1 -1
- package/dist/src/react-native/xcode.js +57 -55
- package/dist/src/react-native/xcode.js.map +1 -1
- package/dist/src/remix/codemods/express-server.js +27 -82
- package/dist/src/remix/codemods/express-server.js.map +1 -1
- package/dist/src/remix/codemods/handle-error.js +28 -31
- package/dist/src/remix/codemods/handle-error.js.map +1 -1
- package/dist/src/remix/codemods/root-common.js +11 -11
- package/dist/src/remix/codemods/root-common.js.map +1 -1
- package/dist/src/remix/codemods/root-v1.js +17 -67
- package/dist/src/remix/codemods/root-v1.js.map +1 -1
- package/dist/src/remix/codemods/root-v2.js +89 -140
- package/dist/src/remix/codemods/root-v2.js.map +1 -1
- package/dist/src/remix/remix-wizard.js +181 -343
- package/dist/src/remix/remix-wizard.js.map +1 -1
- package/dist/src/remix/sdk-example.js +84 -66
- package/dist/src/remix/sdk-example.js.map +1 -1
- package/dist/src/remix/sdk-setup.js +161 -293
- package/dist/src/remix/sdk-setup.js.map +1 -1
- package/dist/src/remix/templates.js +10 -2
- package/dist/src/remix/templates.js.map +1 -1
- package/dist/src/remix/utils.js +13 -14
- package/dist/src/remix/utils.js.map +1 -1
- package/dist/src/run.js +106 -178
- package/dist/src/run.js.map +1 -1
- package/dist/src/sourcemaps/sourcemaps-wizard.js +248 -372
- package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
- package/dist/src/sourcemaps/tools/angular.js +32 -66
- package/dist/src/sourcemaps/tools/angular.js.map +1 -1
- package/dist/src/sourcemaps/tools/create-react-app.js +14 -59
- package/dist/src/sourcemaps/tools/create-react-app.js.map +1 -1
- package/dist/src/sourcemaps/tools/esbuild.js +34 -77
- package/dist/src/sourcemaps/tools/esbuild.js.map +1 -1
- package/dist/src/sourcemaps/tools/nextjs.d.ts +2 -2
- package/dist/src/sourcemaps/tools/nextjs.js +75 -102
- package/dist/src/sourcemaps/tools/nextjs.js.map +1 -1
- package/dist/src/sourcemaps/tools/remix.js +53 -93
- package/dist/src/sourcemaps/tools/remix.js.map +1 -1
- package/dist/src/sourcemaps/tools/rollup.js +35 -76
- package/dist/src/sourcemaps/tools/rollup.js.map +1 -1
- package/dist/src/sourcemaps/tools/sentry-cli.js +157 -289
- package/dist/src/sourcemaps/tools/sentry-cli.js.map +1 -1
- package/dist/src/sourcemaps/tools/tsc.js +68 -134
- package/dist/src/sourcemaps/tools/tsc.js.map +1 -1
- package/dist/src/sourcemaps/tools/vite.js +111 -196
- package/dist/src/sourcemaps/tools/vite.js.map +1 -1
- package/dist/src/sourcemaps/tools/webpack.d.ts +1 -1
- package/dist/src/sourcemaps/tools/webpack.js +158 -260
- package/dist/src/sourcemaps/tools/webpack.js.map +1 -1
- package/dist/src/sourcemaps/utils/detect-tool.js +9 -54
- package/dist/src/sourcemaps/utils/detect-tool.js.map +1 -1
- package/dist/src/sourcemaps/utils/other-wizards.js +77 -144
- package/dist/src/sourcemaps/utils/other-wizards.js.map +1 -1
- package/dist/src/sourcemaps/utils/sdk-version.js +112 -191
- package/dist/src/sourcemaps/utils/sdk-version.js.map +1 -1
- package/dist/src/sveltekit/sdk-example.js +20 -70
- package/dist/src/sveltekit/sdk-example.js.map +1 -1
- package/dist/src/sveltekit/sdk-setup.js +250 -411
- package/dist/src/sveltekit/sdk-setup.js.map +1 -1
- package/dist/src/sveltekit/sveltekit-wizard.js +107 -191
- package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
- package/dist/src/sveltekit/templates.js +147 -13
- package/dist/src/sveltekit/templates.js.map +1 -1
- package/dist/src/sveltekit/utils.js +3 -3
- package/dist/src/sveltekit/utils.js.map +1 -1
- package/dist/src/telemetry.d.ts +2 -2
- package/dist/src/telemetry.js +58 -108
- package/dist/src/telemetry.js.map +1 -1
- package/dist/src/utils/ast-utils.js +39 -54
- package/dist/src/utils/ast-utils.js.map +1 -1
- package/dist/src/utils/bash.js +28 -75
- package/dist/src/utils/bash.js.map +1 -1
- package/dist/src/utils/clack-utils.d.ts +3 -7
- package/dist/src/utils/clack-utils.js +688 -1083
- package/dist/src/utils/clack-utils.js.map +1 -1
- package/dist/src/utils/debug.js +6 -10
- package/dist/src/utils/debug.js.map +1 -1
- package/dist/src/utils/package-json.js +5 -6
- package/dist/src/utils/package-json.js.map +1 -1
- package/dist/src/utils/package-manager.js +65 -139
- package/dist/src/utils/package-manager.js.map +1 -1
- package/dist/src/utils/release-registry.js +12 -59
- package/dist/src/utils/release-registry.js.map +1 -1
- package/dist/src/utils/semver.js +3 -4
- package/dist/src/utils/semver.js.map +1 -1
- package/dist/src/utils/sentrycli-utils.js +4 -4
- package/dist/src/utils/sentrycli-utils.js.map +1 -1
- package/dist/src/utils/url.js +5 -6
- package/dist/src/utils/url.js.map +1 -1
- package/dist/test/android/code-tools.test.js +18 -18
- package/dist/test/android/code-tools.test.js.map +1 -1
- package/dist/test/apple/cocoapod.test.js +154 -299
- package/dist/test/apple/cocoapod.test.js.map +1 -1
- package/dist/test/apple/code-tools.test.js +375 -263
- package/dist/test/apple/code-tools.test.js.map +1 -1
- package/dist/test/apple/fastfile.test.js +319 -271
- package/dist/test/apple/fastfile.test.js.map +1 -1
- package/dist/test/apple/templates.test.js +114 -30
- package/dist/test/apple/templates.test.js.map +1 -1
- package/dist/test/apple/xcode-manager.test.js +230 -234
- package/dist/test/apple/xcode-manager.test.js.map +1 -1
- package/dist/test/flutter/code-tools.test.js +119 -48
- package/dist/test/flutter/code-tools.test.js.map +1 -1
- package/dist/test/flutter/templates.test.js +63 -20
- package/dist/test/flutter/templates.test.js.map +1 -1
- package/dist/test/nextjs/templates.test.js +332 -43
- package/dist/test/nextjs/templates.test.js.map +1 -1
- package/dist/test/nuxt/templates.test.js +161 -33
- package/dist/test/nuxt/templates.test.js.map +1 -1
- package/dist/test/react-native/expo-metro.test.js +61 -15
- package/dist/test/react-native/expo-metro.test.js.map +1 -1
- package/dist/test/react-native/expo.test.js +37 -17
- package/dist/test/react-native/expo.test.js.map +1 -1
- package/dist/test/react-native/gradle.test.js +260 -28
- package/dist/test/react-native/gradle.test.js.map +1 -1
- package/dist/test/react-native/javascript.test.js +85 -19
- package/dist/test/react-native/javascript.test.js.map +1 -1
- package/dist/test/react-native/metro.test.js +261 -187
- package/dist/test/react-native/metro.test.js.map +1 -1
- package/dist/test/react-native/xcode.test.js +243 -62
- package/dist/test/react-native/xcode.test.js.map +1 -1
- package/dist/test/remix/client-entry.test.js +81 -21
- package/dist/test/remix/client-entry.test.js.map +1 -1
- package/dist/test/remix/server-instrumentation.test.js +21 -8
- package/dist/test/remix/server-instrumentation.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/sentry-cli.test.js +20 -72
- package/dist/test/sourcemaps/tools/sentry-cli.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/tsc.test.js +142 -68
- package/dist/test/sourcemaps/tools/tsc.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/vite.test.js +106 -75
- package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/webpack.test.js +226 -102
- package/dist/test/sourcemaps/tools/webpack.test.js.map +1 -1
- package/dist/test/sveltekit/templates.test.js +117 -18
- package/dist/test/sveltekit/templates.test.js.map +1 -1
- package/dist/test/utils/ast-utils.test.js +99 -58
- package/dist/test/utils/ast-utils.test.js.map +1 -1
- package/dist/test/utils/clack-utils.test.js +142 -247
- package/dist/test/utils/clack-utils.test.js.map +1 -1
- package/package.json +16 -9
- package/bin.ts +0 -138
- package/codecov.yml +0 -15
- package/dist/package.json +0 -128
- package/e2e-tests/.env.example +0 -11
- package/e2e-tests/README.md +0 -63
- package/e2e-tests/jest.config.ts +0 -22
- package/e2e-tests/package.json +0 -14
- package/e2e-tests/run.sh +0 -15
- package/e2e-tests/test-applications/apple/damaged-missing-configuration-list/Project.xcodeproj/project.pbxproj +0 -52
- package/e2e-tests/test-applications/apple/damaged-missing-configuration-list/Project.xcodeproj/xcshareddata/xcschemes/Project1.xcscheme +0 -78
- package/e2e-tests/test-applications/apple/no-targets/Project.xcodeproj/project.pbxproj +0 -62
- package/e2e-tests/test-applications/apple/no-targets/Project.xcodeproj/xcshareddata/xcschemes/Project1.xcscheme +0 -78
- package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project.xcodeproj/project.pbxproj +0 -470
- package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project.xcodeproj/xcshareddata/xcschemes/Project1.xcscheme +0 -78
- package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project1/ContentView.swift +0 -7
- package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project1/Project1App.swift +0 -10
- package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project2/ContentView.swift +0 -7
- package/e2e-tests/test-applications/apple/spm-swiftui-multi-targets/Project2/Project2App.swift +0 -10
- package/e2e-tests/test-applications/apple/spm-swiftui-single-target/Project.xcodeproj/project.pbxproj +0 -382
- package/e2e-tests/test-applications/apple/spm-swiftui-single-target/Project.xcodeproj/xcshareddata/xcschemes/Project.xcscheme +0 -78
- package/e2e-tests/test-applications/apple/spm-swiftui-single-target/Sources/ContentView.swift +0 -7
- package/e2e-tests/test-applications/apple/spm-swiftui-single-target/Sources/MainApp.swift +0 -10
- package/e2e-tests/test-applications/flutter-test-app/.metadata +0 -45
- package/e2e-tests/test-applications/flutter-test-app/README.md +0 -16
- package/e2e-tests/test-applications/flutter-test-app/analysis_options.yaml +0 -28
- package/e2e-tests/test-applications/flutter-test-app/android/app/build.gradle +0 -44
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/debug/AndroidManifest.xml +0 -7
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/AndroidManifest.xml +0 -45
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/kotlin/com/example/flutter_magic/MainActivity.kt +0 -5
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/drawable/launch_background.xml +0 -12
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/drawable-v21/launch_background.xml +0 -12
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/values/styles.xml +0 -18
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/values-night/styles.xml +0 -18
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/profile/AndroidManifest.xml +0 -7
- package/e2e-tests/test-applications/flutter-test-app/android/build.gradle +0 -18
- package/e2e-tests/test-applications/flutter-test-app/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/e2e-tests/test-applications/flutter-test-app/android/gradle.properties +0 -3
- package/e2e-tests/test-applications/flutter-test-app/android/settings.gradle +0 -25
- package/e2e-tests/test-applications/flutter-test-app/lib/main.dart +0 -125
- package/e2e-tests/test-applications/flutter-test-app/linux/CMakeLists.txt +0 -145
- package/e2e-tests/test-applications/flutter-test-app/linux/flutter/CMakeLists.txt +0 -88
- package/e2e-tests/test-applications/flutter-test-app/linux/flutter/generated_plugin_registrant.cc +0 -11
- package/e2e-tests/test-applications/flutter-test-app/linux/flutter/generated_plugin_registrant.h +0 -15
- package/e2e-tests/test-applications/flutter-test-app/linux/flutter/generated_plugins.cmake +0 -23
- package/e2e-tests/test-applications/flutter-test-app/linux/main.cc +0 -6
- package/e2e-tests/test-applications/flutter-test-app/linux/my_application.cc +0 -124
- package/e2e-tests/test-applications/flutter-test-app/linux/my_application.h +0 -18
- package/e2e-tests/test-applications/flutter-test-app/macos/Flutter/Flutter-Debug.xcconfig +0 -2
- package/e2e-tests/test-applications/flutter-test-app/macos/Flutter/Flutter-Release.xcconfig +0 -2
- package/e2e-tests/test-applications/flutter-test-app/macos/Flutter/GeneratedPluginRegistrant.swift +0 -10
- package/e2e-tests/test-applications/flutter-test-app/macos/Podfile +0 -43
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/AppDelegate.swift +0 -9
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -68
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Base.lproj/MainMenu.xib +0 -343
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/AppInfo.xcconfig +0 -14
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/Debug.xcconfig +0 -2
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/Release.xcconfig +0 -2
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/Warnings.xcconfig +0 -13
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/DebugProfile.entitlements +0 -12
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Info.plist +0 -32
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/MainFlutterWindow.swift +0 -15
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Release.entitlements +0 -8
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcodeproj/project.pbxproj +0 -705
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +0 -98
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcworkspace/contents.xcworkspacedata +0 -7
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/e2e-tests/test-applications/flutter-test-app/macos/RunnerTests/RunnerTests.swift +0 -12
- package/e2e-tests/test-applications/flutter-test-app/pubspec.lock +0 -213
- package/e2e-tests/test-applications/flutter-test-app/pubspec.yaml +0 -89
- package/e2e-tests/test-applications/flutter-test-app/test/widget_test.dart +0 -30
- package/e2e-tests/test-applications/flutter-test-app/web/favicon.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-192.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-512.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-maskable-192.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-maskable-512.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/web/index.html +0 -38
- package/e2e-tests/test-applications/flutter-test-app/web/manifest.json +0 -35
- package/e2e-tests/test-applications/flutter-test-app/windows/CMakeLists.txt +0 -108
- package/e2e-tests/test-applications/flutter-test-app/windows/flutter/CMakeLists.txt +0 -109
- package/e2e-tests/test-applications/flutter-test-app/windows/flutter/generated_plugin_registrant.cc +0 -11
- package/e2e-tests/test-applications/flutter-test-app/windows/flutter/generated_plugin_registrant.h +0 -15
- package/e2e-tests/test-applications/flutter-test-app/windows/flutter/generated_plugins.cmake +0 -23
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/CMakeLists.txt +0 -40
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/Runner.rc +0 -121
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/flutter_window.cpp +0 -71
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/flutter_window.h +0 -33
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/main.cpp +0 -43
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/resource.h +0 -16
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/resources/app_icon.ico +0 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/runner.exe.manifest +0 -14
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/utils.cpp +0 -65
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/utils.h +0 -19
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/win32_window.cpp +0 -288
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/win32_window.h +0 -102
- package/e2e-tests/test-applications/nextjs-test-app/next.config.mjs +0 -4
- package/e2e-tests/test-applications/nextjs-test-app/package.json +0 -22
- package/e2e-tests/test-applications/nextjs-test-app/src/app/layout.tsx +0 -20
- package/e2e-tests/test-applications/nextjs-test-app/src/app/page.tsx +0 -90
- package/e2e-tests/test-applications/nuxt-3-test-app/README.md +0 -75
- package/e2e-tests/test-applications/nuxt-3-test-app/nuxt.config.ts +0 -5
- package/e2e-tests/test-applications/nuxt-3-test-app/package.json +0 -18
- package/e2e-tests/test-applications/nuxt-3-test-app/public/favicon.ico +0 -0
- package/e2e-tests/test-applications/nuxt-3-test-app/public/robots.txt +0 -1
- package/e2e-tests/test-applications/nuxt-4-test-app/README.md +0 -75
- package/e2e-tests/test-applications/nuxt-4-test-app/nuxt.config.ts +0 -6
- package/e2e-tests/test-applications/nuxt-4-test-app/package.json +0 -18
- package/e2e-tests/test-applications/nuxt-4-test-app/public/favicon.ico +0 -0
- package/e2e-tests/test-applications/nuxt-4-test-app/public/robots.txt +0 -1
- package/e2e-tests/test-applications/remix-test-app/app/entry.client.tsx +0 -18
- package/e2e-tests/test-applications/remix-test-app/app/entry.server.tsx +0 -140
- package/e2e-tests/test-applications/remix-test-app/app/root.tsx +0 -30
- package/e2e-tests/test-applications/remix-test-app/app/routes/_index.tsx +0 -48
- package/e2e-tests/test-applications/remix-test-app/app/tailwind.css +0 -3
- package/e2e-tests/test-applications/remix-test-app/package.json +0 -37
- package/e2e-tests/test-applications/remix-test-app/postcss.config.js +0 -6
- package/e2e-tests/test-applications/remix-test-app/tailwind.config.ts +0 -9
- package/e2e-tests/test-applications/remix-test-app/vite.config.ts +0 -16
- package/e2e-tests/test-applications/sveltekit-test-app/package.json +0 -21
- package/e2e-tests/test-applications/sveltekit-test-app/src/app.d.ts +0 -13
- package/e2e-tests/test-applications/sveltekit-test-app/src/app.html +0 -11
- package/e2e-tests/test-applications/sveltekit-test-app/src/lib/index.ts +0 -1
- package/e2e-tests/test-applications/sveltekit-test-app/src/routes/+page.svelte +0 -2
- package/e2e-tests/test-applications/sveltekit-test-app/svelte.config.js +0 -18
- package/e2e-tests/test-applications/sveltekit-test-app/vite.config.ts +0 -6
- package/e2e-tests/tests/flutter.test.ts +0 -127
- package/e2e-tests/tests/nextjs.test.ts +0 -161
- package/e2e-tests/tests/nuxt-3.test.ts +0 -189
- package/e2e-tests/tests/nuxt-4.test.ts +0 -188
- package/e2e-tests/tests/remix.test.ts +0 -277
- package/e2e-tests/tests/sveltekit.test.ts +0 -284
- package/e2e-tests/utils/index.ts +0 -438
- package/index.ts +0 -2
- package/lib/Constants.ts +0 -118
- package/lib/Helper/BottomBar.ts +0 -28
- package/lib/Helper/Env.ts +0 -7
- package/lib/Helper/File.ts +0 -65
- package/lib/Helper/Git.ts +0 -39
- package/lib/Helper/Logging.ts +0 -44
- package/lib/Helper/MergeConfig.ts +0 -19
- package/lib/Helper/Package.ts +0 -78
- package/lib/Helper/SentryCli.ts +0 -148
- package/lib/Helper/Wizard.ts +0 -59
- package/lib/Helper/__tests__/File.ts +0 -15
- package/lib/Helper/__tests__/MergeConfig.ts +0 -98
- package/lib/Helper/__tests__/SentryCli.ts +0 -86
- package/lib/Helper/test-fixtures/next.config.1-merged.js +0 -18
- package/lib/Helper/test-fixtures/next.config.1.js +0 -6
- package/lib/Helper/test-fixtures/next.config.2.js +0 -8
- package/lib/Helper/test-fixtures/next.config.3-merged.js +0 -21
- package/lib/Helper/test-fixtures/next.config.3.js +0 -9
- package/lib/Helper/test-fixtures/next.config.4-merged.js +0 -21
- package/lib/Helper/test-fixtures/next.config.4.js +0 -9
- package/lib/Setup.ts +0 -41
- package/lib/Steps/BaseStep.ts +0 -25
- package/lib/Steps/ChooseIntegration.ts +0 -112
- package/lib/Steps/ConfigureProject.ts +0 -10
- package/lib/Steps/Initial.ts +0 -44
- package/lib/Steps/Integrations/BaseIntegration.ts +0 -48
- package/lib/Steps/Integrations/Cordova.ts +0 -289
- package/lib/Steps/Integrations/Electron.ts +0 -161
- package/lib/Steps/Integrations/MobileProject.ts +0 -69
- package/lib/Steps/OpenSentry.ts +0 -75
- package/lib/Steps/PromptForParameters.ts +0 -207
- package/lib/Steps/Result.ts +0 -22
- package/lib/Steps/SentryProjectSelector.ts +0 -82
- package/lib/Steps/ShouldConfigure.ts +0 -10
- package/lib/Steps/WaitForSentry.ts +0 -50
- package/lib/Steps/Welcome.ts +0 -21
- package/lib/Steps/index.ts +0 -10
- package/lib/__tests__/Env.ts +0 -29
- package/scripts/NextJs/configs/_error.js +0 -39
- package/scripts/NextJs/configs/next.config.js +0 -36
- package/scripts/NextJs/configs/next.config.template.js +0 -12
- package/scripts/NextJs/configs/sentry.client.config.js +0 -17
- package/scripts/NextJs/configs/sentry.edge.config.js +0 -17
- package/scripts/NextJs/configs/sentry.server.config.js +0 -17
- package/scripts/NextJs/sentry_sample_error.js +0 -47
- package/scripts/craft-pre-release.sh +0 -10
- package/src/android/android-wizard.ts +0 -192
- package/src/android/code-tools.ts +0 -170
- package/src/android/gradle.ts +0 -250
- package/src/android/manifest.ts +0 -180
- package/src/android/templates.ts +0 -86
- package/src/apple/apple-wizard.ts +0 -269
- package/src/apple/cocoapod.ts +0 -73
- package/src/apple/code-tools.ts +0 -147
- package/src/apple/fastlane.ts +0 -170
- package/src/apple/templates.ts +0 -65
- package/src/apple/xcode-manager.ts +0 -404
- package/src/flutter/code-tools.ts +0 -284
- package/src/flutter/flutter-wizard.ts +0 -164
- package/src/flutter/templates.ts +0 -90
- package/src/nextjs/nextjs-wizard.ts +0 -1007
- package/src/nextjs/templates.ts +0 -526
- package/src/nextjs/utils.ts +0 -21
- package/src/nuxt/nuxt-wizard.ts +0 -188
- package/src/nuxt/sdk-example.ts +0 -135
- package/src/nuxt/sdk-setup.ts +0 -349
- package/src/nuxt/templates.ts +0 -303
- package/src/nuxt/types.ts +0 -8
- package/src/nuxt/utils.ts +0 -42
- package/src/react-native/expo-env-file.ts +0 -55
- package/src/react-native/expo-metro.ts +0 -212
- package/src/react-native/expo.ts +0 -175
- package/src/react-native/git.ts +0 -25
- package/src/react-native/glob.ts +0 -13
- package/src/react-native/gradle.ts +0 -26
- package/src/react-native/javascript.ts +0 -103
- package/src/react-native/metro.ts +0 -599
- package/src/react-native/options.ts +0 -5
- package/src/react-native/react-native-wizard.ts +0 -513
- package/src/react-native/uninstall.ts +0 -110
- package/src/react-native/xcode.ts +0 -302
- package/src/remix/codemods/express-server.ts +0 -44
- package/src/remix/codemods/handle-error.ts +0 -118
- package/src/remix/codemods/root-common.ts +0 -63
- package/src/remix/codemods/root-v1.ts +0 -41
- package/src/remix/codemods/root-v2.ts +0 -153
- package/src/remix/remix-wizard.ts +0 -261
- package/src/remix/sdk-example.ts +0 -120
- package/src/remix/sdk-setup.ts +0 -546
- package/src/remix/templates.ts +0 -11
- package/src/remix/utils.ts +0 -96
- package/src/run.ts +0 -204
- package/src/sourcemaps/sourcemaps-wizard.ts +0 -364
- package/src/sourcemaps/tools/angular.ts +0 -42
- package/src/sourcemaps/tools/create-react-app.ts +0 -19
- package/src/sourcemaps/tools/esbuild.ts +0 -65
- package/src/sourcemaps/tools/nextjs.ts +0 -114
- package/src/sourcemaps/tools/remix.ts +0 -90
- package/src/sourcemaps/tools/rollup.ts +0 -67
- package/src/sourcemaps/tools/sentry-cli.ts +0 -287
- package/src/sourcemaps/tools/tsc.ts +0 -144
- package/src/sourcemaps/tools/types.ts +0 -11
- package/src/sourcemaps/tools/vite.ts +0 -300
- package/src/sourcemaps/tools/webpack.ts +0 -383
- package/src/sourcemaps/utils/detect-tool.ts +0 -46
- package/src/sourcemaps/utils/other-wizards.ts +0 -167
- package/src/sourcemaps/utils/sdk-version.ts +0 -266
- package/src/sveltekit/sdk-example.ts +0 -56
- package/src/sveltekit/sdk-setup.ts +0 -667
- package/src/sveltekit/sveltekit-wizard.ts +0 -192
- package/src/sveltekit/templates.ts +0 -185
- package/src/sveltekit/utils.ts +0 -50
- package/src/telemetry.ts +0 -124
- package/src/utils/ast-utils.ts +0 -270
- package/src/utils/bash.ts +0 -57
- package/src/utils/clack-utils.ts +0 -1533
- package/src/utils/debug.ts +0 -20
- package/src/utils/package-json.ts +0 -51
- package/src/utils/package-manager.ts +0 -172
- package/src/utils/release-registry.ts +0 -19
- package/src/utils/semver.ts +0 -33
- package/src/utils/sentrycli-utils.ts +0 -24
- package/src/utils/string.ts +0 -7
- package/src/utils/types.ts +0 -77
- package/src/utils/url.ts +0 -27
- package/src/utils/vendor/is-unicorn-supported.ts +0 -29
- package/test/android/code-tools.test.ts +0 -49
- package/test/apple/cocoapod.test.ts +0 -306
- package/test/apple/code-tools.test.ts +0 -1042
- package/test/apple/fastfile.test.ts +0 -550
- package/test/apple/templates.test.ts +0 -191
- package/test/apple/xcode-manager.test.ts +0 -1066
- package/test/flutter/code-tools.test.ts +0 -212
- package/test/flutter/templates.test.ts +0 -100
- package/test/nextjs/templates.test.ts +0 -429
- package/test/nuxt/templates.test.ts +0 -255
- package/test/react-native/expo-metro.test.ts +0 -81
- package/test/react-native/expo.test.ts +0 -86
- package/test/react-native/gradle.test.ts +0 -310
- package/test/react-native/javascript.test.ts +0 -134
- package/test/react-native/metro.test.ts +0 -396
- package/test/react-native/xcode.test.ts +0 -401
- package/test/remix/client-entry.test.ts +0 -122
- package/test/remix/server-instrumentation.test.ts +0 -36
- package/test/sourcemaps/tools/sentry-cli.test.ts +0 -57
- package/test/sourcemaps/tools/tsc.test.ts +0 -181
- package/test/sourcemaps/tools/vite.test.ts +0 -149
- package/test/sourcemaps/tools/webpack.test.ts +0 -303
- package/test/sveltekit/templates.test.ts +0 -152
- package/test/utils/ast-utils.test.ts +0 -264
- package/test/utils/clack-utils.test.ts +0 -234
- package/types/xcode.d.ts +0 -526
|
@@ -1,1066 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
2
|
-
import * as os from 'os';
|
|
3
|
-
import * as path from 'path';
|
|
4
|
-
import {
|
|
5
|
-
PBXFileReference,
|
|
6
|
-
PBXGroup,
|
|
7
|
-
PBXNativeTarget,
|
|
8
|
-
PBXProject,
|
|
9
|
-
PBXShellScriptBuildPhase,
|
|
10
|
-
XCBuildConfiguration,
|
|
11
|
-
} from 'xcode';
|
|
12
|
-
import { getRunScriptTemplate } from '../../src/apple/templates';
|
|
13
|
-
import { XcodeProject } from '../../src/apple/xcode-manager';
|
|
14
|
-
import { SentryProjectData } from '../../src/utils/types';
|
|
15
|
-
|
|
16
|
-
jest.mock('@clack/prompts', () => ({
|
|
17
|
-
default: {
|
|
18
|
-
log: {
|
|
19
|
-
info: jest.fn(),
|
|
20
|
-
success: jest.fn(),
|
|
21
|
-
step: jest.fn(),
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
}));
|
|
25
|
-
|
|
26
|
-
const appleProjectsPath = path.resolve(
|
|
27
|
-
__dirname,
|
|
28
|
-
'../../e2e-tests/test-applications/apple',
|
|
29
|
-
);
|
|
30
|
-
const damagedProjectPath = path.join(
|
|
31
|
-
appleProjectsPath,
|
|
32
|
-
'damaged-missing-configuration-list/Project.xcodeproj/project.pbxproj',
|
|
33
|
-
);
|
|
34
|
-
const noTargetsProjectPath = path.join(
|
|
35
|
-
appleProjectsPath,
|
|
36
|
-
'no-targets/Project.xcodeproj/project.pbxproj',
|
|
37
|
-
);
|
|
38
|
-
const singleTargetProjectPath = path.join(
|
|
39
|
-
appleProjectsPath,
|
|
40
|
-
'spm-swiftui-single-target/Project.xcodeproj/project.pbxproj',
|
|
41
|
-
);
|
|
42
|
-
const multiTargetProjectPath = path.join(
|
|
43
|
-
appleProjectsPath,
|
|
44
|
-
'spm-swiftui-multi-targets/Project.xcodeproj/project.pbxproj',
|
|
45
|
-
);
|
|
46
|
-
const projectData: SentryProjectData = {
|
|
47
|
-
id: '1234567890',
|
|
48
|
-
slug: 'project',
|
|
49
|
-
organization: {
|
|
50
|
-
id: '1234567890',
|
|
51
|
-
name: 'Sentry',
|
|
52
|
-
slug: 'sentry',
|
|
53
|
-
},
|
|
54
|
-
keys: [{ dsn: { public: 'https://sentry.io/1234567890' } }],
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
describe('XcodeManager', () => {
|
|
58
|
-
afterEach(() => {
|
|
59
|
-
jest.clearAllMocks();
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
describe('XcodeProject', () => {
|
|
63
|
-
describe('getAllTargets', () => {
|
|
64
|
-
describe('single target', () => {
|
|
65
|
-
it('should return all targets', () => {
|
|
66
|
-
// -- Arrange --
|
|
67
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
68
|
-
|
|
69
|
-
// -- Act --
|
|
70
|
-
const targets = xcodeProject.getAllTargets();
|
|
71
|
-
|
|
72
|
-
// -- Assert --
|
|
73
|
-
expect(targets).toEqual(['Project']);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
describe('multiple targets', () => {
|
|
78
|
-
it('should return all targets', () => {
|
|
79
|
-
// -- Arrange --
|
|
80
|
-
const xcodeProject = new XcodeProject(multiTargetProjectPath);
|
|
81
|
-
|
|
82
|
-
// -- Act --
|
|
83
|
-
const targets = xcodeProject.getAllTargets();
|
|
84
|
-
|
|
85
|
-
// -- Assert --
|
|
86
|
-
expect(targets).toEqual(['Project1', 'Project2']);
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
describe('no targets', () => {
|
|
91
|
-
it('should return an empty array', () => {
|
|
92
|
-
// -- Arrange --
|
|
93
|
-
const xcodeProject = new XcodeProject(noTargetsProjectPath);
|
|
94
|
-
|
|
95
|
-
// -- Act --
|
|
96
|
-
const targets = xcodeProject.getAllTargets();
|
|
97
|
-
|
|
98
|
-
// -- Assert --
|
|
99
|
-
expect(targets).toEqual([]);
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
describe('project with missing configuration list', () => {
|
|
104
|
-
it('should return an empty array', () => {
|
|
105
|
-
// -- Arrange --
|
|
106
|
-
const xcodeProject = new XcodeProject(damagedProjectPath);
|
|
107
|
-
|
|
108
|
-
// -- Act --
|
|
109
|
-
const targets = xcodeProject.getAllTargets();
|
|
110
|
-
|
|
111
|
-
// -- Assert --
|
|
112
|
-
expect(targets).toEqual([]);
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
describe('updateXcodeProject', () => {
|
|
118
|
-
let sourceProjectPath: string;
|
|
119
|
-
let tempProjectPath: string;
|
|
120
|
-
let xcodeProject: XcodeProject;
|
|
121
|
-
|
|
122
|
-
beforeEach(() => {
|
|
123
|
-
const tempDir = path.join(
|
|
124
|
-
os.tmpdir(),
|
|
125
|
-
fs.mkdtempSync('update-xcode-project'),
|
|
126
|
-
);
|
|
127
|
-
fs.mkdirSync(tempDir);
|
|
128
|
-
|
|
129
|
-
sourceProjectPath = singleTargetProjectPath;
|
|
130
|
-
tempProjectPath = path.resolve(tempDir, 'project.pbxproj');
|
|
131
|
-
|
|
132
|
-
fs.copyFileSync(sourceProjectPath, tempProjectPath);
|
|
133
|
-
xcodeProject = new XcodeProject(tempProjectPath);
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
describe('upload symbols script', () => {
|
|
137
|
-
const scriptVariants: {
|
|
138
|
-
uploadSource: boolean;
|
|
139
|
-
includeHomebrewPath: boolean;
|
|
140
|
-
}[] = [
|
|
141
|
-
{
|
|
142
|
-
uploadSource: true,
|
|
143
|
-
includeHomebrewPath: true,
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
uploadSource: true,
|
|
147
|
-
includeHomebrewPath: false,
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
uploadSource: false,
|
|
151
|
-
includeHomebrewPath: true,
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
uploadSource: false,
|
|
155
|
-
includeHomebrewPath: false,
|
|
156
|
-
},
|
|
157
|
-
];
|
|
158
|
-
|
|
159
|
-
for (const variant of scriptVariants) {
|
|
160
|
-
describe(`upload source = ${variant.uploadSource?.toString()} and include homebrew path = ${variant.includeHomebrewPath.toString()}`, () => {
|
|
161
|
-
beforeEach(() => {
|
|
162
|
-
jest
|
|
163
|
-
.spyOn(fs, 'existsSync')
|
|
164
|
-
.mockReturnValue(variant.includeHomebrewPath);
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
afterEach(() => {
|
|
168
|
-
jest.restoreAllMocks();
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
it('should add the upload symbols script to the target', () => {
|
|
172
|
-
// -- Arrange --
|
|
173
|
-
const generatedShellScript = getRunScriptTemplate(
|
|
174
|
-
projectData.organization.slug,
|
|
175
|
-
projectData.slug,
|
|
176
|
-
variant.uploadSource,
|
|
177
|
-
variant.includeHomebrewPath,
|
|
178
|
-
);
|
|
179
|
-
const expectedShellScript = `"${generatedShellScript.replace(
|
|
180
|
-
/"/g,
|
|
181
|
-
'\\"',
|
|
182
|
-
)}"`;
|
|
183
|
-
|
|
184
|
-
// -- Act --
|
|
185
|
-
xcodeProject.updateXcodeProject(
|
|
186
|
-
projectData,
|
|
187
|
-
'Project',
|
|
188
|
-
false, // Ignore SPM reference
|
|
189
|
-
variant.uploadSource,
|
|
190
|
-
);
|
|
191
|
-
|
|
192
|
-
// -- Assert --
|
|
193
|
-
const updatedXcodeProject = new XcodeProject(tempProjectPath);
|
|
194
|
-
|
|
195
|
-
// Expect the upload symbols script to be added
|
|
196
|
-
const scriptObjects =
|
|
197
|
-
updatedXcodeProject.objects.PBXShellScriptBuildPhase;
|
|
198
|
-
expect(scriptObjects).toBeDefined();
|
|
199
|
-
if (!scriptObjects) {
|
|
200
|
-
throw new Error('Script objects not found');
|
|
201
|
-
}
|
|
202
|
-
const scriptKeys = Object.keys(scriptObjects);
|
|
203
|
-
expect(scriptKeys).toHaveLength(2);
|
|
204
|
-
|
|
205
|
-
// Find the script ID
|
|
206
|
-
const scriptId = scriptKeys.find(
|
|
207
|
-
(key) => !key.endsWith('_comment'),
|
|
208
|
-
);
|
|
209
|
-
expect(scriptId).toBeDefined();
|
|
210
|
-
if (!scriptId) {
|
|
211
|
-
throw new Error('Script ID not found');
|
|
212
|
-
}
|
|
213
|
-
expect(scriptId).toMatch(/^[A-F0-9]{24}$/i);
|
|
214
|
-
|
|
215
|
-
// Expect the script to be added
|
|
216
|
-
const script = scriptObjects[
|
|
217
|
-
scriptId
|
|
218
|
-
] as PBXShellScriptBuildPhase;
|
|
219
|
-
expect(script).toBeDefined();
|
|
220
|
-
expect(typeof script).not.toBe('string');
|
|
221
|
-
expect(script.inputPaths).toEqual([
|
|
222
|
-
'"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}"',
|
|
223
|
-
]);
|
|
224
|
-
expect(script.outputPaths).toEqual([]);
|
|
225
|
-
expect(script.shellPath).toBe('/bin/sh');
|
|
226
|
-
expect(script.shellScript).toEqual(expectedShellScript);
|
|
227
|
-
|
|
228
|
-
const commentKey = `${scriptId}_comment`;
|
|
229
|
-
expect(scriptKeys).toContain(commentKey);
|
|
230
|
-
expect(scriptObjects[commentKey]).toBe(
|
|
231
|
-
'Upload Debug Symbols to Sentry',
|
|
232
|
-
);
|
|
233
|
-
});
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
describe('debug information format and sandbox', () => {
|
|
239
|
-
describe('upload source is false', () => {
|
|
240
|
-
it('should not update the Xcode project', () => {
|
|
241
|
-
// -- Act --
|
|
242
|
-
xcodeProject.updateXcodeProject(
|
|
243
|
-
projectData,
|
|
244
|
-
'Project',
|
|
245
|
-
false, // Ignore SPM reference
|
|
246
|
-
false,
|
|
247
|
-
);
|
|
248
|
-
|
|
249
|
-
// -- Assert --
|
|
250
|
-
const expectedXcodeProject = new XcodeProject(sourceProjectPath);
|
|
251
|
-
expect(xcodeProject.objects.XCBuildConfiguration).toEqual(
|
|
252
|
-
expectedXcodeProject.objects.XCBuildConfiguration,
|
|
253
|
-
);
|
|
254
|
-
});
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
describe('upload source is true', () => {
|
|
258
|
-
const uploadSource = true;
|
|
259
|
-
|
|
260
|
-
describe('named target not found', () => {
|
|
261
|
-
it('should not update the flags in the Xcode project', () => {
|
|
262
|
-
// -- Act --
|
|
263
|
-
xcodeProject.updateXcodeProject(
|
|
264
|
-
projectData,
|
|
265
|
-
'Invalid Target Name',
|
|
266
|
-
false, // Ignore SPM reference
|
|
267
|
-
uploadSource,
|
|
268
|
-
);
|
|
269
|
-
|
|
270
|
-
// -- Assert --
|
|
271
|
-
const originalXcodeProject = new XcodeProject(sourceProjectPath);
|
|
272
|
-
expect(xcodeProject.objects.XCBuildConfiguration).toEqual(
|
|
273
|
-
originalXcodeProject.objects.XCBuildConfiguration,
|
|
274
|
-
);
|
|
275
|
-
});
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
describe('named target found', () => {
|
|
279
|
-
describe('build configurations is undefined', () => {
|
|
280
|
-
it('should not update the Xcode project', () => {
|
|
281
|
-
// -- Act --
|
|
282
|
-
xcodeProject.updateXcodeProject(
|
|
283
|
-
projectData,
|
|
284
|
-
'Invalid Target Name',
|
|
285
|
-
false, // Ignore SPM reference
|
|
286
|
-
uploadSource,
|
|
287
|
-
);
|
|
288
|
-
|
|
289
|
-
// -- Assert --
|
|
290
|
-
const originalXcodeProject = new XcodeProject(
|
|
291
|
-
sourceProjectPath,
|
|
292
|
-
);
|
|
293
|
-
expect(xcodeProject.objects.XCBuildConfiguration).toEqual(
|
|
294
|
-
originalXcodeProject.objects.XCBuildConfiguration,
|
|
295
|
-
);
|
|
296
|
-
});
|
|
297
|
-
});
|
|
298
|
-
|
|
299
|
-
describe('no build configurations found', () => {
|
|
300
|
-
it('should not update the Xcode project', () => {
|
|
301
|
-
// -- Arrange --
|
|
302
|
-
xcodeProject.objects.XCBuildConfiguration = {};
|
|
303
|
-
|
|
304
|
-
// -- Act --
|
|
305
|
-
xcodeProject.updateXcodeProject(
|
|
306
|
-
projectData,
|
|
307
|
-
'Invalid Target Name',
|
|
308
|
-
false, // Ignore SPM reference
|
|
309
|
-
uploadSource,
|
|
310
|
-
);
|
|
311
|
-
|
|
312
|
-
// -- Assert --
|
|
313
|
-
expect(xcodeProject.objects.XCBuildConfiguration).toEqual({});
|
|
314
|
-
});
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
describe('build configurations found', () => {
|
|
318
|
-
const debugProjectBuildConfigurationListId =
|
|
319
|
-
'D4E604DA2D50CEEE00CAB00F';
|
|
320
|
-
const releaseProjectBuildConfigurationListId =
|
|
321
|
-
'D4E604DB2D50CEEE00CAB00F';
|
|
322
|
-
const debugTargetBuildConfigurationListId =
|
|
323
|
-
'D4E604DD2D50CEEE00CAB00F';
|
|
324
|
-
const releaseTargetBuildConfigurationListId =
|
|
325
|
-
'D4E604DE2D50CEEE00CAB00F';
|
|
326
|
-
|
|
327
|
-
it('should update the target configuration lists', () => {
|
|
328
|
-
// -- Act --
|
|
329
|
-
xcodeProject.updateXcodeProject(
|
|
330
|
-
projectData,
|
|
331
|
-
'Project',
|
|
332
|
-
false, // Ignore SPM reference
|
|
333
|
-
uploadSource,
|
|
334
|
-
);
|
|
335
|
-
|
|
336
|
-
// -- Assert --
|
|
337
|
-
expect(xcodeProject.objects.XCBuildConfiguration).toBeDefined();
|
|
338
|
-
// Both Debug and Release are configured equally
|
|
339
|
-
const expectedConfigKeys = [
|
|
340
|
-
debugTargetBuildConfigurationListId, // Debug
|
|
341
|
-
releaseTargetBuildConfigurationListId, // Release
|
|
342
|
-
];
|
|
343
|
-
for (const key of expectedConfigKeys) {
|
|
344
|
-
const buildConfiguration = xcodeProject.objects
|
|
345
|
-
.XCBuildConfiguration?.[key] as XCBuildConfiguration;
|
|
346
|
-
expect(buildConfiguration).toBeDefined();
|
|
347
|
-
expect(typeof buildConfiguration).not.toBe('string');
|
|
348
|
-
const buildSettings = buildConfiguration.buildSettings ?? {};
|
|
349
|
-
expect(buildSettings.DEBUG_INFORMATION_FORMAT).toBe(
|
|
350
|
-
'"dwarf-with-dsym"',
|
|
351
|
-
);
|
|
352
|
-
expect(buildSettings.ENABLE_USER_SCRIPT_SANDBOXING).toBe(
|
|
353
|
-
'"NO"',
|
|
354
|
-
);
|
|
355
|
-
}
|
|
356
|
-
});
|
|
357
|
-
|
|
358
|
-
it('should not update the project configuration lists', () => {
|
|
359
|
-
// -- Act --
|
|
360
|
-
xcodeProject.updateXcodeProject(
|
|
361
|
-
projectData,
|
|
362
|
-
'Project',
|
|
363
|
-
false, // Ignore SPM reference
|
|
364
|
-
uploadSource,
|
|
365
|
-
);
|
|
366
|
-
|
|
367
|
-
// -- Assert --
|
|
368
|
-
expect(xcodeProject.objects.XCBuildConfiguration).toBeDefined();
|
|
369
|
-
|
|
370
|
-
// Check project build configurations 'Debug'
|
|
371
|
-
const debugBuildConfiguration = xcodeProject.objects
|
|
372
|
-
.XCBuildConfiguration?.[
|
|
373
|
-
debugProjectBuildConfigurationListId
|
|
374
|
-
] as XCBuildConfiguration;
|
|
375
|
-
expect(debugBuildConfiguration).toBeDefined();
|
|
376
|
-
expect(typeof debugBuildConfiguration).not.toBe('string');
|
|
377
|
-
expect(
|
|
378
|
-
debugBuildConfiguration.buildSettings
|
|
379
|
-
?.DEBUG_INFORMATION_FORMAT,
|
|
380
|
-
).toBe('dwarf');
|
|
381
|
-
expect(
|
|
382
|
-
debugBuildConfiguration.buildSettings
|
|
383
|
-
?.ENABLE_USER_SCRIPT_SANDBOXING,
|
|
384
|
-
).toBe('YES');
|
|
385
|
-
|
|
386
|
-
// Check project build configurations 'Release'
|
|
387
|
-
const releaseBuildConfiguration = xcodeProject.objects
|
|
388
|
-
.XCBuildConfiguration?.[
|
|
389
|
-
releaseProjectBuildConfigurationListId
|
|
390
|
-
] as XCBuildConfiguration;
|
|
391
|
-
expect(releaseBuildConfiguration).toBeDefined();
|
|
392
|
-
expect(typeof releaseBuildConfiguration).not.toBe('string');
|
|
393
|
-
expect(
|
|
394
|
-
releaseBuildConfiguration.buildSettings
|
|
395
|
-
?.DEBUG_INFORMATION_FORMAT,
|
|
396
|
-
).toBe('"dwarf-with-dsym"');
|
|
397
|
-
expect(
|
|
398
|
-
releaseBuildConfiguration.buildSettings
|
|
399
|
-
?.ENABLE_USER_SCRIPT_SANDBOXING,
|
|
400
|
-
).toBe('YES');
|
|
401
|
-
});
|
|
402
|
-
});
|
|
403
|
-
});
|
|
404
|
-
});
|
|
405
|
-
});
|
|
406
|
-
|
|
407
|
-
describe('add SPM reference', () => {
|
|
408
|
-
const addSPMReference = true;
|
|
409
|
-
|
|
410
|
-
describe('framework build phase already contains Sentry', () => {
|
|
411
|
-
it('should not update the Xcode project', () => {
|
|
412
|
-
// -- Arrange --
|
|
413
|
-
xcodeProject.objects.PBXFrameworksBuildPhase = {
|
|
414
|
-
'framework-id': {
|
|
415
|
-
files: [
|
|
416
|
-
{
|
|
417
|
-
value: '123',
|
|
418
|
-
comment: 'Sentry in Frameworks',
|
|
419
|
-
},
|
|
420
|
-
],
|
|
421
|
-
},
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
// -- Act --
|
|
425
|
-
xcodeProject.updateXcodeProject(
|
|
426
|
-
projectData,
|
|
427
|
-
'Project',
|
|
428
|
-
addSPMReference,
|
|
429
|
-
);
|
|
430
|
-
|
|
431
|
-
// -- Assert --
|
|
432
|
-
const expectedXcodeProject = new XcodeProject(sourceProjectPath);
|
|
433
|
-
expectedXcodeProject.objects.PBXFrameworksBuildPhase = {
|
|
434
|
-
'framework-id': {
|
|
435
|
-
files: [
|
|
436
|
-
{
|
|
437
|
-
value: '123',
|
|
438
|
-
comment: 'Sentry in Frameworks',
|
|
439
|
-
},
|
|
440
|
-
],
|
|
441
|
-
},
|
|
442
|
-
};
|
|
443
|
-
expect(xcodeProject.objects.PBXFrameworksBuildPhase).toEqual(
|
|
444
|
-
expectedXcodeProject.objects.PBXFrameworksBuildPhase,
|
|
445
|
-
);
|
|
446
|
-
expect(xcodeProject.objects.XCRemoteSwiftPackageReference).toEqual(
|
|
447
|
-
expectedXcodeProject.objects.XCRemoteSwiftPackageReference,
|
|
448
|
-
);
|
|
449
|
-
expect(
|
|
450
|
-
xcodeProject.objects.XCSwiftPackageProductDependency,
|
|
451
|
-
).toEqual(
|
|
452
|
-
expectedXcodeProject.objects.XCSwiftPackageProductDependency,
|
|
453
|
-
);
|
|
454
|
-
});
|
|
455
|
-
});
|
|
456
|
-
|
|
457
|
-
it('should add the SPM reference to the target', () => {
|
|
458
|
-
// -- Act --
|
|
459
|
-
xcodeProject.updateXcodeProject(
|
|
460
|
-
projectData,
|
|
461
|
-
'Project',
|
|
462
|
-
addSPMReference,
|
|
463
|
-
);
|
|
464
|
-
|
|
465
|
-
// -- Assert --
|
|
466
|
-
// Get the target
|
|
467
|
-
const target = xcodeProject.objects.PBXNativeTarget?.[
|
|
468
|
-
'D4E604CC2D50CEEC00CAB00F'
|
|
469
|
-
] as PBXNativeTarget;
|
|
470
|
-
expect(target).toBeDefined();
|
|
471
|
-
if (!target) {
|
|
472
|
-
throw new Error('Target is undefined');
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
// Check the SPM dependency is added to the target
|
|
476
|
-
expect(target.packageProductDependencies).toEqual([
|
|
477
|
-
expect.objectContaining({
|
|
478
|
-
value: expect.any(String) as string,
|
|
479
|
-
comment: 'Sentry',
|
|
480
|
-
}),
|
|
481
|
-
]);
|
|
482
|
-
|
|
483
|
-
// Check the SPM package reference object is added to the project
|
|
484
|
-
const remoteSwiftPackageReferences =
|
|
485
|
-
xcodeProject.objects.XCRemoteSwiftPackageReference;
|
|
486
|
-
expect(remoteSwiftPackageReferences).toBeDefined();
|
|
487
|
-
if (!remoteSwiftPackageReferences) {
|
|
488
|
-
throw new Error('XCRemoteSwiftPackageReference is undefined');
|
|
489
|
-
}
|
|
490
|
-
const rspRefKeys = Object.keys(remoteSwiftPackageReferences);
|
|
491
|
-
expect(rspRefKeys).toHaveLength(2);
|
|
492
|
-
// First key is expected to be the UUID of the SPM package reference
|
|
493
|
-
expect(rspRefKeys[0]).toMatch(/^[A-F0-9]{24}$/i);
|
|
494
|
-
// Second key is expected to be the UUID of the SPM package reference with _comment suffix
|
|
495
|
-
expect(rspRefKeys[1]).toMatch(/^[A-F0-9]{24}_comment$/i);
|
|
496
|
-
|
|
497
|
-
expect(remoteSwiftPackageReferences?.[rspRefKeys[0]]).toEqual({
|
|
498
|
-
isa: 'XCRemoteSwiftPackageReference',
|
|
499
|
-
repositoryURL: '"https://github.com/getsentry/sentry-cocoa/"',
|
|
500
|
-
requirement: {
|
|
501
|
-
kind: 'upToNextMajorVersion',
|
|
502
|
-
minimumVersion: '8.0.0',
|
|
503
|
-
},
|
|
504
|
-
});
|
|
505
|
-
expect(remoteSwiftPackageReferences?.[rspRefKeys[1]]).toBe(
|
|
506
|
-
'XCRemoteSwiftPackageReference "sentry-cocoa"',
|
|
507
|
-
);
|
|
508
|
-
|
|
509
|
-
// Check the SPM package is a dependency of the target
|
|
510
|
-
const packageProductDependencies =
|
|
511
|
-
xcodeProject.objects.XCSwiftPackageProductDependency;
|
|
512
|
-
expect(packageProductDependencies).toBeDefined();
|
|
513
|
-
if (!packageProductDependencies) {
|
|
514
|
-
throw new Error('XCSwiftPackageProductDependency is undefined');
|
|
515
|
-
}
|
|
516
|
-
const ppDepKeys = Object.keys(packageProductDependencies);
|
|
517
|
-
expect(ppDepKeys).toHaveLength(2);
|
|
518
|
-
// First key is expected to be the UUID of the SPM package dependency
|
|
519
|
-
expect(ppDepKeys[0]).toMatch(/^[A-F0-9]{24}$/i);
|
|
520
|
-
// Second key is expected to be the UUID of the SPM package dependency with _comment suffix
|
|
521
|
-
expect(ppDepKeys[1]).toMatch(/^[A-F0-9]{24}_comment$/i);
|
|
522
|
-
expect(packageProductDependencies?.[ppDepKeys[0]]).toEqual({
|
|
523
|
-
isa: 'XCSwiftPackageProductDependency',
|
|
524
|
-
package: rspRefKeys[0],
|
|
525
|
-
package_comment: 'XCRemoteSwiftPackageReference "sentry-cocoa"',
|
|
526
|
-
productName: 'Sentry',
|
|
527
|
-
});
|
|
528
|
-
});
|
|
529
|
-
});
|
|
530
|
-
});
|
|
531
|
-
});
|
|
532
|
-
|
|
533
|
-
describe('filesForTarget', () => {
|
|
534
|
-
describe('targets are undefined', () => {
|
|
535
|
-
it('should return undefined', () => {
|
|
536
|
-
// -- Arrange --
|
|
537
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
538
|
-
xcodeProject.objects.PBXNativeTarget = undefined;
|
|
539
|
-
|
|
540
|
-
// -- Act --
|
|
541
|
-
const files = xcodeProject.filesForTarget('Project');
|
|
542
|
-
|
|
543
|
-
// -- Assert --
|
|
544
|
-
expect(files).toBeUndefined();
|
|
545
|
-
});
|
|
546
|
-
});
|
|
547
|
-
|
|
548
|
-
describe('target not found', () => {
|
|
549
|
-
it('should return undefined', () => {
|
|
550
|
-
// -- Arrange --
|
|
551
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
552
|
-
|
|
553
|
-
// -- Act --
|
|
554
|
-
const files = xcodeProject.filesForTarget('NonExistentTarget');
|
|
555
|
-
|
|
556
|
-
// -- Assert --
|
|
557
|
-
expect(files).toBeUndefined();
|
|
558
|
-
});
|
|
559
|
-
});
|
|
560
|
-
|
|
561
|
-
describe('target build phases are undefined', () => {
|
|
562
|
-
it('should return undefined', () => {
|
|
563
|
-
// -- Arrange --
|
|
564
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
565
|
-
xcodeProject.objects.PBXNativeTarget = {
|
|
566
|
-
Project: {
|
|
567
|
-
name: 'Project',
|
|
568
|
-
buildPhases: undefined,
|
|
569
|
-
},
|
|
570
|
-
};
|
|
571
|
-
|
|
572
|
-
// -- Act --
|
|
573
|
-
const files = xcodeProject.filesForTarget('Project');
|
|
574
|
-
|
|
575
|
-
// -- Assert --
|
|
576
|
-
expect(files).toBeUndefined();
|
|
577
|
-
});
|
|
578
|
-
});
|
|
579
|
-
|
|
580
|
-
describe('build phases are undefined', () => {
|
|
581
|
-
it('should return undefined', () => {
|
|
582
|
-
// -- Arrange --
|
|
583
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
584
|
-
xcodeProject.objects.PBXNativeTarget = {
|
|
585
|
-
Project: {
|
|
586
|
-
name: 'Project',
|
|
587
|
-
buildPhases: undefined,
|
|
588
|
-
},
|
|
589
|
-
};
|
|
590
|
-
xcodeProject.objects.PBXSourcesBuildPhase = undefined;
|
|
591
|
-
|
|
592
|
-
// -- Act --
|
|
593
|
-
const files = xcodeProject.filesForTarget('Project');
|
|
594
|
-
|
|
595
|
-
// -- Assert --
|
|
596
|
-
expect(files).toBeUndefined();
|
|
597
|
-
});
|
|
598
|
-
});
|
|
599
|
-
|
|
600
|
-
describe('referenced build phase is undefined', () => {
|
|
601
|
-
it('should return undefined', () => {
|
|
602
|
-
// -- Arrange --
|
|
603
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
604
|
-
xcodeProject.objects.PBXNativeTarget = {
|
|
605
|
-
Project: {
|
|
606
|
-
name: 'Project',
|
|
607
|
-
buildPhases: [
|
|
608
|
-
{
|
|
609
|
-
value: 'random-build-phase',
|
|
610
|
-
},
|
|
611
|
-
],
|
|
612
|
-
},
|
|
613
|
-
};
|
|
614
|
-
|
|
615
|
-
// -- Act --
|
|
616
|
-
const files = xcodeProject.filesForTarget('Project');
|
|
617
|
-
|
|
618
|
-
// -- Assert --
|
|
619
|
-
expect(files).toBeUndefined();
|
|
620
|
-
});
|
|
621
|
-
});
|
|
622
|
-
|
|
623
|
-
describe('build phase files are undefined', () => {
|
|
624
|
-
it('should return empty array', () => {
|
|
625
|
-
// -- Arrange --
|
|
626
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
627
|
-
xcodeProject.objects.PBXNativeTarget = {
|
|
628
|
-
Project: {
|
|
629
|
-
name: 'Project',
|
|
630
|
-
buildPhases: [
|
|
631
|
-
{
|
|
632
|
-
value: 'build-phase-key',
|
|
633
|
-
},
|
|
634
|
-
],
|
|
635
|
-
},
|
|
636
|
-
};
|
|
637
|
-
xcodeProject.objects.PBXSourcesBuildPhase = {
|
|
638
|
-
'build-phase-key': {
|
|
639
|
-
files: undefined,
|
|
640
|
-
},
|
|
641
|
-
};
|
|
642
|
-
|
|
643
|
-
// -- Act --
|
|
644
|
-
const files = xcodeProject.filesForTarget('Project');
|
|
645
|
-
|
|
646
|
-
// -- Assert --
|
|
647
|
-
expect(files).toEqual([]);
|
|
648
|
-
});
|
|
649
|
-
});
|
|
650
|
-
|
|
651
|
-
describe('build phase has no files', () => {
|
|
652
|
-
it('should return empty array', () => {
|
|
653
|
-
// -- Arrange --
|
|
654
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
655
|
-
|
|
656
|
-
// -- Act --
|
|
657
|
-
const files = xcodeProject.filesForTarget('Project');
|
|
658
|
-
|
|
659
|
-
// -- Assert --
|
|
660
|
-
expect(files).toEqual([]);
|
|
661
|
-
});
|
|
662
|
-
});
|
|
663
|
-
|
|
664
|
-
describe('build phase with files', () => {
|
|
665
|
-
let xcodeProject: XcodeProject;
|
|
666
|
-
|
|
667
|
-
beforeEach(() => {
|
|
668
|
-
xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
669
|
-
xcodeProject.objects.PBXNativeTarget = {
|
|
670
|
-
'some-target': {
|
|
671
|
-
name: 'some-target',
|
|
672
|
-
buildPhases: [
|
|
673
|
-
{
|
|
674
|
-
value: 'build-phase-key',
|
|
675
|
-
},
|
|
676
|
-
],
|
|
677
|
-
},
|
|
678
|
-
};
|
|
679
|
-
xcodeProject.objects.PBXSourcesBuildPhase = {
|
|
680
|
-
'build-phase-key': {
|
|
681
|
-
files: [
|
|
682
|
-
{
|
|
683
|
-
value: 'file-key',
|
|
684
|
-
},
|
|
685
|
-
],
|
|
686
|
-
},
|
|
687
|
-
};
|
|
688
|
-
xcodeProject.objects.PBXBuildFile = {
|
|
689
|
-
'file-key': {
|
|
690
|
-
isa: 'PBXBuildFile',
|
|
691
|
-
fileRef: 'file-ref-key',
|
|
692
|
-
},
|
|
693
|
-
};
|
|
694
|
-
xcodeProject.files = [
|
|
695
|
-
{
|
|
696
|
-
key: 'file-ref-key',
|
|
697
|
-
path: 'file-path',
|
|
698
|
-
},
|
|
699
|
-
];
|
|
700
|
-
});
|
|
701
|
-
|
|
702
|
-
describe('build file objects are not defined', () => {
|
|
703
|
-
it('should return empty array', () => {
|
|
704
|
-
// -- Arrange --
|
|
705
|
-
xcodeProject.objects.PBXBuildFile = undefined;
|
|
706
|
-
|
|
707
|
-
// -- Act --
|
|
708
|
-
const files = xcodeProject.filesForTarget('some-target');
|
|
709
|
-
|
|
710
|
-
// -- Assert --
|
|
711
|
-
expect(files).toEqual([]);
|
|
712
|
-
});
|
|
713
|
-
});
|
|
714
|
-
|
|
715
|
-
describe('build file object is not found', () => {
|
|
716
|
-
it('should return empty array', () => {
|
|
717
|
-
// -- Arrange --
|
|
718
|
-
xcodeProject.objects.PBXBuildFile = {};
|
|
719
|
-
|
|
720
|
-
// -- Act --
|
|
721
|
-
const files = xcodeProject.filesForTarget('some-target');
|
|
722
|
-
|
|
723
|
-
// -- Assert --
|
|
724
|
-
expect(files).toEqual([]);
|
|
725
|
-
});
|
|
726
|
-
});
|
|
727
|
-
|
|
728
|
-
describe('build file object exists', () => {
|
|
729
|
-
describe('file reference is undefined', () => {
|
|
730
|
-
it('should ignore the file', () => {
|
|
731
|
-
// -- Arrange --
|
|
732
|
-
xcodeProject.files = [];
|
|
733
|
-
|
|
734
|
-
// -- Act --
|
|
735
|
-
const files = xcodeProject.filesForTarget('some-target');
|
|
736
|
-
|
|
737
|
-
// -- Assert --
|
|
738
|
-
expect(files).toEqual([]);
|
|
739
|
-
});
|
|
740
|
-
});
|
|
741
|
-
|
|
742
|
-
it('should return array of file paths', () => {
|
|
743
|
-
// -- Act --
|
|
744
|
-
const files = xcodeProject.filesForTarget('some-target');
|
|
745
|
-
|
|
746
|
-
// -- Assert --
|
|
747
|
-
expect(files).toEqual([
|
|
748
|
-
path.join(
|
|
749
|
-
appleProjectsPath,
|
|
750
|
-
'spm-swiftui-single-target',
|
|
751
|
-
'file-path',
|
|
752
|
-
),
|
|
753
|
-
]);
|
|
754
|
-
});
|
|
755
|
-
});
|
|
756
|
-
});
|
|
757
|
-
});
|
|
758
|
-
|
|
759
|
-
describe('projectFiles', () => {
|
|
760
|
-
describe('no groups in project', () => {
|
|
761
|
-
it('should return empty array', () => {
|
|
762
|
-
// -- Arrange --
|
|
763
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
764
|
-
xcodeProject.objects.PBXGroup = undefined;
|
|
765
|
-
|
|
766
|
-
// -- Act --
|
|
767
|
-
const files = xcodeProject.projectFiles();
|
|
768
|
-
|
|
769
|
-
// -- Assert --
|
|
770
|
-
expect(files).toEqual([]);
|
|
771
|
-
});
|
|
772
|
-
});
|
|
773
|
-
|
|
774
|
-
describe('main group not found', () => {
|
|
775
|
-
it('should return empty array', () => {
|
|
776
|
-
// -- Arrange --
|
|
777
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
778
|
-
const project = xcodeProject.objects.PBXProject?.[
|
|
779
|
-
'D4E604C52D50CEEC00CAB00F'
|
|
780
|
-
] as PBXProject;
|
|
781
|
-
if (project) {
|
|
782
|
-
delete project.mainGroup;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
// -- Act --
|
|
786
|
-
const files = xcodeProject.projectFiles();
|
|
787
|
-
|
|
788
|
-
// -- Assert --
|
|
789
|
-
expect(files).toEqual([]);
|
|
790
|
-
});
|
|
791
|
-
});
|
|
792
|
-
|
|
793
|
-
describe('main group found', () => {
|
|
794
|
-
it('should return array of file paths', () => {
|
|
795
|
-
// -- Arrange --
|
|
796
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
797
|
-
|
|
798
|
-
// -- Act --
|
|
799
|
-
const files = xcodeProject.projectFiles();
|
|
800
|
-
|
|
801
|
-
// -- Assert --
|
|
802
|
-
expect(files).toEqual([
|
|
803
|
-
{
|
|
804
|
-
key: 'D4E604CD2D50CEEC00CAB00F',
|
|
805
|
-
path: 'Project.app',
|
|
806
|
-
},
|
|
807
|
-
]);
|
|
808
|
-
});
|
|
809
|
-
|
|
810
|
-
it('should cache the result', () => {
|
|
811
|
-
// -- Arrange --
|
|
812
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
813
|
-
|
|
814
|
-
// Smoke test
|
|
815
|
-
expect(xcodeProject.files).toBeUndefined();
|
|
816
|
-
|
|
817
|
-
// -- Act --
|
|
818
|
-
const files = xcodeProject.projectFiles();
|
|
819
|
-
|
|
820
|
-
// -- Assert --
|
|
821
|
-
expect(xcodeProject.files).toBeDefined();
|
|
822
|
-
expect(xcodeProject.files).toEqual(files);
|
|
823
|
-
});
|
|
824
|
-
});
|
|
825
|
-
});
|
|
826
|
-
|
|
827
|
-
describe('buildGroup', () => {
|
|
828
|
-
describe('group has undefined children', () => {
|
|
829
|
-
it('should return empty array', () => {
|
|
830
|
-
// -- Arrange --
|
|
831
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
832
|
-
const group: PBXGroup = {
|
|
833
|
-
children: undefined,
|
|
834
|
-
path: '',
|
|
835
|
-
};
|
|
836
|
-
|
|
837
|
-
// -- Act --
|
|
838
|
-
const files = xcodeProject.buildGroup(group);
|
|
839
|
-
|
|
840
|
-
// -- Assert --
|
|
841
|
-
expect(files).toEqual([]);
|
|
842
|
-
});
|
|
843
|
-
});
|
|
844
|
-
|
|
845
|
-
describe('group has no children', () => {
|
|
846
|
-
it('should return empty array', () => {
|
|
847
|
-
// -- Arrange --
|
|
848
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
849
|
-
const group: PBXGroup = {};
|
|
850
|
-
|
|
851
|
-
// -- Act --
|
|
852
|
-
const files = xcodeProject.buildGroup(group);
|
|
853
|
-
|
|
854
|
-
// -- Assert --
|
|
855
|
-
expect(files).toEqual([]);
|
|
856
|
-
});
|
|
857
|
-
});
|
|
858
|
-
|
|
859
|
-
describe('group child is file reference', () => {
|
|
860
|
-
const group: PBXGroup = {
|
|
861
|
-
children: [
|
|
862
|
-
{
|
|
863
|
-
value: 'D4E604CD2D50CEEC00CAB00F',
|
|
864
|
-
},
|
|
865
|
-
],
|
|
866
|
-
path: '',
|
|
867
|
-
};
|
|
868
|
-
|
|
869
|
-
describe('file references are undefined', () => {
|
|
870
|
-
it('should return empty array', () => {
|
|
871
|
-
// -- Arrange --
|
|
872
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
873
|
-
xcodeProject.objects.PBXFileReference = undefined;
|
|
874
|
-
|
|
875
|
-
// -- Act --
|
|
876
|
-
const files = xcodeProject.buildGroup(group);
|
|
877
|
-
|
|
878
|
-
// -- Assert --
|
|
879
|
-
expect(files).toEqual([]);
|
|
880
|
-
});
|
|
881
|
-
});
|
|
882
|
-
|
|
883
|
-
describe('file reference is string', () => {
|
|
884
|
-
it('should be ignored', () => {
|
|
885
|
-
// -- Arrange --
|
|
886
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
887
|
-
const group: PBXGroup = {
|
|
888
|
-
children: [
|
|
889
|
-
{
|
|
890
|
-
value: 'D4E604CD2D50CEEC00CAB00F_comment',
|
|
891
|
-
},
|
|
892
|
-
],
|
|
893
|
-
path: '',
|
|
894
|
-
};
|
|
895
|
-
|
|
896
|
-
// -- Act --
|
|
897
|
-
const files = xcodeProject.buildGroup(group);
|
|
898
|
-
|
|
899
|
-
// -- Assert --
|
|
900
|
-
expect(files).toEqual([]);
|
|
901
|
-
});
|
|
902
|
-
});
|
|
903
|
-
|
|
904
|
-
describe('file reference is valid', () => {
|
|
905
|
-
it('should return array of escaped paths', () => {
|
|
906
|
-
// -- Arrange --
|
|
907
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
908
|
-
xcodeProject.objects.PBXFileReference = {
|
|
909
|
-
D4E604CD2D50CEEC00CAB00F: {
|
|
910
|
-
path: '"some/path/to/file.swift"',
|
|
911
|
-
},
|
|
912
|
-
};
|
|
913
|
-
const group: PBXGroup = {
|
|
914
|
-
children: [
|
|
915
|
-
{
|
|
916
|
-
value: 'D4E604CD2D50CEEC00CAB00F',
|
|
917
|
-
},
|
|
918
|
-
],
|
|
919
|
-
path: '',
|
|
920
|
-
};
|
|
921
|
-
|
|
922
|
-
// -- Act --
|
|
923
|
-
const files = xcodeProject.buildGroup(group);
|
|
924
|
-
|
|
925
|
-
// -- Assert --
|
|
926
|
-
expect(files).toEqual([
|
|
927
|
-
{
|
|
928
|
-
key: 'D4E604CD2D50CEEC00CAB00F',
|
|
929
|
-
path: 'some/path/to/file.swift',
|
|
930
|
-
},
|
|
931
|
-
]);
|
|
932
|
-
});
|
|
933
|
-
});
|
|
934
|
-
});
|
|
935
|
-
|
|
936
|
-
describe('group child is group reference', () => {
|
|
937
|
-
const group: PBXGroup = {
|
|
938
|
-
children: [
|
|
939
|
-
{
|
|
940
|
-
value: 'D4E604C42D50CEEC00CAB00F',
|
|
941
|
-
},
|
|
942
|
-
],
|
|
943
|
-
path: '',
|
|
944
|
-
};
|
|
945
|
-
|
|
946
|
-
describe('groups are undefined', () => {
|
|
947
|
-
it('should return empty array', () => {
|
|
948
|
-
// -- Arrange --
|
|
949
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
950
|
-
xcodeProject.objects.PBXGroup = undefined;
|
|
951
|
-
|
|
952
|
-
// -- Act --
|
|
953
|
-
const files = xcodeProject.buildGroup(group);
|
|
954
|
-
|
|
955
|
-
// -- Assert --
|
|
956
|
-
expect(files).toEqual([]);
|
|
957
|
-
});
|
|
958
|
-
});
|
|
959
|
-
|
|
960
|
-
describe('group reference is string', () => {
|
|
961
|
-
it('should return array of file paths', () => {
|
|
962
|
-
// -- Arrange --
|
|
963
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
964
|
-
const group: PBXGroup = {
|
|
965
|
-
children: [
|
|
966
|
-
{
|
|
967
|
-
value: 'D4E604CE2D50CEEC00CAB00F_comment',
|
|
968
|
-
},
|
|
969
|
-
],
|
|
970
|
-
path: '',
|
|
971
|
-
};
|
|
972
|
-
|
|
973
|
-
// -- Act --
|
|
974
|
-
const files = xcodeProject.buildGroup(group);
|
|
975
|
-
|
|
976
|
-
// -- Assert --
|
|
977
|
-
expect(files).toEqual([]);
|
|
978
|
-
});
|
|
979
|
-
});
|
|
980
|
-
|
|
981
|
-
describe('group reference is valid', () => {
|
|
982
|
-
it('should return array of file paths', () => {
|
|
983
|
-
// -- Arrange --
|
|
984
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
985
|
-
|
|
986
|
-
// -- Act --
|
|
987
|
-
const files = xcodeProject.buildGroup(group);
|
|
988
|
-
|
|
989
|
-
// -- Assert --
|
|
990
|
-
expect(files).toEqual([
|
|
991
|
-
{
|
|
992
|
-
key: 'D4E604CD2D50CEEC00CAB00F',
|
|
993
|
-
path: 'Project.app',
|
|
994
|
-
},
|
|
995
|
-
]);
|
|
996
|
-
});
|
|
997
|
-
});
|
|
998
|
-
|
|
999
|
-
describe('group reference has path', () => {
|
|
1000
|
-
it('should append the path to the file paths', () => {
|
|
1001
|
-
// -- Arrange --
|
|
1002
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
1003
|
-
const group: PBXGroup = {
|
|
1004
|
-
children: [
|
|
1005
|
-
{
|
|
1006
|
-
value: 'sub-group',
|
|
1007
|
-
},
|
|
1008
|
-
],
|
|
1009
|
-
path: '"some/path/to/group"',
|
|
1010
|
-
};
|
|
1011
|
-
const subgroup: PBXGroup = {
|
|
1012
|
-
children: [
|
|
1013
|
-
{
|
|
1014
|
-
value: 'file-at-path',
|
|
1015
|
-
},
|
|
1016
|
-
],
|
|
1017
|
-
};
|
|
1018
|
-
const file: PBXFileReference = {
|
|
1019
|
-
path: '"some/file/at/path.swift"',
|
|
1020
|
-
};
|
|
1021
|
-
xcodeProject.objects.PBXGroup = {
|
|
1022
|
-
'main-group': group,
|
|
1023
|
-
'sub-group': subgroup,
|
|
1024
|
-
};
|
|
1025
|
-
xcodeProject.objects.PBXFileReference = {
|
|
1026
|
-
'file-at-path': file,
|
|
1027
|
-
};
|
|
1028
|
-
|
|
1029
|
-
// -- Act --
|
|
1030
|
-
const files = xcodeProject.buildGroup(group);
|
|
1031
|
-
|
|
1032
|
-
// -- Assert --
|
|
1033
|
-
expect(files).toEqual([
|
|
1034
|
-
{
|
|
1035
|
-
key: 'file-at-path',
|
|
1036
|
-
path: 'some/file/at/path.swift',
|
|
1037
|
-
},
|
|
1038
|
-
]);
|
|
1039
|
-
});
|
|
1040
|
-
});
|
|
1041
|
-
});
|
|
1042
|
-
|
|
1043
|
-
describe('group child is not a file reference or group', () => {
|
|
1044
|
-
it('should be ignored', () => {
|
|
1045
|
-
// -- Arrange --
|
|
1046
|
-
const xcodeProject = new XcodeProject(singleTargetProjectPath);
|
|
1047
|
-
xcodeProject.objects.PBXGroup = {};
|
|
1048
|
-
xcodeProject.objects.PBXFileReference = {};
|
|
1049
|
-
const group: PBXGroup = {
|
|
1050
|
-
children: [
|
|
1051
|
-
{
|
|
1052
|
-
value: 'random-key',
|
|
1053
|
-
},
|
|
1054
|
-
],
|
|
1055
|
-
path: '',
|
|
1056
|
-
};
|
|
1057
|
-
|
|
1058
|
-
// -- Act --
|
|
1059
|
-
const files = xcodeProject.buildGroup(group);
|
|
1060
|
-
|
|
1061
|
-
// -- Assert --
|
|
1062
|
-
expect(files).toEqual([]);
|
|
1063
|
-
});
|
|
1064
|
-
});
|
|
1065
|
-
});
|
|
1066
|
-
});
|