Skip to content

Commit 1ec93f7

Browse files
committed
remove build.rs, use CARGO_MANIFEST_DIR env directly
1 parent 815ee0f commit 1ec93f7

File tree

2 files changed

+6
-27
lines changed

2 files changed

+6
-27
lines changed

build.rs

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/compile.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ use crate::types::{Command, Event, Parameter, Protocol, TypeElement, TypeEnum};
77
use proc_macro2::{Ident, Span, TokenStream};
88
use quote::quote;
99

10-
#[cfg(feature = "offline")]
11-
include!(concat!(env!("OUT_DIR"), "/path.rs"));
12-
1310
pub trait StringUtils {
1411
fn first_uppercase(&mut self);
1512
fn first_uppercased(self) -> Self;
@@ -1268,7 +1265,12 @@ pub fn get_events(
12681265
pub fn check_json(file_name: &str, commit: &str) -> Protocol {
12691266
#[cfg(feature = "offline")]
12701267
if cfg!(feature = "offline") {
1271-
let path = Path::new(MANIFEST_DIR).join("json").join(file_name);
1268+
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
1269+
1270+
#[cfg(target_os = "windows")]
1271+
let manifest_dir = manifest_dir.replace(r#"\"#,r#"\\"#);
1272+
1273+
let path = Path::new(&manifest_dir).join("json").join(file_name);
12721274

12731275
let json = std::fs::read_to_string(path).unwrap();
12741276

0 commit comments

Comments
 (0)