diff options
| author | ruki <[email protected]> | 2020-07-24 22:36:33 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-07-24 22:36:33 +0800 |
| commit | 6b89d8b1edc849f8324dae490e635dca080ac473 (patch) | |
| tree | 51f863f80ffbc70d7f8ac3d9b8489d340abdedcd /tests/projects | |
| parent | 3ad0524f1c963c974741285b633157f3f28718db (diff) | |
inherit go modules
Diffstat (limited to 'tests/projects')
| -rw-r--r-- | tests/projects/go/console/src/main.go | 9 | ||||
| -rw-r--r-- | tests/projects/go/console/xmake.lua | 8 | ||||
| -rw-r--r-- | tests/projects/go/console_with_deps/src/main.go | 11 | ||||
| -rw-r--r-- | tests/projects/go/console_with_deps/xmake.lua | 6 | ||||
| -rw-r--r-- | tests/projects/go/static_library/xmake.lua | 20 |
5 files changed, 19 insertions, 35 deletions
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)") - |
