Skip to content

Commit

Permalink
Merge pull request #29 from sebastienrousseau/feat/libmake
Browse files Browse the repository at this point in the history
0.2.1
  • Loading branch information
sebastienrousseau authored Jan 17, 2024
2 parents d97b568 + 1ed6e9f commit c23b528
Show file tree
Hide file tree
Showing 50 changed files with 1,479 additions and 1,652 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
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 --"
61 changes: 42 additions & 19 deletions .github/workflows/test.yml
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.DS_Store
*.profraw
ssg.log
/.vscode/
/target/
build
Expand Down
65 changes: 39 additions & 26 deletions Cargo.toml
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',
Expand All @@ -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",
Expand All @@ -32,6 +40,9 @@ include = [
[workspace]
members = ["xtask"]

[package.metadata.docs.rs]
all-features = true

[[bench]]
name = "benchmark"
harness = false
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,6 @@ providing a lot of useful suggestions on how to improve this project.
[crates-badge]: https://img.shields.io/crates/v/libmake.svg?style=for-the-badge "Crates.io Badge"
[divider]: https://kura.pro/common/images/elements/divider.svg "divider"
[docs-badge]: https://img.shields.io/docsrs/libmake.svg?style=for-the-badge "Docs.rs Badge"
[libs-badge]: https://img.shields.io/badge/lib.rs-v0.2.0-orange.svg?style=for-the-badge "Lib.rs Badge"
[libs-badge]: https://img.shields.io/badge/lib.rs-v0.2.1-orange.svg?style=for-the-badge "Lib.rs Badge"
[license-badge]: https://img.shields.io/crates/l/libmake.svg?style=for-the-badge "License Badge"
[made-with-rust-badge]: https://img.shields.io/badge/rust-f04041?style=for-the-badge&labelColor=c0282d&logo=rust "Made With Rust Badge"
4 changes: 2 additions & 2 deletions TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
alt="LibMake logo" width="261" align="right" />

<!-- markdownlint-enable MD033 MD041 -->
# LibMake v0.2.0 🦀
# LibMake v0.2.1 🦀

A code generator to reduce repetitive tasks and build high-quality Rust libraries.

Expand Down Expand Up @@ -63,6 +63,6 @@ The library is designed to be used as a command-line tool. It is available on [C
[codecov-badge]: https://img.shields.io/codecov/c/github/sebastienrousseau/libmake?style=for-the-badge&token=Q9KJ6XXL67 "Codecov Badge"
[crates-badge]: https://img.shields.io/crates/v/libmake.svg?style=for-the-badge "Crates.io Badge"
[docs-badge]: https://img.shields.io/docsrs/libmake.svg?style=for-the-badge "Docs.rs Badge"
[libs-badge]: https://img.shields.io/badge/lib.rs-v0.2.0-orange.svg?style=for-the-badge "Lib.rs Badge"
[libs-badge]: https://img.shields.io/badge/lib.rs-v0.2.1-orange.svg?style=for-the-badge "Lib.rs Badge"
[license-badge]: https://img.shields.io/crates/l/libmake.svg?style=for-the-badge "License Badge"
[made-with-rust-badge]: https://img.shields.io/badge/rust-f04041?style=for-the-badge&labelColor=c0282d&logo=rust "Made With Rust Badge"
6 changes: 4 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright © 2023 LibMake. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT
// 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 the main function for the build script.
//!
Expand Down
79 changes: 79 additions & 0 deletions examples/example.rs
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();
}
Loading

0 comments on commit c23b528

Please sign in to comment.