Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate code generation to cargo xtask workflow #535

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[alias]
xtask = "run --package xtask --"
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ jobs:
run: |
rustup set profile minimal
rustup override set ${{ matrix.version }}
rustup component add rustfmt

- name: Init submodules
run: git submodule update --init

- name: Codegen checks
run: cargo xtask codegen --check

- name: Cargo bench
run: cargo bench --all
env:
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ members = [
"markup5ever",
"html5ever",
"rcdom",
"xml5ever"
"xml5ever",
"xtask",
]
resolver = "2"
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ git submodule update --init

Run `cargo doc` in the repository root to build local documentation under `target/doc/`.

### Code generation

Some of the components of this repository are generated through automatic
processes. `cargo xtask codegen` runs all generation tasks. Generate code is
commited to the git repository.

In particular, `cargo xtask codegen` generates:

1. `markup5ever/generated.rs` and `markup5ever/data/named_entities.rs`.

2. `html5ever/src/generated.rs`

## Details

Expand Down
6 changes: 0 additions & 6 deletions html5ever/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/servo/html5ever"
description = "High-performance browser-grade HTML5 parser"
documentation = "https://docs.rs/html5ever"
build = "build.rs"
categories = [ "parser-implementations", "web-programming" ]
edition = "2021"

Expand All @@ -23,11 +22,6 @@ markup5ever = { version = "0.12", path = "../markup5ever" }
criterion = "0.5"
typed-arena = "2.0.2"

[build-dependencies]
quote = "1"
syn = { version = "2", features = ["extra-traits", "full", "fold"] }
proc-macro2 = "1"

[[bench]]
name = "html5ever"
harness = false
39 changes: 0 additions & 39 deletions html5ever/build.rs

This file was deleted.

Loading