You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ra...@apache.org on 2020/07/03 16:51:04 UTC
[cordova-android] branch master updated: test(java): fix,
improve and move clean script (#1017)
This is an automated email from the ASF dual-hosted git repository.
raphinesse pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git
The following commit(s) were added to refs/heads/master by this push:
new 3204b98 test(java): fix, improve and move clean script (#1017)
3204b98 is described below
commit 3204b9804b6001c17e91d4ce296c2f4ce8e79e6a
Author: Raphael von der GrĂ¼n <ra...@gmail.com>
AuthorDate: Fri Jul 3 18:50:53 2020 +0200
test(java): fix, improve and move clean script (#1017)
This includes the following changes:
- move this developer-only script to test/ where it conceptually belongs
- this also prevents it from being distributed with this package
- fix paths for `android` and `androidx` variants
- make paths relative to the script, not to CWD
- use `removeSync` instead of `existsSync` and `existsSync`
- rename npm script to `clean:java-unit-tests` to clarify scope
---
package.json | 4 ++--
bin/clean_test.js => test/clean.js | 16 ++++++++++------
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/package.json b/package.json
index d57e76a..324ba79 100644
--- a/package.json
+++ b/package.json
@@ -15,12 +15,12 @@
],
"scripts": {
"test": "npm run lint && npm run cover && npm run java-unit-tests",
+ "lint": "eslint . \"bin/**/!(*.*|gitignore)\"",
"unit-tests": "jasmine --config=spec/unit/jasmine.json",
"cover": "nyc jasmine --config=spec/coverage.json",
"e2e-tests": "jasmine --config=spec/e2e/jasmine.json",
"java-unit-tests": "node test/run_java_unit_tests.js",
- "lint": "eslint . \"bin/**/!(*.*|gitignore)\"",
- "clean-tests": "node bin/clean_test.js"
+ "clean:java-unit-tests": "node test/clean.js"
},
"author": "Apache Software Foundation",
"license": "Apache-2.0",
diff --git a/bin/clean_test.js b/test/clean.js
similarity index 69%
rename from bin/clean_test.js
rename to test/clean.js
index 919f0b2..212226a 100644
--- a/bin/clean_test.js
+++ b/test/clean.js
@@ -17,12 +17,16 @@
under the License.
*/
-const fs = require('fs');
+const fs = require('fs-extra');
+const path = require('path');
-if (fs.existsSync('./test/gradlew')) {
- fs.unlinkSync('./test/gradlew');
-}
+/**
+ * This script is to be run manually (e.g. by npm run clean:java-unit-tests) if
+ * you want to upgrade gradlew or test its proper generation.
+ */
-if (fs.existsSync('./test/gradlew.bat')) {
- fs.unlinkSync('./test/gradlew.bat');
+for (const variant of ['android', 'androidx']) {
+ for (const file of ['gradlew', 'gradlew.bat']) {
+ fs.removeSync(path.join(__dirname, variant, file));
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org