Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions local-cli/runAndroid/runAndroid.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function runOnSpecificDevice(args, gradlew, packageNameWithSuffix, packageName,
let devices = adb.getDevices();
if (devices && devices.length > 0) {
if (devices.indexOf(args.deviceId) !== -1) {
buildApk(gradlew);
buildApk(args, gradlew);
installAndLaunchOnDevice(args, args.deviceId, packageNameWithSuffix, packageName, adbPath);
} else {
console.log('Could not find device with the id: "' + args.deviceId + '".');
Expand All @@ -130,12 +130,23 @@ function runOnSpecificDevice(args, gradlew, packageNameWithSuffix, packageName,
}
}

function buildApk(gradlew) {
function buildApk(args, gradlew) {
try {
console.log(chalk.bold('Building the app...'));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semi: Missing semicolon.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the missing semicolons.

var gradleArgs = [];
if (args.variant) {
gradleArgs.push('assemble' +
args.variant[0].toUpperCase() + args.variant.slice(1)
);
} else {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semi: Missing semicolon.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the missing semicolons.

gradleArgs.push('assembleDebug');
}

// using '-x lint' in order to ignore linting errors while building the apk
child_process.execFileSync(gradlew, ['build', '-x', 'lint'], {
gradleArgs.push('-x', 'lint');

child_process.execFileSync(gradlew, gradleArgs, {
stdio: [process.stdin, process.stdout, process.stderr],
});
} catch (e) {
Expand Down