Skip to content

Commit

Permalink
Merge branch 'hotfix/v2.5.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Aug 12, 2022
2 parents 77b0dc1 + 2c82c85 commit 56beb23
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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**
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
91 changes: 91 additions & 0 deletions scripts/publish.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Copyright (c) 2014-present PlatformIO <[email protected]>
#
# 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,
)
2 changes: 1 addition & 1 deletion src/project/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 56beb23

Please sign in to comment.