From 520e7857579071e5469ff816dd638514e57fb24c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raphael=20von=20der=20Gr=C3=BCn?= Date: Tue, 6 Jul 2021 10:17:14 +0200 Subject: [PATCH] WIP move android SDK version --- bin/android_sdk_version.bat | 26 ------------------- bin/lib/create.js | 13 ---------- .../cordova}/android_sdk_version | 2 +- 3 files changed, 1 insertion(+), 40 deletions(-) delete mode 100644 bin/android_sdk_version.bat rename bin/{ => templates/cordova}/android_sdk_version (93%) diff --git a/bin/android_sdk_version.bat b/bin/android_sdk_version.bat deleted file mode 100644 index 65173a8f8f..0000000000 --- a/bin/android_sdk_version.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script_path="%~dp0android_sdk_version" -IF EXIST %script_path% ( - node %script_path% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'android_sdk_version' script in 'bin' folder, aborting...>&2 - EXIT /B 1 -) diff --git a/bin/lib/create.js b/bin/lib/create.js index ccb3eecc7b..84a1ef30ef 100755 --- a/bin/lib/create.js +++ b/bin/lib/create.js @@ -144,19 +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, '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 android_sdk_version = path.join(destScriptsDir, 'android_sdk_version'); - - // TODO: the file being edited on-the-fly here is 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, ''); } /** diff --git a/bin/android_sdk_version b/bin/templates/cordova/android_sdk_version similarity index 93% rename from bin/android_sdk_version rename to bin/templates/cordova/android_sdk_version index 764a19f428..c4aa8b8653 100755 --- a/bin/android_sdk_version +++ b/bin/templates/cordova/android_sdk_version @@ -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);