Open-CMSIS-Pack / Open-CMSIS-Pack-Spec

Common Microcontroller Software Interface Standard - Pack(age) based distribution system
https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/
Apache License 2.0
50 stars 19 forks source link

Add solution templates via packs: (add <template> sub-element to <csolution> element) #306

Closed ReinhardKeil closed 2 months ago

ReinhardKeil commented 2 months ago

IDE such as Keil Studio, offer templates to start new projects.

image

Currently the standard templates support devices that are compliant with the vanilla CMSIS specification. However there are reasons to deviate from this method:

Enabling this flexibility in an IDE requires a method to define device specific templates as outlined in this proposal:

/package/csolution/template

A template section provides device or board specific project templates for starting new csolution projects.

Parent Chain
template /package/csolution
Attributes Description Type Use
name Name of the template xs:string required
path Path to the directory that contains the template xs:string required
file Name of the *.csolution.yml file (optional with relative path to the directory specified with path) xs:string required
copy-to Path that used to copy the template into the csolution project (default is attribute path) xs:string optional
condition id of a condition. The template is available and will be listed only when the filter condition is true. (Note: no component dependencies are evaluated. xs:string optional
Child Elements Description Type Occurrence
description Briefly documents the purpose and scope of the clayer (maximum 256 characters, recommended 128 characters). BriefDescType 1

Examples:

<csolution> 
  <template name="Basic csolution project" path="templates/blank" file="Blank.csolution.yml" copyto="Blank">
    <description>Create a basic project with empty main function</description>
  </template>
  <template name="TrustZone csolution project" path="templates/trustzone" file="TrustZone.csolution.yml" copyto="TrustZone">
    <description>Create a basic solution with secure and non-secure projects</description>
  </template>
</csolution>