summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
m---------3rd/bee.lua0
m---------3rd/luamake0
-rw-r--r--make.lua23
-rw-r--r--make/install.lua11
-rw-r--r--make/unittest.lua23
-rw-r--r--script/parser/luadoc.lua2
6 files changed, 14 insertions, 45 deletions
diff --git a/3rd/bee.lua b/3rd/bee.lua
-Subproject 28a9af609cbc1c6b787e28a5a946a96164103f2
+Subproject e4c2fe0dd38e7f40339016074aecf089238d7b8
diff --git a/3rd/luamake b/3rd/luamake
-Subproject 3b73cd3530494aa9a8505bd4a33fc9b909a18ba
+Subproject 128f6a1880a28f9475a1e48772b9cd6d63c83fd
diff --git a/make.lua b/make.lua
index 6fd709f7..a7793770 100644
--- a/make.lua
+++ b/make.lua
@@ -1,18 +1,11 @@
local lm = require 'luamake'
-if lm.plat == "macos" then
- lm.flags = {
- "-mmacosx-version-min=10.13",
- }
-end
-
lm:import("3rd/bee.lua/make.lua", {
EXE_RESOURCE = "../../make/lua-language-server.rc"
})
-lm.rootdir = '3rd/'
-
lm:lua_dll 'lpeglabel' {
+ rootdir = '3rd',
sources = 'lpeglabel/*.c',
visibility = 'default',
defines = {
@@ -21,7 +14,7 @@ lm:lua_dll 'lpeglabel' {
}
lm:build 'install' {
- '$luamake', 'lua', 'make/install.lua', lm.plat,
+ '$luamake', 'lua', 'make/install.lua', lm.builddir,
deps = {
'lua',
'lpeglabel',
@@ -30,16 +23,16 @@ lm:build 'install' {
}
}
+local fs = require 'bee.filesystem'
+local pf = require 'bee.platform'
+local exe = pf.OS == 'Windows' and ".exe" or ""
lm:build 'unittest' {
- '$luamake', 'lua', 'make/unittest.lua', lm.plat,
+ fs.path 'bin' / pf.OS / ('lua-language-server' .. exe), 'test.lua', '-E',
+ pool = "console",
deps = {
'install',
'test',
}
}
-lm:default {
- 'install',
- 'test',
- 'unittest',
-}
+lm:default 'unittest'
diff --git a/make/install.lua b/make/install.lua
index 75556ac1..036f0f4b 100644
--- a/make/install.lua
+++ b/make/install.lua
@@ -1,20 +1,19 @@
-local platform = ...
+local builddir = ...
local fs = require 'bee.filesystem'
-local sp = require 'bee.subprocess'
local pf = require 'bee.platform'
local CWD = fs.current_path()
local output = CWD / 'bin' / pf.OS
-local bindir = CWD / 'build' / platform / 'bin'
-local exe = platform == 'msvc' and ".exe" or ""
-local dll = platform == 'msvc' and ".dll" or ".so"
+local bindir = CWD / builddir / 'bin'
+local exe = pf.OS == 'Windows' and ".exe" or ""
+local dll = pf.OS == 'Windows' and ".dll" or ".so"
fs.create_directories(output)
fs.copy_file(bindir / 'lpeglabel'..dll, output / 'lpeglabel'..dll, true)
fs.copy_file(bindir / 'bee'..dll, output / 'bee'..dll, true)
fs.copy_file(bindir / 'lua'..exe, output / 'lua-language-server'..exe, true)
-if platform == 'msvc' then
+if pf.OS == 'Windows' then
fs.copy_file(bindir / 'lua54'..dll, output / 'lua54'..dll, true)
require 'msvc'.copy_vcrt('x64', output)
end
diff --git a/make/unittest.lua b/make/unittest.lua
deleted file mode 100644
index 25839c96..00000000
--- a/make/unittest.lua
+++ /dev/null
@@ -1,23 +0,0 @@
-local platform = ...
-local fs = require 'bee.filesystem'
-local sp = require 'bee.subprocess'
-local pf = require 'bee.platform'
-local exe = platform == 'msvc' and ".exe" or ""
-local CWD = fs.current_path()
-
-local process = assert(sp.spawn {
- CWD / 'bin' / pf.OS / ('lua-language-server' .. exe),
- CWD / 'test.lua',
- '-E',
- stdout = true,
- stderr = true,
-})
-
-for line in process.stdout:lines 'l' do
- print(line)
-end
-process:wait()
-local err = process.stderr:read 'a'
-if err ~= '' then
- error(err)
-end
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index 0edf5371..5f70a9e5 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -1003,7 +1003,7 @@ local function trimTailComment(text)
end
if comment:find '^%s*[\'"[]' then
local result = grammar(nil, comment:gsub('^%s+', ''), 'string')
- if result then
+ if result and result[1] then
comment = result[1][1]
end
end