# Contributor: Krassy Boykinov <kboykinov@teamcentrixx.com>
# Maintainer: Krassy Boykinov <kboykinov@teamcentrixx.com>
pkgname=jdtls
pkgver=1.39.0
pkgrel=0
pkgdesc="Eclipse Java language server"
url="https://github.com/eclipse/eclipse.jdt.ls"
arch="aarch64 x86_64"
license="EPL-2.0"
depends="java-jre-headless python3"
makedepends="maven"
source="$pkgname-$pkgver.tar.gz::https://github.com/eclipse/eclipse.jdt.ls/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/eclipse.jdt.ls-$pkgver"
options="!check" # runs in build

build() {
	mvn -B package
}

package() {
	cd org.eclipse.jdt.ls.product/target/repository

	mkdir -p "$pkgdir"/usr/share/jdtls "$pkgdir"/usr/bin
	cp -a \
		config_linux \
		config_ss_linux \
		features \
		plugins \
		bin \
		"$pkgdir"/usr/share/jdtls/

	ln -sfv ../share/jdtls/bin/jdtls "$pkgdir"/usr/bin/jdtls
}

sha512sums="
ec7221d170b2f1e46b53976ad02a30eaf004b9c29a2bdaea7ece4623c0b58fa61aa7072afd5e363a6f37bd77d0a996f7fc82d79720c319eca7953c107456d028  jdtls-1.39.0.tar.gz
"
