summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoractboy168 <actboy168@gmail.com>2019-06-10 16:52:20 +0800
committeractboy168 <actboy168@gmail.com>2019-06-10 16:52:20 +0800
commit11dbf384b2042e9d2749e95d64e1efbeaeaf0b35 (patch)
treeea840be852b1af89104d2066b51cc8d0d7adc584
parentaa77a6514802a40bde972647b84adf95e375d4ae (diff)
downloadlua-language-server-11dbf384b2042e9d2749e95d64e1efbeaeaf0b35.zip
新的安装脚本
-rw-r--r--.vscode/tasks.json52
-rw-r--r--README.md18
-rwxr-xr-xlinux.sh38
-rwxr-xr-xosx.sh38
4 files changed, 42 insertions, 104 deletions
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 11a5f61e..8bb1b196 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -1,32 +1,48 @@
{
"version": "2.0.0",
+ "type": "shell",
+ "windows": {
+ "options": {
+ "shell": {
+ "executable": "C:\\Windows\\System32\\cmd.exe",
+ "args": [
+ "/c"
+ ]
+ }
+ }
+ },
+ "options": {
+ "cwd": "${workspaceFolder}"
+ },
"tasks": [
{
"type": "shell",
- "label": "编译",
- "command": "cd 3rd\\luamake && tools\\ninja -f ninja\\msvc.ninja && cd ..\\.. && 3rd\\luamake\\luamake rebuild"
+ "label": "PreCompile",
+ "windows": {
+ "command": "tools\\ninja -f ninja\\msvc.ninja"
+ },
+ "linux": {
+ "command": "ninja -f ninja/linux.ninja"
+ },
+ "osx": {
+ "command": "ninja -f ninja/macos.ninja"
+ },
+ "options": {
+ "cwd": "${workspaceFolder}/3rd/luamake"
+ },
},
{
- "label": "Copy Extension",
+ "type": "shell",
+ "label": "Compile",
+ "command": "${workspaceFolder}/3rd/luamake/luamake rebuild"
+ },
+ {
+ "label": "Install",
"command": "${workspaceFolder}/build/lua",
"args": [
"make/copy.lua",
"${command:extensionPath}"
- ],
- "type": "shell",
- "windows": {
- "options": {
- "shell": {
- "executable": "C:\\Windows\\System32\\cmd.exe",
- "args": [
- "/c"
- ]
- }
- }
- },
- "options": {
- "cwd": "${workspaceFolder}"
- },
+ ]
}
]
} \ No newline at end of file
diff --git a/README.md b/README.md
index eeb7a5a9..9d0a1ad1 100644
--- a/README.md
+++ b/README.md
@@ -60,25 +60,23 @@
You need to build `lua-language-server` yourself on macOS/Linux.
* Install [sumneko.lua] in VSCode
+* Install [extension-path] in VSCode
* Install [ninja]
* Clone source code
```
-git clone git@github.com:sumneko/lua-language-server.git
-```
-* Run `osx.sh` / `linux.sh`
-```
-cd lua-language-server
-./osx.sh
-```
-```
-cd lua-language-server
-./linux.sh
+git clone https://github.com/sumneko/lua-language-server
+git submodule update --init --recursive
```
+* Open repo and execute tasks in VSCode
+ 1. PreCompile
+ 2. Compile
+ 3. Install
* Restart VSCode and open your lua project
* Enjoy
[ninja]: https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages
[sumneko.lua]: https://marketplace.visualstudio.com/items?itemName=sumneko.lua
+[extension-path]: https://marketplace.visualstudio.com/items?itemName=actboy168.extension-path
## Version
diff --git a/linux.sh b/linux.sh
deleted file mode 100755
index e7f66e25..00000000
--- a/linux.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-set -e
-
-MY_DIR=$(cd "$(dirname $0)";pwd)
-INSTALL_PATH=`find ~/.vscode/extensions -name "sumneko.lua-*" | sort -r | head -1`
-
-cd $MY_DIR
-
-echo "updating submodule ..."
-git submodule -q update --recursive --init
-
-echo "build luamake ..."
-cd 3rd/luamake
-ninja -f ninja/linux.ninja
-cd -
-
-echo "build binary ..."
-./3rd/luamake/luamake
-
-if [ -d "$INSTALL_PATH" ]; then
- echo "Try to install lua-language-server for you:"
- cp -R server/bin "${INSTALL_PATH}/server"
-
- echo "Test ..."
- cp server/test.lua "${INSTALL_PATH}/server"
- ${INSTALL_PATH}/server/bin/lua-language-server ${INSTALL_PATH}/server/test.lua
- rm ${INSTALL_PATH}/server/test.lua
-
- echo "installed."
- echo "please restart VScode and enjoy."
-else
- echo "Test ..."
- ./server/bin/lua-language-server ./server/publish.lua
-
- echo "please install sumneko Lua in VScode Marketplace first."
-fi
-echo "Done."
diff --git a/osx.sh b/osx.sh
deleted file mode 100755
index 1a1e21e6..00000000
--- a/osx.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-set -e
-
-MY_DIR=$(cd "$(dirname $0)";pwd)
-INSTALL_PATH=`find ~/.vscode/extensions -name "sumneko.lua-*" | sort -r | head -1`
-
-cd $MY_DIR
-
-echo "updating submodule ..."
-git submodule -q update --recursive --init
-
-echo "build luamake ..."
-cd 3rd/luamake
-ninja -f ninja/macos.ninja
-cd -
-
-echo "build binary ..."
-./3rd/luamake/luamake
-
-if [ -d "$INSTALL_PATH" ]; then
- echo "Try to install lua-language-server for you:"
- cp -R server/bin "${INSTALL_PATH}/server"
-
- echo "Test ..."
- cp server/test.lua "${INSTALL_PATH}/server"
- ${INSTALL_PATH}/server/bin/lua-language-server ${INSTALL_PATH}/server/test.lua
- rm ${INSTALL_PATH}/server/test.lua
-
- echo "installed."
- echo "please restart VScode and enjoy."
-else
- echo "Test ..."
- ./server/bin/lua-language-server ./server/publish.lua
-
- echo "please install sumneko Lua in VScode Marketplace first."
-fi
-echo "Done."