Commit a05928d7 authored by Hadi's avatar Hadi
Browse files

androidenv: make `nix-build -A androidenv.test-suite` work

androidenv: set config.allowUnfree = true for integration tests

androidenv: fix concerns in the PR
parent d511bfd0
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -312,7 +312,11 @@ rec {
    You must accept the following licenses:
    ${lib.concatMapStringsSep "\n" (str: "  - ${str}") licenseNames}

    a)
      by setting nixpkgs config option 'android_sdk.accept_license = true;'.
    b)
      by an environment variable for a single invocation of the nix tools.
        $ export NIXPKGS_ACCEPT_ANDROID_SDK_LICENSE=1
  '' else callPackage ./cmdline-tools.nix {
    inherit deployAndroidPackage os cmdLineToolsVersion;

+1 −1
Original line number Diff line number Diff line
{ config, pkgs ? import <nixpkgs> {}
, licenseAccepted ? config.android_sdk.accept_license or false
, licenseAccepted ? config.android_sdk.accept_license or (builtins.getEnv "NIXPKGS_ACCEPT_ANDROID_SDK_LICENSE" == "1")
}:

rec {
+2 −1
Original line number Diff line number Diff line
@@ -46,7 +46,8 @@ let
  # Otherwise, just use the in-tree androidenv:
  androidEnv = pkgs.callPackage ./.. {
    inherit config pkgs;
    licenseAccepted = true;
    # You probably need to uncomment below line to express consent.
    # licenseAccepted = true;
  };

  sdkArgs = {
+2 −1
Original line number Diff line number Diff line
@@ -56,7 +56,8 @@ let
  # Otherwise, just use the in-tree androidenv:
  androidEnv = pkgs.callPackage ./.. {
    inherit config pkgs;
    licenseAccepted = true;
    # You probably need to uncomment below line to express consent.
    # licenseAccepted = true;
  };

  androidComposition = androidEnv.composeAndroidPackages {
+8 −7
Original line number Diff line number Diff line
{ stdenv, callPackage }:
{callPackage, lib, stdenv}:
let
  examples-shell = callPackage ./examples/shell.nix {};
  examples-shell-with-emulator = callPackage ./examples/shell-with-emulator.nix {};
  all-tests = examples-shell.passthru.tests //
    examples-shell-with-emulator.passthru.tests;
in
stdenv.mkDerivation {
  name = "androidenv-test-suite";
  buidInputs = lib.mapAttrsToList (name: value: value) all-tests;

  src = ./.;

  dontConfigure = true;
  dontBuild = true;
  buildCommand = ''
    touch $out
  '';

  passthru.tests = examples-shell.passthru.tests //
    examples-shell-with-emulator.passthru.tests;
  passthru.tests = all-tests;

  meta.timeout = 60;
}