[core] Fix ccache on master build (#435)

This commit is contained in:
LoveSy 2021-03-30 22:58:19 +08:00 committed by GitHub
parent 7f1f5ced93
commit 16982c5a3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 58 additions and 29 deletions

View File

@ -52,9 +52,12 @@ jobs:
key: ccache-cache-${{ github.sha }} key: ccache-cache-${{ github.sha }}
restore-keys: ccache-cache- restore-keys: ccache-cache-
- name: Install ccache - name: Install ccache
run: sudo apt-get install -y ccache run: |
sudo apt-get install -y ccache
ccache -o max_size=2G
ccache -o hash_dir=false
- name: Build with Gradle - name: Build with Gradle
run: | run: |
echo 'org.gradle.caching=true' >> gradle.properties echo 'org.gradle.caching=true' >> gradle.properties
echo 'org.gradle.parallel=true' >> gradle.properties echo 'org.gradle.parallel=true' >> gradle.properties
echo 'org.gradle.vfs.watch=true' >> gradle.properties echo 'org.gradle.vfs.watch=true' >> gradle.properties

2
.gitmodules vendored
View File

@ -9,4 +9,4 @@
url = https://github.com/topjohnwu/libcxx.git url = https://github.com/topjohnwu/libcxx.git
[submodule "core/src/main/cpp/external/Dobby"] [submodule "core/src/main/cpp/external/Dobby"]
path = core/src/main/cpp/external/Dobby path = core/src/main/cpp/external/Dobby
url = https://github.com/jmpews/Dobby.git url = https://github.com/LSPosed/Dobby.git

View File

@ -99,16 +99,20 @@ android {
"-fomit-frame-pointer", "-fomit-frame-pointer",
"-fpie", "-fPIC", "-fpie", "-fPIC",
"-Wno-builtin-macro-redefined", "-Wno-builtin-macro-redefined",
"-D__FILE__=__FILE_NAME__",
"-DRIRU_MODULE", "-DRIRU_MODULE",
"-DRIRU_MODULE_API_VERSION=$moduleMaxRiruApiVersion", "-DRIRU_MODULE_API_VERSION=$moduleMaxRiruApiVersion",
"-DRIRU_MODULE_VERSION=$verCode",
"-D__FILE__=__FILE_NAME__",
"""-DRIRU_MODULE_VERSION_NAME=\"$verName\"""",
"""-DMODULE_NAME=\"$riruModuleId\"""" """-DMODULE_NAME=\"$riruModuleId\""""
// "-DRIRU_MODULE_VERSION=$verCode", // this will stop ccache from hitting
// """-DRIRU_MODULE_VERSION_NAME=\"$verName\"""",
) )
cppFlags("-std=c++20", *flags) cppFlags("-std=c++20", *flags)
cFlags("-std=c18", *flags) cFlags("-std=c18", *flags)
arguments("-DANDROID_STL=none") arguments(
"-DANDROID_STL=none",
"-DVERSION_CODE=$verCode",
"-DVERSION_NAME=$verName"
)
targets("lspd") targets("lspd")
} }
} }

@ -1 +1 @@
Subproject commit 1e3acde39590f365c1fe489ecbd43f7ee8a5e20d Subproject commit 2da2c218b0ae824b3a0e5ef1474223636f7f32a9

View File

@ -20,10 +20,13 @@
cmake_minimum_required(VERSION 3.4.1) cmake_minimum_required(VERSION 3.4.1)
configure_file(template/config.cpp src/config.cpp)
aux_source_directory(src SRC_LIST) aux_source_directory(src SRC_LIST)
aux_source_directory(src/jni SRC_JNI_LIST) aux_source_directory(src/jni SRC_JNI_LIST)
include_directories(include src) include_directories(include src)
add_executable(lspd ${SRC_LIST} ${SRC_JNI_LIST})
add_executable(lspd ${SRC_LIST} ${SRC_JNI_LIST} ${CMAKE_CURRENT_BINARY_DIR}/src/config.cpp)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--dynamic-list=${CMAKE_SOURCE_DIR}/dynamic_list") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--dynamic-list=${CMAKE_SOURCE_DIR}/dynamic_list")

View File

