Skip to content

Commit

Permalink
Generate the icon const table using build.rs
Browse files Browse the repository at this point in the history
Close #392
  • Loading branch information
liuchengxu committed Mar 6, 2021
1 parent 995b814 commit 43b32dd
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 193 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions crates/icon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ icon is a tool for drawing an icon according to the path name for vim-clap.
structopt = "0.3"

pattern = { path = "../pattern" }

[build-dependencies]
serde_json = "1.0"
itertools = "0.10"
190 changes: 0 additions & 190 deletions crates/icon/src/constants.rs

This file was deleted.

7 changes: 4 additions & 3 deletions crates/icon/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mod constants;

pub use constants::*;
include!(concat!(env!("OUT_DIR"), "/constants.rs"));
// Now we do not need to genetate the constants module using the Python script.
// mod constants;
// pub use constants::*;

use std::path::Path;

Expand Down
2 changes: 2 additions & 0 deletions crates/icon/update_constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# This script is now depreated due to icon/build.rs.
#
# Whenever you change exactmatch_map.json or extension_map.json,
# rerun this script to regenerate src/constants.rs:
# ./update_constants.py
Expand Down
11 changes: 11 additions & 0 deletions pythonx/clap/fuzzymatch-rs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 43b32dd

Please sign in to comment.