summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fd1aa2e14cc5a44676af4b38be8fa5b7c904c9a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Maintainer: Phillip Schichtel <phillip@schich.tel>
# Contributor:	Jesse Jaara	<gmail.com: jesse.jaara>
# Contributor:	p2k		<uni-ulm.de: Patrick.Schneider>

pkgname=ktlint
pkgver=1.1.1
pkgrel=1
pkgdesc="An anti-bikeshedding Kotlin linter with built-in formatter"
arch=('any')
url="https://ktlint.github.io/"
license=('MIT')
depends=('java-runtime>=11')
makedepends=(git 'jdk-openjdk>=21')
validpgpkeys=(ADBC987D1A7B91DB6B0AAA81995EFBF4A3D20BEB)
source=("git+https://github.com/pinterest/ktlint.git#commit=0b4193e9f524cc489632f46ee36309dcc0d79327")
sha256sums=('SKIP')

_gradle_build() {
  export GRADLE_USER_HOME="${srcdir}/.gradle"
  export JAVA_HOME=/usr/lib/jvm/java-21-openjdk
  ./gradlew --no-configuration-cache --no-scan --no-daemon --console plain -Pktlint.publication.signing.enable=false shadowJarExecutable
}

build() {
  cd "ktlint"
  _gradle_build || _gradle_build
}

package() {
  install -D -m755 "${srcdir}/ktlint/ktlint-cli/build/run/ktlint" "${pkgdir}/usr/bin/ktlint"
  install -D -m644 "${srcdir}/ktlint/LICENSE" "${pkgdir}/usr/share/licenses/ktlint/LICENSE"
}