diff --git a/HISTORY.rst b/HISTORY.rst index eb4bda94..5abe1a70 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -8,7 +8,7 @@ PlatformIO 3.0 ~~~~~~~~~~~~~~~~~~ * Added aliases (off, light, strict) for - `LDF Compatibility Modes `__ + `LDF Compatibility Mode `__ * Show device system information (MCU, Frequency, RAM, Flash, Debugging tools) in a build log * Show all available upload protocols before firmware uploading in a build log @@ -17,6 +17,10 @@ PlatformIO 3.0 * Fixed project generator for Qt Creator IDE (`issue #1303 `_, `issue #1323 `_) +* Mark project source and library directories for CLion IDE + (`issue #1359 `_, + `issue #1345 `_, + `issue #897 `_) * Fixed issue with duplicated "include" records when generating data for IDE (`issue #1301 `_) diff --git a/platformio/builder/tools/pioplatform.py b/platformio/builder/tools/pioplatform.py index e2735b01..4532f440 100644 --- a/platformio/builder/tools/pioplatform.py +++ b/platformio/builder/tools/pioplatform.py @@ -117,8 +117,8 @@ def PrintConfiguration(env): # pylint: disable=too-many-branches debug_tools = board_config.get("debug", {}).get("tools") ram = board_config.get("upload", {}).get("maximum_ram_size") flash = board_config.get("upload", {}).get("maximum_size") - system_data.append("%s (%s Flash)" % (util.format_filesize(ram), - util.format_filesize(flash))) + system_data.append("%s RAM (%s Flash)" % (util.format_filesize(ram), + util.format_filesize(flash))) if platform_data: print " ".join(platform_data) diff --git a/platformio/ide/projectgenerator.py b/platformio/ide/projectgenerator.py index e1d5b12a..79009657 100644 --- a/platformio/ide/projectgenerator.py +++ b/platformio/ide/projectgenerator.py @@ -30,11 +30,8 @@ class ProjectGenerator(object): self.project_dir = project_dir self.ide = ide self.env_name = env_name + self._tplvars = {} - - with util.cd(self.project_dir): - self.project_src_dir = util.get_projectsrc_dir() - self._gather_tplvars() @staticmethod @@ -92,7 +89,7 @@ class ProjectGenerator(object): def get_src_files(self): result = [] with util.cd(self.project_dir): - for root, _, files in os.walk(self.project_src_dir): + for root, _, files in os.walk(util.get_projectsrc_dir()): for f in files: result.append(relpath(join(root, f))) return result @@ -153,26 +150,20 @@ class ProjectGenerator(object): def _gather_tplvars(self): self._tplvars.update(self.get_project_env()) self._tplvars.update(self.get_project_build_data()) - self._tplvars.update({ - "project_name": - self.get_project_name(), - "src_files": - self.get_src_files(), - "user_home_dir": - abspath(expanduser("~")), - "project_dir": - self.project_dir, - "project_src_dir": - self.project_src_dir, - "systype": - util.get_systype(), - "platformio_path": - self._fix_os_path(util.where_is_program("platformio")), - "env_pathsep": - os.pathsep, - "env_path": - self._fix_os_path(os.getenv("PATH")) - }) + with util.cd(self.project_dir): + self._tplvars.update({ + "project_name": self.get_project_name(), + "src_files": self.get_src_files(), + "user_home_dir": abspath(expanduser("~")), + "project_dir": self.project_dir, + "project_src_dir": util.get_projectsrc_dir(), + "project_lib_dir": util.get_projectlib_dir(), + "systype": util.get_systype(), + "platformio_path": self._fix_os_path( + util.where_is_program("platformio")), + "env_pathsep": os.pathsep, + "env_path": self._fix_os_path(os.getenv("PATH")) + }) # yapf: disable @staticmethod def _fix_os_path(path): diff --git a/platformio/ide/tpls/clion/.idea/misc.xml.tpl b/platformio/ide/tpls/clion/.idea/misc.xml.tpl new file mode 100644 index 00000000..2b0c16ca --- /dev/null +++ b/platformio/ide/tpls/clion/.idea/misc.xml.tpl @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/platformio/ide/tpls/clion/CMakeLists.txt.tpl b/platformio/ide/tpls/clion/CMakeLists.txt.tpl index 075bc805..63274c43 100644 --- a/platformio/ide/tpls/clion/CMakeLists.txt.tpl +++ b/platformio/ide/tpls/clion/CMakeLists.txt.tpl @@ -51,18 +51,4 @@ add_custom_target( WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) -if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib) - add_custom_target( - CODE_COMPLETION_PIOLIB - SOURCES lib - ) -endif() - -if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/.piolibdeps) - add_custom_target( - CODE_COMPLETION_PIOLIBDEPS - SOURCES .piolibdeps - ) -endif() - add_executable(${PROJECT_NAME} ${SRC_LIST})