summaryrefslogtreecommitdiff
path: root/server/compile.lua
blob: 0dc700af5b8c9691cd0c1c3d38c38682cb57c903 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
local fs = require 'bee.filesystem'
local root = fs.current_path()

local function compileRelease()
    local msvc = require 'msvc'
    if not msvc:initialize(141, 'utf8') then
        error('Cannot found Visual Studio Toolset.')
    end

    local property = {
        Configuration = 'Release',
        Platform = 'x86'
    }
    msvc:compile('build', root / 'bee.lua' / 'bee.sln', property)
end

local function copyFile()
    local source = root / 'bee.lua' / 'bin' / 'msvc_x86_Release'
    local target = root / 'bin'
    for _, name in ipairs {
        'bee.dll',
        {'lua.exe', 'lua-language-server.exe'},
        'lua54.dll',
    } do
        if type(name) == 'string' then
            fs.copy_file(source / name, target / name, true)
        else
            fs.copy_file(source / name[1], target / name[2], true)
        end
    end
end

compileRelease()
copyFile()

print 'make complete.'