Skip to content

Commit

Permalink
Merge pull request #4 from killcerr/develop
Browse files Browse the repository at this point in the history
feat: 使用xmake拉取endstone头文件
  • Loading branch information
engsr6982 authored Dec 21, 2024
2 parents 1015cbb + 2dca103 commit c69ae8a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 132 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ on:
- .github/workflows/build.yml
workflow_dispatch:

env:
EndStoneVersion: "v0.5.6"
EndStoneSDKPath: "build/_deps/endstone-src"

jobs:
build:
runs-on: windows-latest
Expand All @@ -29,14 +25,6 @@ jobs:
with:
fetch-depth: 0

- name: Checkout EndStone repo
uses: actions/checkout@v4
with:
repository: EndstoneMC/endstone
ref: ${{ env.EndStoneVersion }}
path: ${{ env.EndStoneSDKPath }}
fetch-depth: 0

- uses: actions/cache@v4
with:
path: |
Expand All @@ -45,12 +33,6 @@ jobs:
restore-keys: |
xmake-
- name: Apply Patch
shell: pwsh
run: |
cd ${{ env.EndStoneSDKPath }}
git apply "${{ github.workspace }}/patch/cxx20.patch"
- uses: xmake-io/github-action-setup-xmake@v1
# with:
# xmake-version: branch@master
Expand Down
96 changes: 0 additions & 96 deletions CMakeLists.txt

This file was deleted.

12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,6 @@ JsEngine 基于 ScriptX 和 QuickJs 实现,支持在 EndStone 中运行 JavaSc
```bash
git clone --depth=1 https://github.com/engsr6982/JS_Engine.git
cd JS_Engine

mkdir build/_deps
cd build/_deps

git clone --depth=1 https://github.com/EndstoneMC/endstone.git
mv endstone endstone-src
cd endstone-src

git apply ../../../patch/cxx20.patch

cd ../../..

xmake -y
```

Expand Down
24 changes: 18 additions & 6 deletions xmake.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
add_rules("mode.debug", "mode.release")

add_repositories("levilamina https://github.com/LiteLDev/xmake-repo.git")
package("endstone")
set_kind("library", {headeronly = true})
set_homepage("https://github.com/EndstoneMC/endstone")
set_description("Endstone - High-level Plugin API for Bedrock Dedicated Servers (BDS), in both Python and C++")
set_license("Apache-2.0")

add_urls("https://github.com/EndstoneMC/endstone/archive/refs/tags/$(version).tar.gz","https://github.com/EndstoneMC/endstone.git")
add_versions("v0.5.6","b6a78473aef733d02aa99fe960ea3ffee6e52486")
add_patches("v0.5.6", "https://github.com/engsr6982/Js_Engine/raw/refs/heads/develop/patch/cxx20.patch",
"547ae3d325b8deb68747179b6bc3aa8772ba4efe36263bf31f34be7a3aac2ceb")
on_install("windows", "linux", function (package)
os.cp("include", package:installdir())
end)
package_end()
add_requires(
"fmt >=10.0.0 <11.0.0",
"expected-lite 0.8.0",
Expand All @@ -10,7 +23,8 @@ add_requires(
"nlohmann_json 3.11.3",
"boost 1.85.0",
"glm 1.0.1",
"concurrentqueue 1.0.4"
"concurrentqueue 1.0.4",
"endstone v0.5.6"
)
add_requires("magic_enum 0.9.7")

Expand All @@ -31,10 +45,7 @@ target("Js_Engine")
"_AMD64_"
)
add_files("src/**.cc")
add_includedirs(
"build/_deps/endstone-src/include", -- 使用 CMake 构建拉取的 EndStone
"src"
)
add_includedirs("src")
add_packages(
"fmt",
"expected-lite",
Expand All @@ -43,7 +54,8 @@ target("Js_Engine")
"nlohmann_json",
"boost",
"glm",
"concurrentqueue"
"concurrentqueue",
"endstone"
)
add_packages("magic_enum")
set_kind("shared")
Expand Down

0 comments on commit c69ae8a

Please sign in to comment.