wifisetup/nix/build.nix
Raito Bezarius a759cc912f chore(nix): nixify
This does almost everything until the final build and fails there
because we are using too modern software with a too old project, I
think.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-05 16:57:52 +02:00

39 lines
767 B
Nix

{ lib
, stdenv
, jdk
, gradle
, mavenRepo
, androidSdk
}:
stdenv.mkDerivation {
pname = "built-with-gradle";
version = "0.0";
src = ../android;
nativeBuildInputs = [ gradle ];
JDK_HOME = "${jdk.home}";
ANDROID_SDK_ROOT = "${androidSdk}/share/android-sdk";
buildPhase = ''
runHook preBuild
gradle build \
--offline --no-daemon --no-build-cache --info --full-stacktrace \
--warning-mode=all --parallel \
-PnixMavenRepo=${mavenRepo} \
-Dorg.gradle.project.android.aapt2FromMavenOverride=$ANDROID_SDK_ROOT/build-tools/30.0.3/aapt2
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r app/build/outputs/* $out
runHook postInstall
'';
dontStrip = true;
}