2024-09-05 16:57:52 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, jdk
|
|
|
|
, gradle
|
|
|
|
, mavenRepo
|
|
|
|
, androidSdk
|
2024-09-18 15:05:28 +02:00
|
|
|
, aapt2
|
2024-09-05 16:57:52 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "built-with-gradle";
|
2024-09-18 15:05:28 +02:00
|
|
|
version = "1.0";
|
2024-09-05 16:57:52 +02:00
|
|
|
|
|
|
|
src = ../android;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ gradle ];
|
|
|
|
|
|
|
|
JDK_HOME = "${jdk.home}";
|
|
|
|
ANDROID_SDK_ROOT = "${androidSdk}/share/android-sdk";
|
|
|
|
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
2024-09-18 15:05:28 +02:00
|
|
|
gradle build -x :app:lintAnalyzeDebug -x :app:lintReportDebug -x :app:lintDebug -x:app:lintVitalAnalyzeRelease \
|
2024-09-05 16:57:52 +02:00
|
|
|
--offline --no-daemon --no-build-cache --info --full-stacktrace \
|
|
|
|
--warning-mode=all --parallel \
|
|
|
|
-PnixMavenRepo=${mavenRepo} \
|
2024-09-18 15:05:28 +02:00
|
|
|
-Dorg.gradle.project.android.aapt2FromMavenOverride=${aapt2}/bin/aapt2
|
2024-09-05 16:57:52 +02:00
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r app/build/outputs/* $out
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
}
|