From 355f5afab93eb01dec75b901c52e9d93352ac534 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 8 Jun 2023 15:03:42 +0300 Subject: [PATCH] * Optimized project integration templates to address the issue of long paths on Windows // Resolve #4652 --- HISTORY.rst | 1 + platformio/project/integration/generator.py | 2 +- .../integration/tpls}/atom/.clang_complete.tpl | 0 .../integration/tpls}/atom/.gcc-flags.json.tpl | 0 .../integration/tpls}/atom/.gitignore.tpl | 0 .../integration/tpls}/clion/.gitignore.tpl | 0 .../integration/tpls}/clion/CMakeLists.txt.tpl | 0 .../integration/tpls}/clion/CMakeListsPrivate.txt.tpl | 0 .../integration/tpls}/codeblocks/platformio.cbp.tpl | 0 .../integration/tpls}/eclipse/.cproject.tpl | 0 .../integration/tpls}/eclipse/.project.tpl | 0 .../eclipse/.settings/PlatformIO Debugger.launch.tpl | 0 .../tpls}/eclipse/.settings/language.settings.xml.tpl | 0 .../eclipse/.settings/org.eclipse.cdt.core.prefs.tpl | 0 .../integration/tpls}/emacs/.ccls.tpl | 0 .../integration/tpls}/emacs/.gitignore.tpl | 0 .../tpls}/netbeans/nbproject/configurations.xml.tpl | 0 .../netbeans/nbproject/private/configurations.xml.tpl | 0 .../netbeans/nbproject/private/launcher.properties.tpl | 0 .../tpls}/netbeans/nbproject/private/private.xml.tpl | 0 .../tpls}/netbeans/nbproject/project.xml.tpl | 0 .../integration/tpls}/qtcreator/.gitignore.tpl | 0 .../integration/tpls}/qtcreator/Makefile.tpl | 0 .../integration/tpls}/qtcreator/platformio.cflags.tpl | 0 .../integration/tpls}/qtcreator/platformio.config.tpl | 0 .../integration/tpls}/qtcreator/platformio.creator.tpl | 0 .../tpls}/qtcreator/platformio.cxxflags.tpl | 0 .../integration/tpls}/qtcreator/platformio.files.tpl | 0 .../tpls}/qtcreator/platformio.includes.tpl | 0 .../integration/tpls}/sublimetext/.ccls.tpl | 0 .../tpls}/sublimetext/platformio.sublime-project.tpl | 0 .../integration/tpls}/vim/.ccls.tpl | 0 .../integration/tpls}/vim/.gitignore.tpl | 0 .../tpls}/visualstudio/platformio.vcxproj.filters.tpl | 0 .../tpls}/visualstudio/platformio.vcxproj.tpl | 0 .../integration/tpls}/vscode/.gitignore.tpl | 0 .../tpls}/vscode/.vscode/c_cpp_properties.json.tpl | 0 .../tpls}/vscode/.vscode/extensions.json.tpl | 0 .../integration/tpls}/vscode/.vscode/launch.json.tpl | 0 setup.py | 10 +++++----- 40 files changed, 7 insertions(+), 6 deletions(-) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/atom/.clang_complete.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/atom/.gcc-flags.json.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/atom/.gitignore.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/clion/.gitignore.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/clion/CMakeLists.txt.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/clion/CMakeListsPrivate.txt.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/codeblocks/platformio.cbp.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/eclipse/.cproject.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/eclipse/.project.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/eclipse/.settings/PlatformIO Debugger.launch.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/eclipse/.settings/language.settings.xml.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/eclipse/.settings/org.eclipse.cdt.core.prefs.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/emacs/.ccls.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/emacs/.gitignore.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/netbeans/nbproject/configurations.xml.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/netbeans/nbproject/private/configurations.xml.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/netbeans/nbproject/private/launcher.properties.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/netbeans/nbproject/private/private.xml.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/netbeans/nbproject/project.xml.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/qtcreator/.gitignore.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/qtcreator/Makefile.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/qtcreator/platformio.cflags.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/qtcreator/platformio.config.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/qtcreator/platformio.creator.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/qtcreator/platformio.cxxflags.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/qtcreator/platformio.files.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/qtcreator/platformio.includes.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/sublimetext/.ccls.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/sublimetext/platformio.sublime-project.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/vim/.ccls.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/vim/.gitignore.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/visualstudio/platformio.vcxproj.filters.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/visualstudio/platformio.vcxproj.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/vscode/.gitignore.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/vscode/.vscode/c_cpp_properties.json.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/vscode/.vscode/extensions.json.tpl (100%) rename platformio/{assets/templates/ide-projects => project/integration/tpls}/vscode/.vscode/launch.json.tpl (100%) diff --git a/HISTORY.rst b/HISTORY.rst index a29f23d1dc..f277cbdac0 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -19,6 +19,7 @@ PlatformIO Core 6 ~~~~~~~~~~~~~~~~~~ * Enhanced the parsing of the |PIOCONF| to provide comprehensive diagnostic information +* Optimized project integration templates to address the issue of long paths on Windows (`issue #4652 `_) 6.1.7 (2023-05-08) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/project/integration/generator.py b/platformio/project/integration/generator.py index 654e5ac353..d55f9aa7dc 100644 --- a/platformio/project/integration/generator.py +++ b/platformio/project/integration/generator.py @@ -52,7 +52,7 @@ def get_best_envname(self, boards=None): @staticmethod def get_ide_tpls_dir(): - return os.path.join(fs.get_assets_dir(), "templates", "ide-projects") + return os.path.join(os.path.dirname(__file__), "tpls") @classmethod def get_supported_ides(cls): diff --git a/platformio/assets/templates/ide-projects/atom/.clang_complete.tpl b/platformio/project/integration/tpls/atom/.clang_complete.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/atom/.clang_complete.tpl rename to platformio/project/integration/tpls/atom/.clang_complete.tpl diff --git a/platformio/assets/templates/ide-projects/atom/.gcc-flags.json.tpl b/platformio/project/integration/tpls/atom/.gcc-flags.json.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/atom/.gcc-flags.json.tpl rename to platformio/project/integration/tpls/atom/.gcc-flags.json.tpl diff --git a/platformio/assets/templates/ide-projects/atom/.gitignore.tpl b/platformio/project/integration/tpls/atom/.gitignore.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/atom/.gitignore.tpl rename to platformio/project/integration/tpls/atom/.gitignore.tpl diff --git a/platformio/assets/templates/ide-projects/clion/.gitignore.tpl b/platformio/project/integration/tpls/clion/.gitignore.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/clion/.gitignore.tpl rename to platformio/project/integration/tpls/clion/.gitignore.tpl diff --git a/platformio/assets/templates/ide-projects/clion/CMakeLists.txt.tpl b/platformio/project/integration/tpls/clion/CMakeLists.txt.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/clion/CMakeLists.txt.tpl rename to platformio/project/integration/tpls/clion/CMakeLists.txt.tpl diff --git a/platformio/assets/templates/ide-projects/clion/CMakeListsPrivate.txt.tpl b/platformio/project/integration/tpls/clion/CMakeListsPrivate.txt.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/clion/CMakeListsPrivate.txt.tpl rename to platformio/project/integration/tpls/clion/CMakeListsPrivate.txt.tpl diff --git a/platformio/assets/templates/ide-projects/codeblocks/platformio.cbp.tpl b/platformio/project/integration/tpls/codeblocks/platformio.cbp.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/codeblocks/platformio.cbp.tpl rename to platformio/project/integration/tpls/codeblocks/platformio.cbp.tpl diff --git a/platformio/assets/templates/ide-projects/eclipse/.cproject.tpl b/platformio/project/integration/tpls/eclipse/.cproject.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/eclipse/.cproject.tpl rename to platformio/project/integration/tpls/eclipse/.cproject.tpl diff --git a/platformio/assets/templates/ide-projects/eclipse/.project.tpl b/platformio/project/integration/tpls/eclipse/.project.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/eclipse/.project.tpl rename to platformio/project/integration/tpls/eclipse/.project.tpl diff --git a/platformio/assets/templates/ide-projects/eclipse/.settings/PlatformIO Debugger.launch.tpl b/platformio/project/integration/tpls/eclipse/.settings/PlatformIO Debugger.launch.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/eclipse/.settings/PlatformIO Debugger.launch.tpl rename to platformio/project/integration/tpls/eclipse/.settings/PlatformIO Debugger.launch.tpl diff --git a/platformio/assets/templates/ide-projects/eclipse/.settings/language.settings.xml.tpl b/platformio/project/integration/tpls/eclipse/.settings/language.settings.xml.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/eclipse/.settings/language.settings.xml.tpl rename to platformio/project/integration/tpls/eclipse/.settings/language.settings.xml.tpl diff --git a/platformio/assets/templates/ide-projects/eclipse/.settings/org.eclipse.cdt.core.prefs.tpl b/platformio/project/integration/tpls/eclipse/.settings/org.eclipse.cdt.core.prefs.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/eclipse/.settings/org.eclipse.cdt.core.prefs.tpl rename to platformio/project/integration/tpls/eclipse/.settings/org.eclipse.cdt.core.prefs.tpl diff --git a/platformio/assets/templates/ide-projects/emacs/.ccls.tpl b/platformio/project/integration/tpls/emacs/.ccls.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/emacs/.ccls.tpl rename to platformio/project/integration/tpls/emacs/.ccls.tpl diff --git a/platformio/assets/templates/ide-projects/emacs/.gitignore.tpl b/platformio/project/integration/tpls/emacs/.gitignore.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/emacs/.gitignore.tpl rename to platformio/project/integration/tpls/emacs/.gitignore.tpl diff --git a/platformio/assets/templates/ide-projects/netbeans/nbproject/configurations.xml.tpl b/platformio/project/integration/tpls/netbeans/nbproject/configurations.xml.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/netbeans/nbproject/configurations.xml.tpl rename to platformio/project/integration/tpls/netbeans/nbproject/configurations.xml.tpl diff --git a/platformio/assets/templates/ide-projects/netbeans/nbproject/private/configurations.xml.tpl b/platformio/project/integration/tpls/netbeans/nbproject/private/configurations.xml.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/netbeans/nbproject/private/configurations.xml.tpl rename to platformio/project/integration/tpls/netbeans/nbproject/private/configurations.xml.tpl diff --git a/platformio/assets/templates/ide-projects/netbeans/nbproject/private/launcher.properties.tpl b/platformio/project/integration/tpls/netbeans/nbproject/private/launcher.properties.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/netbeans/nbproject/private/launcher.properties.tpl rename to platformio/project/integration/tpls/netbeans/nbproject/private/launcher.properties.tpl diff --git a/platformio/assets/templates/ide-projects/netbeans/nbproject/private/private.xml.tpl b/platformio/project/integration/tpls/netbeans/nbproject/private/private.xml.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/netbeans/nbproject/private/private.xml.tpl rename to platformio/project/integration/tpls/netbeans/nbproject/private/private.xml.tpl diff --git a/platformio/assets/templates/ide-projects/netbeans/nbproject/project.xml.tpl b/platformio/project/integration/tpls/netbeans/nbproject/project.xml.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/netbeans/nbproject/project.xml.tpl rename to platformio/project/integration/tpls/netbeans/nbproject/project.xml.tpl diff --git a/platformio/assets/templates/ide-projects/qtcreator/.gitignore.tpl b/platformio/project/integration/tpls/qtcreator/.gitignore.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/qtcreator/.gitignore.tpl rename to platformio/project/integration/tpls/qtcreator/.gitignore.tpl diff --git a/platformio/assets/templates/ide-projects/qtcreator/Makefile.tpl b/platformio/project/integration/tpls/qtcreator/Makefile.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/qtcreator/Makefile.tpl rename to platformio/project/integration/tpls/qtcreator/Makefile.tpl diff --git a/platformio/assets/templates/ide-projects/qtcreator/platformio.cflags.tpl b/platformio/project/integration/tpls/qtcreator/platformio.cflags.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/qtcreator/platformio.cflags.tpl rename to platformio/project/integration/tpls/qtcreator/platformio.cflags.tpl diff --git a/platformio/assets/templates/ide-projects/qtcreator/platformio.config.tpl b/platformio/project/integration/tpls/qtcreator/platformio.config.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/qtcreator/platformio.config.tpl rename to platformio/project/integration/tpls/qtcreator/platformio.config.tpl diff --git a/platformio/assets/templates/ide-projects/qtcreator/platformio.creator.tpl b/platformio/project/integration/tpls/qtcreator/platformio.creator.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/qtcreator/platformio.creator.tpl rename to platformio/project/integration/tpls/qtcreator/platformio.creator.tpl diff --git a/platformio/assets/templates/ide-projects/qtcreator/platformio.cxxflags.tpl b/platformio/project/integration/tpls/qtcreator/platformio.cxxflags.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/qtcreator/platformio.cxxflags.tpl rename to platformio/project/integration/tpls/qtcreator/platformio.cxxflags.tpl diff --git a/platformio/assets/templates/ide-projects/qtcreator/platformio.files.tpl b/platformio/project/integration/tpls/qtcreator/platformio.files.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/qtcreator/platformio.files.tpl rename to platformio/project/integration/tpls/qtcreator/platformio.files.tpl diff --git a/platformio/assets/templates/ide-projects/qtcreator/platformio.includes.tpl b/platformio/project/integration/tpls/qtcreator/platformio.includes.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/qtcreator/platformio.includes.tpl rename to platformio/project/integration/tpls/qtcreator/platformio.includes.tpl diff --git a/platformio/assets/templates/ide-projects/sublimetext/.ccls.tpl b/platformio/project/integration/tpls/sublimetext/.ccls.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/sublimetext/.ccls.tpl rename to platformio/project/integration/tpls/sublimetext/.ccls.tpl diff --git a/platformio/assets/templates/ide-projects/sublimetext/platformio.sublime-project.tpl b/platformio/project/integration/tpls/sublimetext/platformio.sublime-project.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/sublimetext/platformio.sublime-project.tpl rename to platformio/project/integration/tpls/sublimetext/platformio.sublime-project.tpl diff --git a/platformio/assets/templates/ide-projects/vim/.ccls.tpl b/platformio/project/integration/tpls/vim/.ccls.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/vim/.ccls.tpl rename to platformio/project/integration/tpls/vim/.ccls.tpl diff --git a/platformio/assets/templates/ide-projects/vim/.gitignore.tpl b/platformio/project/integration/tpls/vim/.gitignore.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/vim/.gitignore.tpl rename to platformio/project/integration/tpls/vim/.gitignore.tpl diff --git a/platformio/assets/templates/ide-projects/visualstudio/platformio.vcxproj.filters.tpl b/platformio/project/integration/tpls/visualstudio/platformio.vcxproj.filters.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/visualstudio/platformio.vcxproj.filters.tpl rename to platformio/project/integration/tpls/visualstudio/platformio.vcxproj.filters.tpl diff --git a/platformio/assets/templates/ide-projects/visualstudio/platformio.vcxproj.tpl b/platformio/project/integration/tpls/visualstudio/platformio.vcxproj.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/visualstudio/platformio.vcxproj.tpl rename to platformio/project/integration/tpls/visualstudio/platformio.vcxproj.tpl diff --git a/platformio/assets/templates/ide-projects/vscode/.gitignore.tpl b/platformio/project/integration/tpls/vscode/.gitignore.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/vscode/.gitignore.tpl rename to platformio/project/integration/tpls/vscode/.gitignore.tpl diff --git a/platformio/assets/templates/ide-projects/vscode/.vscode/c_cpp_properties.json.tpl b/platformio/project/integration/tpls/vscode/.vscode/c_cpp_properties.json.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/vscode/.vscode/c_cpp_properties.json.tpl rename to platformio/project/integration/tpls/vscode/.vscode/c_cpp_properties.json.tpl diff --git a/platformio/assets/templates/ide-projects/vscode/.vscode/extensions.json.tpl b/platformio/project/integration/tpls/vscode/.vscode/extensions.json.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/vscode/.vscode/extensions.json.tpl rename to platformio/project/integration/tpls/vscode/.vscode/extensions.json.tpl diff --git a/platformio/assets/templates/ide-projects/vscode/.vscode/launch.json.tpl b/platformio/project/integration/tpls/vscode/.vscode/launch.json.tpl similarity index 100% rename from platformio/assets/templates/ide-projects/vscode/.vscode/launch.json.tpl rename to platformio/project/integration/tpls/vscode/.vscode/launch.json.tpl diff --git a/setup.py b/setup.py index ea6000d781..e8fad3e17e 100644 --- a/setup.py +++ b/setup.py @@ -65,11 +65,11 @@ package_data={ "platformio": [ "assets/system/99-platformio-udev.rules", - "assets/templates/ide-projects/*/*.tpl", - "assets/templates/ide-projects/*/.*.tpl", # include hidden files - "assets/templates/ide-projects/*/.*/*.tpl", # include hidden folders - "assets/templates/ide-projects/*/*/*.tpl", # NetBeans - "assets/templates/ide-projects/*/*/*/*.tpl", # NetBeans + "project/integration/tpls/*/*.tpl", + "project/integration/tpls/*/.*.tpl", # include hidden files + "project/integration/tpls/*/.*/*.tpl", # include hidden folders + "project/integration/tpls/*/*/*.tpl", # NetBeans + "project/integration/tpls/*/*/*/*.tpl", # NetBeans ] }, entry_points={