diff --git a/platformio/home/rpc/handlers/project.py b/platformio/home/rpc/handlers/project.py index 2ca3496b..146629ca 100644 --- a/platformio/home/rpc/handlers/project.py +++ b/platformio/home/rpc/handlers/project.py @@ -26,8 +26,8 @@ from platformio.home.rpc.handlers.piocore import PIOCoreRPC from platformio.package.manager.platform import PlatformPackageManager from platformio.project.config import ProjectConfig from platformio.project.exception import ProjectError -from platformio.project.generator import ProjectGenerator from platformio.project.helpers import get_project_dir, is_platformio_project +from platformio.project.integration.generator import ProjectGenerator from platformio.project.options import get_config_options_schema diff --git a/platformio/project/commands/init.py b/platformio/project/commands/init.py index 0f3b719b..baae29ec 100644 --- a/platformio/project/commands/init.py +++ b/platformio/project/commands/init.py @@ -25,8 +25,8 @@ from platformio.package.commands.install import install_project_dependencies from platformio.package.manager.platform import PlatformPackageManager from platformio.platform.exception import UnknownBoard from platformio.project.config import ProjectConfig -from platformio.project.generator import ProjectGenerator from platformio.project.helpers import is_platformio_project +from platformio.project.integration.generator import ProjectGenerator def validate_boards(ctx, param, value): # pylint: disable=W0613 diff --git a/platformio/project/integration/__init__.py b/platformio/project/integration/__init__.py new file mode 100644 index 00000000..b0514903 --- /dev/null +++ b/platformio/project/integration/__init__.py @@ -0,0 +1,13 @@ +# 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. diff --git a/platformio/project/generator.py b/platformio/project/integration/generator.py similarity index 95% rename from platformio/project/generator.py rename to platformio/project/integration/generator.py index cca74dbf..7ffd05e3 100644 --- a/platformio/project/generator.py +++ b/platformio/project/integration/generator.py @@ -15,6 +15,7 @@ import codecs import os import sys +from pathlib import Path import bottle @@ -51,12 +52,11 @@ class ProjectGenerator: @staticmethod def get_supported_ides(): - tpls_dir = os.path.join(fs.get_source_dir(), "project", "tpls") return sorted( [ - d - for d in os.listdir(tpls_dir) - if os.path.isdir(os.path.join(tpls_dir, d)) + item.name + for item in (Path(__file__).parent / "tpls").iterdir() + if item.is_dir() ] ) @@ -132,7 +132,7 @@ class ProjectGenerator: def get_tpls(self): tpls = [] - tpls_dir = os.path.join(fs.get_source_dir(), "project", "tpls", self.ide) + tpls_dir = str(Path(__file__).parent / "tpls" / self.ide) for root, _, files in os.walk(tpls_dir): for f in files: if not f.endswith(".tpl"): diff --git a/platformio/project/tpls/atom/.clang_complete.tpl b/platformio/project/integration/tpls/atom/.clang_complete.tpl similarity index 100% rename from platformio/project/tpls/atom/.clang_complete.tpl rename to platformio/project/integration/tpls/atom/.clang_complete.tpl diff --git a/platformio/project/tpls/atom/.gcc-flags.json.tpl b/platformio/project/integration/tpls/atom/.gcc-flags.json.tpl similarity index 100% rename from platformio/project/tpls/atom/.gcc-flags.json.tpl rename to platformio/project/integration/tpls/atom/.gcc-flags.json.tpl diff --git a/platformio/project/tpls/atom/.gitignore.tpl b/platformio/project/integration/tpls/atom/.gitignore.tpl similarity index 100% rename from platformio/project/tpls/atom/.gitignore.tpl rename to platformio/project/integration/tpls/atom/.gitignore.tpl diff --git a/platformio/project/tpls/clion/.gitignore.tpl b/platformio/project/integration/tpls/clion/.gitignore.tpl similarity index 100% rename from platformio/project/tpls/clion/.gitignore.tpl rename to platformio/project/integration/tpls/clion/.gitignore.tpl diff --git a/platformio/project/tpls/clion/CMakeLists.txt.tpl b/platformio/project/integration/tpls/clion/CMakeLists.txt.tpl similarity index 100% rename from platformio/project/tpls/clion/CMakeLists.txt.tpl rename to platformio/project/integration/tpls/clion/CMakeLists.txt.tpl diff --git a/platformio/project/tpls/clion/CMakeListsPrivate.txt.tpl b/platformio/project/integration/tpls/clion/CMakeListsPrivate.txt.tpl similarity index 100% rename from platformio/project/tpls/clion/CMakeListsPrivate.txt.tpl rename to platformio/project/integration/tpls/clion/CMakeListsPrivate.txt.tpl diff --git a/platformio/project/tpls/codeblocks/platformio.cbp.tpl b/platformio/project/integration/tpls/codeblocks/platformio.cbp.tpl similarity index 100% rename from platformio/project/tpls/codeblocks/platformio.cbp.tpl rename to platformio/project/integration/tpls/codeblocks/platformio.cbp.tpl diff --git a/platformio/project/tpls/eclipse/.cproject.tpl b/platformio/project/integration/tpls/eclipse/.cproject.tpl similarity index 100% rename from platformio/project/tpls/eclipse/.cproject.tpl rename to platformio/project/integration/tpls/eclipse/.cproject.tpl diff --git a/platformio/project/tpls/eclipse/.project.tpl b/platformio/project/integration/tpls/eclipse/.project.tpl similarity index 100% rename from platformio/project/tpls/eclipse/.project.tpl rename to platformio/project/integration/tpls/eclipse/.project.tpl diff --git a/platformio/project/tpls/eclipse/.settings/PlatformIO Debugger.launch.tpl b/platformio/project/integration/tpls/eclipse/.settings/PlatformIO Debugger.launch.tpl similarity index 100% rename from platformio/project/tpls/eclipse/.settings/PlatformIO Debugger.launch.tpl rename to platformio/project/integration/tpls/eclipse/.settings/PlatformIO Debugger.launch.tpl diff --git a/platformio/project/tpls/eclipse/.settings/language.settings.xml.tpl b/platformio/project/integration/tpls/eclipse/.settings/language.settings.xml.tpl similarity index 100% rename from platformio/project/tpls/eclipse/.settings/language.settings.xml.tpl rename to platformio/project/integration/tpls/eclipse/.settings/language.settings.xml.tpl diff --git a/platformio/project/tpls/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/project/tpls/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/project/tpls/emacs/.ccls.tpl b/platformio/project/integration/tpls/emacs/.ccls.tpl similarity index 100% rename from platformio/project/tpls/emacs/.ccls.tpl rename to platformio/project/integration/tpls/emacs/.ccls.tpl diff --git a/platformio/project/tpls/emacs/.gitignore.tpl b/platformio/project/integration/tpls/emacs/.gitignore.tpl similarity index 100% rename from platformio/project/tpls/emacs/.gitignore.tpl rename to platformio/project/integration/tpls/emacs/.gitignore.tpl diff --git a/platformio/project/tpls/netbeans/nbproject/configurations.xml.tpl b/platformio/project/integration/tpls/netbeans/nbproject/configurations.xml.tpl similarity index 100% rename from platformio/project/tpls/netbeans/nbproject/configurations.xml.tpl rename to platformio/project/integration/tpls/netbeans/nbproject/configurations.xml.tpl diff --git a/platformio/project/tpls/netbeans/nbproject/private/configurations.xml.tpl b/platformio/project/integration/tpls/netbeans/nbproject/private/configurations.xml.tpl similarity index 100% rename from platformio/project/tpls/netbeans/nbproject/private/configurations.xml.tpl rename to platformio/project/integration/tpls/netbeans/nbproject/private/configurations.xml.tpl diff --git a/platformio/project/tpls/netbeans/nbproject/private/launcher.properties.tpl b/platformio/project/integration/tpls/netbeans/nbproject/private/launcher.properties.tpl similarity index 100% rename from platformio/project/tpls/netbeans/nbproject/private/launcher.properties.tpl rename to platformio/project/integration/tpls/netbeans/nbproject/private/launcher.properties.tpl diff --git a/platformio/project/tpls/netbeans/nbproject/private/private.xml.tpl b/platformio/project/integration/tpls/netbeans/nbproject/private/private.xml.tpl similarity index 100% rename from platformio/project/tpls/netbeans/nbproject/private/private.xml.tpl rename to platformio/project/integration/tpls/netbeans/nbproject/private/private.xml.tpl diff --git a/platformio/project/tpls/netbeans/nbproject/project.xml.tpl b/platformio/project/integration/tpls/netbeans/nbproject/project.xml.tpl similarity index 100% rename from platformio/project/tpls/netbeans/nbproject/project.xml.tpl rename to platformio/project/integration/tpls/netbeans/nbproject/project.xml.tpl diff --git a/platformio/project/tpls/qtcreator/.gitignore.tpl b/platformio/project/integration/tpls/qtcreator/.gitignore.tpl similarity index 100% rename from platformio/project/tpls/qtcreator/.gitignore.tpl rename to platformio/project/integration/tpls/qtcreator/.gitignore.tpl diff --git a/platformio/project/tpls/qtcreator/Makefile.tpl b/platformio/project/integration/tpls/qtcreator/Makefile.tpl similarity index 100% rename from platformio/project/tpls/qtcreator/Makefile.tpl rename to platformio/project/integration/tpls/qtcreator/Makefile.tpl diff --git a/platformio/project/tpls/qtcreator/platformio.cflags.tpl b/platformio/project/integration/tpls/qtcreator/platformio.cflags.tpl similarity index 100% rename from platformio/project/tpls/qtcreator/platformio.cflags.tpl rename to platformio/project/integration/tpls/qtcreator/platformio.cflags.tpl diff --git a/platformio/project/tpls/qtcreator/platformio.config.tpl b/platformio/project/integration/tpls/qtcreator/platformio.config.tpl similarity index 100% rename from platformio/project/tpls/qtcreator/platformio.config.tpl rename to platformio/project/integration/tpls/qtcreator/platformio.config.tpl diff --git a/platformio/project/tpls/qtcreator/platformio.creator.tpl b/platformio/project/integration/tpls/qtcreator/platformio.creator.tpl similarity index 100% rename from platformio/project/tpls/qtcreator/platformio.creator.tpl rename to platformio/project/integration/tpls/qtcreator/platformio.creator.tpl diff --git a/platformio/project/tpls/qtcreator/platformio.cxxflags.tpl b/platformio/project/integration/tpls/qtcreator/platformio.cxxflags.tpl similarity index 100% rename from platformio/project/tpls/qtcreator/platformio.cxxflags.tpl rename to platformio/project/integration/tpls/qtcreator/platformio.cxxflags.tpl diff --git a/platformio/project/tpls/qtcreator/platformio.files.tpl b/platformio/project/integration/tpls/qtcreator/platformio.files.tpl similarity index 100% rename from platformio/project/tpls/qtcreator/platformio.files.tpl rename to platformio/project/integration/tpls/qtcreator/platformio.files.tpl diff --git a/platformio/project/tpls/qtcreator/platformio.includes.tpl b/platformio/project/integration/tpls/qtcreator/platformio.includes.tpl similarity index 100% rename from platformio/project/tpls/qtcreator/platformio.includes.tpl rename to platformio/project/integration/tpls/qtcreator/platformio.includes.tpl diff --git a/platformio/project/tpls/sublimetext/.ccls.tpl b/platformio/project/integration/tpls/sublimetext/.ccls.tpl similarity index 100% rename from platformio/project/tpls/sublimetext/.ccls.tpl rename to platformio/project/integration/tpls/sublimetext/.ccls.tpl diff --git a/platformio/project/tpls/sublimetext/platformio.sublime-project.tpl b/platformio/project/integration/tpls/sublimetext/platformio.sublime-project.tpl similarity index 100% rename from platformio/project/tpls/sublimetext/platformio.sublime-project.tpl rename to platformio/project/integration/tpls/sublimetext/platformio.sublime-project.tpl diff --git a/platformio/project/tpls/vim/.ccls.tpl b/platformio/project/integration/tpls/vim/.ccls.tpl similarity index 100% rename from platformio/project/tpls/vim/.ccls.tpl rename to platformio/project/integration/tpls/vim/.ccls.tpl diff --git a/platformio/project/tpls/vim/.gitignore.tpl b/platformio/project/integration/tpls/vim/.gitignore.tpl similarity index 100% rename from platformio/project/tpls/vim/.gitignore.tpl rename to platformio/project/integration/tpls/vim/.gitignore.tpl diff --git a/platformio/project/tpls/visualstudio/platformio.vcxproj.filters.tpl b/platformio/project/integration/tpls/visualstudio/platformio.vcxproj.filters.tpl similarity index 100% rename from platformio/project/tpls/visualstudio/platformio.vcxproj.filters.tpl rename to platformio/project/integration/tpls/visualstudio/platformio.vcxproj.filters.tpl diff --git a/platformio/project/tpls/visualstudio/platformio.vcxproj.tpl b/platformio/project/integration/tpls/visualstudio/platformio.vcxproj.tpl similarity index 100% rename from platformio/project/tpls/visualstudio/platformio.vcxproj.tpl rename to platformio/project/integration/tpls/visualstudio/platformio.vcxproj.tpl diff --git a/platformio/project/tpls/vscode/.gitignore.tpl b/platformio/project/integration/tpls/vscode/.gitignore.tpl similarity index 100% rename from platformio/project/tpls/vscode/.gitignore.tpl rename to platformio/project/integration/tpls/vscode/.gitignore.tpl diff --git a/platformio/project/tpls/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/project/tpls/vscode/.vscode/c_cpp_properties.json.tpl rename to platformio/project/integration/tpls/vscode/.vscode/c_cpp_properties.json.tpl diff --git a/platformio/project/tpls/vscode/.vscode/extensions.json.tpl b/platformio/project/integration/tpls/vscode/.vscode/extensions.json.tpl similarity index 100% rename from platformio/project/tpls/vscode/.vscode/extensions.json.tpl rename to platformio/project/integration/tpls/vscode/.vscode/extensions.json.tpl diff --git a/platformio/project/tpls/vscode/.vscode/launch.json.tpl b/platformio/project/integration/tpls/vscode/.vscode/launch.json.tpl similarity index 100% rename from platformio/project/tpls/vscode/.vscode/launch.json.tpl rename to platformio/project/integration/tpls/vscode/.vscode/launch.json.tpl