Skip to content

Commit

Permalink
Simplify onboarding (VSC-426) (#159)
Browse files Browse the repository at this point in the history
* initial auto window

* initial setup window

* add tools setup methods

* complete one click install

* open py esp-idf folders

* add prerequisites validation

* add codicons and custom page

* add initial custom setup page

* idf download setup

* add esp-idf cancel logic

* improve custom ui alignment

* idfToolManager simplify check tools cancel dload

* progress tools cancel py env install

* cancel pkg extract save custom settings

* fix manual path issues

* test on win 1

* rm duplicate python manual path

* 1 click install status window

* update status page

* check esp-idf container and path on install page

* finished status rm custom

* status ui update

* fix esp-idf url links

* check default values env vars

* install py reqs command

* install py req cmd in schema

* fix error message on esp-idf python

* enhance download progress ui

* Add status step background

* improve start ui and errors

* improve tools ui status page

* add custom setup ui

* check settings on extension activate

* rm old onboarding

* show setup when missing pre requisites

* rm test lines

* rm testing on checkExistingSetttings

* improve setup css align and colors

* fix select erroMsg css rm home btn statusPage

* reject execChildProcess only on Error

* fix childProcess cancelToken

* fix icons on vsix

* add resolve url loader fix font codicon

* update yarn lock

* resolve url loader

* fix python list linux

* add font face to setup webview

* update codicon icons ensure idfContainer dir

* fix path sep add def idfPath

* empty default manual idf path

* log download error

* initialize versions currentSetupValid

* set percentage on idf and tools installed status

* update setup docs

* refactor setup panel highlight tools folder

* update doc paths

* rm timeout test setup spaces

* fix python path with spaces

* add fallback on env idf_path idf_tools_path

Co-authored-by: Brian Ignacio <brian.ignacio@espressif.com>
  • Loading branch information
brianignacio5 and brianignacio5 authored Jan 4, 2021
1 parent 3fa6df4 commit 7532f6c
Show file tree
Hide file tree
Showing 75 changed files with 4,690 additions and 4,413 deletions.
58 changes: 29 additions & 29 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ name: "CodeQL"

on:
push:
branches: [ master ]
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [master]
schedule:
- cron: '16 7 * * 6'
- cron: "16 7 * * 6"

jobs:
analyze:
Expand All @@ -28,40 +28,40 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript', 'python' ]
language: ["javascript", "python"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<img src="./media/espressif_icon.png" alt="espressif logo" title="Espressif" align="right" height="60" />
</a>

ESP-IDF VS Code Extension
===
# ESP-IDF VS Code Extension

Develop and debug applications for Espressif [ESP32](https://espressif.com/en/products/hardware/esp32), [ESP32-S2](https://www.espressif.com/en/products/socs/esp32-s2) chips with [ESP-IDF](https://github.com/espressif/esp-idf) IoT Development Framework.

Expand All @@ -15,7 +14,7 @@ Develop and debug applications for Espressif [ESP32](https://espressif.com/en/pr

The ESP-IDF extension makes it easy to develop, build, flash, monitor and debug your ESP-IDF code, some functionality includes:

- Quick [Configure ESP-IDF extension](https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/ONBOARDING.md) for first time user to help you download, install and setup ESP-IDF and required tools within Visual Studio Code extension.
- Quick [Configure ESP-IDF extension](./docs/SETUP.md) for first time user to help you download, install and setup ESP-IDF and required tools within Visual Studio Code extension.
- Quick prototyping by copying ESP-IDF examples with **ESP-IDF: Show ESP-IDF Examples Projects**.
- App tracing when using ESP-IDF Application Level Tracing Library like in [ESP-IDF Application Level Tracing Example](https://github.com/espressif/esp-idf/tree/master/examples/system/app_trace_to_host).
- Size analysis of binaries with **ESP-IDF: Size analysis of the binaries**.
Expand All @@ -29,15 +28,14 @@ The ESP-IDF extension makes it easy to develop, build, flash, monitor and debug

## Prerequisites

There are a few dependencies which needs to be downloaded and installed before you can continue to use the extension. All the other dependencies like ESP-IDF or toolchain will be taken care by the [onboarding](./docs/ONBOARDING.md) process.
There are a few dependencies which needs to be downloaded and installed before you can continue to use the extension. All the other dependencies like ESP-IDF or toolchain will be taken care by the [setup wizard](./docs/SETUP.md) process.

- [Python 3.5](https://www.python.org/download/releases/3.5/)+
- [Git](https://git-scm.com/downloads)
- [CMake](https://cmake.org/download) and [Ninja](https://github.com/ninja-build/ninja/releases) for **Linux or MacOS users**. For Windows users, it is part of the onboarding configuration tools intall.
- [CMake](https://cmake.org/download) and [Ninja](https://github.com/ninja-build/ninja/releases) for **Linux or MacOS users**. For Windows users, it is part of the extension setup wizard.

> Please note that this extension **only [supports](https://github.com/espressif/esp-idf/blob/master/SUPPORT_POLICY.md)** the release versions of ESP-IDF, you can still use the extension on `master` branch or some other branch, but certain feature might not work fully.

## Quick Installation Guide

There are several ways to install this extension to your VSCode, easiest one is from VSCode Marketplace. However if you are looking to contribute to this project we suggest you to have install in [Source mode](#Build-from-Source-Code).
Expand Down Expand Up @@ -65,7 +63,7 @@ To install from `.vsix` file, first head to [releases page](https://github.com/e

#### Build vsix locally

- Build the Visual Studio Code extension setup with `yarn package`
- Build the Visual Studio Code extension setup with `yarn package`.

## Uninstalling the plugin

Expand All @@ -80,7 +78,7 @@ To install from `.vsix` file, first head to [releases page](https://github.com/e
- Then
- Either open Visual Studio Code and create a workspace folder.
- Run `code ${YOUR_PROJECT_DIR}` from the command line.
- Press <kbd>F1</kbd> and type **ESP-IDF: Configure ESP-IDF extension** to configure the extension Please take a look at [ONBOARDING](./docs/ONBOARDING.md) for more detail about extension configuration.
- Press <kbd>F1</kbd> and type **ESP-IDF: Configure ESP-IDF extension** to configure the extension Please take a look at [SETUP](./docs/SETUP.md) for more detail about extension configuration.

- Press <kbd>F1</kbd> and type **ESP-IDF: Create ESP-IDF project** to generate a template ESP-IDF project.

Expand Down Expand Up @@ -131,12 +129,12 @@ The **Show Examples Projects** command allows you create a new project using one

## ESP-IDF Configure extension

Initial configuration is done easily by executing **ESP-IDF: Configure ESP-IDF extension** Please take a look at [ONBOARDING](./docs/ONBOARDING.md) for more in-depth detail. This window is always shown when extension is activated which you can disable with `idf.showOnboardingOnInit`.
Initial configuration is done easily by executing **ESP-IDF: Configure ESP-IDF extension** Please take a look at [SETUP](./docs/SETUP.md) for more in-depth detail.

This windows helps you setup key Visual Studio Code configurations for this extension to perform included features correctly. This is how the extension uses them:

1. `idf.pythonBinPath` is used to executed python scripts within the extension. In **ESP-IDF: Configure ESP-IDF extension** we first select a system-wide python executable from which to create a python virtual environment and we save the executable from this virtual environment in `idf.pythonBinPath`. All required python packages by ESP-IDF are installed in this virtual environment, if using **ESP-IDF: Configure ESP-IDF extension**
2. `idf.customExtraPaths` is pre-appended to your system environment variable PATH within Visual Studio Code **(not modifying your system environment)** before executing any of our extension commands such as `openocd` or `cmake` (i.e. build your current project) else extension commands will try to use what is already in your system PATH. In **ESP-IDF: Configure ESP-IDF extension** you can download ESP-IDF Tools or skip IDF Tools download and manually enter all required ESP-IDF Tools as explain in [ONBOARDING](./docs/ONBOARDING.md) which will be saved in `idf.customExtraPaths`.
2. `idf.customExtraPaths` is pre-appended to your system environment variable PATH within Visual Studio Code **(not modifying your system environment)** before executing any of our extension commands such as `openocd` or `cmake` (i.e. build your current project) else extension commands will try to use what is already in your system PATH. In **ESP-IDF: Configure ESP-IDF extension** you can download ESP-IDF Tools or skip IDF Tools download and manually enter all required ESP-IDF Tools as explain in [SETUP](./docs/SETUP.md) which will be saved in `idf.customExtraPaths`.
3. `idf.customExtraVars` stores any custom environment variable we use such as OPENOCD_SCRIPTS, which is the openOCD scripts directory used in openocd server startup. We add these variables to visual studio code process environment variables, choosing the extension variable if available, else extension commands will try to use what is already in your system PATH. **This doesn't modify your system environment outside Visual Studio Code.**
4. `idf.adapterTargetName` is used to select the chipset (esp32, esp32 s2, etc.) on which to run our extension commands.
5. `idf.openOcdConfigs` is used to store an array of openOCD scripts directory relative path config files to use with OpenOCD server. (Example: ["interface/ftdi/esp32_devkitj_v1.cfg", "board/esp32-wrover.cfg"]).
Expand Down Expand Up @@ -279,7 +277,7 @@ We provide editor code coverage highlight and HTML reports for ESP-IDF projects,

## Debugging

Click <kbd>F5</kbd> to start debugging. For correct debug experience, first `build`, `flash` your device and define the correct `idf.customExtraPaths` paths and `idf.customExtraVars` using [ONBOARDING](./docs/ONBOARDING.md).
Click <kbd>F5</kbd> to start debugging. For correct debug experience, first `build`, `flash` your device and define the correct `idf.customExtraPaths` paths and `idf.customExtraVars` using [SETUP](./docs/SETUP.md).

When you start debug, an OpenOCD process starts in the background. OpenOCD Output log window is created in Visual Studio Code lower panel. To configure your project's launch.json to debug, please review [DEBUGGING](./docs/DEBUGGING.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Your ESP-IDF project should be configured to generate gcda/gcno coverage files using gcov. Please take a look at the [ESP-IDF gcov example](https://github.com/espressif/esp-idf/tree/master/examples/system/gcov) to see how to set up your project.

This extension also requires `gcovr` to generate JSON and HTML reports from generated files. This is installed as part of this extension ESP-IDF Debug Adapter Python requirements when following the **ESP-IDF: Configure ESP-IDF extension** command.
Please take a look at [ONBOARDING](./docs/ONBOARDING.md) for more information.
Please take a look at [SETUP](./docs/SETUP.md) for more information.

Make sure you had properly configure xtensa toolchain in `idf.customExtraPaths` or in your environment variable PATH since the gcov executable used is `xtensa-esp32-elf-gcov` and `gcovr` exists in the same directory as your `${idf.pythonBinPath}` path.

Expand Down
Loading

0 comments on commit 7532f6c

Please sign in to comment.