Skip to content

Commit

Permalink
chore: apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Norman Breau <norman@nbsolutions.ca>
  • Loading branch information
erisu and breautek committed May 16, 2022
1 parent 59e22b7 commit 371ed5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/check_reqs.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const { forgivingWhichSync, isWindows, isDarwin } = require('./utils');
const java = require('./env/java');
const { CordovaError, ConfigParser, events } = require('cordova-common');
const android_sdk = require('./android_sdk');
const { SDK_VERSION, COMPILE_SDK_VERSION } = require('./gradle-config-defaults');
const { SDK_VERSION } = require('./gradle-config-defaults');

// Re-exporting these for backwards compatibility and for unit testing.
// TODO: Remove uses and use the ./utils module directly.
Expand All @@ -50,16 +50,16 @@ module.exports.get_target = function (projectRoot) {
*/
module.exports.get_compile = function (projectRoot) {
const userTargetSdkVersion = getUserTargetSdkVersion(projectRoot) || SDK_VERSION;
const userCompileSdkVersion = getUserCompileSdkVersion(projectRoot) || COMPILE_SDK_VERSION;
const userCompileSdkVersion = getUserCompileSdkVersion(projectRoot) || userTargetSdkVersion;

module.exports.isCompileSdkValid(userCompileSdkVersion, userTargetSdkVersion);

return userCompileSdkVersion;
};

module.exports.isCompileSdkValid = (compileSdk, targetSdk) => {
compileSdk = (compileSdk || COMPILE_SDK_VERSION);
targetSdk = (targetSdk || SDK_VERSION);
compileSdk = (compileSdk || targetSdk);
const isValid = compileSdk >= targetSdk;

if (!isValid) {
Expand Down

0 comments on commit 371ed5e

Please sign in to comment.