diff --git a/examples/Makefile b/examples/Makefile index e4b87d5916..94770580d6 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -2,9 +2,11 @@ LAKE ?= ../build/bin/lake all: check-lake test time-bootstrap check-bootstrap test-bootstrapped -test: test-init test-hello test-io test-deps test-git test-ffi test-ffi-dep test-main +test: test-init test-hello test-io test-deps\ + test-git test-ffi test-ffi-dep test-main -clean: clean-init clean-hello clean-io clean-deps clean-git clean-ffi clean-ffi-dep clean-main clean-bootstrap +clean: clean-init clean-hello clean-io clean-deps\ + clean-git clean-ffi clean-ffi-dep clean-main clean-bootstrap check-lake: $(LAKE) self-check @@ -74,4 +76,5 @@ test-bootstrapped: test-boostrapped-hello test-boostrapped-hello: cd hello && ./bootstrapped-test.sh -.PHONY: all check-lake test clean test-bootstrap time-bootstrap check-bootstrap test-bootstrapped +.PHONY: all check-lake test clean\ + test-bootstrap time-bootstrap check-bootstrap test-bootstrapped diff --git a/examples/deps/bar/.gitignore b/examples/deps/bar/.gitignore new file mode 100644 index 0000000000..796b96d1c4 --- /dev/null +++ b/examples/deps/bar/.gitignore @@ -0,0 +1 @@ +/build diff --git a/examples/deps/bar/Main.lean b/examples/deps/bar/Main.lean new file mode 100644 index 0000000000..37b0338942 --- /dev/null +++ b/examples/deps/bar/Main.lean @@ -0,0 +1,4 @@ +import Foo + +def main : IO Unit := + IO.println s!"Hello, bar {foo} {a} {b}!" diff --git a/examples/deps/bar/lakefile.lean b/examples/deps/bar/lakefile.lean new file mode 100644 index 0000000000..2820d1f136 --- /dev/null +++ b/examples/deps/bar/lakefile.lean @@ -0,0 +1,9 @@ +import Lake +open System Lake DSL + +package where + name := "bar" + dependencies := [ + { name := "foo", src := Source.path (FilePath.mk ".." / "foo") } + ] + binRoot := `Main diff --git a/examples/deps/clean.sh b/examples/deps/clean.sh index bb08ef93ed..ca53ed1f0d 100755 --- a/examples/deps/clean.sh +++ b/examples/deps/clean.sh @@ -1,3 +1,4 @@ rm -rf a/build rm -rf b/build rm -rf foo/build +rm -rf bar/build diff --git a/examples/deps/foo/Foo.lean b/examples/deps/foo/Foo.lean index 70f30e33be..3ac72cda60 100644 --- a/examples/deps/foo/Foo.lean +++ b/examples/deps/foo/Foo.lean @@ -2,6 +2,3 @@ import A import B import Foo.Bar import Foo.Baz - -def main : IO Unit := - IO.println s!"Hello, {foo} {a} {b}!" diff --git a/examples/deps/foo/Main.lean b/examples/deps/foo/Main.lean new file mode 100644 index 0000000000..a97c51c767 --- /dev/null +++ b/examples/deps/foo/Main.lean @@ -0,0 +1,4 @@ +import Foo + +def main : IO Unit := + IO.println s!"Hello, {foo} {a} {b}!" diff --git a/examples/deps/foo/lakefile.lean b/examples/deps/foo/lakefile.lean index 0764357b2b..ab0231d793 100644 --- a/examples/deps/foo/lakefile.lean +++ b/examples/deps/foo/lakefile.lean @@ -7,3 +7,4 @@ package where { name := "a", src := Source.path (FilePath.mk ".." / "a") }, { name := "b", src := Source.path (FilePath.mk ".." / "b") } ] + binRoot := `Main diff --git a/examples/deps/package.sh b/examples/deps/package.sh index 2b5a67a15b..c0edb02a31 100755 --- a/examples/deps/package.sh +++ b/examples/deps/package.sh @@ -1,3 +1,11 @@ +set -ex + +# TODO: flip and fix example (deep deps are currently broken) + cd foo -echo "in directory 'foo'" ${LAKE:-../../../build/bin/lake} build-bin +cd .. + +cd bar +${LAKE:-../../../build/bin/lake} build-bin +cd .. diff --git a/examples/deps/test.sh b/examples/deps/test.sh index 7279493ef9..95bbde3c92 100755 --- a/examples/deps/test.sh +++ b/examples/deps/test.sh @@ -3,3 +3,4 @@ set -e ./clean.sh ./package.sh ./foo/build/bin/foo +./bar/build/bin/bar