This is a detailed note about how the fdroidserver builds an app based on the Builds
blocks in the metadata.
- NDK is checked. If
ndk
is set, fdroidserver will check if NDK is installed. If not, build will failed directly. - Env variables are set:
ANDROID_HOME
,ANDROID_SDK
andANDROID_SDK_ROOT
are set for Android SDK.JAVA{version}_HOME
is set for Java.ANDROID_NDK
,NDK
andANDROID_NDK_HOME
are set for Android NDK. -
sudo:
is executed. Please note that theRepo
hasn't been cloned so thatsudo
is executed in the root directory of fdroiddata. Variables haven't been replaced yet so that$$xxx$$
s do not work. Aftersudo:
, the sudo binary will be removed. -
Repo
is cloned intobuild/{appID}
and checkout tocommit
. Ifsubmodules:true
then submodules will be initialised, recursively. - Path is changed to
build/{appID}
. Ifsubdir:
is set, the path will change to it. -
init:
is executed. Please note that$$xxx$$
s are not available ininit
. -
patch:
is applied onbuild/{appID}
. -
srclibs:
are cloned and prepared. -
local.properties
files are updated.sdk.dir
andndk.dir
are set. - If
gradle:
is set,build.gradle
/build.gradle.kts
is processed. - Debuggable flags are removed.
-
forceversion:
andforcevercode:
are inserted. - Paths in
rm:
are removed. - Keysigning configs will be removed from build.gradle properties files. Please note this may break the build and needs to be fixed in
prebuild
. -
prebuild:
is executed. - If none of
maven:
,gradle:
,buildozer:
andoutput:
is set,ant
will be used by default andandroid update project
will be executed. Becauseandroid
has been removed from Android SDK, the build will fail. - The
clean
task is performed. - The source code is scanned for common problems. Binaries in
scandelete:
will be removed and inscanignore:
will be ignored. -
build:
is executed. -
buildjni:
is executed. -
maven
/buildozer
/gradle
/ant
is executed. - APK file in output path is picked and checked. Output path is calculated from
build/{appID}/{output path}
. Ifsubdir:
is set,build/{appID}/{subdir}/{output path}