diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d91f9e..b771e17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,7 @@ jobs: cmdline: ${{ steps.filter.outputs.cmdline }} llmapi: ${{ steps.filter.outputs.llmapi }} lua: ${{ steps.filter.outputs.lua }} + xpkg: ${{ steps.filter.outputs.xpkg }} steps: - uses: actions/checkout@v4 - uses: dorny/paths-filter@v3 @@ -47,6 +48,10 @@ jobs: - 'packages/m/mcpplibs-capi-lua/**' - 'tests/l/lua/**' - '.github/workflows/ci.yml' + xpkg: + - 'packages/m/mcpplibs-xpkg/**' + - 'tests/m/mcpplibs-xpkg/**' + - '.github/workflows/ci.yml' build: needs: detect-changes @@ -54,7 +59,8 @@ jobs: needs.detect-changes.outputs.templates == 'true' || needs.detect-changes.outputs.cmdline == 'true' || needs.detect-changes.outputs.llmapi == 'true' || - needs.detect-changes.outputs.lua == 'true' + needs.detect-changes.outputs.lua == 'true' || + needs.detect-changes.outputs.xpkg == 'true' strategy: fail-fast: false matrix: @@ -150,3 +156,19 @@ jobs: $env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH" xmake build -P . -y lua_test xmake run -P . lua_test + + # mcpplibs-xpkg + - name: mcpplibs-xpkg (unix) + if: runner.os != 'Windows' && needs.detect-changes.outputs.xpkg == 'true' + working-directory: tests + run: | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" + xmake build -P . -y mcpplibs-xpkg_test + xmake run -P . mcpplibs-xpkg_test + - name: mcpplibs-xpkg (windows) + if: runner.os == 'Windows' && needs.detect-changes.outputs.xpkg == 'true' + working-directory: tests + run: | + $env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH" + xmake build -P . -y mcpplibs-xpkg_test + xmake run -P . mcpplibs-xpkg_test diff --git a/packages/m/mcpplibs-xpkg/xmake.lua b/packages/m/mcpplibs-xpkg/xmake.lua new file mode 100644 index 0000000..4367f24 --- /dev/null +++ b/packages/m/mcpplibs-xpkg/xmake.lua @@ -0,0 +1,25 @@ +package("mcpplibs-xpkg") + + set_homepage("https://github.com/Sunrisepeak/libxpkg") + set_description("C++23 reference implementation of the xpkg package specification") + set_license("MIT") + + add_urls( + "https://github.com/Sunrisepeak/libxpkg/archive/refs/tags/v$(version).tar.gz", + "https://github.com/Sunrisepeak/libxpkg.git v$(version)" + ) + + add_versions("0.0.1", "4bbf178c9225e6be09302408ebe70edfdae237adbf142ddf10d1535aec2ae0cd") + + add_deps("mcpplibs-capi-lua") + + on_install(function (package) + local configs = {} + local install = import("package.tools.xmake").install + -- Install each library target individually to avoid building examples/tests + install(package, configs, {target = "mcpplibs-xpkg"}) + install(package, configs, {target = "mcpplibs-xpkg-loader"}) + install(package, configs, {target = "mcpplibs-xpkg-index"}) + install(package, configs, {target = "mcpplibs-xpkg-lua-stdlib"}) + install(package, configs, {target = "mcpplibs-xpkg-executor"}) + end) diff --git a/tests/m/mcpplibs-xpkg/main.cpp b/tests/m/mcpplibs-xpkg/main.cpp new file mode 100644 index 0000000..a5e9004 --- /dev/null +++ b/tests/m/mcpplibs-xpkg/main.cpp @@ -0,0 +1,10 @@ +import std; +import mcpplibs.xpkg; + +int main() { + mcpplibs::xpkg::Package pkg; + pkg.name = "test"; + pkg.description = "mcpplibs-xpkg smoke test"; + std::println("package: {} - {}", pkg.name, pkg.description); + return 0; +} diff --git a/tests/m/mcpplibs-xpkg/xmake.lua b/tests/m/mcpplibs-xpkg/xmake.lua new file mode 100644 index 0000000..fa797cb --- /dev/null +++ b/tests/m/mcpplibs-xpkg/xmake.lua @@ -0,0 +1,9 @@ +add_requires("mcpplibs-xpkg 0.0.1") +add_requires("mcpplibs-capi-lua 0.0.1") + +target("mcpplibs-xpkg_test") + set_kind("binary") + set_languages("c++23") + add_files("main.cpp") + add_packages("mcpplibs-xpkg", "mcpplibs-capi-lua") + set_policy("build.c++.modules", true) diff --git a/tests/xmake.lua b/tests/xmake.lua index f20ce2d..3074df0 100644 --- a/tests/xmake.lua +++ b/tests/xmake.lua @@ -4,3 +4,4 @@ includes("l/llmapi") includes("l/lua") includes("c/cmdline") includes("t/templates") +includes("m/mcpplibs-xpkg")