ktfmt: init at 0.46
This commit is contained in:
parent
1ff350f7b8
commit
7a1233cc30
1 changed files with 38 additions and 0 deletions
38
pkgs/by-name/kt/ktfmt/package.nix
Normal file
38
pkgs/by-name/kt/ktfmt/package.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{ lib, fetchFromGitHub, jre_headless, makeWrapper, maven }:
|
||||
|
||||
maven.buildMavenPackage rec {
|
||||
pname = "ktfmt";
|
||||
version = "0.46";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "facebook";
|
||||
repo = "ktfmt";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-OIbJ+J5LX6SPv5tuAiY66v/edeM7nFPHj90GXV6zaxw=";
|
||||
};
|
||||
|
||||
mvnHash = "sha256-pzMjkkdkbVqVxZPW2I0YWPl5/l6+SyNkhd6gkm9Uoyc=";
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin
|
||||
install -Dm644 core/target/ktfmt-*-jar-with-dependencies.jar $out/share/ktfmt/ktfmt.jar
|
||||
|
||||
makeWrapper ${jre_headless}/bin/java $out/bin/ktfmt \
|
||||
--add-flags "-jar $out/share/ktfmt/ktfmt.jar"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions.";
|
||||
homepage = "https://github.com/facebook/ktfmt";
|
||||
license = licenses.apsl20;
|
||||
mainProgram = "ktfmt";
|
||||
maintainers = with maintainers; [ ghostbuster91 ];
|
||||
inherit (jre_headless.meta) platforms;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue