blob: 58cef18216abafe25e85f93df3afa2b17d6847b4 (
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
30
31
32
33
|
local Pkg = require "mason-core.package"
local github = require "mason-core.managers.github"
local path = require "mason-core.path"
return Pkg.new {
name = "google-java-format",
desc = [[google-java-format is a program that reformats Java source code to comply with Google Java Style.]],
homepage = "https://github.com/google/google-java-format",
languages = { Pkg.Lang.Java },
categories = { Pkg.Cat.Formatter },
---@async
---@param ctx InstallContext
install = function(ctx)
github
.download_release_file({
repo = "google/google-java-format",
out_file = "google-java-format.jar",
asset_file = function(release)
local version = release:gsub("^v", "")
return ("google-java-format-%s-all-deps.jar"):format(version)
end,
})
.with_receipt()
ctx:link_bin(
"google-java-format",
ctx:write_shell_exec_wrapper(
"google-java-format",
("java -jar %q"):format(path.concat { ctx.package:get_install_path(), "google-java-format.jar" })
)
)
end,
}
|