diff --git a/.gitpod.yml b/.gitpod.yml index 7c42811..efcb346 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -2,15 +2,14 @@ image: file: .gitpod.Dockerfile tasks: - - name: doc - init: cargo +nightly doc --all-features --no-deps + - name: serve docs command: miniserve --index benimator/index.html target/doc - name: test init: | cp .cargo/fast_compiles_config .cargo/config.toml cargo update - cargo doc --all-features --no-deps + cargo +nightly doc --all-features --no-deps cargo clippy --all-features --all-targets cargo test --all-features cargo test @@ -20,7 +19,7 @@ tasks: -x 'test --all-features --tests' \ -x 'test --all-features' \ -x 'clippy --all-features --all-targets' \ - -x 'doc --all-features --no-deps' + -x '+nightly doc --all-features --no-deps' vscode: extensions: @@ -30,10 +29,10 @@ vscode: - bungcip.better-toml ports: - - name: example (wasm) - port: 1334 + - name: documentation + port: 8080 visibility: private - onOpen: notify + onOpen: open-browser github: prebuilds: diff --git a/Cargo.toml b/Cargo.toml index f01bb53..e474246 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,9 @@ repository = "https://github.com/jcornaz/benimator" keywords = ["game", "gamedev", "anmiation", "bevy"] categories = ["game-development"] +[package.metadata.docs.rs] +all-features = true + [features] default = [] unstable-load-from-file = ["serde", "serde_yaml", "anyhow", "bevy_utils"] @@ -31,6 +34,9 @@ bevy = { version = "0.7.0", default-features = false, features = ["render", "x11 rstest = { version = "0.13.0", default-features = false } criterion = { version = "0.3.5", default-features = false } +[build-dependencies] +rustc_version = "0.4.0" + [[bench]] name = "play_component" harness = false @@ -38,6 +44,3 @@ harness = false [[example]] name = "using_animation_file" required-features = ["unstable-load-from-file"] - -[profile.dev] -debug = 0 diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..84c6c2d --- /dev/null +++ b/build.rs @@ -0,0 +1,7 @@ +use rustc_version::{version_meta, Channel}; + +fn main() { + if let Channel::Nightly = version_meta().unwrap().channel { + println!("cargo:rustc-cfg=nightly"); + } +} diff --git a/src/lib.rs b/src/lib.rs index 3485b4c..00ac43a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,6 +6,7 @@ clippy::pedantic )] #![allow(clippy::needless_pass_by_value, clippy::module_name_repetitions)] +#![cfg_attr(nightly, feature(doc_auto_cfg))] //! A sprite-sheet animation plugin for [bevy](https://bevyengine.org) //!