wifisetup/nix/build.nix

41 lines
849 B
Nix
Raw Permalink Normal View History

{ lib
, stdenv
, jdk
, gradle
, mavenRepo
, androidSdk
2024-09-18 15:05:28 +02:00
, aapt2
}:
stdenv.mkDerivation {
pname = "built-with-gradle";
2024-09-18 15:05:28 +02:00
version = "1.0";
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 \
--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
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r app/build/outputs/* $out
runHook postInstall
'';
dontStrip = true;
}