Skip to content

Commit

Permalink
refactor!: remove most platform binaries (#1100)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
raphinesse committed Jul 6, 2021
1 parent 6f35d0b commit facffb0
Show file tree
Hide file tree
Showing 36 changed files with 19 additions and 1,016 deletions.
16 changes: 1 addition & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,7 @@ Cordova Android is an Android application library that allows for Cordova-based

## Cordova Android Developer Tools

We recommend using the [Cordova command-line tool](https://www.npmjs.com/package/cordova) to create projects and be able to easily install plugins.

However, the following scripts can be used instead:

./bin/create [path package activity] ... creates the ./example app or a cordova android project
./bin/check_reqs ....................... checks that your environment is set up for cordova-android development
./bin/update [path] .................... updates an existing cordova-android project to the version of the framework

These commands live in a generated Cordova Android project. Any interactions with the emulator require you to have an AVD defined.

./cordova/clean ........................ cleans the project
./cordova/build ........................ calls `clean` then compiles the project
./cordova/log ........................ streams device or emulator logs to STDOUT
./cordova/run ........................ calls `build` then deploys to a connected Android device. If no Android device is detected, will launch an emulator and deploy to it.
./cordova/version ...................... returns the cordova-android version of the current project
Use the [Cordova command-line tool](https://www.npmjs.com/package/cordova) to create projects and install plugins.

## Using Android Studio

Expand Down
26 changes: 0 additions & 26 deletions bin/android_sdk_version.bat

This file was deleted.

32 changes: 0 additions & 32 deletions bin/check_reqs

This file was deleted.

26 changes: 0 additions & 26 deletions bin/check_reqs.bat

This file was deleted.

61 changes: 0 additions & 61 deletions bin/create

This file was deleted.

26 changes: 0 additions & 26 deletions bin/create.bat

This file was deleted.

17 changes: 0 additions & 17 deletions bin/lib/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,6 @@ function copyScripts (projectPath) {

const nodeModulesDir = path.join(ROOT, 'node_modules');
if (fs.existsSync(nodeModulesDir)) fs.copySync(nodeModulesDir, path.join(destScriptsDir, 'node_modules'));

fs.copySync(path.join(bin, 'check_reqs'), path.join(destScriptsDir, 'check_reqs'));
fs.copySync(path.join(bin, 'check_reqs.bat'), path.join(destScriptsDir, 'check_reqs.bat'));
fs.copySync(path.join(bin, 'android_sdk_version'), path.join(destScriptsDir, 'android_sdk_version'));
fs.copySync(path.join(bin, 'android_sdk_version.bat'), path.join(destScriptsDir, 'android_sdk_version.bat'));

var check_reqs = path.join(destScriptsDir, 'check_reqs');
var android_sdk_version = path.join(destScriptsDir, 'android_sdk_version');

// TODO: the two files being edited on-the-fly here are shared between
// platform and project-level commands. the below is updating the
// `require` path for the two libraries. if there's a better way to share
// modules across both the repo and generated projects, we should make sure
// to remove/update this.
const templatesCordovaRegex = /templates\/cordova\//;
utils.replaceFileContents(android_sdk_version, templatesCordovaRegex, '');
utils.replaceFileContents(check_reqs, templatesCordovaRegex, '');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
under the License.
*/

var android_sdk = require('./templates/cordova/lib/android_sdk');
var android_sdk = require('./lib/android_sdk');

android_sdk.print_newest_available_sdk_target().catch(err => {
console.error(err);
Expand Down
51 changes: 0 additions & 51 deletions bin/templates/cordova/build

This file was deleted.

26 changes: 0 additions & 26 deletions bin/templates/cordova/build.bat

This file was deleted.

51 changes: 0 additions & 51 deletions bin/templates/cordova/clean

This file was deleted.

26 changes: 0 additions & 26 deletions bin/templates/cordova/clean.bat

This file was deleted.

0 comments on commit facffb0

Please sign in to comment.