|
| 1 | +version: "3" |
| 2 | + |
| 3 | +includes: |
| 4 | + utils: |
| 5 | + internal: true |
| 6 | + taskfile: "../tools/yscope-dev-utils/exports/taskfiles/utils/utils.yaml" |
| 7 | + |
| 8 | +vars: |
| 9 | + # General paths |
| 10 | + G_DOCS_BUILD_DIR: "{{.G_BUILD_DIR}}/docs" |
| 11 | + G_DOCS_HTML_DIR: "{{.G_DOCS_BUILD_DIR}}/html" |
| 12 | + G_DOCS_VENV_DIR: "{{.G_DOCS_BUILD_DIR}}/docs-venv" |
| 13 | + G_NODE_DEPS_DIR: "{{.G_DOCS_BUILD_DIR}}/docs-node" |
| 14 | + |
| 15 | + # Doxygen paths |
| 16 | + G_DOXYFILE_PATH: "{{.ROOT_DIR}}/docs/doxygen/Doxyfile" |
| 17 | + G_DOXYGEN_CMD: "{{.G_DOCS_VENV_DIR}}/bin/doxygen" |
| 18 | + |
| 19 | +tasks: |
| 20 | + clean: |
| 21 | + cmds: |
| 22 | + - "rm -rf '{{.G_DOCS_BUILD_DIR}}'" |
| 23 | + |
| 24 | + serve: |
| 25 | + deps: |
| 26 | + - "http-server" |
| 27 | + - "site" |
| 28 | + cmds: |
| 29 | + - "npm --prefix '{{.G_NODE_DEPS_DIR}}' exec -- http-server '{{.G_DOCS_HTML_DIR}}' -c-1" |
| 30 | + |
| 31 | + site: |
| 32 | + vars: |
| 33 | + CHECKSUM_FILE: "{{.G_BUILD_DIR}}/{{.TASK | replace \":\" \"#\"}}.md5" |
| 34 | + OUTPUT_DIR: "{{.G_DOCS_HTML_DIR}}" |
| 35 | + sources: |
| 36 | + - "{{.G_DOXYFILE_PATH}}" |
| 37 | + - "{{.ROOT_DIR}}/docs/**/*" |
| 38 | + - "{{.ROOT_DIR}}/src/**/*" |
| 39 | + - "{{.ROOT_DIR}}/taskfile.yaml" |
| 40 | + - "{{.ROOT_DIR}}/tests/**/*" |
| 41 | + - "{{.TASKFILE}}" |
| 42 | + generates: ["{{.CHECKSUM_FILE}}"] |
| 43 | + deps: |
| 44 | + - task: "utils:checksum:validate" |
| 45 | + vars: |
| 46 | + CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" |
| 47 | + INCLUDE_PATTERNS: ["{{.OUTPUT_DIR}}"] |
| 48 | + - "venv" |
| 49 | + cmds: |
| 50 | + - |- |
| 51 | + rm -rf "{{.G_DOCS_HTML_DIR}}" |
| 52 | + cd "{{.ROOT_DIR}}" |
| 53 | + "{{.G_DOXYGEN_CMD}}" "{{.G_DOXYFILE_PATH}}" |
| 54 | +
|
| 55 | + # This command must be last |
| 56 | + - task: "utils:checksum:compute" |
| 57 | + vars: |
| 58 | + CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" |
| 59 | + INCLUDE_PATTERNS: ["{{.OUTPUT_DIR}}"] |
| 60 | + |
| 61 | + http-server: |
| 62 | + internal: true |
| 63 | + run: "once" |
| 64 | + vars: |
| 65 | + CHECKSUM_FILE: "{{.G_BUILD_DIR}}/{{.TASK | replace \":\" \"#\"}}.md5" |
| 66 | + OUTPUT_DIR: "{{.G_NODE_DEPS_DIR}}" |
| 67 | + sources: |
| 68 | + - "{{.ROOT_DIR}}/taskfile.yaml" |
| 69 | + - "{{.TASKFILE}}" |
| 70 | + generates: ["{{.CHECKSUM_FILE}}"] |
| 71 | + deps: |
| 72 | + - ":init" |
| 73 | + - task: "utils:checksum:validate" |
| 74 | + vars: |
| 75 | + CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" |
| 76 | + INCLUDE_PATTERNS: ["{{.OUTPUT_DIR}}"] |
| 77 | + cmds: |
| 78 | + - "rm -rf '{{.OUTPUT_DIR}}'" |
| 79 | + - "npm --prefix '{{.OUTPUT_DIR}}' install http-server" |
| 80 | + |
| 81 | + # This command must be last |
| 82 | + - task: "utils:checksum:compute" |
| 83 | + vars: |
| 84 | + CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" |
| 85 | + INCLUDE_PATTERNS: ["{{.OUTPUT_DIR}}"] |
| 86 | + |
| 87 | + venv: |
| 88 | + internal: true |
| 89 | + run: "once" |
| 90 | + vars: |
| 91 | + DOXYGEN_FILENAME: "doxygen-1.14.0.linux.bin.tar.gz" |
| 92 | + deps: |
| 93 | + - ":init" |
| 94 | + cmds: |
| 95 | + - "mkdir -p '{{.G_DOCS_VENV_DIR}}'" |
| 96 | + - task: "utils:remote:download-and-extract-tar" |
| 97 | + vars: |
| 98 | + FILE_SHA256: "e5d6ae24d0bf3f0cdc4d8f146726b89ca323922f19441af99b1872d503665ad6" |
| 99 | + INCLUDE_PATTERNS: |
| 100 | + - "bin" |
| 101 | + OUTPUT_DIR: "{{.G_DOCS_VENV_DIR}}" |
| 102 | + TAR_FILE: "{{.G_DOCS_BUILD_DIR}}/{{.DOXYGEN_FILENAME}}" |
| 103 | + URL: "https://www.doxygen.nl/files/{{.DOXYGEN_FILENAME}}" |
0 commit comments