wifisetup/nix/build.nix

40 lines
849 B
Nix

{ lib
, stdenv
, jdk
, gradle
, mavenRepo
, androidSdk
, aapt2
}:
stdenv.mkDerivation {
pname = "built-with-gradle";
version = "1.0";
src = ../android;
nativeBuildInputs = [ gradle ];
JDK_HOME = "${jdk.home}";
ANDROID_SDK_ROOT = "${androidSdk}/share/android-sdk";
buildPhase = ''
runHook preBuild
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} \
-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;
}