MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getBuildInfo

Function getBuildInfo

npm_modules/cli/src/utils/buildInfo.ts:52–99  ·  view source on GitHub ↗
(argv: ArgumentsResolver<CommandParameters>, bazel: BazelClient, checkDevice: boolean)

Source from the content-addressed store, hash-verified

50}
51
52export async function getBuildInfo(argv: ArgumentsResolver<CommandParameters>, bazel: BazelClient, checkDevice: boolean): Promise<BuildInfo> {
53 const platform = argv.getArgument('platform') as PLATFORM;
54 const forDevice = !!argv.getArgument('simulator');
55
56 let selectedDevice: string | undefined;
57 let architectures: Architecture[] = ALL_ARCHITECTURES;
58
59 if (platform === PLATFORM.ANDROID) {
60 if (checkDevice) {
61 selectedDevice = await argv.getArgumentOrResolve('device_id', () => {
62 console.log('Detecting Connected Devices...');
63 return getDeviceChoice(platform);
64 });
65 architectures = [await getArchitectureForAndroidDevice(selectedDevice)];
66 } else {
67 architectures = getAllArchitecturesForAndroid();
68 }
69 }
70
71 const bazelArgs = resolveBazelBuildArgs(
72 platform,
73 argv.getArgument('build_config'),
74 architectures,
75 forDevice,
76 argv.getArgument('enable_runtime_logs'),
77 argv.getArgument('enable_runtime_traces'),
78 argv.getArgument('bazel_args'),
79 );
80
81 // Application Selection
82 // ---------------------
83 const application = await argv.getArgumentOrResolve('application', () => {
84 console.log('No application specified querying available targets...');
85 return selectBazelTarget(
86 bazel,
87 getApplicationTargetTagForPlatform(platform),
88 'valdi_application',
89 'Please select an application target to install:',
90 );
91 });
92
93 return {
94 platform: platform,
95 application: application,
96 bazelArgs: bazelArgs,
97 selectedDevice: selectedDevice,
98 };
99}

Callers 2

valdiInstallFunction · 0.90
valdiBuildFunction · 0.90

Calls 9

resolveBazelBuildArgsFunction · 0.90
selectBazelTargetFunction · 0.90
getDeviceChoiceFunction · 0.85
getArgumentOrResolveMethod · 0.80
logMethod · 0.65
getArgumentMethod · 0.45

Tested by

no test coverage detected