Skip to content

Commit

Permalink
faet: move build script to new repo
Browse files Browse the repository at this point in the history
  • Loading branch information
OEOTYAN committed Aug 7, 2024
1 parent f04ad64 commit 6c32539
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 137 deletions.
118 changes: 0 additions & 118 deletions scripts/after_build.lua

This file was deleted.

22 changes: 3 additions & 19 deletions xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git")
-- add_requires("levilamina develop") to use develop version
-- please note that you should add bdslibrary yourself if using dev version
add_requires("levilamina")
add_requires("levibuildscript")

if not has_config("vs_runtime") then
set_runtimes("MD")
end

target("my-mod") -- Change this to your mod name.
add_rules("@levibuildscript/linkrule")
add_rules("@levibuildscript/modpacker")
add_cxflags(
"/EHa",
"/utf-8",
Expand All @@ -27,26 +30,7 @@ target("my-mod") -- Change this to your mod name.
add_files("src/**.cpp")
add_includedirs("src")
add_packages("levilamina")
add_shflags("/DELAYLOAD:bedrock_server.dll") -- To use symbols provided by SymbolProvider.
set_exceptions("none") -- To avoid conflicts with /EHa.
set_kind("shared")
set_languages("c++20")
set_symbols("debug")

after_build(function (target)
local mod_packer = import("scripts.after_build")

local tag = os.iorun("git describe --tags --abbrev=0 --always")
local major, minor, patch, suffix = tag:match("v(%d+)%.(%d+)%.(%d+)(.*)")
if not major then
print("Failed to parse version tag, using 0.0.0")
major, minor, patch = 0, 0, 0
end
local mod_define = {
modName = target:name(),
modFile = path.filename(target:targetfile()),
modVersion = major .. "." .. minor .. "." .. patch,
}

mod_packer.pack_mod(target,mod_define)
end)

0 comments on commit 6c32539

Please sign in to comment.