gradle2nix icon indicating copy to clipboard operation
gradle2nix copied to clipboard

New analysis method?

Open eyJhb opened this issue 4 years ago • 4 comments

Can this maybe be used, instead of the custom method? https://github.com/gradle-dependency-analyze/gradle-dependency-analyze

Might be better to outsource that part, as I have had issues with some dependencies not being detected.

eyJhb avatar Feb 08 '21 10:02 eyJhb

Thanks, I'll take a look. I've been working on trying to use Gradle's internal APIs for this, but if that solution works I would be satisfied.

tadfisher avatar Feb 08 '21 21:02 tadfisher

@eyJhb Can you provide specific examples of dependencies that we don't resolve? I can add test cases for them.

tadfisher avatar Feb 08 '21 21:02 tadfisher

I can try to see if I can find some, but I think it was in general Signal/Antennapod. :)

eyJhb avatar Feb 09 '21 08:02 eyJhb

Trying with https://github.com/acristescu/OnlineGo/releases/tag/alpha_b346

I have this shell.nix file

{ pkgs ? import <nixpkgs> {config.android_sdk.accept_license = true;} }:

let
  gradle2nixsrc = pkgs.fetchFromGitHub {
    owner = "tadfisher";
    repo = "gradle2nix";
    rev = "fafe5b7e0b0caf4682111e594bb9087559ee3a4f";
    sha256 = "0n72sdjs2dpwgd3p8xdqb7rxvamn8ilwcaj19wi0zd1x81q6g3ip";
  };
  gradle2nix = import "${gradle2nixsrc}/default.nix" {};

  sdk2 = pkgs.androidenv.composeAndroidPackages {
    buildToolsVersions = [ "29.0.3" ];
    # buildToolsVersions = [ "28.0.3" ];
    includeNDK = true;
    ndkVersion = "21.0.6113669";
    cmakeVersions = [ "3.10.2" ];
    # includeExtras = [
    #     "extras;patcher;v4"
    # ];

    platformVersions = [ "28" ];
    abiVersions = [ "x86" "x86_64"];
    # toolsVersion = "26.1.1";
  };

in pkgs.mkShell {
  nativeBuildInputs = with pkgs; [
    jre
    sdk2.androidsdk
    (gradle2nix)
  ];
  shellHook = ''
    echo ${sdk2.androidsdk}/libexec/android-sdk/
  '';
}

When you run nix-shell, then the last line will be a path you should insert into local.properties, so that it looks like.

sdk.dir=/nix/store/3gz69hkd5r2l5v84709a65vzk1kh6v8j-androidsdk/libexec/android-sdk/

It fails during this. Any idea why?

eyJhb avatar Apr 12 '21 11:04 eyJhb