Skip to content

Commit

Permalink
refactor!: drop platform binaries (apache#1180)
Browse files Browse the repository at this point in the history
* test(create): remove create & build binary usage
* refactor!: remove create binaries
* refactor!: remove build binaries
* refactor: update platform
* chore: cleanup update platform error message
* refactor!: remove update binaries
* refactor!: remove check_reqs binaries & usage
* refactor!: remove clean binaries
* refactor!: remove run binaries
* refactor!: remove test binaries
  * This file referenced a binary that hasnt existed since 2012. (apache@acc8b34)
* refactor!: remove log binaries
* refactor: cleanup version binaries
* refactor!: remove uncrustify binary & config
* refactor!: remove binary help methods for build & run
* refactor!: remove version.bat binary
* fix: get realpathSync of os tmp dir
* refactor: cleanup verify create & build methods
* refactor(create.spec): use expectAsync toBeResolved
* refactor!: remove uncrustify pre-commit hook
* refactor!: remove list-emulator-build-targets binary
* refactor!: remove list-started-emulators binary
* refactor!: remove start-emulator binary
* chore: cleanup eslint ignore
* refactor!: remove bat files

Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
  • Loading branch information
2 people authored and gazben committed Aug 26, 2022
1 parent b656fb0 commit 5129809
Show file tree
Hide file tree
Showing 33 changed files with 86 additions and 2,513 deletions.
3 changes: 0 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ tests/spec/unit/fixtures/*
CordovaLib/cordova.js

# Non-JS binaries
bin/test
bin/cordova_plist_to_config_xml
bin/templates/scripts/cordova/log
bin/templates/scripts/cordova/lib/start-emulator
26 changes: 0 additions & 26 deletions bin/apple_ios_version.bat

This file was deleted.

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

This file was deleted.

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

This file was deleted.

32 changes: 0 additions & 32 deletions bin/check_reqs

This file was deleted.

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

This file was deleted.

74 changes: 0 additions & 74 deletions bin/create

This file was deleted.

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

This file was deleted.

18 changes: 0 additions & 18 deletions bin/lib/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ function copyScripts (projectPath, projectName) {
const nodeModulesDir = path.join(ROOT, 'node_modules');
if (fs.existsSync(nodeModulesDir)) fs.copySync(nodeModulesDir, path.join(destScriptsDir, 'node_modules'));

// Copy the check_reqs script
fs.copySync(path.join(binDir, 'check_reqs'), path.join(destScriptsDir, 'check_reqs'));
fs.copySync(path.join(binDir, 'check_reqs.bat'), path.join(destScriptsDir, 'check_reqs.bat'));

// Copy the version scripts
fs.copySync(path.join(binDir, 'apple_ios_version'), path.join(destScriptsDir, 'apple_ios_version'));
fs.copySync(path.join(binDir, 'apple_osx_version'), path.join(destScriptsDir, 'apple_osx_version'));
Expand All @@ -95,7 +91,6 @@ function copyScripts (projectPath, projectName) {
// modules across both the repo and generated projects, we should make sure
// to remove/update this.
const path_regex = /templates\/scripts\/cordova\//;
utils.replaceFileContents(path.join(destScriptsDir, 'check_reqs'), path_regex, '');
utils.replaceFileContents(path.join(destScriptsDir, 'apple_ios_version'), path_regex, '');
utils.replaceFileContents(path.join(destScriptsDir, 'apple_osx_version'), path_regex, '');
utils.replaceFileContents(path.join(destScriptsDir, 'apple_xcode_version'), path_regex, '');
Expand Down Expand Up @@ -237,19 +232,6 @@ exports.createProject = (project_path, package_name, project_name, opts, config)
return Promise.resolve();
};

exports.updateProject = (projectPath, opts) => {
const errorString =
'An in-place platform update is not supported. \n' +
'The `platforms` folder is always treated as a build artifact.\n' +
'To update your platform, you have to remove, then add your ios platform again.\n' +
'Make sure you save your plugins beforehand using `cordova plugin save`, and save a copy of the platform first if you had manual changes in it.\n' +
'\tcordova plugin save\n' +
'\tcordova platform rm ios\n' +
'\tcordova platform add ios\n';

return Promise.reject(new CordovaError(errorString));
};

function generateDoneMessage (type, link) {
const pkg = require('../../package');
let msg = `iOS project ${type === 'update' ? 'updated' : 'created'} with ${pkg.name}@${pkg.version}`;
Expand Down
23 changes: 10 additions & 13 deletions bin/templates/scripts/cordova/Api.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,16 @@ class Api {
static updatePlatform (destination, options, events) {
setupEvents(events);

let result;
try {
result = require('../../../lib/create')
.updateProject(destination, options)
.then(() => {
const PlatformApi = require(path.resolve(destination, 'cordova/Api'));
return new PlatformApi('ios', destination, events);
});
} catch (e) {
events.emit('error', 'updatePlatform is not callable from the iOS project API, you will need to do this manually.');
throw e;
}
return result;
const errorString =
'The update platform command is not supported.\n' +
'The `platforms` folder is always treated as a build artifact.\n' +
'To update, you have to remove the old platform and add the new platform.\n' +
'Make sure to save your plugins beforehand using `cordova plugin save`, and save a copy of the platform first if you had manual changes.\n' +
'\tcordova plugin save\n' +
'\tcordova platform rm ios\n' +
'\tcordova platform add ios\n';

return Promise.reject(new CordovaError(errorString));
}

/**
Expand Down
66 changes: 0 additions & 66 deletions bin/templates/scripts/cordova/build

This file was deleted.

Loading

0 comments on commit 5129809

Please sign in to comment.