@ -58,29 +58,32 @@ namespace lspd {
# define LP_SELECT(lp32, lp64) lp32 # define LP_SELECT(lp32, lp64) lp32
#endif #endif
static constexpr auto kEntryClassName = "org.lsposed.lspd.core.Main"_tstr; inline static constexpr auto kEntryClassName = "org.lsposed.lspd.core.Main"_tstr;
static constexpr auto kClassLinkerClassName = "org.lsposed.lspd.nativebridge.ClassLinker"_tstr; inline static constexpr auto kClassLinkerClassName = "org.lsposed.lspd.nativebridge.ClassLinker"_tstr;
static constexpr auto kBridgeServiceClassName = "org.lsposed.lspd.service.BridgeService"_tstr; inline static constexpr auto kBridgeServiceClassName = "org.lsposed.lspd.service.BridgeService"_tstr;
static constexpr auto kDexPath = "framework/lspd.dex"_tstr; inline static constexpr auto kDexPath = "framework/lspd.dex"_tstr;
static constexpr auto kLibArtName = "libart.so"_tstr; inline static constexpr auto kLibArtName = "libart.so"_tstr;
static constexpr auto kLibFwName = "libandroidfw.so"_tstr; inline static constexpr auto kLibFwName = "libandroidfw.so"_tstr;
static constexpr auto kLinkerName = LP_SELECT("linker"_tstr, "linker64"_tstr); inline static constexpr auto kLinkerName = LP_SELECT("linker"_tstr, "linker64"_tstr);
static constexpr auto kLibcName = "libc.so"_tstr; inline static constexpr auto kLibcName = "libc.so"_tstr;
static constexpr auto kLibbaseName = "libbase.so"_tstr; inline static constexpr auto kLibbaseName = "libbase.so"_tstr;
static constexpr auto kLibBasePath = inline static constexpr auto kLibBasePath =
LP_SELECT("/system/lib/"_tstr, LP_SELECT("/system/lib/"_tstr,
"/system/lib64/"_tstr); "/system/lib64/"_tstr);
static constexpr auto kBinBasePath = "/system/bin/"_tstr; inline static constexpr auto kBinBasePath = "/system/bin/"_tstr;
static constexpr auto kLibFwPath = kLibBasePath + kLibFwName; inline static constexpr auto kLibFwPath = kLibBasePath + kLibFwName;
static constexpr auto kLinkerPath = kBinBasePath + kLinkerName; inline static constexpr auto kLinkerPath = kBinBasePath + kLinkerName;
static constexpr auto kLibcPath = kLibBasePath + kLibcName; inline static constexpr auto kLibcPath = kLibBasePath + kLibcName;
static constexpr auto kLibbasePath = kLibBasePath + kLibbaseName; inline static constexpr auto kLibbasePath = kLibBasePath + kLibbaseName;
inline constexpr const char *const BoolToString(bool b) { inline constexpr const char *BoolToString(bool b) {
return b ? "true" : "false"; return b ? "true" : "false";
} }
extern const int versionCode;
extern const char* const versionName;
} }

View File

@ -36,7 +36,7 @@ namespace lspd {
void onModuleLoaded() { void onModuleLoaded() {
LOGI("onModuleLoaded: welcome to LSPosed!"); LOGI("onModuleLoaded: welcome to LSPosed!");
LOGI("onModuleLoaded: version %s (%d)", RIRU_MODULE_VERSION_NAME, RIRU_MODULE_VERSION); LOGI("onModuleLoaded: version %s (%d)", versionName, versionCode);
// rirud must be used in onModuleLoaded // rirud must be used in onModuleLoaded
Context::GetInstance()->PreLoadDex(magiskPath + '/' + kDexPath); Context::GetInstance()->PreLoadDex(magiskPath + '/' + kDexPath);
InitSymbolCache(); InitSymbolCache();
@ -99,8 +99,8 @@ namespace lspd {
.moduleApiVersion = RIRU_MODULE_API_VERSION, .moduleApiVersion = RIRU_MODULE_API_VERSION,
.moduleInfo = RiruModuleInfo{ .moduleInfo = RiruModuleInfo{
.supportHide = !isDebug, .supportHide = !isDebug,
.version = RIRU_MODULE_VERSION, .version = versionCode,
.versionName = RIRU_MODULE_VERSION_NAME, .versionName = versionName,
.onModuleLoaded = lspd::onModuleLoaded, .onModuleLoaded = lspd::onModuleLoaded,
.forkAndSpecializePre = lspd::nativeForkAndSpecializePre, .forkAndSpecializePre = lspd::nativeForkAndSpecializePre,
.forkAndSpecializePost = lspd::nativeForkAndSpecializePost, .forkAndSpecializePost = lspd::nativeForkAndSpecializePost,

View File

@ -0,0 +1,6 @@
#include "config.h"
namespace lspd {
const int versionCode = ${VERSION_CODE};
extern const char* const versionName = "${VERSION_NAME}";
}

View File

@ -1,6 +1,16 @@
rootProject.name = "LSPosed" rootProject.name = "LSPosed"
include(":core", ":hiddenapi-stubs", ":app", ":service", ":interface", ":hiddenapi-bridge", ":manager-service") include(
":core",
":hiddenapi-stubs",
":app",
":service",
":interface",
":hiddenapi-bridge",
":manager-service"
)
val serviceRoot = "service" val serviceRoot = "service"
project(":interface").projectDir = file("$serviceRoot${File.separator}interface") project(":interface").projectDir = file("$serviceRoot${File.separator}interface")
project(":service").projectDir = file("$serviceRoot${File.separator}service") project(":service").projectDir = file("$serviceRoot${File.separator}service")
buildCache { local { removeUnusedEntriesAfterDays = 1 } }