@datadog/datadog-ci-base 5.7.0 → 5.9.0
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/cli.d.ts +13 -1
- package/dist/cli.js +76 -33
- package/dist/cli.js.map +1 -1
- package/dist/commands/aas/common.d.ts +13 -2
- package/dist/commands/aas/common.js +46 -24
- package/dist/commands/aas/common.js.map +1 -1
- package/dist/commands/aas/instrument.js +1 -1
- package/dist/commands/aas/instrument.js.map +1 -1
- package/dist/commands/aas/uninstrument.js +1 -1
- package/dist/commands/aas/uninstrument.js.map +1 -1
- package/dist/commands/ci-env/cli.d.ts +2 -0
- package/dist/commands/ci-env/cli.js +10 -0
- package/dist/commands/ci-env/cli.js.map +1 -0
- package/dist/commands/ci-env/read.d.ts +7 -0
- package/dist/commands/ci-env/read.js +176 -0
- package/dist/commands/ci-env/read.js.map +1 -0
- package/dist/commands/cloud-run/constants.js +1 -2
- package/dist/commands/cloud-run/constants.js.map +1 -1
- package/dist/commands/container-app/common.js +10 -11
- package/dist/commands/container-app/common.js.map +1 -1
- package/dist/commands/coverage/upload.d.ts +2 -0
- package/dist/commands/coverage/upload.js +6 -0
- package/dist/commands/coverage/upload.js.map +1 -1
- package/dist/commands/elf-symbols/cli.d.ts +2 -0
- package/dist/commands/elf-symbols/cli.js +10 -0
- package/dist/commands/elf-symbols/cli.js.map +1 -0
- package/dist/commands/elf-symbols/elf-constants.d.ts +256 -0
- package/dist/commands/elf-symbols/elf-constants.js +465 -0
- package/dist/commands/elf-symbols/elf-constants.js.map +1 -0
- package/dist/commands/elf-symbols/elf.d.ts +105 -0
- package/dist/commands/elf-symbols/elf.js +431 -0
- package/dist/commands/elf-symbols/elf.js.map +1 -0
- package/dist/commands/elf-symbols/helpers.d.ts +4 -0
- package/dist/commands/elf-symbols/helpers.js +29 -0
- package/dist/commands/elf-symbols/helpers.js.map +1 -0
- package/dist/commands/elf-symbols/interfaces.d.ts +18 -0
- package/dist/commands/elf-symbols/interfaces.js +7 -0
- package/dist/commands/elf-symbols/interfaces.js.map +1 -0
- package/dist/commands/elf-symbols/renderer.d.ts +19 -0
- package/dist/commands/elf-symbols/renderer.js +87 -0
- package/dist/commands/elf-symbols/renderer.js.map +1 -0
- package/dist/commands/elf-symbols/upload.d.ts +31 -0
- package/dist/commands/elf-symbols/upload.js +412 -0
- package/dist/commands/elf-symbols/upload.js.map +1 -0
- package/dist/commands/flutter-symbols/cli.d.ts +2 -0
- package/dist/commands/flutter-symbols/cli.js +10 -0
- package/dist/commands/flutter-symbols/cli.js.map +1 -0
- package/dist/commands/flutter-symbols/helpers.d.ts +8 -0
- package/dist/commands/flutter-symbols/helpers.js +51 -0
- package/dist/commands/flutter-symbols/helpers.js.map +1 -0
- package/dist/commands/flutter-symbols/interfaces.d.ts +17 -0
- package/dist/commands/flutter-symbols/interfaces.js +10 -0
- package/dist/commands/flutter-symbols/interfaces.js.map +1 -0
- package/dist/commands/flutter-symbols/renderer.d.ts +23 -0
- package/dist/commands/flutter-symbols/renderer.js +106 -0
- package/dist/commands/flutter-symbols/renderer.js.map +1 -0
- package/dist/commands/flutter-symbols/upload.d.ts +44 -0
- package/dist/commands/flutter-symbols/upload.js +510 -0
- package/dist/commands/flutter-symbols/upload.js.map +1 -0
- package/dist/commands/lambda/cli.d.ts +2 -1
- package/dist/commands/lambda/cli.js +2 -0
- package/dist/commands/lambda/cli.js.map +1 -1
- package/dist/commands/lambda/cloudwatch.d.ts +15 -0
- package/dist/commands/lambda/cloudwatch.js +77 -0
- package/dist/commands/lambda/cloudwatch.js.map +1 -0
- package/dist/commands/measure/cli.d.ts +2 -0
- package/dist/commands/measure/cli.js +10 -0
- package/dist/commands/measure/cli.js.map +1 -0
- package/dist/commands/measure/measure.d.ts +18 -0
- package/dist/commands/measure/measure.js +171 -0
- package/dist/commands/measure/measure.js.map +1 -0
- package/dist/commands/pe-symbols/breakpad.d.ts +2 -0
- package/dist/commands/pe-symbols/breakpad.js +159 -0
- package/dist/commands/pe-symbols/breakpad.js.map +1 -0
- package/dist/commands/pe-symbols/cli.d.ts +2 -0
- package/dist/commands/pe-symbols/cli.js +10 -0
- package/dist/commands/pe-symbols/cli.js.map +1 -0
- package/dist/commands/pe-symbols/helpers.d.ts +4 -0
- package/dist/commands/pe-symbols/helpers.js +30 -0
- package/dist/commands/pe-symbols/helpers.js.map +1 -0
- package/dist/commands/pe-symbols/interfaces.d.ts +17 -0
- package/dist/commands/pe-symbols/interfaces.js +7 -0
- package/dist/commands/pe-symbols/interfaces.js.map +1 -0
- package/dist/commands/pe-symbols/pe-constants.d.ts +51 -0
- package/dist/commands/pe-symbols/pe-constants.js +160 -0
- package/dist/commands/pe-symbols/pe-constants.js.map +1 -0
- package/dist/commands/pe-symbols/pe.d.ts +40 -0
- package/dist/commands/pe-symbols/pe.js +249 -0
- package/dist/commands/pe-symbols/pe.js.map +1 -0
- package/dist/commands/pe-symbols/renderer.d.ts +19 -0
- package/dist/commands/pe-symbols/renderer.js +87 -0
- package/dist/commands/pe-symbols/renderer.js.map +1 -0
- package/dist/commands/pe-symbols/upload.d.ts +34 -0
- package/dist/commands/pe-symbols/upload.js +457 -0
- package/dist/commands/pe-symbols/upload.js.map +1 -0
- package/dist/commands/react-native/cli.d.ts +5 -0
- package/dist/commands/react-native/cli.js +16 -0
- package/dist/commands/react-native/cli.js.map +1 -0
- package/dist/commands/react-native/codepush.d.ts +29 -0
- package/dist/commands/react-native/codepush.js +176 -0
- package/dist/commands/react-native/codepush.js.map +1 -0
- package/dist/commands/react-native/errors.d.ts +9 -0
- package/dist/commands/react-native/errors.js +34 -0
- package/dist/commands/react-native/errors.js.map +1 -0
- package/dist/commands/react-native/injectDebugId.d.ts +42 -0
- package/dist/commands/react-native/injectDebugId.js +252 -0
- package/dist/commands/react-native/injectDebugId.js.map +1 -0
- package/dist/commands/react-native/interfaces.d.ts +20 -0
- package/dist/commands/react-native/interfaces.js +93 -0
- package/dist/commands/react-native/interfaces.js.map +1 -0
- package/dist/commands/react-native/renderer.d.ts +20 -0
- package/dist/commands/react-native/renderer.js +111 -0
- package/dist/commands/react-native/renderer.js.map +1 -0
- package/dist/commands/react-native/upload.d.ts +30 -0
- package/dist/commands/react-native/upload.js +317 -0
- package/dist/commands/react-native/upload.js.map +1 -0
- package/dist/commands/react-native/utils.d.ts +4 -0
- package/dist/commands/react-native/utils.js +35 -0
- package/dist/commands/react-native/utils.js.map +1 -0
- package/dist/commands/react-native/validation.d.ts +6 -0
- package/dist/commands/react-native/validation.js +24 -0
- package/dist/commands/react-native/validation.js.map +1 -0
- package/dist/commands/react-native/xcode.d.ts +58 -0
- package/dist/commands/react-native/xcode.js +561 -0
- package/dist/commands/react-native/xcode.js.map +1 -0
- package/dist/commands/sourcemaps/cli.d.ts +2 -0
- package/dist/commands/sourcemaps/cli.js +10 -0
- package/dist/commands/sourcemaps/cli.js.map +1 -0
- package/dist/commands/sourcemaps/interfaces.d.ts +18 -0
- package/dist/commands/sourcemaps/interfaces.js +59 -0
- package/dist/commands/sourcemaps/interfaces.js.map +1 -0
- package/dist/commands/sourcemaps/renderer.d.ts +13 -0
- package/dist/commands/sourcemaps/renderer.js +93 -0
- package/dist/commands/sourcemaps/renderer.js.map +1 -0
- package/dist/commands/sourcemaps/upload.d.ts +29 -0
- package/dist/commands/sourcemaps/upload.js +342 -0
- package/dist/commands/sourcemaps/upload.js.map +1 -0
- package/dist/commands/sourcemaps/utils.d.ts +3 -0
- package/dist/commands/sourcemaps/utils.js +73 -0
- package/dist/commands/sourcemaps/utils.js.map +1 -0
- package/dist/commands/sourcemaps/validation.d.ts +7 -0
- package/dist/commands/sourcemaps/validation.js +41 -0
- package/dist/commands/sourcemaps/validation.js.map +1 -0
- package/dist/commands/span/cli.d.ts +2 -0
- package/dist/commands/span/cli.js +10 -0
- package/dist/commands/span/cli.js.map +1 -0
- package/dist/commands/span/span.d.ts +10 -0
- package/dist/commands/span/span.js +112 -0
- package/dist/commands/span/span.js.map +1 -0
- package/dist/commands/terraform/cli.d.ts +2 -0
- package/dist/commands/terraform/cli.js +10 -0
- package/dist/commands/terraform/cli.js.map +1 -0
- package/dist/commands/terraform/upload.d.ts +14 -0
- package/dist/commands/terraform/upload.js +93 -0
- package/dist/commands/terraform/upload.js.map +1 -0
- package/dist/commands/trace/api.d.ts +6 -0
- package/dist/commands/trace/api.js +38 -0
- package/dist/commands/trace/api.js.map +1 -0
- package/dist/commands/trace/cli.d.ts +2 -0
- package/dist/commands/trace/cli.js +10 -0
- package/dist/commands/trace/cli.js.map +1 -0
- package/dist/commands/trace/helper.d.ts +16 -0
- package/dist/commands/trace/helper.js +125 -0
- package/dist/commands/trace/helper.js.map +1 -0
- package/dist/commands/trace/interfaces.d.ts +18 -0
- package/dist/commands/trace/interfaces.js +14 -0
- package/dist/commands/trace/interfaces.js.map +1 -0
- package/dist/commands/trace/test-utils.d.ts +4 -0
- package/dist/commands/trace/test-utils.js +156 -0
- package/dist/commands/trace/test-utils.js.map +1 -0
- package/dist/commands/trace/trace.d.ts +10 -0
- package/dist/commands/trace/trace.js +110 -0
- package/dist/commands/trace/trace.js.map +1 -0
- package/dist/commands/unity-symbols/cli.d.ts +2 -0
- package/dist/commands/unity-symbols/cli.js +10 -0
- package/dist/commands/unity-symbols/cli.js.map +1 -0
- package/dist/commands/unity-symbols/helpers.d.ts +4 -0
- package/dist/commands/unity-symbols/helpers.js +29 -0
- package/dist/commands/unity-symbols/helpers.js.map +1 -0
- package/dist/commands/unity-symbols/interfaces.d.ts +14 -0
- package/dist/commands/unity-symbols/interfaces.js +9 -0
- package/dist/commands/unity-symbols/interfaces.js.map +1 -0
- package/dist/commands/unity-symbols/renderer.d.ts +19 -0
- package/dist/commands/unity-symbols/renderer.js +88 -0
- package/dist/commands/unity-symbols/renderer.js.map +1 -0
- package/dist/commands/unity-symbols/upload.d.ts +32 -0
- package/dist/commands/unity-symbols/upload.js +392 -0
- package/dist/commands/unity-symbols/upload.js.map +1 -0
- package/dist/commands/version/cli.d.ts +2 -0
- package/dist/commands/version/cli.js +10 -0
- package/dist/commands/version/cli.js.map +1 -0
- package/dist/commands/version/version.d.ts +6 -0
- package/dist/commands/version/version.js +31 -0
- package/dist/commands/version/version.js.map +1 -0
- package/dist/helpers/ci.js +50 -5
- package/dist/helpers/ci.js.map +1 -1
- package/dist/helpers/plugin.js +1 -1
- package/dist/helpers/plugin.js.map +1 -1
- package/dist/helpers/serverless/azure.d.ts +2 -0
- package/dist/helpers/serverless/azure.js +3 -3
- package/dist/helpers/serverless/azure.js.map +1 -1
- package/dist/helpers/serverless/lambda-layer-versions.d.ts +3 -3
- package/dist/helpers/serverless/lambda-layer-versions.js +3 -3
- package/package.json +23 -17
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { BaseCommand } from '@datadog/datadog-ci-base';
|
|
2
|
+
export declare class ReactNativeXcodeCommand extends BaseCommand {
|
|
3
|
+
static paths: string[][];
|
|
4
|
+
static usage: import("clipanion").Usage;
|
|
5
|
+
private composeSourcemapsPath;
|
|
6
|
+
private configPath;
|
|
7
|
+
private disableGit;
|
|
8
|
+
private dryRun;
|
|
9
|
+
private force;
|
|
10
|
+
private infoPlistPath;
|
|
11
|
+
private removeSourcesContent;
|
|
12
|
+
private repositoryURL;
|
|
13
|
+
private service;
|
|
14
|
+
private scriptPath;
|
|
15
|
+
private fips;
|
|
16
|
+
private fipsIgnoreError;
|
|
17
|
+
private config;
|
|
18
|
+
private _reactNativePath;
|
|
19
|
+
private _datadogReactNativePath;
|
|
20
|
+
private _defaultScriptPath;
|
|
21
|
+
private get reactNativePath();
|
|
22
|
+
private get datadogReactNativePath();
|
|
23
|
+
private get defaultScriptPath();
|
|
24
|
+
execute(): Promise<number>;
|
|
25
|
+
/**
|
|
26
|
+
* Resolves the Debug ID from the bundle file and writes it into the sourcemap.
|
|
27
|
+
*/
|
|
28
|
+
private copyDebugIdFromBundle;
|
|
29
|
+
/**
|
|
30
|
+
* Fallback method to copy the debug ID from the temporary file created by the Metro plugin.
|
|
31
|
+
* This is used when the debug ID is not found in the bundle file.
|
|
32
|
+
*/
|
|
33
|
+
private copyDebugIdFromTempFile;
|
|
34
|
+
/**
|
|
35
|
+
* Writes the debug ID into the sourcemap file.
|
|
36
|
+
* If the sourcemap already contains a debug ID, it will skip the update unless `force` is true.
|
|
37
|
+
* If the debug ID in the sourcemap does not match the provided debug ID, it will log a warning.
|
|
38
|
+
*/
|
|
39
|
+
private writeDebugIdInSourcemap;
|
|
40
|
+
private bundleReactNativeCodeAndImages;
|
|
41
|
+
private getBundleReactNativeCodeAndImagesEnvironment;
|
|
42
|
+
private composeHermesSourcemaps;
|
|
43
|
+
private getBuildVersion;
|
|
44
|
+
private getBundleLocation;
|
|
45
|
+
private getPlistValue;
|
|
46
|
+
private getReleaseVersion;
|
|
47
|
+
private getSourcemapsLocation;
|
|
48
|
+
/**
|
|
49
|
+
* This function reflects the logic in the react-native-xcode.sh bundle script.
|
|
50
|
+
* When the composition issue is fixed in React Native, this function should
|
|
51
|
+
* return false if the React Native version is at least 0.71 where it was fixed.
|
|
52
|
+
*/
|
|
53
|
+
private shouldComposeHermesSourcemaps;
|
|
54
|
+
private isHermesEnabled;
|
|
55
|
+
private shouldUploadSourcemaps;
|
|
56
|
+
private shouldBundleRNCode;
|
|
57
|
+
private verifyFolderPath;
|
|
58
|
+
}
|
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ReactNativeXcodeCommand = void 0;
|
|
13
|
+
/* eslint-disable no-null/no-null */
|
|
14
|
+
const child_process_1 = require("child_process");
|
|
15
|
+
const fs_1 = require("fs");
|
|
16
|
+
const clipanion_1 = require("clipanion");
|
|
17
|
+
const datadog_ci_base_1 = require("@datadog/datadog-ci-base");
|
|
18
|
+
const constants_1 = require("@datadog/datadog-ci-base/constants");
|
|
19
|
+
const env_1 = require("@datadog/datadog-ci-base/helpers/env");
|
|
20
|
+
const fips_1 = require("@datadog/datadog-ci-base/helpers/fips");
|
|
21
|
+
const plist_1 = require("@datadog/datadog-ci-base/helpers/plist");
|
|
22
|
+
const upload_1 = require("./upload");
|
|
23
|
+
const utils_1 = require("./utils");
|
|
24
|
+
/**
|
|
25
|
+
* Because jest cannot mock require.resolve, reactNativePath cannot
|
|
26
|
+
* be unit tested. If you make any change to it, make sure to test
|
|
27
|
+
* it with a real project.
|
|
28
|
+
*/
|
|
29
|
+
const getReactNativePath = () => {
|
|
30
|
+
try {
|
|
31
|
+
const indexFilePath = require.resolve('react-native');
|
|
32
|
+
// We need to remove the trailing "/index.js" at the end of the path
|
|
33
|
+
return indexFilePath.split('/').slice(0, -1).join('/');
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
// When the command is ran from XCode with `../node_modules/.bin/datadog-ci react-native xcode`
|
|
37
|
+
if ((0, fs_1.existsSync)('../node_modules/react-native/package.json')) {
|
|
38
|
+
return '../node_modules/react-native';
|
|
39
|
+
}
|
|
40
|
+
// Used for internal testing purposes only
|
|
41
|
+
if (process.env.DATADOG_CI_REACT_NATIVE_PATH) {
|
|
42
|
+
return process.env.DATADOG_CI_REACT_NATIVE_PATH;
|
|
43
|
+
}
|
|
44
|
+
// When the command is ran from XCode with yarn react-native xcode` (legacy)
|
|
45
|
+
return 'node_modules/react-native';
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Because jest cannot mock require.resolve, datadogReactNativePath cannot
|
|
50
|
+
* be unit tested. If you make any change to it, make sure to test
|
|
51
|
+
* it with a real project.
|
|
52
|
+
*/
|
|
53
|
+
const getDatadogReactNativePath = () => {
|
|
54
|
+
try {
|
|
55
|
+
const packageJsonPath = require.resolve('@datadog/mobile-react-native/package.json');
|
|
56
|
+
// We need to remove the trailing "/package.json" at the end of the path
|
|
57
|
+
return packageJsonPath.split('/').slice(0, -1).join('/');
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
// When the command is ran from XCode with `../node_modules/.bin/datadog-ci react-native xcode`
|
|
61
|
+
if ((0, fs_1.existsSync)('../node_modules/@datadog/mobile-react-native/package.json')) {
|
|
62
|
+
return '../node_modules/@datadog/mobile-react-native';
|
|
63
|
+
}
|
|
64
|
+
// Used for internal testing purposes only
|
|
65
|
+
if (process.env.DATADOG_REACT_NATIVE_PATH) {
|
|
66
|
+
return process.env.DATADOG_REACT_NATIVE_PATH;
|
|
67
|
+
}
|
|
68
|
+
// When the command is ran from XCode with yarn react-native xcode` (legacy)
|
|
69
|
+
return 'node_modules/@datadog/mobile-react-native';
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
class ReactNativeXcodeCommand extends datadog_ci_base_1.BaseCommand {
|
|
73
|
+
constructor() {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
super(...arguments);
|
|
76
|
+
this.composeSourcemapsPath = clipanion_1.Option.String('--compose-sourcemaps-path', `${this.reactNativePath}/scripts/compose-source-maps.js`);
|
|
77
|
+
this.configPath = clipanion_1.Option.String('--config');
|
|
78
|
+
this.disableGit = clipanion_1.Option.Boolean('--disable-git');
|
|
79
|
+
this.dryRun = clipanion_1.Option.Boolean('--dry-run', false);
|
|
80
|
+
this.force = clipanion_1.Option.Boolean('--force', false);
|
|
81
|
+
this.infoPlistPath = clipanion_1.Option.String('--info-plist-path');
|
|
82
|
+
this.removeSourcesContent = clipanion_1.Option.Boolean('--remove-sources-content');
|
|
83
|
+
this.repositoryURL = clipanion_1.Option.String('--repository-url');
|
|
84
|
+
this.service = clipanion_1.Option.String('--service');
|
|
85
|
+
this.scriptPath = clipanion_1.Option.String({ required: false }); // Positional
|
|
86
|
+
this.fips = clipanion_1.Option.Boolean('--fips', false);
|
|
87
|
+
this.fipsIgnoreError = clipanion_1.Option.Boolean('--fips-ignore-error', false);
|
|
88
|
+
this.config = {
|
|
89
|
+
fips: (_a = (0, env_1.toBoolean)(process.env[constants_1.FIPS_ENV_VAR])) !== null && _a !== void 0 ? _a : false,
|
|
90
|
+
fipsIgnoreError: (_b = (0, env_1.toBoolean)(process.env[constants_1.FIPS_IGNORE_ERROR_ENV_VAR])) !== null && _b !== void 0 ? _b : false,
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Resolves the Debug ID from the bundle file and writes it into the sourcemap.
|
|
94
|
+
*/
|
|
95
|
+
this.copyDebugIdFromBundle = (bundleLocation, sourcemapsLocation) => {
|
|
96
|
+
try {
|
|
97
|
+
const bundleContent = (0, fs_1.readFileSync)(bundleLocation, 'utf8');
|
|
98
|
+
const match = bundleContent.match(/\/\/# debugId=([a-f0-9-]+)/i);
|
|
99
|
+
const debugId = match ? match[1] : undefined;
|
|
100
|
+
if (!debugId) {
|
|
101
|
+
this.context.stderr.write('\nDebug ID not found in bundle.\n');
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
this.context.stdout.write(`\nFound debug ID in bundle. Copying to sourcemap.\n`);
|
|
105
|
+
return this.writeDebugIdInSourcemap(sourcemapsLocation, debugId);
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
this.context.stderr.write(`\nError reading bundle file: ${String(error)}\n`);
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Fallback method to copy the debug ID from the temporary file created by the Metro plugin.
|
|
114
|
+
* This is used when the debug ID is not found in the bundle file.
|
|
115
|
+
*/
|
|
116
|
+
this.copyDebugIdFromTempFile = (sourcemapsLocation) => {
|
|
117
|
+
const debugIdFilePath = `${this.datadogReactNativePath}/.tmp/debug_id`;
|
|
118
|
+
if (!(0, fs_1.existsSync)(debugIdFilePath)) {
|
|
119
|
+
this.context.stderr.write(`\nDebug ID temporary file not found in ${debugIdFilePath}. Skipping copy.\n`);
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
let debugId;
|
|
123
|
+
try {
|
|
124
|
+
debugId = (0, fs_1.readFileSync)(debugIdFilePath, 'utf-8').trim();
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
this.context.stderr.write(`\nError reading debug ID file: ${String(error)}\n`);
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
finally {
|
|
131
|
+
try {
|
|
132
|
+
this.context.stdout.write(`\nRemoving debug ID file at ${debugIdFilePath}\n`);
|
|
133
|
+
(0, fs_1.unlinkSync)(debugIdFilePath);
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
this.context.stderr.write(`\nError removing debug ID file: ${String(error)}\n`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (!debugId || debugId.trim() === '') {
|
|
140
|
+
this.context.stderr.write('\nDebug ID file is empty. Skipping copy.\n');
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
this.context.stdout.write(`\nFound debug ID in ${debugIdFilePath}.\n`);
|
|
144
|
+
const success = this.writeDebugIdInSourcemap(sourcemapsLocation, debugId);
|
|
145
|
+
if (!success) {
|
|
146
|
+
this.context.stderr.write('\nFailed to write debug ID into sourcemap.\n');
|
|
147
|
+
}
|
|
148
|
+
return success;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Writes the debug ID into the sourcemap file.
|
|
152
|
+
* If the sourcemap already contains a debug ID, it will skip the update unless `force` is true.
|
|
153
|
+
* If the debug ID in the sourcemap does not match the provided debug ID, it will log a warning.
|
|
154
|
+
*/
|
|
155
|
+
this.writeDebugIdInSourcemap = (sourcemapsLocation, debugId, force = false) => {
|
|
156
|
+
try {
|
|
157
|
+
const sourcemapFile = (0, fs_1.readFileSync)(sourcemapsLocation, 'utf-8');
|
|
158
|
+
const sourcemap = JSON.parse(sourcemapFile);
|
|
159
|
+
if (sourcemap.debugId && sourcemap.debugId.trim() !== '' && !force) {
|
|
160
|
+
this.context.stdout.write(`\nSourcemap already contains a debugId: ${sourcemap.debugId}. Skipping update.\n`);
|
|
161
|
+
if (sourcemap.debugId !== debugId) {
|
|
162
|
+
this.context.stderr.write(`\nWARNING: The existing debugId (${sourcemap.debugId}) does not match the resolved debugId (${debugId}).
|
|
163
|
+
\nThis should never occur, please open an issue at https://github.com/DataDog/datadog-ci/issues/new?template=BUG_REPORT.yml`);
|
|
164
|
+
}
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
sourcemap.debugId = debugId;
|
|
168
|
+
this.context.stdout.write(`\nAdding debugId ${debugId} to the sourcemap at ${sourcemapsLocation}\n`);
|
|
169
|
+
(0, fs_1.writeFileSync)(sourcemapsLocation, JSON.stringify(sourcemap));
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
this.context.stderr.write(`\nError writing debugId to sourcemap: ${String(error)}\n`);
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
return true;
|
|
176
|
+
};
|
|
177
|
+
this.bundleReactNativeCodeAndImages = () => __awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
const bundleJSChildProcess = (0, child_process_1.spawn)(this.scriptPath || this.defaultScriptPath, [], {
|
|
179
|
+
env: this.getBundleReactNativeCodeAndImagesEnvironment(),
|
|
180
|
+
stdio: ['inherit', 'pipe', 'pipe'],
|
|
181
|
+
});
|
|
182
|
+
bundleJSChildProcess.stdout.on('data', (data) => {
|
|
183
|
+
this.context.stdout.write(`[bundle script]: ${String(data)}`);
|
|
184
|
+
});
|
|
185
|
+
bundleJSChildProcess.stderr.on('data', (data) => {
|
|
186
|
+
this.context.stderr.write(`[bundle script]: ${String(data)}`);
|
|
187
|
+
});
|
|
188
|
+
const [status, signal] = yield new Promise((resolve, reject) => {
|
|
189
|
+
bundleJSChildProcess.on('error', (error) => {
|
|
190
|
+
reject(error);
|
|
191
|
+
});
|
|
192
|
+
bundleJSChildProcess.on('close', (exitStatus, exitSignal) => {
|
|
193
|
+
resolve([exitStatus, exitSignal]);
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
if (status !== 0) {
|
|
197
|
+
throw new Error(`error ${signal} while running datadog-ci xcode.`);
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
this.getBundleReactNativeCodeAndImagesEnvironment = () => {
|
|
201
|
+
const env = process.env;
|
|
202
|
+
/**
|
|
203
|
+
* On React Native 0.70, we need to explicitely set USE_HERMES to true
|
|
204
|
+
* if Hermes is used, otherwise the source maps won't be generated.
|
|
205
|
+
* See the fix for next releases: https://github.com/facebook/react-native/commit/03de19745eec9a0d4d1075bac48639ecf1d41352
|
|
206
|
+
*/
|
|
207
|
+
if (this.shouldComposeHermesSourcemaps()) {
|
|
208
|
+
env.USE_HERMES = 'true';
|
|
209
|
+
}
|
|
210
|
+
return env;
|
|
211
|
+
};
|
|
212
|
+
this.composeHermesSourcemaps = (sourcemapsLocation) => __awaiter(this, void 0, void 0, function* () {
|
|
213
|
+
if (!process.env.UNLOCALIZED_RESOURCES_FOLDER_PATH) {
|
|
214
|
+
this.context.stderr.write('Environment variable UNLOCALIZED_RESOURCES_FOLDER_PATH is missing for Datadog sourcemaps composition.\n');
|
|
215
|
+
this.context.stderr.write('If you are not running this script from XCode, set it to the subfolder containing the hbc sourcemap.\n');
|
|
216
|
+
throw new Error('Environment variable UNLOCALIZED_RESOURCES_FOLDER_PATH is missing for Datadog sourcemaps composition.');
|
|
217
|
+
}
|
|
218
|
+
const composeHermesSourcemapsChildProcess = (0, child_process_1.spawn)(this.composeSourcemapsPath, [
|
|
219
|
+
`${process.env.CONFIGURATION_BUILD_DIR}/main.jsbundle.map`,
|
|
220
|
+
`${process.env.CONFIGURATION_BUILD_DIR}/${process.env.UNLOCALIZED_RESOURCES_FOLDER_PATH}/main.jsbundle.map`,
|
|
221
|
+
'-o',
|
|
222
|
+
sourcemapsLocation,
|
|
223
|
+
], {
|
|
224
|
+
env: process.env,
|
|
225
|
+
stdio: ['inherit', 'pipe', 'pipe'],
|
|
226
|
+
});
|
|
227
|
+
composeHermesSourcemapsChildProcess.stdout.on('data', (data) => {
|
|
228
|
+
this.context.stdout.write(`[compose sourcemaps script]: ${data}`);
|
|
229
|
+
});
|
|
230
|
+
composeHermesSourcemapsChildProcess.stderr.on('data', (data) => {
|
|
231
|
+
this.context.stderr.write(`[compose sourcemaps script]: ${data}`);
|
|
232
|
+
});
|
|
233
|
+
const [status, signal] = yield new Promise((resolve, reject) => {
|
|
234
|
+
composeHermesSourcemapsChildProcess.on('error', (error) => {
|
|
235
|
+
reject(error);
|
|
236
|
+
});
|
|
237
|
+
composeHermesSourcemapsChildProcess.on('close', (exitStatus, exitSignal) => {
|
|
238
|
+
resolve([exitStatus, exitSignal]);
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
if (status !== 0) {
|
|
242
|
+
throw new Error(`error ${signal} while running datadog-ci xcode.`);
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
this.getBuildVersion = () => {
|
|
246
|
+
try {
|
|
247
|
+
const buildVersion = this.getPlistValue('CFBundleVersion');
|
|
248
|
+
return typeof buildVersion === 'number' ? buildVersion.toString() : buildVersion;
|
|
249
|
+
}
|
|
250
|
+
catch (error) {
|
|
251
|
+
if (!process.env.CURRENT_PROJECT_VERSION) {
|
|
252
|
+
this.context.stderr.write('Build version could not be found.\n');
|
|
253
|
+
this.context.stderr.write('Check that a Build is set for your target in XCode. It might need to be changed once.\n');
|
|
254
|
+
if (this.infoPlistPath) {
|
|
255
|
+
this.context.stderr.write(`You can also check that a CFBundleVersion is defined in your Info.plist at ${this.infoPlistPath}.\n`);
|
|
256
|
+
}
|
|
257
|
+
this.context.stderr.write('If you are not running this script from XCode, set a CURRENT_PROJECT_VERSION environment variable before running the script.\n');
|
|
258
|
+
return null;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return process.env.CURRENT_PROJECT_VERSION;
|
|
262
|
+
};
|
|
263
|
+
this.getBundleLocation = () => {
|
|
264
|
+
if (!process.env.CONFIGURATION_BUILD_DIR) {
|
|
265
|
+
return null;
|
|
266
|
+
}
|
|
267
|
+
return `${process.env.CONFIGURATION_BUILD_DIR}/main.jsbundle`;
|
|
268
|
+
};
|
|
269
|
+
this.getPlistValue = (propertyName) => {
|
|
270
|
+
if (!this.infoPlistPath) {
|
|
271
|
+
throw new Error('Could not find plist path');
|
|
272
|
+
}
|
|
273
|
+
return (0, plist_1.parsePlist)(this.infoPlistPath).getPropertyValue(propertyName);
|
|
274
|
+
};
|
|
275
|
+
this.getReleaseVersion = () => {
|
|
276
|
+
if (process.env.DATADOG_RELEASE_VERSION) {
|
|
277
|
+
return process.env.DATADOG_RELEASE_VERSION;
|
|
278
|
+
}
|
|
279
|
+
try {
|
|
280
|
+
const releaseVersion = this.getPlistValue('CFBundleShortVersionString');
|
|
281
|
+
return typeof releaseVersion === 'number' ? releaseVersion.toString() : releaseVersion;
|
|
282
|
+
}
|
|
283
|
+
catch (error) {
|
|
284
|
+
if (!process.env.MARKETING_VERSION) {
|
|
285
|
+
this.context.stderr.write('Version could not be found.\n');
|
|
286
|
+
this.context.stderr.write('Check that a Version is set for your target in XCode. It might need to be changed once.\n');
|
|
287
|
+
if (this.infoPlistPath) {
|
|
288
|
+
this.context.stderr.write(`You can also check that a CFBundleShortVersionString is defined in your Info.plist at ${this.infoPlistPath}.\n`);
|
|
289
|
+
}
|
|
290
|
+
this.context.stderr.write('If you are not running this script from XCode, set a MARKETING_VERSION environment variable before running the script.\n');
|
|
291
|
+
return null;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return process.env.MARKETING_VERSION;
|
|
295
|
+
};
|
|
296
|
+
this.getSourcemapsLocation = () => {
|
|
297
|
+
if (process.env.SOURCEMAP_FILE) {
|
|
298
|
+
return `${process.env.SOURCEMAP_FILE}`;
|
|
299
|
+
}
|
|
300
|
+
if (process.env.EXTRA_PACKAGER_ARGS) {
|
|
301
|
+
const splitArguments = process.env.EXTRA_PACKAGER_ARGS.split(' ');
|
|
302
|
+
const sourcemapsLocationIndex = splitArguments.findIndex((arg) => arg === '--sourcemap-output') + 1;
|
|
303
|
+
if (sourcemapsLocationIndex === 0) {
|
|
304
|
+
return null;
|
|
305
|
+
}
|
|
306
|
+
return splitArguments[sourcemapsLocationIndex];
|
|
307
|
+
}
|
|
308
|
+
return null;
|
|
309
|
+
};
|
|
310
|
+
/**
|
|
311
|
+
* This function reflects the logic in the react-native-xcode.sh bundle script.
|
|
312
|
+
* When the composition issue is fixed in React Native, this function should
|
|
313
|
+
* return false if the React Native version is at least 0.71 where it was fixed.
|
|
314
|
+
*/
|
|
315
|
+
this.shouldComposeHermesSourcemaps = () => {
|
|
316
|
+
/**
|
|
317
|
+
* We start by checking if the version is over 0.70, as the bug
|
|
318
|
+
* is fixed from react-native 0.71.0
|
|
319
|
+
*/
|
|
320
|
+
const reactNativeVersion = (0, utils_1.getReactNativeVersion)(`${this.reactNativePath}/package.json`);
|
|
321
|
+
if (!reactNativeVersion) {
|
|
322
|
+
return false;
|
|
323
|
+
}
|
|
324
|
+
const [_, minor] = reactNativeVersion.split('.');
|
|
325
|
+
if (Number(minor) > 70) {
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* This env variable is empty by default.
|
|
330
|
+
* Before RN 0.70, it had to be set to `true` for Hermes to be used.
|
|
331
|
+
* Since RN 0.70, Hermes is enabled even if it is empty.
|
|
332
|
+
*/
|
|
333
|
+
if (process.env.USE_HERMES) {
|
|
334
|
+
return process.env.USE_HERMES.toLowerCase() !== 'false';
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Check if hermes pod is present in pods.
|
|
338
|
+
* This is the check used until RN 0.70, but the architecture of the pod might change,
|
|
339
|
+
* so it's best not to rely on it to detect if Hermes is disabled.
|
|
340
|
+
*/
|
|
341
|
+
if ((0, fs_1.existsSync)(`${process.env.PODS_ROOT}/hermes-engine/destroot/bin/hermesc`)) {
|
|
342
|
+
return true;
|
|
343
|
+
}
|
|
344
|
+
return this.isHermesEnabled();
|
|
345
|
+
};
|
|
346
|
+
this.isHermesEnabled = () => {
|
|
347
|
+
/**
|
|
348
|
+
* Checks if Hermes is in the Podfile.lock.
|
|
349
|
+
* This is the most recent check for detecting Hermes in the `react-native-xcode.sh` script:
|
|
350
|
+
* https://github.com/facebook/react-native/commit/8745a148b6d8358702b5300d73f4686c3aedb413
|
|
351
|
+
*
|
|
352
|
+
* If the Podfile.lock cannot be found, we assume Hermes is not enabled
|
|
353
|
+
*/
|
|
354
|
+
const podfileLockPath = `${process.env.PODS_PODFILE_DIR_PATH}/Podfile.lock`;
|
|
355
|
+
if (!(0, fs_1.existsSync)(podfileLockPath)) {
|
|
356
|
+
return false;
|
|
357
|
+
}
|
|
358
|
+
const podfileLockContent = (0, fs_1.readFileSync)(podfileLockPath).toString();
|
|
359
|
+
return !!podfileLockContent.match('hermes-engine');
|
|
360
|
+
};
|
|
361
|
+
this.shouldUploadSourcemaps = () => {
|
|
362
|
+
var _a;
|
|
363
|
+
// If we did not bundle the RN code, we won't have anything to upload.
|
|
364
|
+
if (!this.shouldBundleRNCode()) {
|
|
365
|
+
return false;
|
|
366
|
+
}
|
|
367
|
+
if (this.force) {
|
|
368
|
+
return true;
|
|
369
|
+
}
|
|
370
|
+
// We don't upload sourcemaps if the configuration is "Debug"
|
|
371
|
+
return !((_a = process.env.CONFIGURATION) === null || _a === void 0 ? void 0 : _a.includes('Debug'));
|
|
372
|
+
};
|
|
373
|
+
this.shouldBundleRNCode = () => {
|
|
374
|
+
var _a, _b;
|
|
375
|
+
if (this.force) {
|
|
376
|
+
return true;
|
|
377
|
+
}
|
|
378
|
+
// We keep the same logic and order than react-native-xcode.sh script from RN.
|
|
379
|
+
if (!!process.env.SKIP_BUNDLING) {
|
|
380
|
+
return false;
|
|
381
|
+
}
|
|
382
|
+
if ((_a = process.env.CONFIGURATION) === null || _a === void 0 ? void 0 : _a.includes('Debug')) {
|
|
383
|
+
// We don't build for simulators in debug mode but we do for real devices.
|
|
384
|
+
// See https://github.com/DataDog/expo-datadog/issues/31
|
|
385
|
+
if ((_b = process.env.PLATFORM_NAME) === null || _b === void 0 ? void 0 : _b.includes('simulator')) {
|
|
386
|
+
return !!process.env.FORCE_BUNDLING;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return true;
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
get reactNativePath() {
|
|
393
|
+
if (!this._reactNativePath) {
|
|
394
|
+
this._reactNativePath = getReactNativePath();
|
|
395
|
+
this.verifyFolderPath(this._reactNativePath, 'DATADOG_CI_REACT_NATIVE_PATH');
|
|
396
|
+
}
|
|
397
|
+
return this._reactNativePath;
|
|
398
|
+
}
|
|
399
|
+
get datadogReactNativePath() {
|
|
400
|
+
if (!this._datadogReactNativePath) {
|
|
401
|
+
this._datadogReactNativePath = getDatadogReactNativePath();
|
|
402
|
+
this.verifyFolderPath(this._datadogReactNativePath, 'DATADOG_REACT_NATIVE_PATH');
|
|
403
|
+
}
|
|
404
|
+
return this._datadogReactNativePath;
|
|
405
|
+
}
|
|
406
|
+
get defaultScriptPath() {
|
|
407
|
+
if (!this._defaultScriptPath) {
|
|
408
|
+
this._defaultScriptPath = `${this.reactNativePath}/scripts/react-native-xcode.sh`;
|
|
409
|
+
}
|
|
410
|
+
return this._defaultScriptPath;
|
|
411
|
+
}
|
|
412
|
+
execute() {
|
|
413
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
414
|
+
(0, fips_1.enableFips)(this.fips || this.config.fips, this.fipsIgnoreError || this.config.fipsIgnoreError);
|
|
415
|
+
this.service = process.env.SERVICE_NAME_IOS || this.service || process.env.PRODUCT_BUNDLE_IDENTIFIER;
|
|
416
|
+
if (!this.infoPlistPath && process.env.PROJECT_DIR && process.env.INFOPLIST_FILE) {
|
|
417
|
+
this.infoPlistPath = `${process.env.PROJECT_DIR}/${process.env.INFOPLIST_FILE}`;
|
|
418
|
+
}
|
|
419
|
+
if (!this.service) {
|
|
420
|
+
this.context.stderr.write('Environment variable PRODUCT_BUNDLE_IDENTIFIER is missing for Datadog sourcemaps upload.\n');
|
|
421
|
+
this.context.stderr.write('Check that a Bundle Identifier is set for your target in XCode.\n');
|
|
422
|
+
this.context.stderr.write('You can also specify the service as the SERVICE_NAME_IOS environment variable.\n');
|
|
423
|
+
this.context.stderr.write('If you are not running this script from XCode, use the `--service com.company.app` argument.\n');
|
|
424
|
+
return 1;
|
|
425
|
+
}
|
|
426
|
+
if (!process.env.CONFIGURATION) {
|
|
427
|
+
this.context.stderr.write('Environment variable CONFIGURATION is missing for Datadog sourcemaps upload.\n');
|
|
428
|
+
this.context.stderr.write('If you are not running this script from XCode, you can force the sourcemaps upload with a --force argument.\n');
|
|
429
|
+
return 1;
|
|
430
|
+
}
|
|
431
|
+
const sourcemapsLocation = this.getSourcemapsLocation();
|
|
432
|
+
if (!sourcemapsLocation) {
|
|
433
|
+
this.context.stderr.write('No sourcemap output has been specified.\n');
|
|
434
|
+
this.context.stderr.write('Check that you either set a SOURCEMAP_FILE or an EXTRA_PACKAGER_ARGS environment variable in your "Bundle React Native code and images" Build Phase in XCode.\n');
|
|
435
|
+
this.context.stderr.write('If you are not running this script from XCode, set a SOURCEMAP_FILE environment variable before running the script.\n');
|
|
436
|
+
return 1;
|
|
437
|
+
}
|
|
438
|
+
const bundleLocation = this.getBundleLocation();
|
|
439
|
+
if (!bundleLocation) {
|
|
440
|
+
this.context.stderr.write('No bundle file output has been specified.\n');
|
|
441
|
+
this.context.stderr.write('If you are not running this script from XCode, set a CONFIGURATION_BUILD_DIR (directory containing the generated bundle) environment variable before running the script.\n');
|
|
442
|
+
return 1;
|
|
443
|
+
}
|
|
444
|
+
const releaseVersion = this.getReleaseVersion();
|
|
445
|
+
const buildVersion = this.getBuildVersion();
|
|
446
|
+
if (releaseVersion === null || buildVersion === null) {
|
|
447
|
+
return 1;
|
|
448
|
+
}
|
|
449
|
+
// Run bundle script
|
|
450
|
+
try {
|
|
451
|
+
if (!this.shouldBundleRNCode()) {
|
|
452
|
+
this.context.stdout.write(`Skipping bundling and sourcemaps upload.`);
|
|
453
|
+
return 0;
|
|
454
|
+
}
|
|
455
|
+
yield this.bundleReactNativeCodeAndImages();
|
|
456
|
+
if (!this.shouldUploadSourcemaps()) {
|
|
457
|
+
this.context.stdout.write(`Build configuration ${process.env.CONFIGURATION} is not Release, skipping sourcemaps upload.`);
|
|
458
|
+
return 0;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Because of a bug in React Native (https://github.com/facebook/react-native/issues/34212), the composition
|
|
462
|
+
* of the 2 Hermes sourcemaps is not done correctly. Therefore we need to do the composition ourselves to
|
|
463
|
+
* overwrite the sourcemaps before the upload
|
|
464
|
+
*/
|
|
465
|
+
if (this.shouldComposeHermesSourcemaps()) {
|
|
466
|
+
this.context.stdout.write('Hermes detected, composing sourcemaps');
|
|
467
|
+
yield this.composeHermesSourcemaps(sourcemapsLocation);
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* If Hermes is enabled, we need to copy the debug ID from the bundle file to the composed sourcemaps file.
|
|
471
|
+
*/
|
|
472
|
+
if (this.isHermesEnabled()) {
|
|
473
|
+
this.context.stdout.write(`\nHermes is enabled, trying to copy debug ID to composed sourcemaps.`);
|
|
474
|
+
// Copy debug ID from the bundle to the sourcemaps location
|
|
475
|
+
if (!this.copyDebugIdFromBundle(bundleLocation, sourcemapsLocation)) {
|
|
476
|
+
// Try to copy debug ID from the temporary file generated by Datadog Metro Plugin as a fallback
|
|
477
|
+
this.copyDebugIdFromTempFile(sourcemapsLocation);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
catch (error) {
|
|
482
|
+
this.context.stderr.write(`Error running bundle script from datadog-ci xcode.\n${String(error)}`);
|
|
483
|
+
return 1;
|
|
484
|
+
}
|
|
485
|
+
if (this.force) {
|
|
486
|
+
this.context.stdout.write(`Force upload for configuration ${process.env.CONFIGURATION}`);
|
|
487
|
+
}
|
|
488
|
+
// Run upload script in the background
|
|
489
|
+
const cli = new clipanion_1.Cli();
|
|
490
|
+
cli.register(upload_1.ReactNativeUploadCommand);
|
|
491
|
+
const uploadCommand = [
|
|
492
|
+
'react-native',
|
|
493
|
+
'upload',
|
|
494
|
+
'--platform',
|
|
495
|
+
'ios',
|
|
496
|
+
'--release-version',
|
|
497
|
+
releaseVersion,
|
|
498
|
+
'--build-version',
|
|
499
|
+
buildVersion,
|
|
500
|
+
'--service',
|
|
501
|
+
this.service,
|
|
502
|
+
'--bundle',
|
|
503
|
+
bundleLocation,
|
|
504
|
+
'--sourcemap',
|
|
505
|
+
sourcemapsLocation,
|
|
506
|
+
];
|
|
507
|
+
if (this.configPath) {
|
|
508
|
+
uploadCommand.push('--config', this.configPath);
|
|
509
|
+
}
|
|
510
|
+
if (this.disableGit) {
|
|
511
|
+
uploadCommand.push('--disable-git');
|
|
512
|
+
}
|
|
513
|
+
if (this.repositoryURL) {
|
|
514
|
+
uploadCommand.push('--repository-url', this.repositoryURL);
|
|
515
|
+
}
|
|
516
|
+
if (this.removeSourcesContent) {
|
|
517
|
+
uploadCommand.push('--remove-sources-content');
|
|
518
|
+
}
|
|
519
|
+
if (this.dryRun) {
|
|
520
|
+
uploadCommand.push('--dry-run');
|
|
521
|
+
}
|
|
522
|
+
return cli.run(uploadCommand, this.context);
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
verifyFolderPath(folderPath, envVariableName) {
|
|
526
|
+
var _a, _b, _c, _d;
|
|
527
|
+
const fallbackMessage = envVariableName
|
|
528
|
+
? `You can override the path by setting the ENV variable: ${envVariableName}`
|
|
529
|
+
: '';
|
|
530
|
+
if (!(0, fs_1.existsSync)(folderPath)) {
|
|
531
|
+
(_b = (_a = this.context) === null || _a === void 0 ? void 0 : _a.stderr) === null || _b === void 0 ? void 0 : _b.write(`\nResolved path does not exist: ${folderPath}.` + fallbackMessage);
|
|
532
|
+
return false;
|
|
533
|
+
}
|
|
534
|
+
if (!(0, fs_1.statSync)(folderPath).isDirectory()) {
|
|
535
|
+
(_d = (_c = this.context) === null || _c === void 0 ? void 0 : _c.stderr) === null || _d === void 0 ? void 0 : _d.write(`\nResolved path is not a directory: ${folderPath}.` + fallbackMessage);
|
|
536
|
+
return false;
|
|
537
|
+
}
|
|
538
|
+
return true;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
exports.ReactNativeXcodeCommand = ReactNativeXcodeCommand;
|
|
542
|
+
ReactNativeXcodeCommand.paths = [['react-native', 'xcode']];
|
|
543
|
+
ReactNativeXcodeCommand.usage = clipanion_1.Command.Usage({
|
|
544
|
+
category: 'RUM',
|
|
545
|
+
description: 'Bundle React Native code and images in XCode and send sourcemaps to Datadog.',
|
|
546
|
+
details: `
|
|
547
|
+
This command will bundle the react native code and images and then upload React Native sourcemaps and their corresponding JavaScript bundle to Datadog in order to un-minify front-end stack traces received by Datadog.\n
|
|
548
|
+
See README for details.
|
|
549
|
+
`,
|
|
550
|
+
examples: [
|
|
551
|
+
[
|
|
552
|
+
'Usage as XCode build phase for RN < 0.69',
|
|
553
|
+
'set -e\nexport SOURCEMAP_FILE=./build/main.jsbundle.map\nexport NODE_BINARY=node\n# Replace /opt/homebrew/bin/node (resp. /opt/homebrew/bin/yarn) by the value of $(command -v node) (resp. $(command -v yarn))\n/opt/homebrew/bin/node /opt/homebrew/bin/yarn datadog-ci react-native xcode node_modules/react-native/scripts/react-native-xcode.sh\n',
|
|
554
|
+
],
|
|
555
|
+
[
|
|
556
|
+
'Usage as XCode build phase for RN >= 0.69',
|
|
557
|
+
'set -e\nexport SOURCEMAP_FILE=./main.jsbundle.map\nWITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"\nREACT_NATIVE_XCODE="./datadog-sourcemaps.sh"\n\n/bin/sh -c "$WITH_ENVIRONMENT $REACT_NATIVE_XCODE"\n',
|
|
558
|
+
],
|
|
559
|
+
],
|
|
560
|
+
});
|
|
561
|
+
//# sourceMappingURL=xcode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xcode.js","sourceRoot":"","sources":["../../../src/commands/react-native/xcode.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAoC;AACpC,iDAAmC;AACnC,2BAAgF;AAEhF,yCAA8C;AAE9C,8DAAoD;AACpD,kEAA0F;AAC1F,8DAA8D;AAC9D,gEAAgE;AAChE,kEAAiE;AAEjE,qCAAiD;AACjD,mCAA6C;AAE7C;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,IAAI;QACF,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;QAErD,oEAAoE;QACpE,OAAO,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;KACvD;IAAC,OAAO,KAAK,EAAE;QACd,+FAA+F;QAC/F,IAAI,IAAA,eAAU,EAAC,2CAA2C,CAAC,EAAE;YAC3D,OAAO,8BAA8B,CAAA;SACtC;QAED,0CAA0C;QAC1C,IAAI,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE;YAC5C,OAAO,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAA;SAChD;QAED,4EAA4E;QAC5E,OAAO,2BAA2B,CAAA;KACnC;AACH,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,yBAAyB,GAAG,GAAG,EAAE;IACrC,IAAI;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