2023-10-06 17:56:04 +09:00
|
|
|
# Add dependencies to Language Server project
|
|
|
|
# TODO: automatically list up necessary packages
|
|
|
|
using Pkg
|
2023-10-06 19:36:59 +09:00
|
|
|
@info "project path" Pkg.project().path
|
2023-10-06 17:56:04 +09:00
|
|
|
|
|
|
|
# add LanguageServer.jl
|
|
|
|
Pkg.add("LanguageServer")
|
|
|
|
|
|
|
|
# add dependencies of LanguageServer.jl
|
|
|
|
pkg_ls = Pkg.project().dependencies["LanguageServer"]
|
|
|
|
pkg_ls_deps = Pkg.dependencies()[pkg_ls].dependencies |> keys
|
|
|
|
foreach(Pkg.add, pkg_ls_deps)
|
|
|
|
|
|
|
|
# add extra dependencies
|
2023-10-06 19:36:59 +09:00
|
|
|
# these packages are manually collected
|
2024-10-11 12:03:23 +09:00
|
|
|
pkg_extra = ["Logging", "Sockets", "DataStructures", "Tar", "ArgTools", "Dates", "Downloads", "TOML"]
|
2023-10-06 19:36:59 +09:00
|
|
|
foreach(Pkg.add, pkg_extra)
|
|
|
|
@info "dependency added"
|
|
|
|
|
|
|
|
# save pkgs to be used for precompile functions with traced script
|
|
|
|
out_path = joinpath(Pkg.project().path |> dirname, "precompile_exec_head.jl")
|
|
|
|
@info "writing $(out_path)"
|
|
|
|
open(out_path, "w") do io
|
|
|
|
println(io, "using LanguageServer")
|
|
|
|
println(io, "using " * join(pkg_ls_deps, ", "))
|
|
|
|
println(io, "using " * join(pkg_extra, ", "))
|
|
|
|
end
|
|
|
|
@info "finished writing precompile head file"
|
2023-10-06 17:56:04 +09:00
|
|
|
|