diff options
-rw-r--r-- | maintainers/maintainer-list.nix | 6 | ||||
-rw-r--r-- | pkgs/development/tools/detekt/default.nix | 38 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
3 files changed, 46 insertions, 0 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index c3e1496c93be8..7311dadb1eef5 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -9144,6 +9144,12 @@ fingerprint = "D709 03C8 0BE9 ACDC 14F0 3BFB 77BF E531 397E DE94"; }]; }; + mdr = { + email = "MattRussellUK@gmail.com"; + github = "mdr"; + githubId = 241257; + name = "Matt Russell"; + }; meain = { email = "mail@meain.io"; matrix = "@meain:matrix.org"; diff --git a/pkgs/development/tools/detekt/default.nix b/pkgs/development/tools/detekt/default.nix new file mode 100644 index 0000000000000..0c67c5dd66a93 --- /dev/null +++ b/pkgs/development/tools/detekt/default.nix @@ -0,0 +1,38 @@ +{ detekt, lib, stdenv, fetchurl, makeWrapper, jre_headless, testers }: +stdenv.mkDerivation rec { + pname = "detekt"; + version = "1.22.0"; + + jarfilename = "${pname}-${version}-executable.jar"; + + src = fetchurl { + url = "https://github.com/detekt/detekt/releases/download/v${version}/detekt-cli-${version}-all.jar"; + sha256 = "sha256-NCOMBcAtk7cOlP3H8Bz/hfR/305j/DfaoFrwc504b/4="; + }; + + dontUnpack = true; + + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + runHook preInstall + + install -D "$src" "$out/share/java/${jarfilename}" + + makeWrapper ${jre_headless}/bin/java $out/bin/detekt \ + --add-flags "-jar $out/share/java/${jarfilename}" + + runHook postInstall + ''; + + passthru.tests.version = testers.testVersion { package = detekt; }; + + meta = with lib; { + description = "Static code analysis for Kotlin"; + homepage = "https://detekt.dev/"; + license = licenses.asl20; + platforms = jre_headless.meta.platforms; + maintainers = with maintainers; [ mdr ]; + sourceProvenance = with sourceTypes; [ binaryBytecode ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c46a2637ca327..dc7c6e5ca6cb1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17427,6 +17427,8 @@ with pkgs; datree = callPackage ../development/tools/datree { }; + detekt = callPackage ../development/tools/detekt { }; + dcadec = callPackage ../development/tools/dcadec { }; dejagnu = callPackage ../development/tools/misc/dejagnu { }; |