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
e4f3fb36
Commit
e4f3fb36
authored
Apr 19, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update build scripts
parent
b2f87928
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
22 deletions
+19
-22
build.cmd
build.cmd
+6
-12
build.sh
build.sh
+13
-10
No files found.
build.cmd
View file @
e4f3fb36
...
@@ -31,16 +31,6 @@ EXIT /B %ERRORLEVEL%
...
@@ -31,16 +31,6 @@ EXIT /B %ERRORLEVEL%
:all
:all
SET OK=y
SET OK=y
IF [%~1] == [] (
CALL :error "Missing version info"
CALL :usage
EXIT /B %ERRORLEVEL%
)
IF [%~2] == [] (
CALL :error "Missing version info"
CALL :usage
EXIT /B %ERRORLEVEL%
)
CALL :build "%~1" "%~2"
CALL :build "%~1" "%~2"
CALL :zip "%~1"
CALL :zip "%~1"
EXIT /B %ERRORLEVEL%
EXIT /B %ERRORLEVEL%
...
@@ -48,7 +38,7 @@ EXIT /B %ERRORLEVEL%
...
@@ -48,7 +38,7 @@ EXIT /B %ERRORLEVEL%
:debug
:debug
SET OK=y
SET OK=y
SET DEBUG=-DDEBUG
SET DEBUG=-DDEBUG
CALL :build "
VER_DEBUG" "99999
"
CALL :build "
%~1" "%~2
"
EXIT /B %ERRORLEVEL%
EXIT /B %ERRORLEVEL%
:build
:build
...
@@ -63,8 +53,12 @@ EXIT /B %ERRORLEVEL%
...
@@ -63,8 +53,12 @@ EXIT /B %ERRORLEVEL%
CALL :usage
CALL :usage
EXIT /B %ERRORLEVEL%
EXIT /B %ERRORLEVEL%
)
)
SET BUILD=Build
IF NOT [%DEBUG%] == [] (
SET BUILD=Debug
)
ECHO ************************
ECHO ************************
ECHO *
Building
: VERSION=%~1 CODE=%~2
ECHO *
%BUILD%
: VERSION=%~1 CODE=%~2
ECHO ************************
ECHO ************************
FOR /F "tokens=* USEBACKQ" %%F IN (`where ndk-build`) DO (
FOR /F "tokens=* USEBACKQ" %%F IN (`where ndk-build`) DO (
IF [%%F] == [] (
IF [%%F] == [] (
...
...
build.sh
View file @
e4f3fb36
#!/bin/bash
#!/bin/bash
usage
()
{
usage
()
{
echo
"
$
0
all <version name> <version code>"
echo
"
$
ME
all <version name> <version code>"
echo
-e
"
\t
Build binaries, zip, and sign Magisk"
echo
-e
"
\t
Build binaries, zip, and sign Magisk"
echo
-e
"
\t
This is equlivant to first <build>, then <zip>"
echo
-e
"
\t
This is equlivant to first <build>, then <zip>"
echo
"
$
0
clean"
echo
"
$
ME
clean"
echo
-e
"
\t
Cleanup compiled / generated files"
echo
-e
"
\t
Cleanup compiled / generated files"
echo
"
$
0
build <verison name> <version code>"
echo
"
$
ME
build <verison name> <version code>"
echo
-e
"
\t
Build the binaries with ndk"
echo
-e
"
\t
Build the binaries with ndk"
echo
"
$
0
debug
"
echo
"
$
ME
debug <verison name> <version code>
"
echo
-e
"
\t
Build the binaries with the debug flag on
\n\t
Call <zip> afterwards if you want to flash on device"
echo
-e
"
\t
Build the binaries with the debug flag on
\n\t
Call <zip> afterwards if you want to flash on device"
echo
"
$
0
zip <version name>"
echo
"
$
ME
zip <version name>"
echo
-e
"
\t
Zip and sign Magisk"
echo
-e
"
\t
Zip and sign Magisk"
echo
"
$
0
uninstaller"
echo
"
$
ME
uninstaller"
echo
-e
"
\t
Zip and sign the uninstaller"
echo
-e
"
\t
Zip and sign the uninstaller"
exit
1
exit
1
}
}
...
@@ -49,8 +49,11 @@ error() {
...
@@ -49,8 +49,11 @@ error() {
}
}
build_bin
()
{
build_bin
()
{
[
-z
"
$1
"
-o
-z
"
$2
"
]
&&
echo
-e
"! Missing version info
\n
"
&&
usage
BUILD
=
"Build"
[
-z
"DEBUG"
]
||
BUILD
=
"Debug"
echo
"************************"
echo
"************************"
echo
"*
Building
: VERSION=
$1
CODE=
$2
"
echo
"*
$BUILD
: VERSION=
$1
CODE=
$2
"
echo
"************************"
echo
"************************"
[
-z
`
which ndk-build
`
]
&&
error
"Please add ndk-build to PATH!"
[
-z
`
which ndk-build
`
]
&&
error
"Please add ndk-build to PATH!"
ndk-build
APP_CFLAGS
=
"-DMAGISK_VERSION=
$1
-DMAGISK_VER_CODE=
$2
$DEBUG
"
-j
${
CPUNUM
}
||
error
"Magisk binary tools build failed...."
ndk-build
APP_CFLAGS
=
"-DMAGISK_VERSION=
$1
-DMAGISK_VER_CODE=
$2
$DEBUG
"
-j
${
CPUNUM
}
||
error
"Magisk binary tools build failed...."
...
@@ -72,6 +75,7 @@ build_bin() {
...
@@ -72,6 +75,7 @@ build_bin() {
}
}
zip_package
()
{
zip_package
()
{
[
-z
"
$1
"
]
&&
echo
-e
"! Missing version info
\n
"
&&
usage
[
!
-f
"zip_static/arm/magiskboot"
]
&&
error
"Missing binaries!! Please run '
$0
build' before zipping"
[
!
-f
"zip_static/arm/magiskboot"
]
&&
error
"Missing binaries!! Please run '
$0
build' before zipping"
echo
"************************"
echo
"************************"
echo
"* Adding version info"
echo
"* Adding version info"
...
@@ -154,10 +158,10 @@ DIR="$(cd "$(dirname "$0")"; pwd)"
...
@@ -154,10 +158,10 @@ DIR="$(cd "$(dirname "$0")"; pwd)"
cd
"
$DIR
"
cd
"
$DIR
"
DEBUG
=
DEBUG
=
CPUNUM
=
`
getconf _NPROCESSORS_ONLN
`
CPUNUM
=
`
getconf _NPROCESSORS_ONLN
`
ME
=
$0
case
$1
in
case
$1
in
"all"
)
"all"
)
[
-z
"
$2
"
-o
-z
"
$3
"
]
&&
echo
-e
"! Missing version info
\n
"
&&
usage
build_bin
$2
$3
build_bin
$2
$3
zip_package
$2
zip_package
$2
;;
;;
...
@@ -165,12 +169,11 @@ case $1 in
...
@@ -165,12 +169,11 @@ case $1 in
cleanup
cleanup
;;
;;
"build"
)
"build"
)
[
-z
"
$2
"
-o
-z
"
$3
"
]
&&
echo
-e
"! Missing version info
\n
"
&&
usage
build_bin
$2
$3
build_bin
$2
$3
;;
;;
"debug"
)
"debug"
)
DEBUG
=
"-DDEBUG"
DEBUG
=
"-DDEBUG"
build_bin
"VER_DEBUG"
"99999"
build_bin
$2
$3
;;
;;
"zip"
)
"zip"
)
[
-z
"
$2
"
]
&&
echo
-e
"! Missing version info
\n
"
&&
usage
[
-z
"
$2
"
]
&&
echo
-e
"! Missing version info
\n
"
&&
usage
...
...
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