Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-update ada to v3.0.1 #6309

Merged
merged 3 commits into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion packages/a/ada/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package("ada")
set_urls("https://github.com/ada-url/ada/archive/refs/tags/$(version).tar.gz",
"https://github.com/ada-url/ada.git")

add_versions("v3.0.1", "525890a87a002b1cc14c091800c53dcf4a24746dbfc5e3b8a9c80490daad9263")
add_versions("v2.9.2", "f41575ad7eec833afd9f6a0d6101ee7dc2f947fdf19ae8f1b54a71d59f4ba5ec")
add_versions("v2.9.1", "64eb3d91db941645d1b68ac8d1cbb7b534fbe446b66c1da11e384e17fca975e7")
add_versions("v2.9.0", "8b992f0ce9134cb4eafb74b164d2ce2cb3af1900902162713b0e0c5ab0b6acd8")
Expand All @@ -25,21 +26,40 @@ package("ada")

add_deps("cmake")

if on_check then
on_check("android", function (package)
if package:version() and package:version():ge("3.0.0") then
local ndk = package:toolchain("ndk"):config("ndkver")
assert(ndk and tonumber(ndk) > 22, "package(ada >=3.0.0) require ndk version > 22")
end
end)
end

on_install(function (package)
io.replace("CMakeLists.txt", "add_subdirectory(singleheader)", "", {plain = true})
io.replace("CMakeLists.txt", "add_subdirectory(tools)", "", {plain = true})

io.replace("src/CMakeLists.txt", "/WX", "", {plain = true})

local configs = {"-DBUILD_TESTING=OFF", "-DADA_TOOLS=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DADA_SANITIZE=" .. (package:config("asan") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)

on_test(function (package)
local languages
if package:version() and package:version():ge("3.0.0") then
languages = "c++20"
else
languages = "c++17"
end
assert(package:check_cxxsnippets({test = [[
#include <iostream>
#include <ada.h>
void test() {
auto url = ada::parse<ada::url_aggregator>("https://xmake.io");
}
]]}, {configs = {languages = "c++17"}}))
]]}, {configs = {languages = languages}}))
end)