diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b27502..77a0158 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes +## 2.5.2 (2022-08-12) + +- Fixed an issue when project tasks with a title didn't work (issue [#3274](https://github.com/platformio/platformio-vscode-ide/issues/3274)) + ## 2.5.1 (2022-07-28) **Requires VSCode 1.63 or above** diff --git a/package.json b/package.json index 320b88a..147da83 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "platformio-ide", - "version": "2.5.1", + "version": "2.5.2", "publisher": "platformio", "engines": { "vscode": "^1.63.0" }, "license": "Apache-2.0", "displayName": "PlatformIO IDE", - "description": "Professional development environment for Embedded, IoT, Arduino, CMSIS, ESP-IDF, FreeRTOS, libOpenCM3, mbed OS, Pulp OS, SPL, STM32Cube, Zephyr RTOS, ARM, AVR, Espressif (ESP8266/ESP32), FPGA, MCS-51 (8051), MSP430, Nordic (nRF51/nRF52), NXP i.MX RT, PIC32, RISC-V, STMicroelectronics (STM8/STM32), Teensy", + "description": "Professional development environment for Embedded, IoT, Arduino, CMSIS, ESP-IDF, FreeRTOS, libOpenCM3, mbed OS, Pulp OS, SPL, STM32Cube, Zephyr RTOS, ARM, AVR, Espressif (ESP8266/ESP32), FPGA, MCS-51 (8051), MSP430, Nordic (nRF51/nRF52), PIC32, RISC-V, STMicroelectronics (STM8/STM32), Teensy", "categories": [ "Programming Languages", "Linters", @@ -632,14 +632,14 @@ "platformio-vscode-debug": "~1.4.1" }, "devDependencies": { - "@babel/core": "~7.18.9", + "@babel/core": "~7.18.10", "@babel/eslint-parser": "~7.18.9", "@babel/plugin-proposal-class-properties": "~7.18.6", - "@babel/preset-env": "~7.18.9", + "@babel/preset-env": "~7.18.10", "@types/node": "~14", "@types/vscode": "~1.63.0", "babel-loader": "~8.2.5", - "eslint": "~8.20.0", + "eslint": "~8.21.0", "eslint-import-resolver-webpack": "~0.13.2", "eslint-plugin-import": "~2.26.0", "prettier": "~2.7.1", diff --git a/scripts/publish.py b/scripts/publish.py new file mode 100644 index 0000000..18a7849 --- /dev/null +++ b/scripts/publish.py @@ -0,0 +1,91 @@ +# Copyright (c) 2014-present PlatformIO +# +# Licensed 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. + +import os +import shutil +import subprocess +from dataclasses import dataclass +from pathlib import Path + +from platformio.package.manager.tool import ToolPackageManager +from platformio.package.meta import PackageSpec + + +@dataclass +class PlatformItem: + target: str + system: str + + def __init__(self, target, system=None): + self.target = target + self.system = system + + +PLATFORM_LIST = [ + PlatformItem("win32-arm64"), + PlatformItem("win32-ia32", "windows_x86"), + PlatformItem("win32-x64", "windows_amd64"), + PlatformItem("linux-arm64"), + PlatformItem("linux-armhf"), + PlatformItem("linux-x64"), + PlatformItem("alpine-x64"), + PlatformItem("alpine-arm64"), + PlatformItem("darwin-arm64"), + PlatformItem("darwin-x64", "darwin_x86_64"), + PlatformItem("web"), +] + +ROOT_DIR = (Path(__file__).parent / "..").resolve() +PREDOWNLOADED_DIR = ROOT_DIR / "assets" / "predownloaded" + + +def cleanup_predownload_dir(path: Path): + for child in path.iterdir(): + if child.name != ".keep": + os.remove(str(child)) + + +def predownload_portable_python(dst_dir: Path, custom_system): + tm = ToolPackageManager() + package = tm.fetch_registry_package(PackageSpec("platformio/python-portable")) + assert package + version = tm.pick_best_registry_version( + package["versions"], custom_system=custom_system + ) + if not version: + print(f"Could not find portable Python for {custom_system}") + return + pkgfile = tm.pick_compatible_pkg_file(version["files"], custom_system=custom_system) + dlfile_path = tm.download(pkgfile["download_url"], pkgfile["checksum"]["sha256"]) + shutil.copy(dlfile_path, dst_dir / os.path.basename(pkgfile["download_url"])) + + +if __name__ == "__main__": + subprocess.run(["yarn", "build"], cwd=ROOT_DIR) + for item in PLATFORM_LIST: + print(f"Publishing {item}") + cleanup_predownload_dir(PREDOWNLOADED_DIR) + if item.system: + predownload_portable_python(PREDOWNLOADED_DIR, item.system) + subprocess.run( + [ + "npx", + "vsce", + "publish", + "--allow-star-activation", + "--target", + item.target, + ], + cwd=ROOT_DIR, + ) diff --git a/src/project/tasks.js b/src/project/tasks.js index 1f9691e..52d489a 100644 --- a/src/project/tasks.js +++ b/src/project/tasks.js @@ -120,7 +120,7 @@ export default class ProjectTaskManager { task: projectTask.id, }, vscode.workspace.getWorkspaceFolder(vscode.Uri.file(this.projectDir)), - projectTask.title, + projectTask.id, ProjectTaskManager.PROVIDER_TYPE, new vscode.ProcessExecution( IS_WINDOWS ? 'platformio.exe' : 'platformio',