2020-12-02 12:33:47 +00:00
|
|
|
version: '3'
|
|
|
|
|
|
|
|
vars:
|
|
|
|
DEBUG_PORT: 2345
|
2021-11-12 12:08:56 +00:00
|
|
|
REVEALJS_VERSION: 4.1.2
|
2021-11-12 12:34:54 +00:00
|
|
|
HIGHLIGHTJS_VERSION: 11.3.1
|
2020-12-02 12:33:47 +00:00
|
|
|
BINARY_NAME: goveal
|
|
|
|
OUT_DIR: ./out
|
|
|
|
GO_BUILD_ARGS: -ldflags="-w -s"
|
2020-12-06 11:18:42 +00:00
|
|
|
CMD_PACKAGE: github.com/baez90/goveal/cmd/goveal
|
2020-12-02 12:33:47 +00:00
|
|
|
|
2021-11-12 12:08:56 +00:00
|
|
|
env:
|
2020-12-02 12:33:47 +00:00
|
|
|
CGO_ENABLED: 0
|
2021-11-12 12:08:56 +00:00
|
|
|
GOBIN:
|
|
|
|
sh: echo "$(pwd)/bin/"
|
2020-12-02 12:33:47 +00:00
|
|
|
|
|
|
|
tasks:
|
|
|
|
clean:
|
|
|
|
cmds:
|
|
|
|
- rm -f debug {{ .BINARY_NAME }}
|
|
|
|
- rm -rf ./dist {{ .OUT_DIR }}
|
|
|
|
|
2021-11-12 12:08:56 +00:00
|
|
|
fmt:
|
|
|
|
desc: Run gofumpt against code
|
|
|
|
deps:
|
|
|
|
- gofumpt
|
|
|
|
- goimports
|
|
|
|
sources:
|
|
|
|
- "**/*.go"
|
2020-12-02 12:33:47 +00:00
|
|
|
cmds:
|
2021-11-12 12:08:56 +00:00
|
|
|
- "{{ .GOBIN }}gofumpt -l -w ./"
|
|
|
|
- "{{ .GOBIN }}goimports -w -local github.com/baez90/goveal ./."
|
2020-12-02 12:33:47 +00:00
|
|
|
|
|
|
|
deps:
|
|
|
|
sources:
|
|
|
|
- go.mod
|
|
|
|
- go.sum
|
|
|
|
cmds:
|
|
|
|
- go mod download
|
|
|
|
- go mod tidy
|
|
|
|
|
|
|
|
test:
|
|
|
|
sources:
|
|
|
|
- ./**/*.go
|
|
|
|
deps:
|
|
|
|
- deps
|
2021-11-12 12:34:54 +00:00
|
|
|
- fmt
|
2020-12-02 12:33:47 +00:00
|
|
|
cmds:
|
2020-12-02 12:37:09 +00:00
|
|
|
- mkdir -p {{ .OUT_DIR }}
|
2020-12-02 12:33:47 +00:00
|
|
|
- go test -coverprofile={{ .OUT_DIR }}/cov-raw.out -v ./...
|
|
|
|
- cat {{ .OUT_DIR }}/cov-raw.out | grep -v "generated" > {{ .OUT_DIR }}/cov.out
|
|
|
|
|
|
|
|
cli-cover-report:
|
2020-12-02 12:37:09 +00:00
|
|
|
deps:
|
|
|
|
- test
|
2020-12-02 12:33:47 +00:00
|
|
|
cmds:
|
|
|
|
- go tool cover -func={{ .OUT_DIR }}/cov.out
|
|
|
|
|
|
|
|
html-cover-report:
|
2020-12-02 12:37:09 +00:00
|
|
|
deps:
|
|
|
|
- test
|
2020-12-02 12:33:47 +00:00
|
|
|
cmds:
|
|
|
|
- go tool cover -html={{ .OUT_DIR }}/cov.out -o {{ .OUT_DIR }}/coverage.html
|
|
|
|
|
|
|
|
build:
|
|
|
|
deps:
|
|
|
|
- deps
|
|
|
|
sources:
|
|
|
|
- ./**/*.go
|
|
|
|
cmds:
|
|
|
|
- go build {{ .GO_BUILD_ARGS }} -o {{ .BINARY_NAME }} {{ .CMD_PACKAGE }}
|
|
|
|
|
|
|
|
run:
|
|
|
|
deps:
|
|
|
|
- deps
|
2021-11-12 12:08:56 +00:00
|
|
|
dir: ./examples
|
2020-12-02 12:33:47 +00:00
|
|
|
cmds:
|
2021-11-12 12:08:56 +00:00
|
|
|
- go run {{ .CMD_PACKAGE }} serve ./slides.md --config ./goveal.yaml
|
2020-12-02 12:33:47 +00:00
|
|
|
|
|
|
|
debug:
|
|
|
|
cmds:
|
|
|
|
- dlv debug --headless --listen=127.10.10.2:{{ .DEBUG_PORT }} --api-version=2 {{ .CMD_PACKAGE }} --build-flags="-tags debug" -- serve --config ./examples/goveal.yaml ./examples/slides.md
|
|
|
|
|
|
|
|
snapshot-release:
|
|
|
|
cmds:
|
|
|
|
- goreleaser --snapshot --skip-publish --rm-dist
|
|
|
|
|
|
|
|
download-reveal:
|
2021-11-12 12:34:54 +00:00
|
|
|
sources:
|
|
|
|
- Taskfile.yml
|
2020-12-02 12:33:47 +00:00
|
|
|
cmds:
|
|
|
|
- rm -rf ./assets/reveal
|
|
|
|
- mkdir -p ./assets/reveal
|
2020-12-04 15:28:02 +00:00
|
|
|
- curl -sL https://github.com/hakimel/reveal.js/archive/{{ .REVEALJS_VERSION }}.tar.gz | tar -xvz --strip-components=1 -C ./assets/reveal --wildcards "*.js" --wildcards "*.css" --wildcards "*.html" --wildcards "*.woff" --wildcards "*.ttf" --exclude "test" --exclude "gulpfile.js" --exclude "gruntfile.js" --exclude "demo.html" --exclude "index.html" --exclude "examples/*.html"
|
2020-12-02 12:33:47 +00:00
|
|
|
- mkdir -p ./assets/reveal/plugin/menu ./assets/reveal/plugin/mouse-pointer
|
|
|
|
- git clone https://github.com/denehyg/reveal.js-menu.git ./assets/reveal/plugin/menu
|
|
|
|
- curl -L -o ./assets/reveal/plugin/mouse-pointer/mouse-pointer.js https://raw.githubusercontent.com/caiofcm/plugin-revealjs-mouse-pointer/master/mouse-pointer.js
|
2020-12-04 15:28:02 +00:00
|
|
|
- rm -f ./assets/reveal/plugin/menu/{bower.json,CONTRIBUTING.md,LICENSE,package.json,README.md,.gitignore,gulpfile.js,package-lock.json}
|
2021-11-12 12:34:54 +00:00
|
|
|
- curl -L https://github.com/highlightjs/highlight.js/archive/{{ .HIGHLIGHTJS_VERSION }}.tar.gz | tar -xvz --strip-components=3 -C ./assets/reveal/plugin/highlight --wildcards "*.css" highlight.js-{{ .HIGHLIGHTJS_VERSION }}/src/styles/
|
2021-11-12 12:08:56 +00:00
|
|
|
|
|
|
|
go-get-tool:
|
|
|
|
vars:
|
|
|
|
PACKAGE: '{{ default "" .PACKAGE }}'
|
|
|
|
cmds:
|
|
|
|
- go install {{ .PACKAGE }}
|
|
|
|
|
|
|
|
gofumpt:
|
|
|
|
desc: Download gofumpt locally if necessary
|
|
|
|
cmds:
|
|
|
|
- task: go-get-tool
|
|
|
|
vars:
|
2021-11-12 12:34:54 +00:00
|
|
|
PACKAGE: mvdan.cc/gofumpt@v0.2.0
|
2021-11-12 12:08:56 +00:00
|
|
|
status:
|
|
|
|
- test -f {{ .GOBIN }}gofumpt
|
|
|
|
|
|
|
|
goimports:
|
|
|
|
desc: Download goimports locally if necessary
|
|
|
|
cmds:
|
|
|
|
- task: go-get-tool
|
|
|
|
vars:
|
|
|
|
PACKAGE: golang.org/x/tools/cmd/goimports@v0.1.7
|
|
|
|
status:
|
|
|
|
- test -f {{ .GOBIN }}goimports
|