Skip to content

Commit

Permalink
Implement slaff's idea to support for more Integrated Development Env…
Browse files Browse the repository at this point in the history
…ironments (IDE)s

Add new help topic called "IDE tools"
Rename vscode target to ide-vscode. This way the autocompletion in bash can hint the user to find easily all supported ide operations by typing make ide[PRESS-TAB]
  • Loading branch information
mikee47 committed Feb 26, 2021
1 parent 3d7d55d commit 141ff45
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
36 changes: 19 additions & 17 deletions Sming/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -430,23 +430,6 @@ $(foreach c,$(BUILDABLE_COMPONENTS),$(eval $(call GenerateComponentTargets,$c)))
# The arch-specific targets, including link and firmware image creation
include $(ARCH_BASE)/app.mk

.PHONY: vscode
vscode: checkdirs submodules ##Create/update vscode project configuration
$(Q) $(MAKE) --no-print-directory vscode-update

.PHONY: vscode-update
vscode-update:
$(Q) CXX=$(CXX) \
SMING_HOME=$(SMING_HOME) \
ESP_HOME=$(ESP_HOME) \
IDF_PATH=$(IDF_PATH) \
IDF_TOOLS_PATH=$(IDF_TOOLS_PATH) \
SMING_ARCH=$(SMING_ARCH) \
GDB=$(GDB) \
COM_SPEED_GDB=$(COM_SPEED_GDB) \
WSL_ROOT=$(WSL_ROOT) \
$(PYTHON) $(SMING_HOME)/../Tools/vscode/setup.py

.PHONY: rebuild
rebuild: clean all ##Re-build application

Expand Down Expand Up @@ -532,6 +515,25 @@ else
$(Q) $(PYTHON) -m pip install $(PIP_ARGS) $(foreach reqfile,$(PYTHON_REQUIREMENTS),-r $(reqfile))
endif

##@IDE Tools

.PHONY: ide-vscode
ide-vscode: checkdirs submodules ##Create/update vscode project configuration
$(Q) $(MAKE) --no-print-directory ide-vscode-update

.PHONY: ide-vscode-update
ide-vscode-update:
$(Q) CXX=$(CXX) \
SMING_HOME=$(SMING_HOME) \
ESP_HOME=$(ESP_HOME) \
IDF_PATH=$(IDF_PATH) \
IDF_TOOLS_PATH=$(IDF_TOOLS_PATH) \
SMING_ARCH=$(SMING_ARCH) \
GDB=$(GDB) \
COM_SPEED_GDB=$(COM_SPEED_GDB) \
WSL_ROOT=$(WSL_ROOT) \
$(PYTHON) $(SMING_HOME)/../Tools/vscode/setup.py

##@Testing

# OTA Server
Expand Down
14 changes: 7 additions & 7 deletions docs/source/tools/vscode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ The vscode workspace root directory is your project directory.

Change to your project directory (e.g. ``samples/Basic_Blink``) and run these commands::

make vscode SMING_ARCH=Esp8266
make vscode SMING_ARCH=Host
make ide-vscode SMING_ARCH=Esp8266
make ide-vscode SMING_ARCH=Host

Now open the workspace in vscode, and open a source file (.c, .cpp, .h).
You should now be able to select the architecture from the icon in the bottom-right corner:
Expand All @@ -61,7 +61,7 @@ To debug your application, follow these steps:

- Update the vscode configuration::

make vscode
make ide-vscode

- In vscode, select the require 'Run' task:

Expand All @@ -73,7 +73,7 @@ To debug your application, follow these steps:
Manual configuration changes
----------------------------

When you run ``make vscode`` the configuration files are actually generated using a python script
When you run ``make ide-vscode`` the configuration files are actually generated using a python script
``Tools/vscode/setup.py``. Configuration variables are passed from the project makefile.

If you make any changes to the configuration files, please note the following behaviour:
Expand All @@ -97,11 +97,11 @@ And, please consider contributing any changes or suggestions to the community!
Known issues / features
-----------------------

- The vscode configuration files are only updated when you manually run ``make vscode``.
- The vscode configuration files are only updated when you manually run ``make ide-vscode``.
If you update change critical build variables or add/remove Components to your project,
you may need to run it again to update them.
- When running ``make vscode`` comments in the configuration files will be discarded.
- ``make vscode`` may overwrite parts of your configuration: be warned!
- When running ``make ide-vscode``, comments in the configuration files will be discarded.
- ``make ide-vscode`` may overwrite parts of your configuration: be warned!
- When debugging for esp8266 output in the console is not formatted correctly.
Lines appear with @ in front of them.
- A debugging configuration is not currently provided for ESP32.

0 comments on commit 141ff45

Please sign in to comment.