-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathcommand.ts
More file actions
30 lines (29 loc) · 919 Bytes
/
command.ts
File metadata and controls
30 lines (29 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import type { AndroidProjectConfig } from '@react-native-community/cli-types';
import type { PluginApi } from '@rnef/config';
import { getValidProjectConfig } from '../getValidProjectConfig.js';
import type { BuildFlags } from './buildAndroid.js';
import { buildAndroid, options } from './buildAndroid.js';
export function registerBuildCommand(
api: PluginApi,
pluginConfig: AndroidProjectConfig | undefined,
commandName: string
) {
api.registerCommand({
name: commandName,
description: 'Builds your app for Android platform.',
action: async (args) => {
const androidConfig = getValidProjectConfig(
api.getProjectRoot(),
pluginConfig
);
await buildAndroid(
androidConfig,
args as BuildFlags,
api.getProjectRoot(),
await api.getRemoteCacheProvider(),
api.getFingerprintOptions()
);
},
options: options,
});
}