remove:移除xmake和pack。

This commit is contained in:
taynpg 2025-02-17 21:35:55 +08:00
parent 2e3f39138e
commit a014f79848
4 changed files with 0 additions and 205 deletions

View File

@ -1,31 +0,0 @@
add_rules("mode.debug", "mode.release")
set_languages("c++17")
if is_plat("windows") then
add_cxxflags("/source-charset:utf-8", {force = true})
end
if is_plat("mingw") then
add_cxxflags("-Wno-unused-variable -finput-charset=utf-8 -fexec-charset=gbk")
end
if is_mode("debug") then
set_suffixname("d")
end
target("lua_fs")
add_options("boost")
add_defines("FS_LIB_EXPORT")
set_kind("shared")
add_files("*.cxx")
add_deps("lua")
if is_plat("mingw") or is_plat("windows") then
set_filename("lua_fs.dll")
end
option("boost")
set_default(false)
set_showmenu(true)
boost_root_dir = os.getenv("BOOST_HEADER_DIR")
boost_lib_dir = os.getenv("BOOST_LIB_DIR")
boost_libs = os.getenv("BOOST_LIBS")
add_includedirs(boost_root_dir)
add_defines("USE_BOOST_FILESYSTEM")
add_linkdirs(boost_lib_dir)
add_links(boost_libs)

View File

@ -1,89 +0,0 @@
local fs = require("lua_fs")
local path1 = "C:\\Program Files\\NSIS\\makensis.exe"
local path2 = "C:\\Program Files (x86)\\NSIS\\makensis.exe"
local version = "v0.1"
local package_name = "mlua"
local extern = ""
-- 确定使用哪个路径
local makensis_path = nil
if fs.exists(path2) then
makensis_path = path2
elseif fs.exists(path1) then
makensis_path = path1
else
print("Error: makensis.exe not found!")
return
end
-- 执行 xmake f -v 命令并获取输出
local handle = io.popen('cd .. && xmake f -v') -- 使用 io.popen 执行命令并获取输出句柄
if not handle then
print("xmake f -v 命令执行失败")
return
end
local output = handle:read("*a") -- 读取命令输出
handle:close() -- 关闭文件句柄
-- 匹配并提取 plat, arch 和 mode
local plat = string.match(output, "plat = (%S+)")
local arch = string.match(output, "arch = (%S+)")
local mode = string.match(output, "mode = (%S+)")
-- 打印结果
print("plat: " .. plat)
print("arch: " .. arch)
print("mode: " .. mode)
-- 获取当前脚本所在的目录
local cur = fs.get_current_directory()
local updir = fs.get_parent(cur)
local re_bin_dir = updir .. "/build/" .. plat .. "/" .. arch .. "/" .. mode
local bin_dir = fs.normalize(re_bin_dir)
print("bin_dir: " .. bin_dir)
local files = ""
local filenames = {"mlua.exe", "mluac.exe", "lua_fs.dll"}
local function add_files_to_list(arg_bin_dir)
for _, filename in ipairs(filenames) do
files = files .. "File \"" .. fs.append_path(arg_bin_dir, filename) .. "\"\n "
end
return files
end
add_files_to_list(bin_dir)
-- 打开文件
local file = io.open("pack.nsi", "r")
if not file then
print("文件打开失败")
return
end
-- 读取文件内容
local content = file:read("*all")
file:close()
local new_str = string.gsub(content, "REP_NAME", package_name)
new_str = string.gsub(new_str, "REP_BIN_FILE", package_name .. "-" .. version .. "-" .. arch .. extern)
new_str = string.gsub(new_str, ";REP_FILES", files)
print(new_str)
local f = io.open("tpack.nsi", "w")
if f then
f:write(new_str)
f:close()
print("success to save file tpack.nsi")
else
print("can't open file tpack.nsi")
end
local command = "\"\"" .. makensis_path .. "\" tpack.nsi\""
print("command: " .. command)
local result = os.execute(command)
os.remove("tpack.nsi")
print("End...")

View File

@ -1,82 +0,0 @@
;NSIS Modern User Interface
;Welcome/Finish Page Example Script
;Written by Joost Verburg
;--------------------------------
;Include Modern UI
!include "MUI2.nsh"
;--------------------------------
;General
!define ProgramName "REP_NAME"
Name "${ProgramName}"
OutFile "REP_BIN_FILE.exe"
Unicode True
InstallDir "$LOCALAPPDATA\${ProgramName}"
RequestExecutionLevel user
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;--------------------------------
;Pages
!insertmacro MUI_PAGE_WELCOME
;!insertmacro MUI_PAGE_LICENSE "REP_LICENSE"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "SimpChinese"
;--------------------------------
;Installer Sections
Section "REP_NAME" All
SetOutPath "$INSTDIR"
;ADD YOUR OWN FILES HERE...
;REP_FILES
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
;--------------------------------
;Descriptions
;Language strings
LangString DESC_All 2052 "install all main files."
;Assign language strings to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${All} $(DESC_All)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;--------------------------------
;Uninstaller Section
Section "Uninstall"
;ADD YOUR OWN FILES HERE...
Delete "$INSTDIR\Uninstall.exe"
RMDir "$INSTDIR"
DeleteRegKey /ifempty HKCU "Software\${ProgramName}"
SectionEnd

View File

@ -1,3 +0,0 @@
add_rules("mode.debug", "mode.release")
set_languages("c++17")
includes("lua", "fs")