Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
fd8dbe3e
Commit
fd8dbe3e
authored
Dec 04, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Greatly reduce Gradle sync time and frequency
parent
bb97cc59
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
6 deletions
+9
-6
build.py
build.py
+4
-3
build.gradle
core/build.gradle
+1
-1
Android.mk
core/jni/Android.mk
+3
-1
magisk.c
core/jni/core/magisk.c
+1
-1
No files found.
build.py
View file @
fd8dbe3e
...
@@ -88,8 +88,8 @@ def build_all(args):
...
@@ -88,8 +88,8 @@ def build_all(args):
def
build_binary
(
args
):
def
build_binary
(
args
):
header
(
'* Building Magisk binaries'
)
header
(
'* Building Magisk binaries'
)
# Force update
Android.mk
timestamp to trigger recompilation
# Force update
logging.h
timestamp to trigger recompilation
os
.
utime
(
os
.
path
.
join
(
'core'
,
'jni'
,
'
Android.mk
'
))
os
.
utime
(
os
.
path
.
join
(
'core'
,
'jni'
,
'
include'
,
'logging.h
'
))
debug_flag
=
''
if
args
.
release
else
'-DMAGISK_DEBUG'
debug_flag
=
''
if
args
.
release
else
'-DMAGISK_DEBUG'
cflag
=
'MAGISK_FLAGS=
\"
-DMAGISK_VERSION=
\\\"
{}
\\\"
-DMAGISK_VER_CODE={} {}
\"
'
.
format
(
args
.
versionString
,
args
.
versionCode
,
debug_flag
)
cflag
=
'MAGISK_FLAGS=
\"
-DMAGISK_VERSION=
\\\"
{}
\\\"
-DMAGISK_VER_CODE={} {}
\"
'
.
format
(
args
.
versionString
,
args
.
versionCode
,
debug_flag
)
...
@@ -385,7 +385,8 @@ def cleanup(args):
...
@@ -385,7 +385,8 @@ def cleanup(args):
if
'binary'
in
args
.
target
:
if
'binary'
in
args
.
target
:
header
(
'* Cleaning binaries'
)
header
(
'* Cleaning binaries'
)
subprocess
.
run
(
ndk_build
+
' -C core COMPILEALL=true clean'
,
shell
=
True
)
subprocess
.
run
(
ndk_build
+
' -C core PRECOMPILE=true clean'
,
shell
=
True
)
subprocess
.
run
(
ndk_build
+
' -C core clean'
,
shell
=
True
)
for
arch
in
[
'arm64-v8a'
,
'armeabi-v7a'
,
'x86'
,
'x86_64'
]:
for
arch
in
[
'arm64-v8a'
,
'armeabi-v7a'
,
'x86'
,
'x86_64'
]:
shutil
.
rmtree
(
os
.
path
.
join
(
'out'
,
arch
),
ignore_errors
=
True
)
shutil
.
rmtree
(
os
.
path
.
join
(
'out'
,
arch
),
ignore_errors
=
True
)
...
...
core/build.gradle
View file @
fd8dbe3e
...
@@ -13,7 +13,7 @@ android {
...
@@ -13,7 +13,7 @@ android {
externalNativeBuild
{
externalNativeBuild
{
ndkBuild
{
ndkBuild
{
// Passes an optional argument to ndk-build.
// Passes an optional argument to ndk-build.
arguments
"
COMPILEALL
=true"
arguments
"
GRADLE
=true"
}
}
}
}
}
}
...
...
core/jni/Android.mk
View file @
fd8dbe3e
...
@@ -14,7 +14,7 @@ LIBFDT := $(EXT_PATH)/dtc/libfdt
...
@@ -14,7 +14,7 @@ LIBFDT := $(EXT_PATH)/dtc/libfdt
# Binaries
# Binaries
########################
########################
ifneq "$(or $(PRECOMPILE), $(
COMPILEALL
))" ""
ifneq "$(or $(PRECOMPILE), $(
GRADLE
))" ""
# magisk main binary
# magisk main binary
include $(CLEAR_VARS)
include $(CLEAR_VARS)
...
@@ -115,6 +115,7 @@ LOCAL_LDLIBS := -lz
...
@@ -115,6 +115,7 @@ LOCAL_LDLIBS := -lz
include $(BUILD_EXECUTABLE)
include $(BUILD_EXECUTABLE)
# 32-bit static binaries
# 32-bit static binaries
ifndef GRADLE # Do not run gradle sync on these binaries
ifneq ($(TARGET_ARCH_ABI), x86_64)
ifneq ($(TARGET_ARCH_ABI), x86_64)
ifneq ($(TARGET_ARCH_ABI), arm64-v8a)
ifneq ($(TARGET_ARCH_ABI), arm64-v8a)
# b64xz
# b64xz
...
@@ -129,6 +130,7 @@ include $(BUILD_EXECUTABLE)
...
@@ -129,6 +130,7 @@ include $(BUILD_EXECUTABLE)
include jni/external/busybox/Android.mk
include jni/external/busybox/Android.mk
endif
endif
endif
endif
endif
# Precompile
# Precompile
endif
endif
...
...
core/jni/core/magisk.c
View file @
fd8dbe3e
...
@@ -40,7 +40,7 @@ static void usage() {
...
@@ -40,7 +40,7 @@ static void usage() {
" -c print current binary version
\n
"
" -c print current binary version
\n
"
" -v print running daemon version
\n
"
" -v print running daemon version
\n
"
" -V print running daemon version code
\n
"
" -V print running daemon version code
\n
"
" --list list all avail
i
ble applets
\n
"
" --list list all avail
a
ble applets
\n
"
" --install [SOURCE] DIR symlink all applets to DIR. SOURCE is optional
\n
"
" --install [SOURCE] DIR symlink all applets to DIR. SOURCE is optional
\n
"
" --createimg IMG SIZE create ext4 image. SIZE is interpreted in MB
\n
"
" --createimg IMG SIZE create ext4 image. SIZE is interpreted in MB
\n
"
" --imgsize IMG report ext4 image used/total size
\n
"
" --imgsize IMG report ext4 image used/total size
\n
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment