Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(all): remove ndk message, fix eslint warnings #629

Merged
merged 1 commit into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sourceType": "script"
},
"rules": {
"no-empty": ["error", { "allowEmptyCatch": true }],
"no-implicit-globals": "off"
},
"overrides": [
Expand Down
29 changes: 8 additions & 21 deletions lib/android.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ exports.detect = function detect(config, opts, finished) {
}

var archs = {};
run(dpkg, '--print-architecture', function (code, stdout, stderr) {
run(dpkg, '--print-architecture', function (code, stdout, _stderr) {
stdout.split('\n').forEach(function (line) {
(line = line.trim()) && (archs[line] = 1);
});
run(dpkg, '--print-foreign-architectures', function (code, stdout, stderr) {
run(dpkg, '--print-foreign-architectures', function (code, stdout, _stderr) {
stdout.split('\n').forEach(function (line) {
(line = line.trim()) && (archs[line] = 1);
});
Expand All @@ -278,7 +278,7 @@ exports.detect = function detect(config, opts, finished) {
async.each(
[ 'libc6:i386', 'libncurses5:i386', 'libstdc++6:i386', 'zlib1g:i386' ],
function (pkg, next) {
run(dpkgquery, [ '-l', pkg ], function (code, out, err) {
run(dpkgquery, [ '-l', pkg ], function (code, out, _err) {
result[pkg] = false;
if (!code) {
var lines = out.split('\n'),
Expand Down Expand Up @@ -310,7 +310,7 @@ exports.detect = function detect(config, opts, finished) {
return cb();
}

run(rpm, '-qa', function (code, stdout, stderr) {
run(rpm, '-qa', function (code, stdout, _stderr) {
stdout.split('\n').forEach(function (line) {
if (/^glibc-/.test(line)) {
if (/\.i[36]86$/.test(line)) {
Expand Down Expand Up @@ -362,7 +362,8 @@ exports.detect = function detect(config, opts, finished) {
type: 'error',
message: __('JDK (Java Development Kit) not found.') + '\n'
+ __('If you already have installed the JDK, verify your __JAVA_HOME__ environment variable is correctly set.') + '\n'
+ __('The JDK can be downloaded and installed from %s.', '__https://www.oracle.com/technetwork/java/javase/downloads/index.html__')
+ __('The JDK can be downloaded and installed from %s', '__https://www.oracle.com/java/technologies/downloads/__') + '\n'
+ __('or %s.', '__https://jdk.java.net/archive/__')
});
results.sdk = null;
return finalize();
Expand Down Expand Up @@ -391,19 +392,6 @@ exports.detect = function detect(config, opts, finished) {
}
}

if (!results.ndk) {
results.issues.push({
id: 'ANDROID_NDK_NOT_FOUND',
type: 'warning',
message: __('Unable to locate an Android NDK.') + '\n'
+ __('Without the NDK, you will not be able to build native Android Titanium modules.') + '\n'
+ __('If you have already downloaded and installed the Android NDK, you can tell Titanium where the Android NDK is located by running \'%s\', otherwise you can install it by running \'%s\' or manually downloading from %s.',
'__' + commandPrefix + 'titanium config android.ndkPath /path/to/android-ndk__',
'__' + commandPrefix + 'titanium setup android__',
'__https://developer.android.com/ndk__')
});
}

// if we don't have an android sdk, then nothing else to do
if (!results.sdk) {
results.issues.push({
Expand Down Expand Up @@ -714,8 +702,7 @@ exports.detect = function detect(config, opts, finished) {
} else if (message.length > 0) {
message += '\n';
}
message +=
__('Current installed Android SDK tools:') + '\n'
message += __('Current installed Android SDK tools:') + '\n'
+ ' Android SDK Tools: ' + (results.sdk.tools.version || 'not installed') + ' (Supported: ' + androidPackageJson.vendorDependencies['android tools'] + ')\n'
+ ' Android SDK Platform Tools: ' + (results.sdk.platformTools.version || 'not installed') + ' (Supported: ' + androidPackageJson.vendorDependencies['android platform tools'] + ')\n'
+ ' Android SDK Build Tools: ' + (results.sdk.buildTools.version || 'not installed') + ' (Supported: ' + androidPackageJson.vendorDependencies['android build tools'] + ')\n\n'
Expand Down Expand Up @@ -1033,7 +1020,7 @@ function loadPlatform(dir, systemImages) {
};
}

function loadAddon(dir, platforms, systemImages) {
function loadAddon(dir, platforms, _systemImages) {
// read in the properties
const sourceProps = readProps(path.join(dir, 'source.properties'));
const apiLevel = sourceProps ? ~~sourceProps['AndroidVersion.ApiLevel'] : null;
Expand Down
12 changes: 6 additions & 6 deletions lib/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ Builder.prototype.validate = function validate(logger, config, cli) {
* Defines common variables prior to running the build. This super function
* should be called prior to the platform-specific build command's run().
*
* @param {Object} logger - The logger instance
* @param {Object} config - The CLI config
* @param {Object} cli - The CLI instance
* @param {Function} finished - A function to call after the function finishes
* @param {Object} _logger - The logger instance
* @param {Object} _config - The CLI config
* @param {Object} _cli - The CLI instance
* @param {Function} _finished - A function to call after the function finishes
*/
Builder.prototype.run = function run(logger, config, cli, finished) {
Builder.prototype.run = function run(_logger, _config, _cli, _finished) {
// note: this function must be sync!

var buildDirFiles = this.buildDirFiles = {};
Expand Down Expand Up @@ -508,7 +508,7 @@ Builder.prototype.generateAppIcons = function generateAppIcons(icons, callback)
return fail();
}

appc.image.resize(defaultIcon, icons, function (error, stdout, stderr) {
appc.image.resize(defaultIcon, icons, function (error, _stdout, _stderr) {
if (error) {
this.logger.error(error);
this.logger.log();
Expand Down
11 changes: 8 additions & 3 deletions lib/emulators/avd.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ exports.start = function start(config, emu, opts, callback) {
cb(tryPort > 5584 ? new Error(__('Unable to find a free port between 5554 and 5584')) : null);
});

socket.on('end', function (err) {
socket.on('end', function (_err) {
if (socket) {
socket.end();
socket = null;
Expand Down Expand Up @@ -225,11 +225,16 @@ exports.start = function start(config, emu, opts, callback) {
var args = [
'-avd', emu.id, // use a specific android virtual device
'-port', port, // TCP port that will be used for the console
'-partition-size', opts.partitionSize || 512 // system/data partition size in MBs
];

if (opts.partitionSize !== undefined) {
args.push('-partition-size', opts.partitionSize); // system/data partition size in MBs
}

var sdcard = opts.sdcard || emu.sdcard;
sdcard && args.push('-sdcard', sdcard); // SD card image (default <system>/sdcard.img
if (sdcard !== undefined) {
args.push('-sdcard', sdcard); // SD card image (default <system>/sdcard.img
}

// add any other args
opts.logcat && args.push('-logcat', opts.logcat); // enable logcat output with given tags
Expand Down
6 changes: 3 additions & 3 deletions lib/emulators/genymotion.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ exports.detect = function detect(config, opts, finished) {
// try to find the VBoxManage file in the config file or system paths
appc.subprocess.findExecutable([ config.get('genymotion.executables.vboxmanage'), 'VBoxManage' + exe ], function (err, result) {
function getVersion(exe) {
appc.subprocess.run(exe, '--version', function (code, out, err) {
appc.subprocess.run(exe, '--version', function (code, out, _err) {
next(null, {
vboxmanage: exe,
version: code ? null : out.trim()
Expand Down Expand Up @@ -312,7 +312,7 @@ function findGenymotion(dir, config, callback) {
}

function getVMInfo(config, vboxmanage, callback) {
appc.subprocess.run(vboxmanage, [ 'list', 'vms' ], function (code, out, err) {
appc.subprocess.run(vboxmanage, [ 'list', 'vms' ], function (code, out, _err) {
if (code) {
return callback(null, []);
}
Expand All @@ -337,7 +337,7 @@ function getVMInfo(config, vboxmanage, callback) {
'sdk-version': null
};

appc.subprocess.run(vboxmanage, [ 'guestproperty', 'enumerate', emu.guid ], function (code, out, err) {
appc.subprocess.run(vboxmanage, [ 'guestproperty', 'enumerate', emu.guid ], function (code, out, _err) {
if (!code) {
out.split('\n').forEach(function (line) {
var m = line.trim().match(/Name: (\S+), value: (\S*), timestamp:/);
Expand Down
4 changes: 2 additions & 2 deletions lib/titanium.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ exports.validateCorrectSDK = function (logger, config, cli, commandName) {
}
}

function cmdAddSecret(param) {
function cmdAddSecret(_param) {
for (var i = 0; i < arguments.length; i++) {
cmd.push(arguments[i]);
cmdSafe.push('*******');
Expand Down Expand Up @@ -636,7 +636,7 @@ exports.validateCorrectSDK = function (logger, config, cli, commandName) {
setTimeout(function () {
spawn(cmdRoot, cmd, {
stdio: 'inherit'
}).on('exit', function (code, signal) {
}).on('exit', function (code, _signal) {
code && process.exit(code);
});
}, delayCmd ? 1000 : 0);
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.