Skip to content

Commit ef14410

Browse files
author
Matsievskiy S.V
committed
Add PackageCompiler project and compilation script
This PR adds script for package compilation into binary
1 parent 131557f commit ef14410

File tree

5 files changed

+74
-0
lines changed

5 files changed

+74
-0
lines changed

contrib/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
JuliaLSP_compiled

contrib/JuliaLSP/Project.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name = "JuliaLSP"
2+
uuid = "9488cb22-ff86-4d62-8f4a-077fe1791049"
3+
authors = ["Matsievskiy S.V. <matsievskiysv@gmail.com>"]
4+
version = "0.1.0"
5+
6+
[deps]
7+
LanguageServer = "2b0e0bc5-e4fd-59b4-8912-456d1b03d8d7"
8+
SymbolServer = "cf896787-08d5-524d-9de7-132aaa0cb996"

contrib/JuliaLSP/precompile_app.jl

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
using JuliaLSP
2+
3+
push!(ARGS, "arg")
4+
JuliaLSP.julia_main()

contrib/JuliaLSP/src/JuliaLSP.jl

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module JuliaLSP
2+
3+
using LanguageServer
4+
import SymbolServer
5+
6+
function julia_main()::Cint
7+
server = LanguageServer.LanguageServerInstance(stdin, stdout)
8+
server.runlinter = true
9+
run(server)
10+
return 0 # if things finished successfully
11+
end
12+
13+
end # module

contrib/compile.sh

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
3+
JULIABIN="julia"
4+
JULIAPROJ="JuliaLSP"
5+
JULIACOMP="JuliaLSP_compiled"
6+
7+
REPO="https://github.com/julia-vscode/LanguageServer.jl"
8+
BRANCH="master"
9+
10+
RED='\033[0;31m'
11+
NC='\033[0m'
12+
13+
while [[ $# -gt 0 ]]
14+
do
15+
key="$1"
16+
17+
case $key in
18+
-j|--julia)
19+
JULIABIN="$2"
20+
shift
21+
;;
22+
-b|--branch)
23+
BRANCH="$2"
24+
shift
25+
;;
26+
-r|--repo)
27+
REPO="$2"
28+
shift
29+
;;
30+
*)
31+
echo -e "Usage:\ncompile.sh [-j|--julia <julia binary>] [-b|--branch <repo branch>]" >&2
32+
exit
33+
;;
34+
esac
35+
shift
36+
done
37+
38+
echo -e ${RED}Updating packages${NC}
39+
40+
$JULIABIN --startup-file=no --history-file=no -e \
41+
"import Pkg; Pkg.activate(\"${JULIAPROJ}\"); Pkg.add(Pkg.PackageSpec(url=\"${REPO}\", rev=\"${BRANCH}\")); Pkg.update();" || exit
42+
43+
echo -e ${RED}Compiling...${NC}
44+
45+
$JULIABIN --startup-file=no --history-file=no -e \
46+
"import Pkg; Pkg.add(\"PackageCompiler\"); using PackageCompiler; create_app(\"${JULIAPROJ}\", \"${JULIACOMP}\", force=true);" || exit
47+
48+
echo -e ${RED}Compiled${NC}

0 commit comments

Comments
 (0)