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; use crate::gen::gen_cxx_binding;
#[path = "../include/gen.rs"]
mod gen; mod gen;
fn main() { 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 libc;
pub use consts::*;
pub use files::*; pub use files::*;
pub use logging::*; pub use logging::*;
pub use misc::*; pub use misc::*;
pub use xwrap::*; pub use xwrap::*;
mod consts;
mod files; mod files;
mod logging; mod logging;
mod misc; mod misc;

View File

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

View File

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

View File

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

View File

@ -20,6 +20,7 @@ use base::*;
use crate::daemon::{MagiskD, MAGISKD}; use crate::daemon::{MagiskD, MAGISKD};
use crate::logging::LogFile::{Actual, Buffer}; use crate::logging::LogFile::{Actual, Buffer};
use crate::LOGFILE;
#[allow(dead_code, non_camel_case_types)] #[allow(dead_code, non_camel_case_types)]
#[derive(FromPrimitive, ToPrimitive)] #[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; use crate::gen::gen_cxx_binding;
#[path = "../base/gen.rs"] #[path = "../include/gen.rs"]
mod gen; mod gen;
fn main() { fn main() {