forked from platformio/platformio-core
Merge branch 'develop' into feature/v7
# Conflicts: # platformio/project/integration/tpls/clion/CMakeListsPrivate.txt.tpl
This commit is contained in:
@ -13,9 +13,14 @@ Release Notes
|
|||||||
PlatformIO Core 6
|
PlatformIO Core 6
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
**A professional collaborative platform for declarative, safety-critical, and test-driven embedded development.**
|
Unlock the true potential of embedded software development with
|
||||||
|
PlatformIO's collaborative ecosystem, embracing declarative principles,
|
||||||
|
test-driven methodologies, and modern toolchains for unrivaled success.
|
||||||
|
|
||||||
6.1.10 (2023-??-??)
|
6.1.11 (2023-??-??)
|
||||||
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
6.1.10 (2023-08-11)
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
* Resolved an issue that caused generated projects for `PlatformIO IDE for VSCode <https://docs.platformio.org/en/latest/integration/ide/vscode.html>`__ to break when the ``-iprefix`` compiler flag was used
|
* Resolved an issue that caused generated projects for `PlatformIO IDE for VSCode <https://docs.platformio.org/en/latest/integration/ide/vscode.html>`__ to break when the ``-iprefix`` compiler flag was used
|
||||||
|
@ -36,9 +36,11 @@ PlatformIO Core
|
|||||||
.. image:: https://raw.githubusercontent.com/platformio/platformio-web/develop/app/images/platformio-ide-laptop.png
|
.. image:: https://raw.githubusercontent.com/platformio/platformio-web/develop/app/images/platformio-ide-laptop.png
|
||||||
:target: https://platformio.org?utm_source=github&utm_medium=core
|
:target: https://platformio.org?utm_source=github&utm_medium=core
|
||||||
|
|
||||||
`PlatformIO <https://platformio.org>`_ is a professional collaborative platform for embedded development.
|
`PlatformIO <https://platformio.org>`_: Your Gateway to Embedded Software Development Excellence.
|
||||||
|
|
||||||
**A place where Developers and Teams have true Freedom! No more vendor lock-in!**
|
Unlock the true potential of embedded software development with
|
||||||
|
PlatformIO's collaborative ecosystem, embracing declarative principles,
|
||||||
|
test-driven methodologies, and modern toolchains for unrivaled success.
|
||||||
|
|
||||||
* Open source, maximum permissive Apache 2.0 license
|
* Open source, maximum permissive Apache 2.0 license
|
||||||
* Cross-platform IDE and Unified Debugger
|
* Cross-platform IDE and Unified Debugger
|
||||||
|
@ -12,20 +12,16 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
VERSION = (6, 1, "10a4")
|
VERSION = (6, 1, "11a1")
|
||||||
__version__ = ".".join([str(s) for s in VERSION])
|
__version__ = ".".join([str(s) for s in VERSION])
|
||||||
|
|
||||||
__title__ = "platformio"
|
__title__ = "platformio"
|
||||||
__description__ = (
|
__description__ = (
|
||||||
"A professional collaborative platform for embedded development. "
|
"Your Gateway to Embedded Software Development Excellence. "
|
||||||
"Cross-platform IDE and Unified Debugger. "
|
"Unlock the true potential of embedded software development "
|
||||||
"Static Code Analyzer and Remote Unit Testing. "
|
"with PlatformIO's collaborative ecosystem, embracing "
|
||||||
"Multi-platform and Multi-architecture Build System. "
|
"declarative principles, test-driven methodologies, and "
|
||||||
"Firmware File Explorer and Memory Inspection. "
|
"modern toolchains for unrivaled success."
|
||||||
"IoT, Arduino, CMSIS, ESP-IDF, FreeRTOS, libOpenCM3, mbedOS, 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"
|
|
||||||
)
|
)
|
||||||
__url__ = "https://platformio.org"
|
__url__ = "https://platformio.org"
|
||||||
|
|
||||||
|
@ -1,3 +1 @@
|
|||||||
.pio
|
.pio
|
||||||
CMakeListsPrivate.txt
|
|
||||||
cmake-build-*/
|
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
# !!! WARNING !!! AUTO-GENERATED FILE, PLEASE DO NOT MODIFY IT AND USE
|
|
||||||
# https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags
|
|
||||||
#
|
|
||||||
# If you need to override existing CMake configuration or add extra,
|
|
||||||
# please create `CMakeListsUser.txt` in the root of project.
|
|
||||||
# The `CMakeListsUser.txt` will not be overwritten by PlatformIO.
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.13)
|
|
||||||
set(CMAKE_SYSTEM_NAME Generic)
|
|
||||||
set(CMAKE_C_COMPILER_WORKS 1)
|
|
||||||
set(CMAKE_CXX_COMPILER_WORKS 1)
|
|
||||||
|
|
||||||
project("{{project_name}}" C CXX)
|
|
||||||
|
|
||||||
include(CMakeListsPrivate.txt)
|
|
||||||
|
|
||||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/CMakeListsUser.txt)
|
|
||||||
include(CMakeListsUser.txt)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_custom_target(
|
|
||||||
Production ALL
|
|
||||||
COMMAND platformio -c clion run "$<$<NOT:$<CONFIG:All>>:-e${CMAKE_BUILD_TYPE}>"
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_target(
|
|
||||||
Debug ALL
|
|
||||||
COMMAND platformio -c clion debug "$<$<NOT:$<CONFIG:All>>:-e${CMAKE_BUILD_TYPE}>"
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
add_executable(Z_DUMMY_TARGET ${SRC_LIST})
|
|
@ -1,127 +0,0 @@
|
|||||||
# !!! WARNING !!! AUTO-GENERATED FILE, PLEASE DO NOT MODIFY IT AND USE
|
|
||||||
# https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags
|
|
||||||
#
|
|
||||||
# If you need to override existing CMake configuration or add extra,
|
|
||||||
# please create `CMakeListsUser.txt` in the root of project.
|
|
||||||
# The `CMakeListsUser.txt` will not be overwritten by PlatformIO.
|
|
||||||
|
|
||||||
% import os
|
|
||||||
% import re
|
|
||||||
%
|
|
||||||
% from platformio.compat import shlex_join
|
|
||||||
% from platformio.project.helpers import load_build_metadata
|
|
||||||
%
|
|
||||||
% def _normalize_path(path):
|
|
||||||
% if project_dir in path:
|
|
||||||
% path = path.replace(project_dir, "${CMAKE_CURRENT_LIST_DIR}")
|
|
||||||
% elif user_home_dir in path:
|
|
||||||
% if "windows" in systype:
|
|
||||||
% path = path.replace(user_home_dir, "${ENV_HOME_PATH}")
|
|
||||||
% else:
|
|
||||||
% path = path.replace(user_home_dir, "$ENV{HOME}")
|
|
||||||
% end
|
|
||||||
% end
|
|
||||||
% return path
|
|
||||||
% end
|
|
||||||
%
|
|
||||||
% def _fix_lib_dirs(lib_dirs):
|
|
||||||
% result = []
|
|
||||||
% for lib_dir in lib_dirs:
|
|
||||||
% if not os.path.isabs(lib_dir):
|
|
||||||
% lib_dir = os.path.join(project_dir, lib_dir)
|
|
||||||
% end
|
|
||||||
% result.append(to_unix_path(os.path.normpath(lib_dir)))
|
|
||||||
% end
|
|
||||||
% return result
|
|
||||||
% end
|
|
||||||
%
|
|
||||||
% def _escape(text):
|
|
||||||
% return to_unix_path(text).replace('"', '\\"')
|
|
||||||
% end
|
|
||||||
%
|
|
||||||
% def _get_lib_dirs(envname):
|
|
||||||
% env_libdeps_dir = os.path.join(config.get("platformio", "libdeps_dir"), envname)
|
|
||||||
% env_lib_extra_dirs = config.get("env:" + envname, "lib_extra_dirs", [])
|
|
||||||
% return _fix_lib_dirs([env_libdeps_dir] + env_lib_extra_dirs)
|
|
||||||
% end
|
|
||||||
%
|
|
||||||
% envs = config.envs()
|
|
||||||
|
|
||||||
|
|
||||||
% if len(envs) > 1:
|
|
||||||
set(CMAKE_CONFIGURATION_TYPES "{{ ";".join(envs) }};" CACHE STRING "Build Types reflect PlatformIO Environments" FORCE)
|
|
||||||
% else:
|
|
||||||
set(CMAKE_CONFIGURATION_TYPES "{{ env_name }}" CACHE STRING "Build Types reflect PlatformIO Environments" FORCE)
|
|
||||||
% end
|
|
||||||
|
|
||||||
# Convert "Home Directory" that may contain unescaped backslashes on Windows
|
|
||||||
% if "windows" in systype:
|
|
||||||
file(TO_CMAKE_PATH $ENV{HOMEDRIVE}$ENV{HOMEPATH} ENV_HOME_PATH)
|
|
||||||
% end
|
|
||||||
|
|
||||||
% if svd_path:
|
|
||||||
set(CLION_SVD_FILE_PATH "{{ _normalize_path(svd_path) }}" CACHE FILEPATH "Peripheral Registers Definitions File" FORCE)
|
|
||||||
% end
|
|
||||||
|
|
||||||
SET(CMAKE_C_COMPILER "{{ _normalize_path(cc_path) }}")
|
|
||||||
SET(CMAKE_CXX_COMPILER "{{ _normalize_path(cxx_path) }}")
|
|
||||||
SET(CMAKE_CXX_FLAGS {{ _normalize_path(to_unix_path(shlex_join(cxx_flags))) }})
|
|
||||||
SET(CMAKE_C_FLAGS {{ _normalize_path(to_unix_path(shlex_join(cc_flags))) }})
|
|
||||||
|
|
||||||
% cc_stds = [arg for arg in cc_flags if arg.startswith("-std=")]
|
|
||||||
% cxx_stds = [arg for arg in cxx_flags if arg.startswith("-std=")]
|
|
||||||
% if cc_stds:
|
|
||||||
SET(CMAKE_C_STANDARD {{ cc_stds[-1][-2:] }})
|
|
||||||
% end
|
|
||||||
% if cxx_stds:
|
|
||||||
set(CMAKE_CXX_STANDARD {{ cxx_stds[-1][-2:] }})
|
|
||||||
% end
|
|
||||||
|
|
||||||
if (CMAKE_BUILD_TYPE MATCHES "{{ env_name }}")
|
|
||||||
% for define in defines:
|
|
||||||
add_definitions(-D{{!re.sub(r"([\"\(\)\ #])", r"\\\1", define)}})
|
|
||||||
% end
|
|
||||||
|
|
||||||
% for include in filter_includes(includes):
|
|
||||||
include_directories("{{ _normalize_path(include) }}")
|
|
||||||
% end
|
|
||||||
|
|
||||||
FILE(GLOB_RECURSE EXTRA_LIB_SOURCES
|
|
||||||
% for dir in _get_lib_dirs(env_name):
|
|
||||||
{{ _normalize_path(dir) + "/*.*" }}
|
|
||||||
% end
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
% leftover_envs = list(set(envs) ^ set([env_name]))
|
|
||||||
%
|
|
||||||
% ide_data = {}
|
|
||||||
% if leftover_envs:
|
|
||||||
% ide_data = load_build_metadata(None, leftover_envs)
|
|
||||||
% end
|
|
||||||
%
|
|
||||||
% for env, data in ide_data.items():
|
|
||||||
if (CMAKE_BUILD_TYPE MATCHES "{{ env }}")
|
|
||||||
% for define in data["defines"]:
|
|
||||||
add_definitions(-D{{!re.sub(r"([\"\(\)\ #])", r"\\\1", define)}})
|
|
||||||
% end
|
|
||||||
|
|
||||||
% for include in filter_includes(data["includes"]):
|
|
||||||
include_directories("{{ _normalize_path(to_unix_path(include)) }}")
|
|
||||||
% end
|
|
||||||
|
|
||||||
FILE(GLOB_RECURSE EXTRA_LIB_SOURCES
|
|
||||||
% for dir in _get_lib_dirs(env):
|
|
||||||
{{ _normalize_path(dir) + "/*.*" }}
|
|
||||||
% end
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
% end
|
|
||||||
|
|
||||||
FILE(GLOB_RECURSE SRC_LIST
|
|
||||||
% for path in (project_src_dir, project_lib_dir, project_test_dir):
|
|
||||||
{{ _normalize_path(path) + "/*.*" }}
|
|
||||||
% end
|
|
||||||
)
|
|
||||||
|
|
||||||
list(APPEND SRC_LIST ${EXTRA_LIB_SOURCES})
|
|
@ -27,7 +27,7 @@ import httpx
|
|||||||
from platformio import __title__, __version__, app, exception, fs, util
|
from platformio import __title__, __version__, app, exception, fs, util
|
||||||
from platformio.cli import PlatformioCLI
|
from platformio.cli import PlatformioCLI
|
||||||
from platformio.debug.config.base import DebugConfigBase
|
from platformio.debug.config.base import DebugConfigBase
|
||||||
from platformio.http import HTTPSession, ensure_internet_on
|
from platformio.http import HTTPSession
|
||||||
from platformio.proc import is_ci
|
from platformio.proc import is_ci
|
||||||
from platformio.project.helpers import get_project_id
|
from platformio.project.helpers import get_project_id
|
||||||
|
|
||||||
@ -362,8 +362,6 @@ def postpone_events(events):
|
|||||||
|
|
||||||
|
|
||||||
def process_postponed_logs():
|
def process_postponed_logs():
|
||||||
if not ensure_internet_on():
|
|
||||||
return None
|
|
||||||
events = load_postponed_events()
|
events = load_postponed_events()
|
||||||
if not events:
|
if not events:
|
||||||
return None
|
return None
|
||||||
@ -377,4 +375,5 @@ def process_postponed_logs():
|
|||||||
timestamp=event["timestamp"],
|
timestamp=event["timestamp"],
|
||||||
instant_sending=False,
|
instant_sending=False,
|
||||||
)
|
)
|
||||||
|
telemetry.send()
|
||||||
return True
|
return True
|
||||||
|
@ -16,7 +16,6 @@ import json
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from platformio.commands.boards import cli as cmd_boards
|
from platformio.commands.boards import cli as cmd_boards
|
||||||
from platformio.package.commands.exec import package_exec_cmd
|
|
||||||
from platformio.project.commands.init import project_init_cmd
|
from platformio.project.commands.init import project_init_cmd
|
||||||
from platformio.project.config import ProjectConfig
|
from platformio.project.config import ProjectConfig
|
||||||
from platformio.project.exception import ProjectEnvsNotAvailableError
|
from platformio.project.exception import ProjectEnvsNotAvailableError
|
||||||
@ -216,82 +215,3 @@ def test_init_incorrect_board(clirunner):
|
|||||||
assert result.exit_code == 2
|
assert result.exit_code == 2
|
||||||
assert "Error: Invalid value for" in result.output
|
assert "Error: Invalid value for" in result.output
|
||||||
assert isinstance(result.exception, SystemExit)
|
assert isinstance(result.exception, SystemExit)
|
||||||
|
|
||||||
|
|
||||||
def test_init_ide_clion(clirunner, validate_cliresult, tmpdir):
|
|
||||||
project_dir = tmpdir.join("project").mkdir()
|
|
||||||
# Add extra libraries to cover cases with possible unwanted backslashes
|
|
||||||
lib_extra_dirs = tmpdir.join("extra_libs").mkdir()
|
|
||||||
extra_lib = lib_extra_dirs.join("extra_lib").mkdir()
|
|
||||||
extra_lib.join("extra_lib.h").write(" ")
|
|
||||||
extra_lib.join("extra_lib.cpp").write(" ")
|
|
||||||
|
|
||||||
with project_dir.as_cwd():
|
|
||||||
result = clirunner.invoke(
|
|
||||||
project_init_cmd,
|
|
||||||
[
|
|
||||||
"-b",
|
|
||||||
"uno",
|
|
||||||
"--ide",
|
|
||||||
"clion",
|
|
||||||
"--project-option",
|
|
||||||
"framework=arduino",
|
|
||||||
"--project-option",
|
|
||||||
"platform_packages=platformio/tool-ninja",
|
|
||||||
"--project-option",
|
|
||||||
"lib_extra_dirs=%s" % str(lib_extra_dirs),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
validate_cliresult(result)
|
|
||||||
assert all(
|
|
||||||
os.path.isfile(f) for f in ("CMakeLists.txt", "CMakeListsPrivate.txt")
|
|
||||||
)
|
|
||||||
|
|
||||||
project_dir.join("src").join("main.cpp").write(
|
|
||||||
"""#include <Arduino.h>
|
|
||||||
#include "extra_lib.h"
|
|
||||||
void setup(){}
|
|
||||||
void loop(){}
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
project_dir.join("build_dir").mkdir()
|
|
||||||
result = clirunner.invoke(
|
|
||||||
package_exec_cmd,
|
|
||||||
[
|
|
||||||
"-p",
|
|
||||||
"tool-cmake",
|
|
||||||
"--",
|
|
||||||
"cmake",
|
|
||||||
"-DCMAKE_BUILD_TYPE=uno",
|
|
||||||
"-DCMAKE_MAKE_PROGRAM=%s"
|
|
||||||
% os.path.join(
|
|
||||||
ProjectConfig().get("platformio", "packages_dir"),
|
|
||||||
"tool-ninja",
|
|
||||||
"ninja",
|
|
||||||
),
|
|
||||||
"-G",
|
|
||||||
"Ninja",
|
|
||||||
"-S",
|
|
||||||
str(project_dir),
|
|
||||||
"-B",
|
|
||||||
"build_dir",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
validate_cliresult(result)
|
|
||||||
|
|
||||||
# build
|
|
||||||
result = clirunner.invoke(
|
|
||||||
package_exec_cmd,
|
|
||||||
[
|
|
||||||
"-p",
|
|
||||||
"tool-cmake",
|
|
||||||
"--",
|
|
||||||
"cmake",
|
|
||||||
"--build",
|
|
||||||
"build_dir",
|
|
||||||
"--target",
|
|
||||||
"Debug",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
validate_cliresult(result)
|
|
||||||
|
Reference in New Issue
Block a user