Skip to content

Commit

Permalink
fix docs build
Browse files Browse the repository at this point in the history
  • Loading branch information
vito committed Apr 18, 2023
1 parent 7d6ec9c commit d177458
Showing 1 changed file with 28 additions and 19 deletions.
47 changes: 28 additions & 19 deletions bass/bass.bass
Original file line number Diff line number Diff line change
Expand Up @@ -34,39 +34,41 @@
(from (deps src)
($ cp src/go.mod src/go.sum ./)
($ cp -a & $submodule-cp-args)
($ go mod download)))))
(with-go-cache
($ go mod download))))))

(provide [build dist smoke-test tests docs coverage]
(use (*dir*/buildkit.bass))

(defn dist [src version os arch]
(-> ($ make
(str "VERSION=" version)
(str "GOOS=" os)
(str "GOARCH=" arch)
dist)
(-> (cd (go-files src)
($ make
(str "VERSION=" version)
(str "GOOS=" os)
(str "GOARCH=" arch)
dist))
with-go-cache
(with-deps-and-shims src)
(subpath ./dist/)))

; compiles a bass binary for the given platform and puts it in an archive
(defn build [src version os arch]
(archive src (dist src version os arch) os arch))

(defn go-files [src]
(glob src
./**/*.go
./**/go.mod
./**/go.sum
./std/*.bass
./pkg/bass/testdata/**/*
./pkg/runtimes/testdata/**/*
./pkg/lsp/testdata/**/*
./Makefile))

(defn with-deps-and-shims [thunk src]
(-> thunk
(with-mount
(glob src
./**/*.go
./**/go.mod
./**/go.sum
./std/*.bass
./pkg/bass/testdata/**/*
./pkg/runtimes/testdata/**/*
./pkg/lsp/testdata/**/*
./Makefile)
./)
(with-mount (make-shims src) ./pkg/runtimes/bin/)
with-go-cache
(with-image (deps+go src))))

; returns a thunk with the make targets built into the output directory, as
Expand Down Expand Up @@ -156,9 +158,16 @@
(with-mount test-depot /etc/ssl/certs/bass-depot/)
(with-deps-and-shims src))))

(defn docs-files [src]
(glob (go-files src)
./docs/**/*
./demos/**/*))

; returns a directory containing the built docs HTML
(defn docs [src]
(-> ($ ./docs/scripts/build)
(-> (cd (docs-files src)
($ ./docs/scripts/build))
with-go-cache
(with-bass-and-buildkitd src)
(subpath ./docs/)))

Expand Down

0 comments on commit d177458

Please sign in to comment.