-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from sebastienrousseau/feat/libmake
0.2.1
- Loading branch information
Showing
50 changed files
with
1,479 additions
and
1,652 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[alias] | ||
xtask = "run --package xtask --bin xtask --" | ||
xtask = "run --package libmake --bin libmake --" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,69 @@ | ||
name: 🧪 Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- feat/libmake | ||
pull_request: | ||
branches: | ||
- feat/libmake | ||
release: | ||
types: [created] | ||
|
||
on: [pull_request, push] | ||
jobs: | ||
all: | ||
# Run tests on Linux | ||
name: Test | ||
test-lib: | ||
name: Test library | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
toolchain: [stable, nightly] | ||
continue-on-error: true | ||
|
||
steps: | ||
- uses: hecrj/setup-rust-action@v2 | ||
- uses: actions/checkout@v4 | ||
- name: Run tests | ||
run: cargo test --verbose --workspace | ||
# Checkout the repository | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# Setup Rust | ||
- name: Setup Rust | ||
run: | | ||
rustup toolchain add ${{ matrix.toolchain }} --component llvm-tools-preview | ||
rustup override set ${{ matrix.toolchain }} | ||
# Configure cache | ||
- name: Configure cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: test-${{ runner.os }}-cargo-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
# Run tests with all features | ||
- name: Run tests with all features | ||
id: run-tests-all-features | ||
run: cargo test --verbose --workspace --all-features | ||
|
||
# Install grcov | ||
- name: Install grcov | ||
# Only run this job on the main branch when a commit is pushed. | ||
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | ||
id: install-grcov | ||
run: | | ||
mkdir -p "${HOME}/.local/bin" | ||
curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.18/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - -C "${HOME}/.local/bin" | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
# Use grcov to generate a coverage report | ||
- name: Generate coverage report | ||
id: coverage | ||
# Only run this job on the main branch when a commit is pushed. | ||
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | ||
id: generate-code-coverage | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: xtask | ||
args: coverage | ||
|
||
# Upload the coverage report to codecov | ||
- name: Upload coverage report to codecov | ||
id: codecov | ||
# Only run this job on the main branch when a commit is pushed. | ||
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | ||
id: upload-report-codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: coverage/*.lcov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
*.DS_Store | ||
*.profraw | ||
ssg.log | ||
/.vscode/ | ||
/target/ | ||
build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
[package] | ||
authors = ["Sebastien Rousseau <[email protected]>"] | ||
categories = ['development-tools', 'command-line-utilities', 'template-engine'] | ||
description = "A code generator to reduce repetitive tasks and build high-quality Rust libraries." | ||
authors = ["LibMake Contributors"] | ||
categories = ["development-tools", "command-line-utilities", "template-engine"] | ||
description = """ | ||
A code generator to reduce repetitive tasks and build high-quality Rust | ||
libraries and applications, by providing a simple interface to create | ||
projects, generate code, and manage dependencies. | ||
""" | ||
documentation = "https://docs.rs/libmake" | ||
edition = "2021" | ||
exclude = ["/.git/*", "/.github/*", "/.gitignore", "/.vscode/*"] | ||
homepage = "https://libmake.com" | ||
keywords = [ | ||
'code-generation', | ||
'generator', | ||
|
@@ -12,9 +19,10 @@ keywords = [ | |
] | ||
license = "MIT OR Apache-2.0" | ||
name = "libmake" | ||
readme = "README.md" | ||
repository = "https://github.com/sebastienrousseau/libmake.git" | ||
rust-version = "1.71.1" | ||
version = "0.2.0" | ||
rust-version = "1.75.0" | ||
version = "0.2.1" | ||
include = [ | ||
"/CONTRIBUTING.md", | ||
"/LICENSE-APACHE", | ||
|
@@ -32,6 +40,9 @@ include = [ | |
[workspace] | ||
members = ["xtask"] | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
|
||
[[bench]] | ||
name = "benchmark" | ||
harness = false | ||
|
@@ -41,19 +52,23 @@ path = "benches/criterion.rs" | |
debug = true | ||
|
||
[dependencies] | ||
anyhow = "1.0.75" | ||
anyhow = "1.0.77" | ||
assert_cmd = "2.0.12" | ||
clap = "4.4.7" | ||
clap = "4.4.12" | ||
csv = "1.3.0" | ||
dtt = "0.0.4" | ||
dtt = "0.0.5" | ||
env_logger = "0.10.1" | ||
figlet-rs = "0.1.5" | ||
openssl = { version = "0.10.59", features = ["vendored"] } | ||
reqwest = { version = "0.11.22", features = ["blocking"] } | ||
serde = { version = "1.0.192", features = ["derive"] } | ||
openssl = { version = "0.10.62", features = ["vendored"] } | ||
reqwest = { version = "0.11.23", features = ["blocking"] } | ||
rlg = "0.0.2" | ||
serde = { version = "1.0.193", features = ["derive"] } | ||
serde_json = "1.0.108" | ||
serde_yaml = "0.9.27" | ||
serde_yaml = "0.9.29" | ||
tempfile = "3.9.0" | ||
toml = "0.8.8" | ||
vrd = "0.0.4" | ||
vrd = "0.0.5" | ||
xtasks = "0.0.2" | ||
|
||
[dev-dependencies] | ||
criterion = "0.5.1" | ||
|
@@ -63,13 +78,11 @@ predicates = "3.0.4" | |
crate-type = ["lib"] | ||
name = "libmake" | ||
path = "src/lib.rs" | ||
required-features = [] | ||
|
||
[features] | ||
default = [] | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
|
||
[profile.dev] | ||
codegen-units = 256 | ||
debug = true | ||
|
@@ -83,16 +96,16 @@ rpath = false | |
strip = false | ||
|
||
[profile.release] | ||
codegen-units = 1 # Compile crates one after another so the compiler can optimize better | ||
debug = false # Disable debug information | ||
debug-assertions = false # Disable debug assertions | ||
incremental = false # Disable incremental compilation | ||
lto = true # Enables link to optimizations | ||
opt-level = "s" # Optimize for binary size | ||
overflow-checks = false # Disable overflow checks | ||
panic = "abort" # Strip expensive panic clean-up logic | ||
rpath = false # Disable rpath | ||
strip = "symbols" # Automatically strip symbols from the binary. | ||
codegen-units = 1 | ||
debug = false | ||
debug-assertions = false | ||
incremental = false | ||
lto = true | ||
opt-level = "s" | ||
overflow-checks = false | ||
panic = "abort" | ||
rpath = false | ||
strip = "symbols" | ||
|
||
[profile.test] | ||
codegen-units = 256 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// Copyright notice and licensing information. | ||
// These lines indicate the copyright of the software and its licensing terms. | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT indicates dual licensing under Apache 2.0 or MIT licenses. | ||
// Copyright © 2024 LibMake. All rights reserved. | ||
|
||
//! This is an example crate for LibMake. | ||
//! | ||
//! This crate provides various modules and examples for demonstrating the functionality | ||
//! of LibMake. Each module focuses on a specific feature or functionality. | ||
//! | ||
//! Copyright © 2024 LibMake. All rights reserved. | ||
//! | ||
//! Dual-licensed under the terms of the Apache License, Version 2.0, or the MIT License, | ||
//! at your option. See the 'LICENSE' file for details. | ||
|
||
// Module Declarations | ||
// Each `mod` statement declares a module in the current crate. | ||
// Modules help organize code into separate namespaces, each focusing on specific functionalities. | ||
|
||
/// This is a module for the example `generate_from_args`. | ||
mod generate_from_args; | ||
|
||
/// This is a module for the example `generate_from_config`. | ||
mod generate_from_config; | ||
|
||
/// This is a module for the example `generate_from_csv`. | ||
mod generate_from_csv; | ||
|
||
/// This is a module for the example `generate_from_json`. | ||
mod generate_from_json; | ||
|
||
/// This is a module for the example `generate_from_toml`. | ||
mod generate_from_toml; | ||
|
||
/// This is a module for the example `generate_from_yaml`. | ||
mod generate_from_yaml; | ||
|
||
/// This is a module for the example `get_csv_field`. | ||
mod get_csv_field; | ||
|
||
/// This is a module for the example `get_json_field`. | ||
mod get_json_field; | ||
|
||
/// This is a module for the example `get_yaml_field`. | ||
mod get_yaml_field; | ||
|
||
// Main Function | ||
// The `main` function serves as the entry point of the program. | ||
// Here, it calls the `main` function of each module to execute their respective examples. | ||
|
||
/// The main function that runs all the example modules. | ||
fn main() { | ||
// Run the example module `generate_from_args`. | ||
generate_from_args::main(); | ||
|
||
// Run the example module `generate_from_config`. | ||
generate_from_config::main(); | ||
|
||
// Run the example module `generate_from_csv`. | ||
generate_from_csv::main(); | ||
|
||
// Run the example module `generate_from_json`. | ||
generate_from_json::main(); | ||
|
||
// Run the example module `generate_from_toml`. | ||
generate_from_toml::main(); | ||
|
||
// Run the example module `generate_from_yaml`. | ||
generate_from_yaml::main(); | ||
|
||
// Run the example module `get_csv_field`. | ||
get_csv_field::main(); | ||
|
||
// Run the example module `get_json_field`. | ||
get_json_field::main(); | ||
|
||
// Run the example module `get_yaml_field`. | ||
get_yaml_field::main(); | ||
} |
Oops, something went wrong.