From 801998c7171ae417b77b95afd55affff758a75aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 19 Jun 2020 13:04:23 +0300 Subject: [PATCH] Generate documentation from the docs crate directly --- gstreamer-app/Cargo.toml | 6 +++--- gstreamer-app/build.rs | 29 ++++++--------------------- gstreamer-audio/Cargo.toml | 6 +++--- gstreamer-audio/build.rs | 29 ++++++--------------------- gstreamer-base/Cargo.toml | 6 +++--- gstreamer-base/build.rs | 29 ++++++--------------------- gstreamer-check/Cargo.toml | 6 +++--- gstreamer-check/build.rs | 29 ++++++--------------------- gstreamer-editing-services/Cargo.toml | 6 +++--- gstreamer-editing-services/build.rs | 29 ++++++--------------------- gstreamer-gl/Cargo.toml | 6 +++--- gstreamer-gl/build.rs | 29 ++++++--------------------- gstreamer-net/Cargo.toml | 6 +++--- gstreamer-net/build.rs | 29 ++++++--------------------- gstreamer-pbutils/Cargo.toml | 6 +++--- gstreamer-pbutils/build.rs | 29 ++++++--------------------- gstreamer-player/Cargo.toml | 6 +++--- gstreamer-player/build.rs | 29 ++++++--------------------- gstreamer-rtp/Cargo.toml | 9 ++++----- gstreamer-rtp/build.rs | 29 ++++++--------------------- gstreamer-rtsp-server/Cargo.toml | 6 +++--- gstreamer-rtsp-server/build.rs | 29 ++++++--------------------- gstreamer-rtsp/Cargo.toml | 6 +++--- gstreamer-rtsp/build.rs | 29 ++++++--------------------- gstreamer-sdp/Cargo.toml | 6 +++--- gstreamer-sdp/build.rs | 29 ++++++--------------------- gstreamer-video/Cargo.toml | 6 +++--- gstreamer-video/build.rs | 29 ++++++--------------------- gstreamer-webrtc/Cargo.toml | 6 +++--- gstreamer-webrtc/build.rs | 29 ++++++--------------------- gstreamer/Cargo.toml | 6 +++--- gstreamer/build.rs | 29 ++++++--------------------- 32 files changed, 145 insertions(+), 418 deletions(-) diff --git a/gstreamer-app/Cargo.toml b/gstreamer-app/Cargo.toml index 746e44a76..919747d39 100644 --- a/gstreamer-app/Cargo.toml +++ b/gstreamer-app/Cargo.toml @@ -27,7 +27,7 @@ gstreamer-base = { path = "../gstreamer-base" } once_cell = "1.0" [build-dependencies] -rustdoc-stripper = { version = "0.1", optional = true } +gstreamer-rs-lgpl-docs = { path = "../docs", optional = true } [dev-dependencies] futures-util = { version = "0.3", features = ["sink"] } @@ -40,8 +40,8 @@ v1_12 = ["gstreamer/v1_12", "gstreamer-base/v1_12", "gstreamer-app-sys/v1_12", " v1_14 = ["gstreamer/v1_14", "gstreamer-base/v1_14", "gstreamer-app-sys/v1_14", "v1_12"] v1_16 = ["gstreamer/v1_16", "gstreamer-base/v1_16", "gstreamer-app-sys/v1_16", "v1_14"] v1_18 = ["gstreamer/v1_18", "gstreamer-base/v1_18", "gstreamer-app-sys/v1_18", "v1_16"] -embed-lgpl-docs = ["rustdoc-stripper"] -purge-lgpl-docs = ["rustdoc-stripper"] +embed-lgpl-docs = ["gstreamer-rs-lgpl-docs"] +purge-lgpl-docs = ["gstreamer-rs-lgpl-docs"] dox = ["v1_18", "gstreamer-app-sys/dox", "glib/dox", "gstreamer/dox", "gstreamer-base/dox"] [package.metadata.docs.rs] diff --git a/gstreamer-app/build.rs b/gstreamer-app/build.rs index afa26b343..70ce86804 100644 --- a/gstreamer-app/build.rs +++ b/gstreamer-app/build.rs @@ -7,29 +7,12 @@ fn main() { not(all(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")) ))] fn manage_docs() { - extern crate stripper_lib; - use std::io; - - let path = "src"; - let ignores: &[&str] = &[]; - - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), - &ignores, - false, - ); - - #[cfg(feature = "embed-lgpl-docs")] - { - let docs = include_str!("../docs/gstreamer-app/docs.md"); - let mut infos = stripper_lib::parse_cmts(docs.lines(), true); - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), - &ignores, - false, - ); + extern crate lgpl_docs; + const PATH: &str = "src"; + const IGNORES: &[&str] = &[]; + lgpl_docs::purge(PATH, IGNORES); + if cfg!(feature = "embed-lgpl-docs") { + lgpl_docs::embed(lgpl_docs::Library::GstApp, PATH, IGNORES); } } diff --git a/gstreamer-audio/Cargo.toml b/gstreamer-audio/Cargo.toml index e67e2caca..bfbb5a356 100644 --- a/gstreamer-audio/Cargo.toml +++ b/gstreamer-audio/Cargo.toml @@ -27,7 +27,7 @@ array-init = "0.1" once_cell = "1.0" [build-dependencies] -rustdoc-stripper = { version = "0.1", optional = true } +gstreamer-rs-lgpl-docs = { path = "../docs", optional = true } [dev-dependencies] itertools = "0.9" @@ -39,8 +39,8 @@ v1_12 = ["gstreamer/v1_12", "gstreamer-base/v1_12", "gstreamer-audio-sys/v1_12", v1_14 = ["gstreamer/v1_14", "gstreamer-base/v1_14", "gstreamer-audio-sys/v1_14", "v1_12"] v1_16 = ["gstreamer/v1_16", "gstreamer-base/v1_16", "gstreamer-audio-sys/v1_16", "v1_14"] v1_18 = ["gstreamer/v1_18", "gstreamer-base/v1_18", "gstreamer-audio-sys/v1_18", "v1_16"] -embed-lgpl-docs = ["rustdoc-stripper"] -purge-lgpl-docs = ["rustdoc-stripper"] +embed-lgpl-docs = ["gstreamer-rs-lgpl-docs"] +purge-lgpl-docs = ["gstreamer-rs-lgpl-docs"] dox = ["v1_18", "gstreamer-audio-sys/dox", "glib/dox", "gstreamer/dox"] [package.metadata.docs.rs] diff --git a/gstreamer-audio/build.rs b/gstreamer-audio/build.rs index 1cb0a37b8..4e8e2edeb 100644 --- a/gstreamer-audio/build.rs +++ b/gstreamer-audio/build.rs @@ -7,29 +7,12 @@ fn main() { not(all(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")) ))] fn manage_docs() { - extern crate stripper_lib; - use std::io; - - let path = "src"; - let ignores: &[&str] = &[]; - - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), - &ignores, - false, - ); - - #[cfg(feature = "embed-lgpl-docs")] - { - let docs = include_str!("../docs/gstreamer-audio/docs.md"); - let mut infos = stripper_lib::parse_cmts(docs.lines(), true); - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), - &ignores, - false, - ); + extern crate lgpl_docs; + const PATH: &str = "src"; + const IGNORES: &[&str] = &[]; + lgpl_docs::purge(PATH, IGNORES); + if cfg!(feature = "embed-lgpl-docs") { + lgpl_docs::embed(lgpl_docs::Library::GstAudio, PATH, IGNORES); } } diff --git a/gstreamer-base/Cargo.toml b/gstreamer-base/Cargo.toml index aa0a97d50..db6a5ad72 100644 --- a/gstreamer-base/Cargo.toml +++ b/gstreamer-base/Cargo.toml @@ -23,7 +23,7 @@ glib = { git = "https://github.com/gtk-rs/glib" } gstreamer = { path = "../gstreamer" } [build-dependencies] -rustdoc-stripper = { version = "0.1", optional = true } +gstreamer-rs-lgpl-docs = { path = "../docs", optional = true } [features] default = [] @@ -33,8 +33,8 @@ v1_14 = ["gstreamer/v1_14", "gstreamer-base-sys/v1_14", "v1_12"] v1_14_1 = ["gstreamer/v1_14", "gstreamer-base-sys/v1_14_1", "v1_14"] v1_16 = ["gstreamer/v1_16", "gstreamer-base-sys/v1_16", "v1_14_1"] v1_18 = ["gstreamer/v1_18", "gstreamer-base-sys/v1_18", "v1_16"] -embed-lgpl-docs = ["rustdoc-stripper"] -purge-lgpl-docs = ["rustdoc-stripper"] +embed-lgpl-docs = ["gstreamer-rs-lgpl-docs"] +purge-lgpl-docs = ["gstreamer-rs-lgpl-docs"] dox = ["v1_18", "gstreamer-base-sys/dox", "glib/dox", "gstreamer/dox"] [package.metadata.docs.rs] diff --git a/gstreamer-base/build.rs b/gstreamer-base/build.rs index 04648e155..132af28f9 100644 --- a/gstreamer-base/build.rs +++ b/gstreamer-base/build.rs @@ -7,29 +7,12 @@ fn main() { not(all(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")) ))] fn manage_docs() { - extern crate stripper_lib; - use std::io; - - let path = "src"; - let ignores: &[&str] = &[]; - - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), - &ignores, - false, - ); - - #[cfg(feature = "embed-lgpl-docs")] - { - let docs = include_str!("../docs/gstreamer-base/docs.md"); - let mut infos = stripper_lib::parse_cmts(docs.lines(), true); - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), - &ignores, - false, - ); + extern crate lgpl_docs; + const PATH: &str = "src"; + const IGNORES: &[&str] = &[]; + lgpl_docs::purge(PATH, IGNORES); + if cfg!(feature = "embed-lgpl-docs") { + lgpl_docs::embed(lgpl_docs::Library::GstBase, PATH, IGNORES); } } diff --git a/gstreamer-check/Cargo.toml b/gstreamer-check/Cargo.toml index 2fe70ec0a..74cd40193 100644 --- a/gstreamer-check/Cargo.toml +++ b/gstreamer-check/Cargo.toml @@ -22,7 +22,7 @@ glib = { git = "https://github.com/gtk-rs/glib" } gstreamer = { path = "../gstreamer" } [build-dependencies] -rustdoc-stripper = { version = "0.1", optional = true } +gstreamer-rs-lgpl-docs = { path = "../docs", optional = true } [features] default = [] @@ -31,8 +31,8 @@ v1_12 = ["gstreamer/v1_12", "gstreamer-check-sys/v1_12", "v1_10"] v1_14 = ["gstreamer/v1_14", "gstreamer-check-sys/v1_14", "v1_12"] v1_16 = ["gstreamer/v1_16", "gstreamer-check-sys/v1_16", "v1_14"] v1_18 = ["gstreamer/v1_18", "gstreamer-check-sys/v1_18", "v1_16"] -embed-lgpl-docs = ["rustdoc-stripper"] -purge-lgpl-docs = ["rustdoc-stripper"] +embed-lgpl-docs = ["gstreamer-rs-lgpl-docs"] +purge-lgpl-docs = ["gstreamer-rs-lgpl-docs"] dox = ["v1_18", "gstreamer-check-sys/dox", "glib/dox", "gstreamer/dox"] [package.metadata.docs.rs] diff --git a/gstreamer-check/build.rs b/gstreamer-check/build.rs index 03a27dffe..8adc1cedf 100644 --- a/gstreamer-check/build.rs +++ b/gstreamer-check/build.rs @@ -7,29 +7,12 @@ fn main() { not(all(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")) ))] fn manage_docs() { - extern crate stripper_lib; - use std::io; - - let path = "src"; - let ignores: &[&str] = &[]; - - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), - &ignores, - false, - ); - - #[cfg(feature = "embed-lgpl-docs")] - { - let docs = include_str!("../docs/gstreamer-check/docs.md"); - let mut infos = stripper_lib::parse_cmts(docs.lines(), true); - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), - &ignores, - false, - ); + extern crate lgpl_docs; + const PATH: &str = "src"; + const IGNORES: &[&str] = &[]; + lgpl_docs::purge(PATH, IGNORES); + if cfg!(feature = "embed-lgpl-docs") { + lgpl_docs::embed(lgpl_docs::Library::GstCheck, PATH, IGNORES); } } diff --git a/gstreamer-editing-services/Cargo.toml b/gstreamer-editing-services/Cargo.toml index 61e21944a..63b1c6d67 100644 --- a/gstreamer-editing-services/Cargo.toml +++ b/gstreamer-editing-services/Cargo.toml @@ -27,7 +27,7 @@ gstreamer-base = { path = "../gstreamer-base" } gstreamer-pbutils = { path = "../gstreamer-pbutils" } [build-dependencies] -rustdoc-stripper = { version = "0.1", optional = true } +gstreamer-rs-lgpl-docs = { path = "../docs", optional = true } [features] v1_10 = ["gstreamer/v1_10", "gstreamer-base/v1_10", "gstreamer-pbutils/v1_10", "gstreamer-editing-services-sys/v1_10"] @@ -35,8 +35,8 @@ v1_12 = ["gstreamer/v1_12", "gstreamer-base/v1_12", "gstreamer-pbutils/v1_12", " v1_14 = ["gstreamer/v1_14", "gstreamer-base/v1_14", "gstreamer-pbutils/v1_14", "gstreamer-editing-services-sys/v1_14", "v1_12"] v1_16 = ["gstreamer/v1_16", "gstreamer-base/v1_16", "gstreamer-pbutils/v1_16", "gstreamer-editing-services-sys/v1_16", "v1_14"] v1_18 = ["gstreamer/v1_18", "gstreamer-base/v1_18", "gstreamer-pbutils/v1_18", "gstreamer-editing-services-sys/v1_18", "v1_16"] -embed-lgpl-docs = ["rustdoc-stripper"] -purge-lgpl-docs = ["rustdoc-stripper"] +embed-lgpl-docs = ["gstreamer-rs-lgpl-docs"] +purge-lgpl-docs = ["gstreamer-rs-lgpl-docs"] dox = ["v1_18", "gstreamer-editing-services-sys/dox", "glib/dox", "gstreamer/dox"] [package.metadata.docs.rs] diff --git a/gstreamer-editing-services/build.rs b/gstreamer-editing-services/build.rs index 0151ee936..ef8ae9969 100644 --- a/gstreamer-editing-services/build.rs +++ b/gstreamer-editing-services/build.rs @@ -7,29 +7,12 @@ fn main() { not(all(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")) ))] fn manage_docs() { - extern crate stripper_lib; - use std::io; - - let path = "src"; - let ignores: &[&str] = &[]; - - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), - &ignores, - false, - ); - - #[cfg(feature = "embed-lgpl-docs")] - { - let docs = include_str!("../docs/gstreamer-editing-services/docs.md"); - let mut infos = stripper_lib::parse_cmts(docs.lines(), true); - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), - &ignores, - false, - ); + extern crate lgpl_docs; + const PATH: &str = "src"; + const IGNORES: &[&str] = &[]; + lgpl_docs::purge(PATH, IGNORES); + if cfg!(feature = "embed-lgpl-docs") { + lgpl_docs::embed(lgpl_docs::Library::GES, PATH, IGNORES); } } diff --git a/gstreamer-gl/Cargo.toml b/gstreamer-gl/Cargo.toml index 8d5a0aeab..a4a0e8f02 100644 --- a/gstreamer-gl/Cargo.toml +++ b/gstreamer-gl/Cargo.toml @@ -29,7 +29,7 @@ gstreamer-base = { path = "../gstreamer-base", features = ["v1_14"] } gstreamer-video = { path = "../gstreamer-video", features = ["v1_14"] } [build-dependencies] -rustdoc-stripper = { version = "0.1", optional = true } +gstreamer-rs-lgpl-docs = { path = "../docs", optional = true } [features] default = [] @@ -37,8 +37,8 @@ dox = ["v1_18", "gstreamer-gl-sys/dox", "glib/dox", "gstreamer/dox", "gstreamer- egl = ["gstreamer-gl-sys/egl"] x11 = ["gstreamer-gl-sys/x11"] wayland = ["gstreamer-gl-sys/wayland"] -embed-lgpl-docs = ["rustdoc-stripper"] -purge-lgpl-docs = ["rustdoc-stripper"] +embed-lgpl-docs = ["gstreamer-rs-lgpl-docs"] +purge-lgpl-docs = ["gstreamer-rs-lgpl-docs"] v1_16 = ["gstreamer/v1_16", "gstreamer-base/v1_16", "gstreamer-video/v1_16", "gstreamer-gl-sys/v1_16"] v1_18 = ["gstreamer/v1_18", "gstreamer-base/v1_18", "gstreamer-video/v1_18", "gstreamer-gl-sys/v1_18", "v1_16"] diff --git a/gstreamer-gl/build.rs b/gstreamer-gl/build.rs index a6043d9dc..255210dc5 100644 --- a/gstreamer-gl/build.rs +++ b/gstreamer-gl/build.rs @@ -7,29 +7,12 @@ fn main() { not(all(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")) ))] fn manage_docs() { - extern crate stripper_lib; - use std::io; - - let path = "src"; - let ignores: &[&str] = &[]; - - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), - &ignores, - false, - ); - - #[cfg(feature = "embed-lgpl-docs")] - { - let docs = include_str!("../docs/gstreamer-gl/docs.md"); - let mut infos = stripper_lib::parse_cmts(docs.lines(), true); - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), - &ignores, - false, - ); + extern crate lgpl_docs; + const PATH: &str = "src"; + const IGNORES: &[&str] = &[]; + lgpl_docs::purge(PATH, IGNORES); + if cfg!(feature = "embed-lgpl-docs") { + lgpl_docs::embed(lgpl_docs::Library::GstGL, PATH, IGNORES); } } diff --git a/gstreamer-net/Cargo.toml b/gstreamer-net/Cargo.toml index 79332c0ef..8d42671df 100644 --- a/gstreamer-net/Cargo.toml +++ b/gstreamer-net/Cargo.toml @@ -22,7 +22,7 @@ gstreamer = { path = "../gstreamer" } gio = { git = "https://github.com/gtk-rs/gio" } [build-dependencies] -rustdoc-stripper = { version = "0.1", optional = true } +gstreamer-rs-lgpl-docs = { path = "../docs", optional = true } [features] default = [] @@ -31,8 +31,8 @@ v1_12 = ["gstreamer/v1_12", "gstreamer-net-sys/v1_12", "v1_10"] v1_14 = ["gstreamer/v1_14", "gstreamer-net-sys/v1_14", "v1_12"] v1_16 = ["gstreamer/v1_16", "gstreamer-net-sys/v1_16", "v1_14"] v1_18 = ["gstreamer/v1_18", "gstreamer-net-sys/v1_18", "v1_16"] -embed-lgpl-docs = ["rustdoc-stripper"] -purge-lgpl-docs = ["rustdoc-stripper"] +embed-lgpl-docs = ["gstreamer-rs-lgpl-docs"] +purge-lgpl-docs = ["gstreamer-rs-lgpl-docs"] dox = ["v1_18", "gstreamer-net-sys/dox", "glib/dox", "gstreamer/dox"] [package.metadata.docs.rs] diff --git a/gstreamer-net/build.rs b/gstreamer-net/build.rs index a4266cd57..03b5ad512 100644 --- a/gstreamer-net/build.rs +++ b/gstreamer-net/build.rs @@ -7,29 +7,12 @@ fn main() { not(all(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")) ))] fn manage_docs() { - extern crate stripper_lib; - use std::io; - - let path = "src"; - let ignores: &[&str] = &[]; - - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), - &ignores, - false, - ); - - #[cfg(feature = "embed-lgpl-docs")] - { - let docs = include_str!("../docs/gstreamer-net/docs.md"); - let mut infos = stripper_lib::parse_cmts(docs.lines(), true); - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), - &ignores, - false, - ); + extern crate lgpl_docs; + const PATH: &str = "src"; + const IGNORES: &[&str] = &[]; + lgpl_docs::purge(PATH, IGNORES); + if cfg!(feature = "embed-lgpl-docs") { + lgpl_docs::embed(lgpl_docs::Library::GstNet, PATH, IGNORES); } } diff --git a/gstreamer-pbutils/Cargo.toml b/gstreamer-pbutils/Cargo.toml index cf86ad610..6bb5fa490 100644 --- a/gstreamer-pbutils/Cargo.toml +++ b/gstreamer-pbutils/Cargo.toml @@ -24,7 +24,7 @@ gstreamer = { path = "../gstreamer" } thiserror = "1.0" [build-dependencies] -rustdoc-stripper = { version = "0.1", optional = true } +gstreamer-rs-lgpl-docs = { path = "../docs", optional = true } [features] default = [] @@ -33,8 +33,8 @@ v1_12 = ["gstreamer/v1_12", "gstreamer-pbutils-sys/v1_12", "v1_10"] v1_14 = ["gstreamer/v1_14", "gstreamer-pbutils-sys/v1_14", "v1_12"] v1_16 = ["gstreamer/v1_16", "gstreamer-pbutils-sys/v1_16", "v1_14"] v1_18 = ["gstreamer/v1_18", "gstreamer-pbutils-sys/v1_18", "v1_16"] -embed-lgpl-docs = ["rustdoc-stripper"] -purge-lgpl-docs = ["rustdoc-stripper"] +embed-lgpl-docs = ["gstreamer-rs-lgpl-docs"] +purge-lgpl-docs = ["gstreamer-rs-lgpl-docs"] dox = ["v1_18", "gstreamer-pbutils-sys/dox"] [package.metadata.docs.rs] diff --git a/gstreamer-pbutils/build.rs b/gstreamer-pbutils/build.rs index ed1f28b4c..df7f7ecb1 100644 --- a/gstreamer-pbutils/build.rs +++ b/gstreamer-pbutils/build.rs @@ -7,29 +7,12 @@ fn main() { not(all(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")) ))] fn manage_docs() { - extern crate stripper_lib; - use std::io; - - let path = "src"; - let ignores: &[&str] = &[]; - - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), - &ignores, - false, - ); - - #[cfg(feature = "embed-lgpl-docs")] - { - let docs = include_str!("../docs/gstreamer-pbutils/docs.md"); - let mut infos = stripper_lib::parse_cmts(docs.lines(), true); - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), - &ignores, - false, - ); + extern crate lgpl_docs; + const PATH: &str = "src"; + const IGNORES: &[&str] = &[]; + lgpl_docs::purge(PATH, IGNORES); + if cfg!(feature = "embed-lgpl-docs") { + lgpl_docs::embed(lgpl_docs::Library::GstPbutils, PATH, IGNORES); } } diff --git a/gstreamer-player/Cargo.toml b/gstreamer-player/Cargo.toml index 7a0485e99..6782250ac 100644 --- a/gstreamer-player/Cargo.toml +++ b/gstreamer-player/Cargo.toml @@ -24,15 +24,15 @@ gstreamer = { path = "../gstreamer", features = ["v1_12"] } gstreamer-video = { path = "../gstreamer-video", features = ["v1_12"] } [build-dependencies] -rustdoc-stripper = { version = "0.1", optional = true } +gstreamer-rs-lgpl-docs = { path = "../docs", optional = true } [features] default = [] v1_14 = ["gstreamer/v1_14", "gstreamer-video/v1_14", "gstreamer-player-sys/v1_14"] v1_16 = ["gstreamer/v1_16", "gstreamer-video/v1_16", "gstreamer-player-sys/v1_16", "v1_14"] v1_18 = ["gstreamer/v1_18", "gstreamer-video/v1_18", "gstreamer-player-sys/v1_18", "v1_16"] -embed-lgpl-docs = ["rustdoc-stripper"] -purge-lgpl-docs = ["rustdoc-stripper"] +embed-lgpl-docs = ["gstreamer-rs-lgpl-docs"] +purge-lgpl-docs = ["gstreamer-rs-lgpl-docs"] dox = ["v1_18", "gstreamer-player-sys/dox", "glib/dox", "gstreamer/dox"] [package.metadata.docs.rs] diff --git a/gstreamer-player/build.rs b/gstreamer-player/build.rs index 1977b33d4..052f85dc1 100644 --- a/gstreamer-player/build.rs +++ b/gstreamer-player/build.rs @@ -7,29 +7,12 @@ fn main() { not(all(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")) ))] fn manage_docs() { - extern crate stripper_lib; - use std::io; - - let path = "src"; - let ignores: &[&str] = &[]; - - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), - &ignores, - false, - ); - - #[cfg(feature = "embed-lgpl-docs")] - { - let docs = include_str!("../docs/gstreamer-player/docs.md"); - let mut infos = stripper_lib::parse_cmts(docs.lines(), true); - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), - &ignores, - false, - ); + extern crate lgpl_docs; + const PATH: &str = "src"; + const IGNORES: &[&str] = &[]; + lgpl_docs::purge(PATH, IGNORES); + if cfg!(feature = "embed-lgpl-docs") { + lgpl_docs::embed(lgpl_docs::Library::GstPlayer, PATH, IGNORES); } } diff --git a/gstreamer-rtp/Cargo.toml b/gstreamer-rtp/Cargo.toml index 6dd20288c..d941f4afe 100644 --- a/gstreamer-rtp/Cargo.toml +++ b/gstreamer-rtp/Cargo.toml @@ -22,9 +22,8 @@ gstreamer-rtp-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer- glib = { git = "https://github.com/gtk-rs/glib" } gstreamer = { path = "../gstreamer" } -[build-dependencies.rustdoc-stripper] -version = "0.1" -optional = true +[build-dependencies] +gstreamer-rs-lgpl-docs = { path = "../docs", optional = true } [features] default = [] @@ -33,8 +32,8 @@ v1_12 = ["gstreamer/v1_12", "gstreamer-rtp-sys/v1_12", "v1_10"] v1_14 = ["gstreamer/v1_14", "gstreamer-rtp-sys/v1_14", "v1_12"] v1_16 = ["gstreamer/v1_16", "gstreamer-rtp-sys/v1_16", "v1_14"] v1_18 = ["gstreamer/v1_18", "gstreamer-rtp-sys/v1_18", "v1_16"] -embed-lgpl-docs = ["rustdoc-stripper"] -purge-lgpl-docs = ["rustdoc-stripper"] +embed-lgpl-docs = ["gstreamer-rs-lgpl-docs"] +purge-lgpl-docs = ["gstreamer-rs-lgpl-docs"] dox = ["v1_18", "gstreamer-rtp-sys/dox", "glib/dox", "gstreamer/dox"] [package.metadata.docs.rs] diff --git a/gstreamer-rtp/build.rs b/gstreamer-rtp/build.rs index d60a6e84f..d45ff227f 100644 --- a/gstreamer-rtp/build.rs +++ b/gstreamer-rtp/build.rs @@ -7,29 +7,12 @@ fn main() { not(all(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")) ))] fn manage_docs() { - extern crate stripper_lib; - use std::io; - - let path = "src"; - let ignores: &[&str] = &[]; - - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), - &ignores, - false, - ); - - #[cfg(feature = "embed-lgpl-docs")] - { - let docs = include_str!("../docs/gstreamer-rtp/docs.md"); - let mut infos = stripper_lib::parse_cmts(docs.lines(), true); - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), - &ignores, - false, - ); + extern crate lgpl_docs; + const PATH: &str = "src"; + const IGNORES: &[&str] = &[]; + lgpl_docs::purge(PATH, IGNORES); + if cfg!(feature = "embed-lgpl-docs") { + lgpl_docs::embed(lgpl_docs::Library::GstRtp, PATH, IGNORES); } } diff --git a/gstreamer-rtsp-server/Cargo.toml b/gstreamer-rtsp-server/Cargo.toml index 8cfd4ef37..b677b23e1 100644 --- a/gstreamer-rtsp-server/Cargo.toml +++ b/gstreamer-rtsp-server/Cargo.toml @@ -32,7 +32,7 @@ gstreamer-rtsp = { path = "../gstreamer-rtsp" } gstreamer-net = { path = "../gstreamer-net" } [build-dependencies] -rustdoc-stripper = { version = "0.1", optional = true } +gstreamer-rs-lgpl-docs = { path = "../docs", optional = true } [features] default = [] @@ -41,8 +41,8 @@ v1_12 = ["gstreamer/v1_12", "gstreamer-sdp/v1_12", "gstreamer-rtsp/v1_12", "gstr v1_14 = ["gstreamer/v1_14", "gstreamer-sdp/v1_14", "gstreamer-rtsp/v1_14", "gstreamer-net/v1_14", "gstreamer-rtsp-server-sys/v1_14", "v1_12"] v1_16 = ["gstreamer/v1_16", "gstreamer-sdp/v1_16", "gstreamer-rtsp/v1_16", "gstreamer-net/v1_16", "gstreamer-rtsp-server-sys/v1_16", "v1_14"] v1_18 = ["gstreamer/v1_18", "gstreamer-sdp/v1_18", "gstreamer-rtsp/v1_18", "gstreamer-net/v1_18", "gstreamer-rtsp-server-sys/v1_18", "v1_16"] -embed-lgpl-docs = ["rustdoc-stripper"] -purge-lgpl-docs = ["rustdoc-stripper"] +embed-lgpl-docs = ["gstreamer-rs-lgpl-docs"] +purge-lgpl-docs = ["gstreamer-rs-lgpl-docs"] dox = ["v1_18", "gstreamer-rtsp-server-sys/dox", "glib/dox", "gstreamer/dox"] [package.metadata.docs.rs] diff --git a/gstreamer-rtsp-server/build.rs b/gstreamer-rtsp-server/build.rs index 0de08a739..1f164c057 100644 --- a/gstreamer-rtsp-server/build.rs +++ b/gstreamer-rtsp-server/build.rs @@ -7,29 +7,12 @@ fn main() { not(all(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")) ))] fn manage_docs() { - extern crate stripper_lib; - use std::io; - - let path = "src"; - let ignores: &[&str] = &[]; - - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), - &ignores, - false, - ); - - #[cfg(feature = "embed-lgpl-docs")] - { - let docs = include_str!("../docs/gstreamer-rtsp-server/docs.md"); - let mut infos = stripper_lib::parse_cmts(docs.lines(), true); - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), - &ignores, - false, - ); + extern crate lgpl_docs; + const PATH: &str = "src"; + const IGNORES: &[&str] = &[]; + lgpl_docs::purge(PATH, IGNORES); + if cfg!(feature = "embed-lgpl-docs") { + lgpl_docs::embed(lgpl_docs::Library::GstRtspServer, PATH, IGNORES); } } diff --git a/gstreamer-rtsp/Cargo.toml b/gstreamer-rtsp/Cargo.toml index a50ba2eef..8363aabc6 100644 --- a/gstreamer-rtsp/Cargo.toml +++ b/gstreamer-rtsp/Cargo.toml @@ -27,7 +27,7 @@ gstreamer = { path = "../gstreamer" } gstreamer-sdp = { path = "../gstreamer-sdp" } [build-dependencies] -rustdoc-stripper = { version = "0.1", optional = true } +gstreamer-rs-lgpl-docs = { path = "../docs", optional = true } [features] default = [] @@ -36,8 +36,8 @@ v1_12 = ["gstreamer/v1_12", "gstreamer-sdp/v1_12", "gstreamer-rtsp-sys/v1_12", " v1_14 = ["gstreamer/v1_14", "gstreamer-sdp/v1_14", "gstreamer-rtsp-sys/v1_14", "v1_12"] v1_16 = ["gstreamer/v1_16", "gstreamer-sdp/v1_16", "gstreamer-rtsp-sys/v1_16", "v1_14"] v1_18 = ["gstreamer/v1_18", "gstreamer-sdp/v1_18", "gstreamer-rtsp-sys/v1_18", "v1_16"] -embed-lgpl-docs = ["rustdoc-stripper"] -purge-lgpl-docs = ["rustdoc-stripper"] +embed-lgpl-docs = ["gstreamer-rs-lgpl-docs"] +purge-lgpl-docs = ["gstreamer-rs-lgpl-docs"] dox = ["v1_18", "gstreamer-rtsp-sys/dox", "glib/dox", "gstreamer/dox"] [package.metadata.docs.rs] diff --git a/gstreamer-rtsp/build.rs b/gstreamer-rtsp/build.rs index d8ff11a98..1eaa6c56e 100644 --- a/gstreamer-rtsp/build.rs +++ b/gstreamer-rtsp/build.rs @@ -7,29 +7,12 @@ fn main() { not(all(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")) ))] fn manage_docs() { - extern crate stripper_lib; - use std::io; - - let path = "src"; - let ignores: &[&str] = &[]; - - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), - &ignores, - false, - ); - - #[cfg(feature = "embed-lgpl-docs")] - { - let docs = include_str!("../docs/gstreamer-rtsp/docs.md"); - let mut infos = stripper_lib::parse_cmts(docs.lines(), true); - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), - &ignores, - false, - ); + extern crate lgpl_docs; + const PATH: &str = "src"; + const IGNORES: &[&str] = &[]; + lgpl_docs::purge(PATH, IGNORES); + if cfg!(feature = "embed-lgpl-docs") { + lgpl_docs::embed(lgpl_docs::Library::GstRtsp, PATH, IGNORES); } } diff --git a/gstreamer-sdp/Cargo.toml b/gstreamer-sdp/Cargo.toml index 2623d392c..54c895d53 100644 --- a/gstreamer-sdp/Cargo.toml +++ b/gstreamer-sdp/Cargo.toml @@ -21,7 +21,7 @@ glib = { git = "https://github.com/gtk-rs/glib" } gstreamer = { path = "../gstreamer" } [build-dependencies] -rustdoc-stripper = { version = "0.1", optional = true } +gstreamer-rs-lgpl-docs = { path = "../docs", optional = true } [features] default = [] @@ -31,8 +31,8 @@ v1_12 = ["gstreamer/v1_12", "gstreamer-sdp-sys/v1_12", "v1_10"] v1_14 = ["gstreamer/v1_14", "gstreamer-sdp-sys/v1_14", "v1_12"] v1_16 = ["gstreamer/v1_16", "gstreamer-sdp-sys/v1_16", "v1_14"] v1_18 = ["gstreamer/v1_18", "gstreamer-sdp-sys/v1_18", "v1_16"] -embed-lgpl-docs = ["rustdoc-stripper"] -purge-lgpl-docs = ["rustdoc-stripper"] +embed-lgpl-docs = ["gstreamer-rs-lgpl-docs"] +purge-lgpl-docs = ["gstreamer-rs-lgpl-docs"] dox = ["v1_18", "gstreamer-sdp-sys/dox", "glib/dox", "gstreamer/dox"] [package.metadata.docs.rs] diff --git a/gstreamer-sdp/build.rs b/gstreamer-sdp/build.rs index b77204894..7d96b1cd7 100644 --- a/gstreamer-sdp/build.rs +++ b/gstreamer-sdp/build.rs @@ -7,29 +7,12 @@ fn main() { not(all(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")) ))] fn manage_docs() { - extern crate stripper_lib; - use std::io; - - let path = "src"; - let ignores: &[&str] = &[]; - - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), - &ignores, - false, - ); - - #[cfg(feature = "embed-lgpl-docs")] - { - let docs = include_str!("../docs/gstreamer-sdp/docs.md"); - let mut infos = stripper_lib::parse_cmts(docs.lines(), true); - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), - &ignores, - false, - ); + extern crate lgpl_docs; + const PATH: &str = "src"; + const IGNORES: &[&str] = &[]; + lgpl_docs::purge(PATH, IGNORES); + if cfg!(feature = "embed-lgpl-docs") { + lgpl_docs::embed(lgpl_docs::Library::GstSdp, PATH, IGNORES); } } diff --git a/gstreamer-video/Cargo.toml b/gstreamer-video/Cargo.toml index 5ca5a631f..22910d3ef 100644 --- a/gstreamer-video/Cargo.toml +++ b/gstreamer-video/Cargo.toml @@ -28,7 +28,7 @@ futures-channel = "0.3" futures-util = "0.3" [build-dependencies] -rustdoc-stripper = { version = "0.1", optional = true } +gstreamer-rs-lgpl-docs = { path = "../docs", optional = true } [dev-dependencies] itertools = "0.9" @@ -40,8 +40,8 @@ v1_12 = ["gstreamer/v1_12", "gstreamer-base/v1_12", "gstreamer-video-sys/v1_12", v1_14 = ["gstreamer/v1_14", "gstreamer-base/v1_14", "gstreamer-video-sys/v1_14", "v1_12"] v1_16 = ["gstreamer/v1_16", "gstreamer-base/v1_16", "gstreamer-video-sys/v1_16", "v1_14"] v1_18 = ["gstreamer/v1_18", "gstreamer-base/v1_18", "gstreamer-video-sys/v1_18", "v1_16"] -embed-lgpl-docs = ["rustdoc-stripper"] -purge-lgpl-docs = ["rustdoc-stripper"] +embed-lgpl-docs = ["gstreamer-rs-lgpl-docs"] +purge-lgpl-docs = ["gstreamer-rs-lgpl-docs"] dox = ["v1_18", "gstreamer-video-sys/dox", "glib/dox", "gstreamer/dox"] [package.metadata.docs.rs] diff --git a/gstreamer-video/build.rs b/gstreamer-video/build.rs index 0cec9f2bf..7732a0afa 100644 --- a/gstreamer-video/build.rs +++ b/gstreamer-video/build.rs @@ -7,29 +7,12 @@ fn main() { not(all(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")) ))] fn manage_docs() { - extern crate stripper_lib; - use std::io; - - let path = "src"; - let ignores: &[&str] = &[]; - - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), - &ignores, - false, - ); - - #[cfg(feature = "embed-lgpl-docs")] - { - let docs = include_str!("../docs/gstreamer-video/docs.md"); - let mut infos = stripper_lib::parse_cmts(docs.lines(), true); - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), - &ignores, - false, - ); + extern crate lgpl_docs; + const PATH: &str = "src"; + const IGNORES: &[&str] = &[]; + lgpl_docs::purge(PATH, IGNORES); + if cfg!(feature = "embed-lgpl-docs") { + lgpl_docs::embed(lgpl_docs::Library::GstVideo, PATH, IGNORES); } } diff --git a/gstreamer-webrtc/Cargo.toml b/gstreamer-webrtc/Cargo.toml index f9e8540ff..4c564e071 100644 --- a/gstreamer-webrtc/Cargo.toml +++ b/gstreamer-webrtc/Cargo.toml @@ -23,12 +23,12 @@ gstreamer = { path = "../gstreamer", features = ["v1_14"] } gstreamer-sdp = { path = "../gstreamer-sdp", features = ["v1_14"] } [build-dependencies] -rustdoc-stripper = { version = "0.1", optional = true } +gstreamer-rs-lgpl-docs = { path = "../docs", optional = true } [features] default = [] -embed-lgpl-docs = ["rustdoc-stripper"] -purge-lgpl-docs = ["rustdoc-stripper"] +embed-lgpl-docs = ["gstreamer-rs-lgpl-docs"] +purge-lgpl-docs = ["gstreamer-rs-lgpl-docs"] dox = ["v1_18", "gstreamer-webrtc-sys/dox", "glib/dox", "gstreamer/dox"] v1_16 = ["gstreamer/v1_16", "gstreamer-sdp/v1_16", "gstreamer-webrtc-sys/v1_16"] v1_18 = ["gstreamer/v1_18", "gstreamer-sdp/v1_18", "gstreamer-webrtc-sys/v1_18", "v1_16"] diff --git a/gstreamer-webrtc/build.rs b/gstreamer-webrtc/build.rs index cd0721e72..bfb9a0a52 100644 --- a/gstreamer-webrtc/build.rs +++ b/gstreamer-webrtc/build.rs @@ -7,29 +7,12 @@ fn main() { not(all(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")) ))] fn manage_docs() { - extern crate stripper_lib; - use std::io; - - let path = "src"; - let ignores: &[&str] = &[]; - - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), - &ignores, - false, - ); - - #[cfg(feature = "embed-lgpl-docs")] - { - let docs = include_str!("../docs/gstreamer-webrtc/docs.md"); - let mut infos = stripper_lib::parse_cmts(docs.lines(), true); - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), - &ignores, - false, - ); + extern crate lgpl_docs; + const PATH: &str = "src"; + const IGNORES: &[&str] = &[]; + lgpl_docs::purge(PATH, IGNORES); + if cfg!(feature = "embed-lgpl-docs") { + lgpl_docs::embed(lgpl_docs::Library::GstWebRTC, PATH, IGNORES); } } diff --git a/gstreamer/Cargo.toml b/gstreamer/Cargo.toml index 11e7587d4..7078ce8b8 100644 --- a/gstreamer/Cargo.toml +++ b/gstreamer/Cargo.toml @@ -34,7 +34,7 @@ pretty-hex = "0.1" thiserror = "1" [build-dependencies] -rustdoc-stripper = { version = "0.1", optional = true } +gstreamer-rs-lgpl-docs = { path = "../docs", optional = true } [dev-dependencies] ron = "0.6" @@ -48,8 +48,8 @@ v1_12 = ["gstreamer-sys/v1_12", "v1_10"] v1_14 = ["gstreamer-sys/v1_14", "v1_12"] v1_16 = ["gstreamer-sys/v1_16", "v1_14"] v1_18 = ["gstreamer-sys/v1_18", "v1_16"] -embed-lgpl-docs = ["rustdoc-stripper"] -purge-lgpl-docs = ["rustdoc-stripper"] +embed-lgpl-docs = ["gstreamer-rs-lgpl-docs"] +purge-lgpl-docs = ["gstreamer-rs-lgpl-docs"] dox = ["v1_18", "gstreamer-sys/dox", "glib/dox", "ser_de"] ser_de = ["num-rational/serde", "serde", "serde_bytes", "serde_derive"] diff --git a/gstreamer/build.rs b/gstreamer/build.rs index 234ee5bf8..7ffb608ce 100644 --- a/gstreamer/build.rs +++ b/gstreamer/build.rs @@ -7,29 +7,12 @@ fn main() { not(all(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")) ))] fn manage_docs() { - extern crate stripper_lib; - use std::io; - - let path = "src"; - let ignores: &[&str] = &[]; - - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), - &ignores, - false, - ); - - #[cfg(feature = "embed-lgpl-docs")] - { - let docs = include_str!("../docs/gstreamer/docs.md"); - let mut infos = stripper_lib::parse_cmts(docs.lines(), true); - stripper_lib::loop_over_files( - path.as_ref(), - &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), - &ignores, - false, - ); + extern crate lgpl_docs; + const PATH: &str = "src"; + const IGNORES: &[&str] = &[]; + lgpl_docs::purge(PATH, IGNORES); + if cfg!(feature = "embed-lgpl-docs") { + lgpl_docs::embed(lgpl_docs::Library::Gst, PATH, IGNORES); } }