Move project common code into include

This commit is contained in:
topjohnwu 2023-05-23 21:30:30 -07:00
parent 7087badf87
commit 8e8f01f8b5
10 changed files with 15 additions and 15 deletions

View File

@ -1,5 +1,6 @@
use crate::gen::gen_cxx_binding;
#[path = "../include/gen.rs"]
mod gen;
fn main() {

View File

@ -1,9 +0,0 @@
// We expose constant values as macros so that all constants are literals
// An advantage for doing this is that we can use concat!() on these values
#[macro_export]
macro_rules! LOGFILE {
() => {
"/cache/magisk.log"
};
}

View File

@ -2,13 +2,11 @@
pub use libc;
pub use consts::*;
pub use files::*;
pub use logging::*;
pub use misc::*;
pub use xwrap::*;
mod consts;
mod files;
mod logging;
mod misc;

View File

@ -2,7 +2,7 @@ use protobuf_codegen::Customize;
use crate::gen::gen_cxx_binding;
#[path = "../base/gen.rs"]
#[path = "../include/gen.rs"]
mod gen;
fn main() {

View File

@ -1,6 +1,6 @@
use crate::gen::gen_cxx_binding;
#[path = "../base/gen.rs"]
#[path = "../include/gen.rs"]
mod gen;
fn main() {

View File

@ -1,8 +1,9 @@
pub use base;
use daemon::*;
use logging::*;
use std::ffi::CStr;
#[path = "../include/consts.rs"]
mod consts;
mod daemon;
mod logging;

View File

@ -20,6 +20,7 @@ use base::*;
use crate::daemon::{MagiskD, MAGISKD};
use crate::logging::LogFile::{Actual, Buffer};
use crate::LOGFILE;
#[allow(dead_code, non_camel_case_types)]
#[derive(FromPrimitive, ToPrimitive)]

View File

@ -0,0 +1,8 @@
// Expose constant strings as macros so that we can use concat!() on these values
#[macro_export]
macro_rules! LOGFILE {
() => {
"/cache/magisk.log"
};
}

View File

@ -1,6 +1,6 @@
use crate::gen::gen_cxx_binding;
#[path = "../base/gen.rs"]
#[path = "../include/gen.rs"]
mod gen;
fn main() {