Skip to content

Commit

Permalink
add inja
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Oct 3, 2019
1 parent b526867 commit 7d788ef
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 5 deletions.
28 changes: 28 additions & 0 deletions packages/i/inja/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package("inja")

set_homepage("https://pantor.github.io/inja/")
set_description("A Template Engine for Modern C++")

add_urls("https://github.com/pantor/inja/archive/$(version).tar.gz",
"https://github.com/pantor/inja.git")

add_versions("v2.1.0", "038ecde8f6dbad5d3cedb6ceb0853fd0e488d5dc57593a869633ecb30b0dfa6e")

add_deps("nlohmann_json")

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

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
using namespace inja;
using json = nlohmann::json;
void test() {
inja::Environment env;
json data;
data["name"] = "world";
env.render("Hello {{ name }}!", data);
}
]]}, {configs = {languages = "c++11"}, includes = {"inja/inja.hpp"}}))
end)
16 changes: 11 additions & 5 deletions packages/n/nana/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,23 @@ package("nana")
add_versions("1.6.2", "5f5cb791dff292e27bfa29d850b93f809a0d91d6044ea7e22ce7ae76a5d8b24e")
add_versions("1.7.2", "e2efb3b7619e4ef3b6de93f8afc70ff477ec6cabf4f9740f0d786904c790613f")

if is_plat("linux") then
add_deps("cmake")
end

on_install("linux", function (package)
import("package.tools.cmake").install(package)
end)

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
using namespace nana;
form fm;
label lb(fm, rectangle(fm.size()));
lb.caption("Hello, World");
fm.show();
exec();
void test() {
form fm;
label lb(fm, rectangle(fm.size()));
lb.caption("Hello, World");
fm.show();
exec();
}
]]}, {configs = {languages = "c++11"}, includes = {"nana/gui/wvl.hpp", "nana/gui/widgets/label.hpp"}}))
end)
11 changes: 11 additions & 0 deletions packages/n/nlohmann_json/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package("nlohmann_json")
add_urls("https://github.com/nlohmann/json/releases/download/$(version)/include.zip",
"https://github.com/nlohmann/json.git")
add_versions("v3.4.0", "bfec46fc0cee01c509cf064d2254517e7fa80d1e7647fea37cf81d97c5682bdc")
add_versions("v3.7.0", "541c34438fd54182e9cdc68dd20c898d766713ad6d901fb2c6e28ff1f1e7c10d")

on_install(function (package)
if os.isdir("include") then
Expand All @@ -14,3 +15,13 @@ package("nlohmann_json")
os.cp("*", package:installdir("include"))
end
end)

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
using json = nlohmann::json;
void test() {
json data;
data["name"] = "world";
}
]]}, {configs = {languages = "c++14"}, includes = {"nlohmann/json.hpp"}}))
end)

0 comments on commit 7d788ef

Please sign in to comment.