Compare commits
6 Commits
84a6196416
...
v1.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
| 528bc1be87 | |||
| 40ce49a180 | |||
| 15ff177b18 | |||
| 9a2ce7b1cc | |||
| f8e2dbfd5c | |||
| b999b67ed8 |
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -155,7 +155,7 @@ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pallet"
|
name = "pallet"
|
||||||
version = "1.0.0"
|
version = "1.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"colored",
|
"colored",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "pallet"
|
name = "pallet"
|
||||||
version = "1.0.0"
|
version = "1.0.2"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
32
README.md
32
README.md
@@ -1,6 +1,6 @@
|
|||||||
# Pallet
|
# Pallet
|
||||||
|
|
||||||
Pallet is a project manager and build system for C inspired by Cargo for Rust.
|
Pallet is a project manager and build system for C inspired by Rust's Cargo.
|
||||||
|
|
||||||
This is a toy project not meant to be taken very seriously.
|
This is a toy project not meant to be taken very seriously.
|
||||||
|
|
||||||
@@ -10,6 +10,7 @@ This is a toy project not meant to be taken very seriously.
|
|||||||
- `pallet init`: initializes a new project in the current directory
|
- `pallet init`: initializes a new project in the current directory
|
||||||
- `pallet run`: runs the local project
|
- `pallet run`: runs the local project
|
||||||
- `pallet build`: builds the local project
|
- `pallet build`: builds the local project
|
||||||
|
- `pallet clean`: cleans the local project's build artifacts
|
||||||
|
|
||||||
## Configuring
|
## Configuring
|
||||||
|
|
||||||
@@ -17,4 +18,31 @@ You can configure options by editing `Pallet.toml`
|
|||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
TBD
|
- `name`: the name of the output executable
|
||||||
|
- `default_build`: the name of the default build profile to use
|
||||||
|
|
||||||
|
Additionally, one can define one or more build profiles with the following parameters:
|
||||||
|
|
||||||
|
- `name`: the name of the build profile
|
||||||
|
- `args`: the args to supply to gcc when using this profile
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
name = "my-app"
|
||||||
|
default_build = "debug"
|
||||||
|
|
||||||
|
[[build]]
|
||||||
|
name = "debug"
|
||||||
|
args = [
|
||||||
|
"-g",
|
||||||
|
"-O0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[build]]
|
||||||
|
name = "release"
|
||||||
|
args = [
|
||||||
|
"-DNDEBUG",
|
||||||
|
"-O3",
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use colored::Colorize;
|
|||||||
use glob::glob;
|
use glob::glob;
|
||||||
|
|
||||||
const MAIN_C: &str = include_str!("templates/main.c");
|
const MAIN_C: &str = include_str!("templates/main.c");
|
||||||
const GITIGNORE: &str = include_str!("templates/gitignoretemplate");
|
const GITIGNORE: &str = "target/";
|
||||||
|
|
||||||
#[derive(clap::Parser)]
|
#[derive(clap::Parser)]
|
||||||
#[clap(version)]
|
#[clap(version)]
|
||||||
@@ -31,6 +31,7 @@ enum Subcommand {
|
|||||||
/// The build mode to use
|
/// The build mode to use
|
||||||
mode: Option<String>,
|
mode: Option<String>,
|
||||||
/// Arguments to pass to the project binary
|
/// Arguments to pass to the project binary
|
||||||
|
#[arg(long, short)]
|
||||||
args: Option<Vec<String>>,
|
args: Option<Vec<String>>,
|
||||||
},
|
},
|
||||||
/// Build the local project
|
/// Build the local project
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
#[derive(serde::Deserialize, serde::Serialize)]
|
#[derive(serde::Deserialize, serde::Serialize, Default)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
/// The name of the output binary
|
/// The name of the output binary
|
||||||
pub name: String,
|
pub name: String,
|
||||||
/// The default build to use
|
/// The default build to use
|
||||||
pub default_build: String,
|
pub default_build: String,
|
||||||
|
/// A brief description
|
||||||
|
pub description: Option<String>,
|
||||||
|
/// The version of the project
|
||||||
|
pub version: Option<String>,
|
||||||
|
/// The authors of the project
|
||||||
|
pub authors: Option<Vec<String>>,
|
||||||
/// Build configs
|
/// Build configs
|
||||||
pub build: Vec<BuildConf>,
|
pub build: Vec<BuildConf>,
|
||||||
}
|
}
|
||||||
@@ -14,6 +20,7 @@ impl Config {
|
|||||||
name: name.to_owned(),
|
name: name.to_owned(),
|
||||||
default_build: "debug".to_owned(),
|
default_build: "debug".to_owned(),
|
||||||
build: vec![BuildConf::debug(), BuildConf::release()],
|
build: vec![BuildConf::debug(), BuildConf::release()],
|
||||||
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
target/
|
|
||||||
Reference in New Issue
Block a user