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

add package rule test #4764

Merged
merged 3 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
rule("markdown")
set_extensions(".md")
on_config(function (target)
print("test: config %s", target:name())
end)
on_build_file(function(target, sourcefile)
print("test: build %s", sourcefile)
end)
after_clean(function (target)
print("test: clean")
end)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package("foo")
on_install(function()
end)
6 changes: 6 additions & 0 deletions tests/projects/package/package_rule/src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <stdio.h>

int main(int argc, char** argv) {
printf("hello world!\n");
return 0;
}
Empty file.
12 changes: 12 additions & 0 deletions tests/projects/package/package_rule/test.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function main(t)

-- freebsd ci is slower
if is_host("bsd") then
return
end

-- only for x86/x64, because it will take too long time on ci with arm/mips
if os.subarch():startswith("x") or os.subarch() == "i386" then
t:build()
end
end
11 changes: 11 additions & 0 deletions tests/projects/package/package_rule/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
add_rules("mode.debug", "mode.release")

add_requires("foo")
add_repositories("myrepo ./repo")

target("console")
set_kind("binary")
add_files("src/main.cpp", "src/*.md")
add_packages("foo")
add_rules("@foo/markdown")

Loading