(argv: ArgumentsResolver<CommandParameters>)
| 15 | |
| 16 | |
| 17 | async function valdiInstall(argv: ArgumentsResolver<CommandParameters>) { |
| 18 | const bazel = new BazelClient(); |
| 19 | |
| 20 | const buildInfo = await getBuildInfo(argv, bazel, true); |
| 21 | |
| 22 | // Output Selection |
| 23 | // ---------------- |
| 24 | |
| 25 | // Perform build and install |
| 26 | // ------------------------- |
| 27 | console.log(`Building: ${wrapInColor(buildInfo.application, ANSI_COLORS.GREEN_COLOR)}`); |
| 28 | |
| 29 | switch (buildInfo.platform) { |
| 30 | case PLATFORM.ANDROID: { |
| 31 | const outputFilePath = await argv.getArgumentOrResolve('target_output_path', () => { |
| 32 | console.log('Resolving output paths...'); |
| 33 | return getOutputFilePath(bazel, applicationExtensionForPlatform(buildInfo.platform), buildInfo.application, buildInfo.bazelArgs); |
| 34 | }); |
| 35 | await bazel.buildTarget(buildInfo.application, buildInfo.bazelArgs); |
| 36 | |
| 37 | console.log('Installing Android application...'); |
| 38 | await installAndroidApk(outputFilePath, buildInfo.selectedDevice); |
| 39 | logReproduceThisCommandIfNeeded(argv); |
| 40 | break; |
| 41 | } |
| 42 | case PLATFORM.IOS: { |
| 43 | console.log('Installing iOS application...'); |
| 44 | await bazel.runTarget(buildInfo.application, buildInfo.bazelArgs); |
| 45 | logReproduceThisCommandIfNeeded(argv); |
| 46 | break; |
| 47 | } |
| 48 | case PLATFORM.MACOS: { |
| 49 | logReproduceThisCommandIfNeeded(argv); |
| 50 | console.log('Installing MacOS application...'); |
| 51 | await bazel.runTarget(buildInfo.application, buildInfo.bazelArgs); |
| 52 | break; |
| 53 | } |
| 54 | case PLATFORM.LINUX: { |
| 55 | logReproduceThisCommandIfNeeded(argv); |
| 56 | console.log('Running Linux application...'); |
| 57 | await bazel.runTarget(buildInfo.application, buildInfo.bazelArgs); |
| 58 | break; |
| 59 | } |
| 60 | case PLATFORM.CLI: { |
| 61 | logReproduceThisCommandIfNeeded(argv); |
| 62 | console.log('Running CLI application...'); |
| 63 | await bazel.runTarget(buildInfo.application, buildInfo.bazelArgs); |
| 64 | break; |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | export const command = 'install <platform>'; |
| 70 | export const describe = 'Build and install the application to the connected device'; |
nothing calls this directly
no test coverage detected