aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-12-13 12:57:14 +0400
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-12-13 12:57:14 +0400
commitff5f81498ba1807ab06ffb5dadb1c99c102e0284 (patch)
tree4c19b6daaac3b4857022f724005095474ed35b45
parent60410a42e46d97e3581493c9d185184b7fd87bb5 (diff)
downloadmarkdown-rs-ff5f81498ba1807ab06ffb5dadb1c99c102e0284.tar.gz
markdown-rs-ff5f81498ba1807ab06ffb5dadb1c99c102e0284.tar.bz2
markdown-rs-ff5f81498ba1807ab06ffb5dadb1c99c102e0284.zip
Replace build script with private crate
Closes GH-34. Closes GH-35.
Diffstat (limited to '')
-rw-r--r--.github/workflows/main.yml2
-rw-r--r--Cargo.toml7
-rw-r--r--generate/Cargo.toml11
-rw-r--r--generate/src/main.rs (renamed from build.rs)10
-rw-r--r--readme.md4
-rw-r--r--src/util/unicode.rs2
-rw-r--r--tests/commonmark.rs2
7 files changed, 29 insertions, 9 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index a38c5c5..c439044 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -11,6 +11,7 @@ jobs:
with:
toolchain: stable
components: rustfmt, clippy
+ - run: cargo run --manifest-path generate/Cargo.toml
- run: cargo fmt --check && cargo clippy --examples --tests --benches
- run: cargo test
coverage:
@@ -20,5 +21,6 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
+ - run: cargo run --manifest-path generate/Cargo.toml
- run: cargo install cargo-tarpaulin && cargo tarpaulin --out Xml
- uses: codecov/codecov-action@v3
diff --git a/Cargo.toml b/Cargo.toml
index cd80209..bd27a80 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,7 +21,6 @@ harness = false
log = "0.4"
unicode-id = { version = "0.3", features = ["no_std"] }
-
[dev-dependencies]
env_logger = "0.10"
criterion = "0.4"
@@ -33,7 +32,5 @@ swc_core = { version = "0.43.30", features = [
"common",
] }
-[build-dependencies]
-regex = "1"
-reqwest = "0.11"
-tokio = { version = "1", features = ["full"] }
+[workspace]
+members = ["generate"]
diff --git a/generate/Cargo.toml b/generate/Cargo.toml
new file mode 100644
index 0000000..7a2cf63
--- /dev/null
+++ b/generate/Cargo.toml
@@ -0,0 +1,11 @@
+[package]
+name = "markdown-generate"
+version = "0.0.0"
+authors = ["Titus Wormer <tituswormer@gmail.com>"]
+edition = "2018"
+publish = false
+
+[dependencies]
+regex = "1"
+reqwest = "0.11"
+tokio = { version = "1", features = ["full"] }
diff --git a/build.rs b/generate/src/main.rs
index 658cb0a..9f0d14b 100644
--- a/build.rs
+++ b/generate/src/main.rs
@@ -1,3 +1,9 @@
+// To regenerate, run the following from the repository root:
+//
+// ```sh
+// cargo run --manifest-path generate/Cargo.toml
+// ```
+
use regex::Regex;
use std::fs;
@@ -63,7 +69,7 @@ async fn commonmark() {
let doc = format!(
"//! `CommonMark` test suite.
-// > 👉 **Important**: this module is generated by `build.rs`.
+// > 👉 **Important**: this module is generated by `generate/src/main.rs`.
// > It is generate from the latest CommonMark website.
use markdown::{{to_html_with_options, CompileOptions, Options}};
@@ -130,7 +136,7 @@ async fn punctuation() {
/// List of characters that are considered punctuation.
///
-/// > 👉 **Important**: this module is generated by `build.rs`.
+/// > 👉 **Important**: this module is generated by `generate/src/main.rs`.
/// > It is generate from the latest Unicode data.
///
/// Rust does not contain an `is_punctuation` method on `char`, while it does
diff --git a/readme.md b/readme.md
index 7f39fdf..55091ea 100644
--- a/readme.md
+++ b/readme.md
@@ -241,6 +241,10 @@ Fuzz testing is used to check for things that might fall through coverage.
The following bash scripts are useful when working on this project:
+* generate code (latest CM tests and Unicode info):
+ ```sh
+ cargo run --manifest-path generate/Cargo.toml
+ ```
* run examples:
```sh
RUST_BACKTRACE=1 RUST_LOG=debug cargo run --example lib
diff --git a/src/util/unicode.rs b/src/util/unicode.rs
index 15004c7..a8da957 100644
--- a/src/util/unicode.rs
+++ b/src/util/unicode.rs
@@ -2,7 +2,7 @@
/// List of characters that are considered punctuation.
///
-/// > 👉 **Important**: this module is generated by `build.rs`.
+/// > 👉 **Important**: this module is generated by `generate/src/main.rs`.
/// > It is generate from the latest Unicode data.
///
/// Rust does not contain an `is_punctuation` method on `char`, while it does
diff --git a/tests/commonmark.rs b/tests/commonmark.rs
index 30f62ca..9dbc417 100644
--- a/tests/commonmark.rs
+++ b/tests/commonmark.rs
@@ -1,6 +1,6 @@
//! `CommonMark` test suite.
-// > 👉 **Important**: this module is generated by `build.rs`.
+// > 👉 **Important**: this module is generated by `generate/src/main.rs`.
// > It is generate from the latest CommonMark website.
use markdown::{to_html_with_options, CompileOptions, Options};