Remove unnecesarily heavy and practically unused cargo-generate
This commit is contained in:
+1
-2
@@ -1,7 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
# TODO fix `authors` and `name` if you didn't use `cargo-generate`
|
# TODO fix `authors` and `name` if you didn't use `cargo-generate`
|
||||||
authors = ["{{authors}}"]
|
name = "test-app"
|
||||||
name = "{{project-name}}"
|
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
||||||
|
|||||||
@@ -25,28 +25,15 @@ $ # make sure to install v0.2.0 or later
|
|||||||
$ cargo install probe-run
|
$ cargo install probe-run
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 3. [`cargo-generate`]:
|
|
||||||
|
|
||||||
``` console
|
|
||||||
$ cargo install cargo-generate
|
|
||||||
```
|
|
||||||
|
|
||||||
[`cargo-generate`]: https://crates.io/crates/cargo-generate
|
|
||||||
|
|
||||||
> *Note:* You can also just clone this repository instead of using `cargo-generate`, but this involves additional manual adjustments.
|
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
#### 1. Initialize the project template
|
#### 1. Clone the project template
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ cargo generate \
|
$ git clone https://github.com/rtic-rs/app-template test-app
|
||||||
--git https://github.com/rtic-rs/app-template \
|
|
||||||
--branch main \
|
|
||||||
--name my-app
|
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
If you look into your new `test-app` folder, you'll find that there are a few `TODO`s in the files marking the properties you need to set.
|
||||||
|
|
||||||
Let's walk through them together now.
|
Let's walk through them together now.
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
[template]
|
|
||||||
ignore = ["README.md", "run-steps.sh"]
|
|
||||||
+16
-5
@@ -4,14 +4,27 @@ set -ex
|
|||||||
|
|
||||||
project="test-app"
|
project="test-app"
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
echo "Cleaning up"
|
||||||
|
mv Cargo.toml.tmp Cargo.toml
|
||||||
|
mv .cargo/config.toml.tmp .cargo/config.toml
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$1" = "cleanup" ]; then
|
||||||
|
cleanup
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Installing necessary tools"
|
echo "Installing necessary tools"
|
||||||
cargo install flip-link cargo-generate sd
|
cargo install flip-link sd
|
||||||
|
|
||||||
echo "Cleaning up old project"
|
echo "Cleaning up old project"
|
||||||
rm -rf "$project"
|
rm -rf "$project"
|
||||||
|
|
||||||
echo "Creating new project"
|
echo "Creating new project"
|
||||||
cargo generate -p . --name "$project"
|
# cargo generate -p . --name "$project"
|
||||||
|
mkdir -p "$project"
|
||||||
|
cp -r Cargo.toml LICENSE-* src/ rust-toolchain.toml .cargo/ "$project"
|
||||||
|
|
||||||
echo "Storing current config so that the child project will compile."
|
echo "Storing current config so that the child project will compile."
|
||||||
mv Cargo.toml Cargo.toml.tmp
|
mv Cargo.toml Cargo.toml.tmp
|
||||||
@@ -32,6 +45,4 @@ sd -s 'FreeInterrupt1, ...' 'SWI0_EGU0' src/bin/minimal.rs
|
|||||||
cargo bbr minimal
|
cargo bbr minimal
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
echo "Cleaning up"
|
cleanup
|
||||||
mv Cargo.toml.tmp Cargo.toml
|
|
||||||
mv .cargo/config.toml.tmp .cargo/config.toml
|
|
||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
use {{crate_name}} as _; // global logger + panicking-behavior + memory layout
|
use test_app as _; // global logger + panicking-behavior + memory layout
|
||||||
|
|
||||||
#[rtic::app(
|
#[rtic::app(
|
||||||
device = some_hal::pac, // TODO: Replace `some_hal::pac` with the path to the PAC
|
device = some_hal::pac, // TODO: Replace `some_hal::pac` with the path to the PAC
|
||||||
|
|||||||
Reference in New Issue
Block a user