diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-08-28 23:42:50 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-08-28 23:42:50 +0800 |
commit | 8b8cb7760d9ee01475d068f18ea88be1e96f1cf0 (patch) | |
tree | 883b7983746e8918dcda3525a84e654f73cc438f /server | |
parent | b55a6b05c01238de4555e0cd92ef8305254394be (diff) | |
download | lua-language-server-8b8cb7760d9ee01475d068f18ea88be1e96f1cf0.zip |
自动测试支持
Diffstat (limited to 'server')
-rw-r--r-- | server/main.lua | 2 | ||||
-rw-r--r-- | server/platform.lua | 14 | ||||
-rw-r--r-- | server/publish.lua | 25 |
3 files changed, 24 insertions, 17 deletions
diff --git a/server/main.lua b/server/main.lua index cc136079..56d9d994 100644 --- a/server/main.lua +++ b/server/main.lua @@ -8,6 +8,8 @@ local fs = require 'bee.filesystem' ROOT = fs.absolute(fs.path(rootPath):parent_path()) LANG = LANG or 'en-US' +print(package.cpath) + --collectgarbage('generational') collectgarbage("setpause", 100) collectgarbage("setstepmul", 1000) diff --git a/server/platform.lua b/server/platform.lua index 2d4a3035..3832a762 100644 --- a/server/platform.lua +++ b/server/platform.lua @@ -7,10 +7,12 @@ end package.path = rootPath .. 'src/?.lua' .. ';' .. rootPath .. 'src/?/init.lua' -if package.loadlib(rootPath .. '/Macos/bin/bee.so', 'luaopen_bee_platform') then - package.cpath = rootPath .. '/Macos/bin/?.so' -elseif package.loadlib(rootPath .. '/Linux/bin/bee.so', 'luaopen_bee_platform') then - package.cpath = rootPath .. '/Linux/bin/?.so' -elseif package.loadlib(rootPath .. '/Windows/bin/bee.dll', 'luaopen_bee_platform') then - package.cpath = rootPath .. '/Windows/bin/?.dll' +if package.loadlib(rootPath .. 'Macos/bin/bee.so', 'luaopen_bee_platform') then + package.cpath = rootPath .. 'Macos/bin/?.so' +elseif package.loadlib(rootPath .. 'Linux/bin/bee.so', 'luaopen_bee_platform') then + package.cpath = rootPath .. 'Linux/bin/?.so' +elseif package.loadlib(rootPath .. 'Windows/bin/bee.dll', 'luaopen_bee_platform') then + package.cpath = rootPath .. 'Windows/bin/?.dll' +else + error([[It doesn't seem to support your OS, please let me know at https://github.com/sumneko/lua-language-server/issues]]) end diff --git a/server/publish.lua b/server/publish.lua index 9437d85e..12a4e9be 100644 --- a/server/publish.lua +++ b/server/publish.lua @@ -75,7 +75,7 @@ end local function runTest(root) local ext = platform.OS == 'Windows' and '.exe' or '' - local exe = root / 'bin' / 'lua-language-server' .. ext + local exe = root / platform.OS / 'bin' / 'lua-language-server' .. ext local test = root / 'test.lua' local lua = subprocess.spawn { exe, @@ -140,13 +140,16 @@ local count = copyFiles(EXTENSION , out) { ['tsconfig.json'] = true, }, ['server'] = { - ['bin'] = true, - ['libs'] = true, - ['locale'] = true, - ['src'] = true, - ['test'] = true, - ['main.lua'] = true, - ['test.lua'] = true, + ['Windows'] = true, + ['Macos'] = true, + ['Linux'] = true, + ['libs'] = true, + ['locale'] = true, + ['src'] = true, + ['test'] = true, + ['main.lua'] = true, + ['platform.lua'] = true, + ['test.lua'] = true, ['build_package.lua'] = true, }, ['images'] = { @@ -168,9 +171,9 @@ runTest(out / 'server') print('删除多余文件...') removeFiles(out) { ['server'] = { - ['log'] = true, - ['test'] = true, - ['test.lua'] = true, + ['log'] = true, + ['test'] = true, + ['test.lua'] = true, ['build_package.lua'] = true, }, } |