Skip to content

Commit

Permalink
croncpp: add package (#5171)
Browse files Browse the repository at this point in the history
  • Loading branch information
apocelipes authored Sep 7, 2024
1 parent 44ab2dd commit f5024a7
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/c/croncpp/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package("croncpp")
set_kind("library", {headeronly = true})
set_homepage("https://github.com/mariusbancila/croncpp")
set_description("A C++11/14/17 header-only cross-platform library for handling CRON expressions")
set_license("MIT")

add_urls("https://github.com/mariusbancila/croncpp/archive/refs/tags/$(version).tar.gz",
"https://github.com/mariusbancila/croncpp.git")

add_versions("v2023.03.30", "0731b7f900a670c009585eb5e9639722aeff6531dbbd5bfc9ce895459733837e")

on_install(function (package)
os.cp("include", package:installdir())
end)

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <iostream>
#include <ctime>
int main() {
auto cr = cron::make_cron("* 0/5 * * * ?");
auto time = cron::utils::to_tm("2024-08-28 20:01:00");
auto next = cron::cron_next(cr, time);
std::cout << std::asctime(&next);
}
]]}, {configs = {languages = "c++14"}, includes = "croncpp.h"}))
end)

0 comments on commit f5024a7

Please sign in to comment.