Skip to content

Commit

Permalink
Merge pull request #279 from leograba/contributing-updates
Browse files Browse the repository at this point in the history
contributing: add how to test new template
  • Loading branch information
andreriesco authored Nov 8, 2024
2 parents 8dae6d3 + 3c2db6a commit 4d5a2a5
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ The purpose of `Dockerfile.sdk` is to create an image with the cross toolchain S

> ⚠️ The `Dockerfile.sdk` file is needed only if the application framework or runtime only runs machine code.
#### Scripts
### Scripts

For some templates, complex and very specific tasks are required. For these cases add a new script in the [scripts](./scripts) folder.

The idea is that the project created from the template should be independent of this repository and the creation mechanisms. So, when creating a new template that needs a script, copy the script to the `.conf` folder of the created project.

> ⚠️ Check the [createFromTemplate.ps1](./scripts/createFromTemplate.ps1) script for reference.
#### Substitution tags
### Substitution tags

Substitution tags can be used inside files and as folders names to rename stuff needed by the project template. There are two substitution tags used by Torizon IDE Extension:

Expand All @@ -78,7 +78,7 @@ Substitution tags can be used inside files and as folders names to rename stuff

> ⚠️ Check the [createFromTemplate.ps1](./scripts/createFromTemplate.ps1) script for reference.
#### Dot VS Code Folder
### Dot VS Code Folder

In the `.vscode` folder the following files are expected:

Expand Down Expand Up @@ -108,7 +108,7 @@ In the `.vscode` folder the following files are expected:

> ℹ️ All these are VS Code related files, check the Microsoft official documentation to know more: [Documentation for Visual Studio Code](https://code.visualstudio.com/docs)

#### Dot Conf Folder
### Dot Conf Folder

In the `.conf` folder the following files are expected:

Expand All @@ -129,7 +129,7 @@ In the `.conf` folder the following files are expected:

> ⚠️ The "private" and public keys used on Torizon IDE Extension projects are only for debug purposes!

#### Dot Doc Folder
### Dot Doc Folder

In the `.doc` folder is present the documentation specific of each template.

Expand All @@ -139,6 +139,20 @@ This documentation should give some explanation of how the code is being built a

The media (images, videos, GIFs and so on) of the template documentation should be stored on the [toradex/vscode-torizon-templates-documentation](https://github.com/toradex/vscode-torizon-templates-documentation/]) GitHub repository

### Root Folder

In the `.` (root) folder, there are two files that must be edited when a template is created:

- [README.md](./README.md): you must add the template to the list of Partner or Community templates.
- [templates.json](./templates.json): you must add a template entry to this file. When a new project is created, the IDE uses this file to list the template for the users.

## Testing a New Template

To test a new template, you must instruct the Torizon IDE Extension to use your repository. Export the following environment variables and open VS Code from a terminal:

- `TEST_TEMPLATES_GIT_REPO`: path to your local repository or Git URL to your remote repository.
- `TEST_TEMPLATES_GIT_REPO_BRANCH`: Git branch where the template to be tested is being developed. The tip of the branch will be fetched.
- `TEST_TEMPLATES_GIT_TAG`: this tag is reserved for the IDE usage. For testing, set the value to be the same as `TEST_TEMPLATES_GIT_REPO_BRANCH`.

## Creating a Pull Request

Expand Down

0 comments on commit 4d5a2a5

Please sign in to comment.