Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: Generate StyleDisplay using cbindgen.
We use the same setup WR uses, which is checking-in the files. But I think it's much better than keeping the two things in sync manually :) When you add a new value, you need to add it to the rust source, then run the command, but since it doesn't need to build the style crate (it uses the Rust AST, doesn't build) there's no problem. Differential Revision: https://phabricator.services.mozilla.com/D2354
- Loading branch information
Showing
3 changed files
with
63 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
header = """/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */""" | ||
autogen_warning = """/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen. | ||
* To generate this file: | ||
* 1. Get the latest cbindgen using `cargo install --force cbindgen` | ||
* a. Alternatively, you can clone `https://github.com/eqrion/cbindgen` and use a tagged release | ||
* 2. Run `rustup run nightly cbindgen toolkit/library/rust/ --lockfile Cargo.lock --crate style -o layout/style/ServoStyleConsts.h` | ||
*/""" | ||
include_version = true | ||
braces = "SameLine" | ||
line_length = 80 | ||
tab_width = 2 | ||
language = "C++" | ||
namespaces = ["mozilla"] | ||
|
||
[struct] | ||
derive_eq = true | ||
|
||
[enum] | ||
derive_helper_methods = true | ||
|
||
[export] | ||
prefix = "Style" | ||
include = ["StyleDisplay"] | ||
item_types = ["enums"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters