aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/groovyls/init.lua
blob: 8dbb1b5cb01fa4412f503964d16f55775504e4a0 (plain) (blame)
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
local server = require "nvim-lsp-installer.server"
local path = require "nvim-lsp-installer.path"
local std = require "nvim-lsp-installer.installers.std"
local context = require "nvim-lsp-installer.installers.context"

return function(name, root_dir)
    return server.Server:new {
        name = name,
        root_dir = root_dir,
        languages = { "groovy" },
        homepage = "https://github.com/GroovyLanguageServer/groovy-language-server",
        installer = {
            std.ensure_executables { { "javac", "javac was not found in path." } },
            std.git_clone "https://github.com/GroovyLanguageServer/groovy-language-server",
            context.promote_install_dir(),
            std.gradlew {
                args = { "build" },
            },
            context.receipt(function(receipt)
                receipt:with_primary_source(
                    receipt.git_remote "https://github.com/GroovyLanguageServer/groovy-language-server"
                )
            end),
        },
        default_options = {
            cmd = { "java", "-jar", path.concat { root_dir, "build", "libs", "groovyls-all.jar" } },
        },
    }
end