4 Commits
v1.1.0 ... main

Author SHA1 Message Date
9cfcd14e0a add config keys (#31)
Reviewed-on: http://192.168.1.227:3000/sfrembling/pallet/pulls/31
Co-authored-by: Shea Frembling <sfrembling@gmail.com>
Co-committed-by: Shea Frembling <sfrembling@gmail.com>
2026-03-23 20:49:32 -06:00
130525a868 Increment version 2026-03-23 21:10:28 -05:00
a6734c45ab Fix bug with nested / moduled c files not compiling (#30)
closes #29

Reviewed-on: http://192.168.1.227:3000/sfrembling/pallet/pulls/30
Co-authored-by: Shea Frembling <sfrembling@gmail.com>
Co-committed-by: Shea Frembling <sfrembling@gmail.com>
2026-03-23 20:09:19 -06:00
b14662a666 Update README.md 2026-03-23 17:03:58 -06:00
6 changed files with 66 additions and 7 deletions

2
Cargo.lock generated
View File

@@ -440,7 +440,7 @@ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
[[package]] [[package]]
name = "pallet" name = "pallet"
version = "1.1.0" version = "1.1.1"
dependencies = [ dependencies = [
"clap", "clap",
"clap_complete", "clap_complete",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "pallet" name = "pallet"
version = "1.1.0" version = "1.1.1"
edition = "2024" edition = "2024"
description = "A project manager and build system for C inspired by Rust's Cargo" description = "A project manager and build system for C inspired by Rust's Cargo"

View File

@@ -1,6 +1,6 @@
# Maintainer: Shea Frembling <sfrembling@gmail.com> # Maintainer: Shea Frembling <sfrembling@gmail.com>
pkgname=pallet pkgname=pallet
pkgver=1.1.0 pkgver=1.1.1
pkgrel=1 pkgrel=1
pkgdesc="A simple C project manager inspired by Cargo" pkgdesc="A simple C project manager inspired by Cargo"
arch=('x86_64') arch=('x86_64')

View File

@@ -72,3 +72,11 @@ args = [
"-O3", "-O3",
] ]
``` ```
## Creating Changelogs
Use the following command to create a changelog:
```sh
git log --oneline (git describe --tags --abbrev=0)..HEAD | sed 's/^/- /' | xclip -selection clipboard
```

View File

@@ -95,6 +95,8 @@ enum UtilSubcommand {
/// The build mode to generate for /// The build mode to generate for
mode: Option<String>, mode: Option<String>,
}, },
/// Generate the config keys for Pallet.toml
GenConfigKeys,
} }
#[derive(Clone, clap::ValueEnum)] #[derive(Clone, clap::ValueEnum)]
@@ -193,6 +195,15 @@ impl App {
std::process::exit(1); std::process::exit(1);
} }
} }
UtilSubcommand::GenConfigKeys => {
println!(
"{} a property with a '?' indicates that the property is optional",
"Hint".yellow().bold()
);
for (id, desc, dt) in crate::config::Config::get_config_syntax() {
println!(" - {} ({}): {desc}", id.green().bold(), dt.blue().bold());
}
}
}, },
Subcommand::List => { Subcommand::List => {
if let Err(e) = list() { if let Err(e) = list() {
@@ -482,7 +493,7 @@ fn gen_compile_commands(mode: &Option<String>) -> std::io::Result<()> {
let cwd = std::env::current_dir()?; let cwd = std::env::current_dir()?;
let obj_dir = format!("target/{}/obj", build_config.name); let obj_dir = format!("target/{}/obj", build_config.name);
let source_files: Vec<PathBuf> = glob("src/*.c") let source_files: Vec<PathBuf> = glob("src/**/*.c")
.map_err(|e| std::io::Error::new(std::io::ErrorKind::NotFound, format!("{e}")))? .map_err(|e| std::io::Error::new(std::io::ErrorKind::NotFound, format!("{e}")))?
.filter_map(|e| e.ok()) .filter_map(|e| e.ok())
.collect(); .collect();
@@ -665,7 +676,7 @@ fn build(mode: &Option<String>, force_recompile: bool) -> std::io::Result<()> {
.collect(); .collect();
} }
let source_files: Vec<PathBuf> = glob("src/*.c") let source_files: Vec<PathBuf> = glob("src/**/*.c")
.map_err(|e| std::io::Error::new(std::io::ErrorKind::NotFound, format!("{e}")))? .map_err(|e| std::io::Error::new(std::io::ErrorKind::NotFound, format!("{e}")))?
.filter_map(|e| e.ok()) .filter_map(|e| e.ok())
.collect(); .collect();
@@ -814,7 +825,7 @@ fn clean() -> std::io::Result<()> {
} }
fn fmt() -> std::io::Result<()> { fn fmt() -> std::io::Result<()> {
let source_files: Vec<PathBuf> = glob("src/*.c") let source_files: Vec<PathBuf> = glob("src/**/*.c")
.map_err(|e| std::io::Error::new(std::io::ErrorKind::NotFound, format!("{e}")))? .map_err(|e| std::io::Error::new(std::io::ErrorKind::NotFound, format!("{e}")))?
.chain( .chain(
glob("src/*.h") glob("src/*.h")
@@ -846,7 +857,7 @@ fn fmt() -> std::io::Result<()> {
fn lint() -> std::io::Result<()> { fn lint() -> std::io::Result<()> {
gen_compile_commands(&None)?; gen_compile_commands(&None)?;
let source_files: Vec<PathBuf> = glob("src/*.c") let source_files: Vec<PathBuf> = glob("src/**/*.c")
.map_err(|e| std::io::Error::new(std::io::ErrorKind::NotFound, format!("{e}")))? .map_err(|e| std::io::Error::new(std::io::ErrorKind::NotFound, format!("{e}")))?
.filter_map(|e| e.ok()) .filter_map(|e| e.ok())
.collect(); .collect();

View File

@@ -35,6 +35,46 @@ impl Config {
self.build.iter().find(|bc| bc.name == self.default_build) self.build.iter().find(|bc| bc.name == self.default_build)
} }
} }
pub fn get_config_syntax() -> Vec<(String, String, String)> {
vec![
(
"compiler?",
"the compiler used by Pallet (defeault=gcc)",
"string",
),
("name", "the name of your application", "string"),
(
"default_build",
"the name of the build to use by default when running or building",
"string",
),
(
"description?",
"a brief description of your application",
"string",
),
("version?", "the version of your application", "string"),
(
"authors?",
"the author or authors of your application",
"string[]",
),
(
"build",
"a build config that can be used when compiling",
"{name: string, args: string[]}[]",
),
(
"dependencies",
"libraries (such as zlib) used by your application that require pkg-config to be compiled correclty",
"string[]"
)
]
.into_iter()
.map(|(a, b, c)| (a.to_owned(), b.to_owned(), c.to_owned()))
.collect()
}
} }
#[derive(serde::Deserialize, serde::Serialize)] #[derive(serde::Deserialize, serde::Serialize)]