diff --git a/.genignore b/.genignore deleted file mode 100644 index 8d1e189..0000000 --- a/.genignore +++ /dev/null @@ -1 +0,0 @@ -.github/FUNDING.yml diff --git a/Cargo.toml b/Cargo.toml index 4dd8ca1..8e0a7c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] -# TODO(1) fix `authors` and `name` if you didn't use `cargo-generate` +# TODO(1) fix `authors` and `name` if you didn't use `kickstart` authors = ["{{authors}}"] -name = "{{project-name}}" +name = "{{project_name}}" edition = "2018" version = "0.1.0" @@ -76,4 +76,4 @@ overflow-checks = false # <- # defmt = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" } # defmt-rtt = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" } # defmt-test = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" } -# panic-probe = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" } \ No newline at end of file +# panic-probe = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" } diff --git a/README.md b/README.md index 18affb9..71c59c2 100644 --- a/README.md +++ b/README.md @@ -20,25 +20,22 @@ $ cargo install flip-link $ cargo install probe-run ``` -#### 3. [`cargo-generate`]: +#### 3. [`kickstart`]: ``` -$ cargo install cargo-generate +$ cargo install kickstart ``` -[`cargo-generate`]: https://crates.io/crates/cargo-generate +[`kickstart`]: https://crates.io/crates/kickstart -> *Note:* You can also just clone this repository instead of using `cargo-generate`, but this involves additional manual adjustments. +> *Note:* You can also just clone this repository instead of using `kickstart`, but this involves additional manual adjustments. ## Setup #### 1. Initialize the project template ``` console -$ cargo generate \ - --git https://github.com/knurling-rs/app-template \ - --branch main \ - --name my-app +$ kickstart https://github.com/knurling-rs/app-template ``` If you look into your new `my-app` folder, you'll find that there are a few `TODO`s in the files marking the properties you need to set. @@ -49,14 +46,14 @@ Let's walk through them together now. Pick a chip from `probe-run --list-chips` and enter it into `.cargo/config.toml`. -If, for example, you have a nRF52840 Development Kit from one of [our workshops], replace `{{chip}}` with `nRF52840_xxAA`. +If, for example, you have a nRF52840 Development Kit from one of [our workshops], replace `$CHIP` with `nRF52840_xxAA`. [our workshops]: https://github.com/ferrous-systems/embedded-trainings-2020 ``` diff # .cargo/config.toml [target.'cfg(all(target_arch = "arm", target_os = "none"))'] --runner = "probe-run --chip {{chip}}" +-runner = "probe-run --chip $CHIP" +runner = "probe-run --chip nRF52840_xxAA" ``` diff --git a/cargo-generate.toml b/cargo-generate.toml deleted file mode 100644 index 0c72b6c..0000000 --- a/cargo-generate.toml +++ /dev/null @@ -1,2 +0,0 @@ -[template] -exclude = ["README.md"] diff --git a/template.toml b/template.toml new file mode 100644 index 0000000..d31a406 --- /dev/null +++ b/template.toml @@ -0,0 +1,26 @@ +name = "knurling-app-template" + +description = """ +Quickly set up a `probe-run` + `defmt` + `flip-link` embedded project +""" + +kickstart_version = 1 + +ignore = [".github"] + +[[variables]] +name = "project_name" +prompt = "Enter the project name" +default = "app-template" +validation = "^([a-zA-Z_][a-zA-Z0-9_-]+)$" + +[[variables]] +name = "crate_name" +prompt = "Enter the crate name (usually the project name with `-` replaced by `_`)" +default = "app_template" +validation = "^([a-zA-Z_][a-zA-Z0-9_]+)$" + +[[variables]] +name = "authors" +prompt = "Enter the project authors" +default = "Nobody " diff --git a/testsuite/Cargo.toml b/testsuite/Cargo.toml index 5a7766d..59d2187 100644 --- a/testsuite/Cargo.toml +++ b/testsuite/Cargo.toml @@ -1,5 +1,5 @@ [package] -# TODO(1) fix `authors` if you didn't use `cargo-generate` +# TODO(1) fix `authors` if you didn't use `kickstart` authors = ["{{authors}}"] name = "testsuite" publish = false @@ -11,7 +11,7 @@ name = "test" harness = false [dependencies] -{{project-name}} = { path = ".." } +{{project_name}} = { path = ".." } cortex-m = "0.6.3" cortex-m-rt = "0.6.12" defmt = "0.1.0"