refactor!: remove most platform binaries (#1100)

* Remove binaries cordova/lib/*

* Remove binary bin/android_sdk_version

* Remove binary bin/update script

* Remove binary bin/check_reqs

* Remove binary bin/create script

* Remove binary cordova/build

* Remove binary cordova/run

* Remove binary cordova/clean

* Remove binary cordova/log

* Remove unused module cordova/loggingHelper

* Update README

* Restore target-listing binaries used by CLI

Usage: cordova-lib/src/cordova/targets.js

* Restore binary bin/android_sdk_version for CLI compatibility

This is used in CLI to implement an Android SDK version check for plugins.
See https://cordova.apache.org/docs/en/latest/plugin_ref/spec.html#engines-and-engine

* Remove version.bat
This commit is contained in:
Raphael von der Grün
2021-07-06 15:37:46 +02:00
committed by GitHub
parent 6f35d0b2b7
commit facffb0809
36 changed files with 19 additions and 1016 deletions
+17 -5
View File
@@ -20,11 +20,13 @@
const os = require('os');
const fs = require('fs-extra');
const path = require('path');
const execa = require('execa');
const { PluginInfoProvider } = require('cordova-common');
const { EventEmitter } = require('events');
const { ConfigParser, PluginInfoProvider } = require('cordova-common');
const Api = require('../../bin/templates/cordova/Api');
const createBin = path.join(__dirname, '../../bin/create');
const fakePluginPath = path.join(__dirname, 'fixtures/cordova-plugin-fake');
const configXmlPath = path.join(__dirname, '../../bin/templates/project/res/xml/config.xml');
describe('plugin add', function () {
let tmpDir;
@@ -40,11 +42,16 @@ describe('plugin add', function () {
const projectname = 'testpluginframework';
const projectid = 'com.test.plugin.framework';
const config = new ConfigParser(configXmlPath);
config.setPackageName(projectid);
config.setName(projectname);
const projectPath = path.join(tmpDir, projectname);
const pluginInfo = new PluginInfoProvider().get(fakePluginPath);
const noopEvents = new EventEmitter();
return Promise.resolve()
.then(() => execa(createBin, [projectPath, projectid, projectname]))
.then(() => Api.createPlatform(projectPath, config, {}, noopEvents))
.then(() => {
// Allow test project to find the `cordova-android` module
fs.ensureSymlinkSync(
@@ -53,8 +60,13 @@ describe('plugin add', function () {
'junction'
);
// We need to use the API from the project or some paths break
// TODO remove this and use the API instance returned from
// createPlatform once we fixed the platform
const Api = require(path.join(projectPath, 'cordova/Api.js'));
return new Api('android', projectPath).addPlugin(pluginInfo);
const api = new Api('android', projectPath, noopEvents);
return api.addPlugin(pluginInfo);
});
}, 90000);
});