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

No longer require tooling that has been removed and/or is no longer referenced by the SDK build #467

Merged
merged 6 commits into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 3 additions & 26 deletions lib/android.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,10 @@ const fs = require('fs'),
findExecutable = appc.subprocess.findExecutable,
exe = process.platform === 'win32' ? '.exe' : '',
cmd = process.platform === 'win32' ? '.cmd' : '',
bat = process.platform === 'win32' ? '.bat' : '',
commandPrefix = process.env.APPC_ENV ? 'appc ' : '',
requiredSdkTools = {
adb: exe,
emulator: exe,
mksdcard: exe,
zipalign: exe,
aapt: exe,
aidl: exe,
dx: bat
emulator: exe
},
pkgPropRegExp = /^([^=]*)=\s*(.+)$/;

Expand Down Expand Up @@ -745,25 +739,14 @@ function findSDK(dir, config, androidPackageJson, callback) {
return callback(true);
}

const dxJarPath = path.join(dir, 'platform-tools', 'lib', 'dx.jar'),
proguardPath = path.join(dir, 'tools', 'proguard', 'lib', 'proguard.jar'),
const proguardPath = path.join(dir, 'tools', 'proguard', 'lib', 'proguard.jar'),
emulatorPath = path.join(dir, 'emulator', 'emulator' + exe),
result = {
path: dir,
executables: {
adb: path.join(dir, 'platform-tools', 'adb' + exe),
android: null, // this tool has been deprecated
emulator: fs.existsSync(emulatorPath) ? emulatorPath : path.join(dir, 'tools', 'emulator' + exe),
mksdcard: path.join(dir, 'tools', 'mksdcard' + exe),
zipalign: path.join(dir, 'tools', 'zipalign' + exe),
// Android SDK Tools v21 and older puts aapt and aidl in the platform-tools dir.
// For SDK Tools v22 and later, they live in the build-tools/<ver> directory.
aapt: path.join(dir, 'platform-tools', 'aapt' + exe),
aidl: path.join(dir, 'platform-tools', 'aidl' + exe),
dx: path.join(dir, 'platform-tools', 'dx' + bat),
apksigner: null
emulator: fs.existsSync(emulatorPath) ? emulatorPath : path.join(dir, 'tools', 'emulator' + exe)
},
dx: fs.existsSync(dxJarPath) ? dxJarPath : null,
proguard: fs.existsSync(proguardPath) ? proguardPath : null,
tools: {
path: null,
Expand Down Expand Up @@ -832,12 +815,6 @@ function findSDK(dir, config, androidPackageJson, callback) {
tooNew: buildToolsSupported,
maxSupported: appc.version.parseMax(androidPackageJson.vendorDependencies['android build tools'], true)
};
fs.existsSync(file = path.join(buildToolsDir, ver, 'aapt' + exe)) && (result.executables.aapt = file);
fs.existsSync(file = path.join(buildToolsDir, ver, 'aidl' + exe)) && (result.executables.aidl = file);
fs.existsSync(file = path.join(buildToolsDir, ver, 'apksigner' + bat)) && (result.executables.apksigner = file);
fs.existsSync(file = path.join(buildToolsDir, ver, 'dx' + bat)) && (result.executables.dx = file);
fs.existsSync(file = path.join(buildToolsDir, ver, 'lib', 'dx.jar')) && (result.dx = file);
fs.existsSync(file = path.join(buildToolsDir, ver, 'zipalign' + exe)) && (result.executables.zipalign = file);
}
} else {
// build tools don't exist at the given location
Expand Down
5 changes: 5 additions & 0 deletions tests/adb_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ describe('adb', function () {

after(function (finished) {
this.timeout(35000);
// Just call finished if there is no device, there may have been an issue when starting
// the emulator in the before
if (!device) {
return finished();
}
emulator.stop(device.emulator.id, function (errOrCode) {
errOrCode.should.eql(0);
setTimeout(finished, 5000); // let it wait 5 seconds or else adb will still report it as connected
Expand Down
2 changes: 1 addition & 1 deletion tests/avd_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('emulator', function () {

it('#start(), #isRunning() and #stop()', function (finished) {
this.slow(30000);
this.timeout(90000);
this.timeout(180000);

emulator.start(avd.id, function (err, emu) {
if (err) {
Expand Down