summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0986030c6d54656c6ef969c97fdf4ea064e54637 (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
# Maintainer: nycex <nycex / cccp.org>
_pkgbasename=ktlint
pkgname=$_pkgbasename-git
pkgrel=1
pkgver=0.36.0.r13.ga86d1c7
pkgdesc="An anti-bikeshedding Kotlin linter with built-in formatter"
arch=('any')
url="https://github.com/pinterest/ktlint"
license=('MIT')
depends=('java-runtime')
makedepends=('git')
source=(git+https://github.com/pinterest/${_pkgbasename})
sha256sums=('SKIP')

pkgver() {
    cd "${srcdir}/${_pkgbasename}"
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    cd "${srcdir}/${_pkgbasename}"
    ./gradlew --no-daemon shadowJarExecutable
}

package() {
    cd "${srcdir}/${_pkgbasename}"

    install -D -m755 ktlint/build/run/ktlint "${pkgdir}/usr/bin/ktlint"
    install -D -m644 LICENSE "${pkgdir}/usr/share/license/ktlint/LICENSE"
}