From 6b89d8b1edc849f8324dae490e635dca080ac473 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 24 Jul 2020 22:36:33 +0800 Subject: inherit go modules --- tests/projects/go/console/src/main.go | 9 +-------- tests/projects/go/console/xmake.lua | 8 +------- tests/projects/go/console_with_deps/src/main.go | 11 +++++++++++ tests/projects/go/console_with_deps/xmake.lua | 6 ++++++ tests/projects/go/static_library/xmake.lua | 20 -------------------- 5 files changed, 19 insertions(+), 35 deletions(-) create mode 100644 tests/projects/go/console_with_deps/src/main.go create mode 100644 tests/projects/go/console_with_deps/xmake.lua (limited to 'tests') diff --git a/tests/projects/go/console/src/main.go b/tests/projects/go/console/src/main.go index 8ea127243..b689db480 100644 --- a/tests/projects/go/console/src/main.go +++ b/tests/projects/go/console/src/main.go @@ -1,14 +1,7 @@ package main -/* ///////////////////////////////////////////////////////////////////////////////////////////////// - * imports - */ import "fmt" -/* ///////////////////////////////////////////////////////////////////////////////////////////////// - * main - */ func main() { - - fmt.Println("hello xmake for go!") + fmt.Println("hello xmake!") } diff --git a/tests/projects/go/console/xmake.lua b/tests/projects/go/console/xmake.lua index b263bdac7..753a88a08 100644 --- a/tests/projects/go/console/xmake.lua +++ b/tests/projects/go/console/xmake.lua @@ -1,12 +1,6 @@ --- add rules add_rules("mode.debug", "mode.release") --- add target -target("console_go") - - -- set kind +target("test") set_kind("binary") - - -- add files add_files("src/*.go") diff --git a/tests/projects/go/console_with_deps/src/main.go b/tests/projects/go/console_with_deps/src/main.go new file mode 100644 index 000000000..cf33b2d7f --- /dev/null +++ b/tests/projects/go/console_with_deps/src/main.go @@ -0,0 +1,11 @@ +package main + +import ( + log "github.com/sirupsen/logrus" +) + +func main() { + log.WithFields(log.Fields{ + "animal": "walrus", + }).Info("A walrus appears") +} diff --git a/tests/projects/go/console_with_deps/xmake.lua b/tests/projects/go/console_with_deps/xmake.lua new file mode 100644 index 000000000..753a88a08 --- /dev/null +++ b/tests/projects/go/console_with_deps/xmake.lua @@ -0,0 +1,6 @@ +add_rules("mode.debug", "mode.release") + +target("test") + set_kind("binary") + add_files("src/*.go") + diff --git a/tests/projects/go/static_library/xmake.lua b/tests/projects/go/static_library/xmake.lua index 8284fb983..99ca434f9 100644 --- a/tests/projects/go/static_library/xmake.lua +++ b/tests/projects/go/static_library/xmake.lua @@ -1,30 +1,10 @@ --- add rules add_rules("mode.debug", "mode.release") --- add target target("module") - - -- set kind set_kind("static") - - -- add files add_files("src/test/*.go") --- add target target("test") - - -- set kind set_kind("binary") - - -- add deps add_deps("module") - - -- add files add_files("src/*.go") - - -- add link directory - add_linkdirs("$(buildir)/$(plat)/$(arch)/$(mode)") - - -- add include directory - add_includedirs("$(buildir)/$(plat)/$(arch)/$(mode)") - -- cgit v1.3.1