mirror of
https://github.com/adelphes/android-dev-ext.git
synced 2025-12-22 17:39:19 +00:00
* upgrade package-lock.jsons * upgrade debugadapter package * upgrade debugprotocol package * upgrade long package * upgrade unzipper package * upgrade uuid package * upgrade ws package * upgrade xpath package * update dev dependencies * fix eslint config to allow newer language features (async shorthand functions and optional catch parameters) * fix import type declarations * update eslint * remove unsupported stopOnEntry properties * code tidy - fix warnings, separate type imports from value imports, remove unused code * report stack on adb connection error and default host name to 127.0.0.1 * fix imported types in jdwp * lang server tidyups * add a new helper for creating android API library cache file * update the android API cache file to 34 * bump to version 1.4.0
31 lines
1.0 KiB
JavaScript
31 lines
1.0 KiB
JavaScript
/**
|
|
* 1. Download the latest platform and source
|
|
* ./android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install 'platforms;android-30'
|
|
* ./android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install 'sources;android-30'
|
|
*
|
|
* 2. Run this file, passing in the android API version
|
|
* node library-cache.js android-30
|
|
*
|
|
* 3. To create the final shipped data, move the JSON into a 'cache' folder and zip
|
|
* mkdir cache
|
|
* mv android-30.json cache
|
|
* zip -9 -r android-30.zip cache
|
|
*/
|
|
|
|
const path = require('path');
|
|
const { createAndroidLibraryCacheFile } = require('java-mti/android-library');
|
|
|
|
/**
|
|
* @param {`android-${number}`} api
|
|
*/
|
|
async function buildLibraryCache(api) {
|
|
// `createAndroidLibraryCacheFile()` just creates the JSON (not the zipped version)
|
|
const cache_filename = path.join(__dirname, '.library-cache', `${api}.json`);
|
|
await createAndroidLibraryCacheFile(cache_filename, { api });
|
|
}
|
|
|
|
const api = process.argv[2];
|
|
if (!api) throw new Error('android api parameter expected');
|
|
|
|
buildLibraryCache(api);
|