mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 14:18:36 +00:00
Compare commits
6 Commits
v0.7.1-dev
...
v0.7.1
| Author | SHA1 | Date | |
|---|---|---|---|
| a6ce0a3332 | |||
| cea43e99c8 | |||
| de4fb0bc29 | |||
| 59e27b6f5d | |||
| c8cb155e5a | |||
| 6424aab69d |
19
.github/workflows/release.yml
vendored
19
.github/workflows/release.yml
vendored
@@ -83,24 +83,40 @@ jobs:
|
|||||||
notes:
|
notes:
|
||||||
needs: setup
|
needs: setup
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
release_name: ${{ steps.extract.outputs.release_name }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ needs.setup.outputs.tag }}
|
ref: ${{ needs.setup.outputs.tag }}
|
||||||
|
|
||||||
- name: Prepare Release Notes
|
- name: Prepare Release Notes
|
||||||
|
id: extract
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
tag="${{ needs.setup.outputs.version }}"
|
tag="${{ needs.setup.outputs.version }}"
|
||||||
notes_file=".github/release-notes.md"
|
notes_file=".github/release-notes.md"
|
||||||
if grep -q "^## \\[${tag}\\]" CHANGELOG.md; then
|
if grep -q "^## \\[${tag}\\]" CHANGELOG.md; then
|
||||||
|
# Extract release name from header: ## [0.7.1] - 2026-06-02 "Title"
|
||||||
|
release_name=$(awk -v ver="$tag" '
|
||||||
|
$0 ~ "^## \\[" ver "\\]" {
|
||||||
|
match($0, /"([^"]+)"/, arr)
|
||||||
|
if (arr[1] != "") {
|
||||||
|
print "v" ver " - " arr[1]
|
||||||
|
} else {
|
||||||
|
print "v" ver
|
||||||
|
}
|
||||||
|
}
|
||||||
|
' CHANGELOG.md)
|
||||||
|
echo "release_name=${release_name}" >> "$GITHUB_OUTPUT"
|
||||||
awk -v ver="$tag" '
|
awk -v ver="$tag" '
|
||||||
$0 ~ "^## \\[" ver "\\]" {found=1; next}
|
$0 ~ "^## \\[" ver "\\]" {found=1; next}
|
||||||
found && $0 ~ "^## \\[" {exit}
|
found && $0 ~ "^## \\[" {exit}
|
||||||
found {print}
|
found {print}
|
||||||
' CHANGELOG.md | sed -e '${/^$/d;}' > "$notes_file"
|
' CHANGELOG.md | sed -e '${/^$/d;}' > "$notes_file"
|
||||||
else
|
else
|
||||||
|
echo "release_name=v${tag}" >> "$GITHUB_OUTPUT"
|
||||||
echo "No CHANGELOG section for $tag." > "$notes_file"
|
echo "No CHANGELOG section for $tag." > "$notes_file"
|
||||||
git log -1 --pretty=format:"%s%n%n%b" >> "$notes_file"
|
git log -1 --pretty=format:"%s%n%n%b" >> "$notes_file"
|
||||||
fi
|
fi
|
||||||
@@ -126,6 +142,7 @@ jobs:
|
|||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ needs.setup.outputs.tag }}
|
tag_name: ${{ needs.setup.outputs.tag }}
|
||||||
|
name: ${{ needs.notes.outputs.release_name }}
|
||||||
body_path: .github/release-notes.md
|
body_path: .github/release-notes.md
|
||||||
prerelease: ${{ needs.setup.outputs.prerelease == 'true' }}
|
prerelease: ${{ needs.setup.outputs.prerelease == 'true' }}
|
||||||
|
|
||||||
@@ -651,6 +668,8 @@ jobs:
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
PKG
|
PKG
|
||||||
|
|
||||||
|
cat > packages/aur/dcr/.SRCINFO <<SRC
|
||||||
pkgbase = dcr
|
pkgbase = dcr
|
||||||
pkgdesc = Cargo-like utility to manage C/C++ projects
|
pkgdesc = Cargo-like utility to manage C/C++ projects
|
||||||
pkgver = ${PKGVER_CLEAN}
|
pkgver = ${PKGVER_CLEAN}
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,6 +2,7 @@ target/
|
|||||||
sandbox/**
|
sandbox/**
|
||||||
.idea/
|
.idea/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
.cargo/
|
||||||
.env
|
.env
|
||||||
|
|
||||||
personal/
|
personal/
|
||||||
24
Cargo.toml
24
Cargo.toml
@@ -69,16 +69,32 @@ toml = "1.0.3"
|
|||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
ctrlc = "3"
|
ctrlc = "3"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = ["vendored"]
|
||||||
|
vendored = [
|
||||||
|
"git2/vendored-libgit2",
|
||||||
|
"git2/vendored-openssl",
|
||||||
|
"openssl/vendored",
|
||||||
|
]
|
||||||
|
|
||||||
[target.'cfg(not(windows))'.dependencies]
|
[target.'cfg(not(windows))'.dependencies]
|
||||||
git2 = { version = "0.20.4", features = ["vendored-libgit2", "vendored-openssl"] }
|
git2 = "0.20.4"
|
||||||
openssl = { version = "0.10", features = ["vendored"] }
|
openssl = "0.10"
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
git2 = { version = "0.20.4", features = ["vendored-libgit2"] }
|
git2 = "0.20.4"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = "z"
|
opt-level = "z"
|
||||||
lto = true
|
lto = "thin"
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
strip = true
|
strip = true
|
||||||
|
|
||||||
|
[profile.fast]
|
||||||
|
inherits = "release"
|
||||||
|
opt-level = 1
|
||||||
|
lto = false
|
||||||
|
codegen-units = 16
|
||||||
|
panic = "abort"
|
||||||
|
strip = true
|
||||||
@@ -226,7 +226,7 @@ other in [docs/](docs/), `dcr --help` and `dcr <command> --help`
|
|||||||
| Linux (Musl) | ✅ | ✅ | ✅ | ✅ | 🚧 |
|
| Linux (Musl) | ✅ | ✅ | ✅ | ✅ | 🚧 |
|
||||||
| macOS | ✅ | ✅ | ❌ | ❌ | ❌ |
|
| macOS | ✅ | ✅ | ❌ | ❌ | ❌ |
|
||||||
| Windows (MSVC) | ✅ | ✅ | ❌ | ✅ | ❌ |
|
| Windows (MSVC) | ✅ | ✅ | ❌ | ✅ | ❌ |
|
||||||
| Windows (MinGW) | ✅ | 🚧 | ❌ | ✅ | ❌ |
|
| Windows (MinGW) | ✅ | 🚧 | ❌ | ❌ | ❌ |
|
||||||
| FreeBSD | ✅ | 🚧 | ❌ | ❌ | ❌ |
|
| FreeBSD | ✅ | 🚧 | ❌ | ❌ | ❌ |
|
||||||
| OpenBSD | ✅ | 🚧 | ❌ | ❌ | ❌ |
|
| OpenBSD | ✅ | 🚧 | ❌ | ❌ | ❌ |
|
||||||
| NetBSD | ✅ | 🚧 | ❌ | ❌ | ❌ |
|
| NetBSD | ✅ | 🚧 | ❌ | ❌ | ❌ |
|
||||||
@@ -271,6 +271,7 @@ cargo test
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
GPL-3.0 — see [LICENSE](LICENSE)<br/>
|
GPL-3.0 — see [LICENSE](LICENSE)<br/>
|
||||||
|
DCR is a build tool, not a library. The GPL applies only to DCR's own source code, not to projects built with it.<br/>
|
||||||
Made with ❤️ by [Dexoron](https://github.com/dexoron) and contributors.
|
Made with ❤️ by [Dexoron](https://github.com/dexoron) and contributors.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ dcr gen vscode
|
|||||||
| [Self Update](/docs/self-update) | Auto-update |
|
| [Self Update](/docs/self-update) | Auto-update |
|
||||||
| [FAQ](/docs/faq) | Frequently asked questions |
|
| [FAQ](/docs/faq) | Frequently asked questions |
|
||||||
| [Changelog](/docs/changelog) | Version history |
|
| [Changelog](/docs/changelog) | Version history |
|
||||||
|
| [License](/docs/license) | DCR and vendored library licenses |
|
||||||
| [Contributing](/docs/contributing) | DCR development |
|
| [Contributing](/docs/contributing) | DCR development |
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|||||||
46
docs/license.mdx
Normal file
46
docs/license.mdx
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
sidebar_label: License
|
||||||
|
---
|
||||||
|
|
||||||
|
# License
|
||||||
|
|
||||||
|
## DCR
|
||||||
|
|
||||||
|
DCR itself is [GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later.html) licensed.
|
||||||
|
|
||||||
|
> **Note:** DCR is a build tool, not a library. The GPL applies only to DCR's own source code. Projects built with DCR are not subject to DCR's license — their licensing is determined solely by their own code and dependencies.
|
||||||
|
|
||||||
|
## Vendored libraries
|
||||||
|
|
||||||
|
DCR statically links the following C libraries through its vendored Rust dependencies:
|
||||||
|
|
||||||
|
| Library | License | Bundled by |
|
||||||
|
|---|---|---|
|
||||||
|
| [libgit2](https://libgit2.org) | MIT OR Apache-2.0 | `git2` / `libgit2-sys` |
|
||||||
|
| [libssh2](https://libssh2.org) | MIT OR Apache-2.0 | `libgit2-sys` |
|
||||||
|
| [zlib](https://zlib.net) | MIT OR Apache-2.0 | `libgit2-sys` |
|
||||||
|
| [OpenSSL](https://openssl.org) | Apache-2.0 | `openssl-sys` / `openssl-src` |
|
||||||
|
| [ring](https://github.com/briansmith/ring) | Apache-2.0 AND ISC | `rustls` |
|
||||||
|
|
||||||
|
## Rust dependencies
|
||||||
|
|
||||||
|
DCR is written in Rust. The following notable Rust crates are statically linked:
|
||||||
|
|
||||||
|
| Crate | License |
|
||||||
|
|---|---|
|
||||||
|
| [`reqwest`](https://crates.io/crates/reqwest) | MIT OR Apache-2.0 |
|
||||||
|
| [`rustls`](https://crates.io/crates/rustls) | Apache-2.0 OR ISC OR MIT |
|
||||||
|
| [`serde`](https://crates.io/crates/serde) | MIT OR Apache-2.0 |
|
||||||
|
| [`toml`](https://crates.io/crates/toml) | MIT OR Apache-2.0 |
|
||||||
|
| [`sha2`](https://crates.io/crates/sha2) | MIT OR Apache-2.0 |
|
||||||
|
| [`git2`](https://crates.io/crates/git2) | MIT OR Apache-2.0 |
|
||||||
|
| [`openssl`](https://crates.io/crates/openssl) | Apache-2.0 |
|
||||||
|
| [`tokio`](https://crates.io/crates/tokio) | MIT |
|
||||||
|
| [`hyper`](https://crates.io/crates/hyper) | MIT |
|
||||||
|
| [`ctrlc`](https://crates.io/crates/ctrlc) | MIT OR Apache-2.0 |
|
||||||
|
|
||||||
|
Full dependency tree (143 packages) is available in [`Cargo.lock`](https://github.com/dexoron/dcr/blob/main/Cargo.lock). The overwhelming majority are dual-licensed under MIT OR Apache-2.0.
|
||||||
|
|
||||||
|
## Additional credits
|
||||||
|
|
||||||
|
- DCR's CLI design and project model are inspired by [Cargo](https://doc.rust-lang.org/cargo/).
|
||||||
@@ -34,9 +34,12 @@ pub struct AddArgs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn add(args: &[String]) -> i32 {
|
pub fn add(args: &[String]) -> i32 {
|
||||||
if args.first().map_or(false, |a| a == "--help") {
|
if args.first().is_some_and(|a| a == "--help") {
|
||||||
printc("USAGE:", BOLD_GREEN);
|
printc("USAGE:", BOLD_GREEN);
|
||||||
printc(" dcr add <name> <source> [--branch <b>] [--tag <t>] [--rev <r>]", BOLD_CYAN);
|
printc(
|
||||||
|
" dcr add <name> <source> [--branch <b>] [--tag <t>] [--rev <r>]",
|
||||||
|
BOLD_CYAN,
|
||||||
|
);
|
||||||
println!();
|
println!();
|
||||||
printc("DESCRIPTION:", BOLD_GREEN);
|
printc("DESCRIPTION:", BOLD_GREEN);
|
||||||
println!(" Adds a dependency to the project.");
|
println!(" Adds a dependency to the project.");
|
||||||
|
|||||||
@@ -42,9 +42,12 @@ static BUILD_INTERRUPTED: AtomicBool = AtomicBool::new(false);
|
|||||||
static SIGNAL_HANDLER: Once = Once::new();
|
static SIGNAL_HANDLER: Once = Once::new();
|
||||||
|
|
||||||
pub fn build(args: &[String]) -> i32 {
|
pub fn build(args: &[String]) -> i32 {
|
||||||
if args.first().map_or(false, |a| a == "--help") {
|
if args.first().is_some_and(|a| a == "--help") {
|
||||||
printc("USAGE:", BOLD_GREEN);
|
printc("USAGE:", BOLD_GREEN);
|
||||||
printc(" dcr build [--debug | --release] [--target <triple>] [--force] [--clean] [--verbose]", BOLD_CYAN);
|
printc(
|
||||||
|
" dcr build [--debug | --release] [--target <triple>] [--force] [--clean] [--verbose]",
|
||||||
|
BOLD_CYAN,
|
||||||
|
);
|
||||||
println!();
|
println!();
|
||||||
printc("DESCRIPTION:", BOLD_GREEN);
|
printc("DESCRIPTION:", BOLD_GREEN);
|
||||||
println!(" Compiles the project. Default profile is --debug.");
|
println!(" Compiles the project. Default profile is --debug.");
|
||||||
|
|||||||
@@ -27,9 +27,12 @@ use std::fs;
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
pub fn clean(args: &[String]) -> i32 {
|
pub fn clean(args: &[String]) -> i32 {
|
||||||
if args.first().map_or(false, |a| a == "--help") {
|
if args.first().is_some_and(|a| a == "--help") {
|
||||||
printc("USAGE:", BOLD_GREEN);
|
printc("USAGE:", BOLD_GREEN);
|
||||||
printc(" dcr clean [--debug | --release] [--target <triple>] [--all]", BOLD_CYAN);
|
printc(
|
||||||
|
" dcr clean [--debug | --release] [--target <triple>] [--all]",
|
||||||
|
BOLD_CYAN,
|
||||||
|
);
|
||||||
println!();
|
println!();
|
||||||
printc("DESCRIPTION:", BOLD_GREEN);
|
printc("DESCRIPTION:", BOLD_GREEN);
|
||||||
println!(" Removes build artifacts from the target directory.");
|
println!(" Removes build artifacts from the target directory.");
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ struct ReleaseAsset {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn flag_update(args: &[String]) -> i32 {
|
pub fn flag_update(args: &[String]) -> i32 {
|
||||||
if args.first().map_or(false, |a| a == "--help") {
|
if args.first().is_some_and(|a| a == "--help") {
|
||||||
printc("USAGE:", BOLD_GREEN);
|
printc("USAGE:", BOLD_GREEN);
|
||||||
printc(" dcr --update", BOLD_CYAN);
|
printc(" dcr --update", BOLD_CYAN);
|
||||||
println!();
|
println!();
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ use glob::glob;
|
|||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
pub fn fmt(args: &[String]) -> i32 {
|
pub fn fmt(args: &[String]) -> i32 {
|
||||||
if args.first().map_or(false, |a| a == "--help") {
|
if args.first().is_some_and(|a| a == "--help") {
|
||||||
printc("USAGE:", BOLD_GREEN);
|
printc("USAGE:", BOLD_GREEN);
|
||||||
printc(" dcr fmt", BOLD_CYAN);
|
printc(" dcr fmt", BOLD_CYAN);
|
||||||
println!();
|
println!();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::config::FILE_MAIN_C;
|
use crate::config::FILE_MAIN_C;
|
||||||
use crate::core::config::{validate_package_name, Config};
|
use crate::core::config::{Config, validate_package_name};
|
||||||
use crate::utils::fs::check_dir;
|
use crate::utils::fs::check_dir;
|
||||||
use crate::utils::log::{error, warn};
|
use crate::utils::log::{error, warn};
|
||||||
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
|
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
|
||||||
@@ -25,7 +25,7 @@ use std::io::Write;
|
|||||||
use toml::Value;
|
use toml::Value;
|
||||||
|
|
||||||
pub fn init(args: &[String]) -> i32 {
|
pub fn init(args: &[String]) -> i32 {
|
||||||
if args.first().map_or(false, |a| a == "--help") {
|
if args.first().is_some_and(|a| a == "--help") {
|
||||||
printc("USAGE:", BOLD_GREEN);
|
printc("USAGE:", BOLD_GREEN);
|
||||||
printc(" dcr init", BOLD_CYAN);
|
printc(" dcr init", BOLD_CYAN);
|
||||||
println!();
|
println!();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::config::FILE_MAIN_C;
|
use crate::config::FILE_MAIN_C;
|
||||||
use crate::core::config::{validate_package_name, Config};
|
use crate::core::config::{Config, validate_package_name};
|
||||||
use crate::utils::fs::check_dir;
|
use crate::utils::fs::check_dir;
|
||||||
use crate::utils::log::{error, warn};
|
use crate::utils::log::{error, warn};
|
||||||
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
|
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
|
||||||
@@ -25,7 +25,7 @@ use std::io::Write;
|
|||||||
use toml::Value;
|
use toml::Value;
|
||||||
|
|
||||||
pub fn new(args: &[String]) -> i32 {
|
pub fn new(args: &[String]) -> i32 {
|
||||||
if args.first().map_or(false, |a| a == "--help") {
|
if args.first().is_some_and(|a| a == "--help") {
|
||||||
printc("USAGE:", BOLD_GREEN);
|
printc("USAGE:", BOLD_GREEN);
|
||||||
printc(" dcr new <name>", BOLD_CYAN);
|
printc(" dcr new <name>", BOLD_CYAN);
|
||||||
println!();
|
println!();
|
||||||
|
|||||||
@@ -56,9 +56,12 @@ fn get_run_cmd(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn run(args: &[String]) -> i32 {
|
pub fn run(args: &[String]) -> i32 {
|
||||||
if args.first().map_or(false, |a| a == "--help") {
|
if args.first().is_some_and(|a| a == "--help") {
|
||||||
printc("USAGE:", BOLD_GREEN);
|
printc("USAGE:", BOLD_GREEN);
|
||||||
printc(" dcr run [--debug | --release] [--target <triple>] [--force] [--clean] [--verbose]", BOLD_CYAN);
|
printc(
|
||||||
|
" dcr run [--debug | --release] [--target <triple>] [--force] [--clean] [--verbose]",
|
||||||
|
BOLD_CYAN,
|
||||||
|
);
|
||||||
println!();
|
println!();
|
||||||
printc("DESCRIPTION:", BOLD_GREEN);
|
printc("DESCRIPTION:", BOLD_GREEN);
|
||||||
println!(" Builds and runs the project. Only available for kind = \"bin\".");
|
println!(" Builds and runs the project. Only available for kind = \"bin\".");
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, printc};
|
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, printc};
|
||||||
|
|
||||||
pub fn setup(args: &[String]) -> i32 {
|
pub fn setup(args: &[String]) -> i32 {
|
||||||
if args.first().map_or(false, |a| a == "--help") {
|
if args.first().is_some_and(|a| a == "--help") {
|
||||||
printc("USAGE:", BOLD_GREEN);
|
printc("USAGE:", BOLD_GREEN);
|
||||||
printc(" dcr setup", BOLD_CYAN);
|
printc(" dcr setup", BOLD_CYAN);
|
||||||
println!();
|
println!();
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ use std::path::{Path, PathBuf};
|
|||||||
use toml::Value;
|
use toml::Value;
|
||||||
|
|
||||||
pub fn tree(args: &[String]) -> i32 {
|
pub fn tree(args: &[String]) -> i32 {
|
||||||
if args.first().map_or(false, |a| a == "--help") {
|
if args.first().is_some_and(|a| a == "--help") {
|
||||||
printc("USAGE:", BOLD_GREEN);
|
printc("USAGE:", BOLD_GREEN);
|
||||||
printc(" dcr tree", BOLD_CYAN);
|
printc(" dcr tree", BOLD_CYAN);
|
||||||
println!();
|
println!();
|
||||||
|
|||||||
Reference in New Issue
Block a user