-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add PackageCompiler project and compilation script
- Loading branch information
Matsievskiy S.V
committed
May 12, 2020
1 parent
936a813
commit 7f77e4a
Showing
5 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
JuliaLSP_compiled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name = "JuliaLSP" | ||
uuid = "9488cb22-ff86-4d62-8f4a-077fe1791049" | ||
authors = ["Matsievskiy S.V. <matsievskiysv@gmail.com>"] | ||
version = "0.1.0" | ||
|
||
[deps] | ||
LanguageServer = "2b0e0bc5-e4fd-59b4-8912-456d1b03d8d7" | ||
SymbolServer = "cf896787-08d5-524d-9de7-132aaa0cb996" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
using JuliaLSP | ||
|
||
push!(ARGS, "arg") | ||
JuliaLSP.julia_main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module JuliaLSP | ||
|
||
using LanguageServer | ||
import SymbolServer | ||
|
||
function julia_main()::Cint | ||
server = LanguageServer.LanguageServerInstance(stdin, stdout) | ||
server.runlinter = true | ||
run(server) | ||
return 0 # if things finished successfully | ||
end | ||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env bash | ||
|
||
JULIABIN="julia" | ||
JULIAPROJ="JuliaLSP" | ||
JULIACOMP="JuliaLSP_compiled" | ||
|
||
REPO="https://github.com/julia-vscode/LanguageServer.jl" | ||
BRANCH="master" | ||
|
||
RED='\033[0;31m' | ||
NC='\033[0m' | ||
|
||
while [[ $# -gt 0 ]] | ||
do | ||
key="$1" | ||
|
||
case $key in | ||
-j|--julia) | ||
JULIABIN="$2" | ||
shift | ||
;; | ||
-b|--branch) | ||
BRANCH="$2" | ||
shift | ||
;; | ||
-r|--repo) | ||
REPO="$2" | ||
shift | ||
;; | ||
*) | ||
echo -e "Usage:\ncompile.sh [-j|--julia <julia binary>] [-b|--branch <repo branch>]" >&2 | ||
exit | ||
;; | ||
esac | ||
shift | ||
done | ||
|
||
echo -e ${RED}Updating packages${NC} | ||
|
||
$JULIABIN --startup-file=no --history-file=no -e \ | ||
"import Pkg; Pkg.activate(\"${JULIAPROJ}\"); Pkg.add(Pkg.PackageSpec(url=\"${REPO}\", rev=\"${BRANCH}\")); Pkg.update();" || exit | ||
|
||
echo -e ${RED}Compiling...${NC} | ||
|
||
$JULIABIN --startup-file=no --history-file=no -e \ | ||
"import Pkg; Pkg.add(\"PackageCompiler\"); using PackageCompiler; create_app(\"${JULIAPROJ}\", \"${JULIACOMP}\", force=true);" || exit | ||
|
||
echo -e ${RED}Compiled${NC} |