You've already forked architect
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
bf8694a04c
|
|||
|
681cc73479
|
|||
|
0c437d816a
|
|||
|
a6d429ae41
|
Vendored
-9
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"vadimcn.vscode-lldb",
|
||||
"barbosshack.crates-io",
|
||||
"usernamehw.errorlens",
|
||||
"tamasfe.even-better-toml",
|
||||
"rust-lang.rust-analyzer",
|
||||
]
|
||||
}
|
||||
Vendored
-33
@@ -1,33 +0,0 @@
|
||||
{
|
||||
// VSCode
|
||||
"editor.detectIndentation": false,
|
||||
"editor.insertSpaces": false,
|
||||
"editor.tabSize": 4,
|
||||
"files.exclude": {
|
||||
"**/target": true,
|
||||
"**/Cargo.lock": true,
|
||||
},
|
||||
"files.insertFinalNewline": true,
|
||||
"files.trimFinalNewlines": true,
|
||||
"files.trimTrailingWhitespace": true,
|
||||
"files.watcherExclude": {
|
||||
"**/.git/**": true,
|
||||
"**/target/**": true,
|
||||
},
|
||||
// Extensions
|
||||
"crates.listPreReleases": true,
|
||||
"evenBetterToml.formatter.alignComments": true,
|
||||
"evenBetterToml.formatter.alignEntries": false,
|
||||
"evenBetterToml.formatter.allowedBlankLines": 1,
|
||||
"evenBetterToml.formatter.arrayAutoExpand": true,
|
||||
"evenBetterToml.formatter.arrayTrailingComma": true,
|
||||
"evenBetterToml.formatter.columnWidth": 80,
|
||||
"evenBetterToml.formatter.reorderKeys": true,
|
||||
"evenBetterToml.formatter.trailingNewline": true,
|
||||
"rust-analyzer.imports.granularity.enforce": true,
|
||||
"rust-analyzer.imports.granularity.group": "module",
|
||||
"rust-analyzer.imports.group.enable": true,
|
||||
"rust-analyzer.imports.merge.glob": false,
|
||||
"rust-analyzer.imports.preferNoStd": true,
|
||||
"rust-analyzer.showUnlinkedFileNotification": false,
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"languages": {
|
||||
"TOML": {
|
||||
"format_on_save": "on",
|
||||
"formatter": { "language_server": { "name": "tombi" } },
|
||||
},
|
||||
},
|
||||
"lsp": {
|
||||
"rust-analyzer": {
|
||||
"initialization_options": {
|
||||
"imports": {
|
||||
"granularity": { "enforce": true, "group": "module" },
|
||||
"group": { "enable": true },
|
||||
"merge": { "glob": false },
|
||||
"preferNoStd": true,
|
||||
},
|
||||
"server": {
|
||||
"extraEnv": {
|
||||
"RUSTUP_TOOLCHAIN": "stable",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
+2
-1
@@ -3,4 +3,5 @@ How to Contribute
|
||||
|
||||
We'd love to accept your patches and contributions to this project.
|
||||
We just need you to follow the Contributor License Agreement outlined
|
||||
in the latest v0.0.x of https://github.com/Skrunix/license
|
||||
in the latest v0.0.x of https://git.skrundz.dev/skrunix/license
|
||||
(mirrored to https://github.com/skrunix/license)
|
||||
|
||||
+31
-13
@@ -1,23 +1,41 @@
|
||||
[workspace]
|
||||
members = ["architect", "sample"]
|
||||
resolver = "2"
|
||||
members = ["crates/*"]
|
||||
|
||||
[workspace.package]
|
||||
authors = []
|
||||
edition = "2024"
|
||||
license-file = "LICENSE.md"
|
||||
|
||||
edition = "2024"
|
||||
rust-version = "1.85.0"
|
||||
|
||||
[workspace.lints.rust]
|
||||
unsafe_code = "forbid"
|
||||
|
||||
[profile.release]
|
||||
codegen-units = 1
|
||||
lto = "fat"
|
||||
opt-level = 3
|
||||
strip = "debuginfo"
|
||||
|
||||
[workspace.dependencies]
|
||||
architect = { path = "architect", version = "=0.0.0", default-features = false }
|
||||
architect = { path = "crates/architect", version = "=0.0.0", default-features = false }
|
||||
sample = { path = "crates/sample", version = "=0.0.0", default-features = false }
|
||||
|
||||
paste = { version = "^1", default-features = false }
|
||||
|
||||
[workspace.lints.clippy]
|
||||
arithmetic_side_effects = "forbid"
|
||||
as_conversions = "forbid"
|
||||
checked_conversions = "forbid"
|
||||
default_union_representation = "forbid"
|
||||
expect_used = "forbid"
|
||||
indexing_slicing = "forbid"
|
||||
integer_division = "forbid"
|
||||
integer_division_remainder_used = "forbid"
|
||||
transmute_undefined_repr = "forbid"
|
||||
unchecked_duration_subtraction = "forbid"
|
||||
unwrap_used = "forbid"
|
||||
|
||||
[workspace.lints.rust]
|
||||
arithmetic_overflow = "forbid"
|
||||
missing_docs = "forbid"
|
||||
unsafe_code = "forbid"
|
||||
unused_doc_comments = "forbid"
|
||||
|
||||
[profile.release]
|
||||
opt-level = 3
|
||||
strip = "debuginfo"
|
||||
overflow-checks = true
|
||||
lto = "fat"
|
||||
codegen-units = 1
|
||||
|
||||
@@ -6,6 +6,10 @@ A library for build scripts to interface with cargo. It is intended that you add
|
||||
|
||||
- build: `cargo hack --feature-powerset build`
|
||||
- clippy: `cargo hack --feature-powerset clippy -- -D warnings`
|
||||
- test: `cargo hack --feature-powerset test`
|
||||
- test old: `cargo +1.85 hack --feature-powerset test`
|
||||
- miri: `cargo +nightly hack --feature-powerset miri test`
|
||||
- fmt: `cargo fmt --check`
|
||||
- docs: `RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features`
|
||||
- semver: `cargo semver-checks --all-features`
|
||||
- publish: `cargo publish --dry-run -p architect`
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
pub mod input;
|
||||
pub mod output;
|
||||
@@ -1,18 +1,21 @@
|
||||
[package]
|
||||
name = "architect"
|
||||
version = "0.0.0"
|
||||
license-file.workspace = true
|
||||
|
||||
categories = ["development-tools::build-utils"]
|
||||
description = "A cargo interface for build scripts"
|
||||
repository = "https://github.com/QuantumShade/architect"
|
||||
categories = ["development-tools::build-utils"]
|
||||
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
license-file.workspace = true
|
||||
rust-version.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[dependencies]
|
||||
paste = { workspace = true }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -1,2 +1,4 @@
|
||||
//! Everything relating to getting inputs
|
||||
|
||||
/// Raw access for any missing APIs, these may be deleted at any time.
|
||||
pub mod raw;
|
||||
@@ -0,0 +1,6 @@
|
||||
//! Cargo interface for build scripts
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
|
||||
pub mod input;
|
||||
pub mod output;
|
||||
@@ -1,2 +1,4 @@
|
||||
//! Everything relating to writing outputs
|
||||
|
||||
/// Raw access for any missing APIs, these may be deleted at any time.
|
||||
pub mod raw;
|
||||
@@ -12,6 +12,8 @@
|
||||
//! > against library `bar`, you may want to make sure that library `bar`’s
|
||||
//! > [`cargo::rustc-link-lib`] instruction appears _after_ instructions to link
|
||||
//! > object `foo`.
|
||||
//!
|
||||
//! [`cargo::rustc-link-lib`]: https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib
|
||||
|
||||
/// The `rustc-link-arg` instruction tells Cargo to pass the [`-C link-arg=FLAG`
|
||||
/// option] to the compiler, but only when building supported targets
|
||||
@@ -19,7 +21,6 @@
|
||||
/// highly platform specific. It is useful to set the shared library version or
|
||||
/// linker script.
|
||||
///
|
||||
/// [`cargo::rustc-link-lib`]: https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib
|
||||
/// [`-C link-arg=FLAG` option]: https://doc.rust-lang.org/rustc/codegen-options/index.html#link-arg
|
||||
pub fn rustc_link_arg(flag: &str) {
|
||||
println!("cargo::rustc-link-arg={flag}");
|
||||
@@ -169,11 +170,14 @@ pub fn rustc_cfg(key: &str, value: Option<&str>) {
|
||||
///
|
||||
/// The instruction can be used like this:
|
||||
///
|
||||
/// ```no_run
|
||||
/// # let foo_bar_condition = false;
|
||||
/// // build.rs
|
||||
/// println!("cargo::rustc-check-cfg=cfg(foo, values(\"bar\"))");
|
||||
/// if foo_bar_condition {
|
||||
/// println!("cargo::rustc-cfg=foo=\"bar\"");
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// Note that all possible cfgs should be defined, regardless of which cfgs are
|
||||
/// currently enabled. This includes all possible values of a given cfg name.
|
||||
@@ -0,0 +1,31 @@
|
||||
[package]
|
||||
name = "sample"
|
||||
version = "0.0.0"
|
||||
license-file.workspace = true
|
||||
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[build-dependencies]
|
||||
architect = { workspace = true }
|
||||
|
||||
[lints.clippy]
|
||||
arithmetic_side_effects = "forbid"
|
||||
as_conversions = "forbid"
|
||||
checked_conversions = "forbid"
|
||||
default_union_representation = "forbid"
|
||||
expect_used = "forbid"
|
||||
indexing_slicing = "forbid"
|
||||
integer_division = "forbid"
|
||||
integer_division_remainder_used = "forbid"
|
||||
transmute_undefined_repr = "forbid"
|
||||
unchecked_duration_subtraction = "forbid"
|
||||
unwrap_used = "deny"
|
||||
|
||||
[lints.rust]
|
||||
arithmetic_overflow = "forbid"
|
||||
unsafe_code = "forbid"
|
||||
@@ -3,11 +3,15 @@ fn main() {
|
||||
architect::output::raw::warning(&format!("{k}={v}"));
|
||||
}
|
||||
|
||||
#[allow(clippy::unwrap_used)]
|
||||
let manifest_path = architect::input::raw::cargo_manifest_path_os().unwrap();
|
||||
architect::output::raw::warning(&format!("Manifest Path: {manifest_path:?}"));
|
||||
|
||||
#[allow(clippy::unwrap_used)]
|
||||
let arch = architect::input::raw::cargo_cfg_target_arch_os().unwrap();
|
||||
#[allow(clippy::unwrap_used)]
|
||||
let os = architect::input::raw::cargo_cfg_target_os_os().unwrap();
|
||||
#[allow(clippy::unwrap_used)]
|
||||
let endian = architect::input::raw::cargo_cfg_target_endian_os().unwrap();
|
||||
architect::output::raw::warning(&format!("Target: {arch:?} {os:?} ({endian:?})"));
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
[package]
|
||||
name = "sample"
|
||||
version = "0.0.0"
|
||||
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
license-file.workspace = true
|
||||
rust-version.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[build-dependencies]
|
||||
architect = { workspace = true }
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
toml-version = "v1.0.0"
|
||||
|
||||
[format.rules]
|
||||
indent-style = "tab"
|
||||
indent-width = 4
|
||||
|
||||
# Required for rust <1.94
|
||||
[[schemas]]
|
||||
toml-version = "v1.0.0"
|
||||
path = "tombi://www.schemastore.org/cargo.json"
|
||||
include = ["Cargo.toml"]
|
||||
Reference in New Issue
Block a user