|
| 1 | +#!/usr/bin/env nu |
| 2 | + |
| 3 | +def main [] { |
| 4 | + let root = ($env.PWD) |
| 5 | + let deps_dir = ($root | path join "docs/subprojects") |
| 6 | + let doxyrest_src = ($deps_dir | path join "doxyrest") |
| 7 | + let install_dir = ($deps_dir | path join "install") |
| 8 | + let has_doxyrest = (which doxyrest | is-not-empty) |
| 9 | + |
| 10 | + # Setup Directory Structure |
| 11 | + if not ($deps_dir | path exists) { |
| 12 | + mkdir $deps_dir |
| 13 | + } |
| 14 | + |
| 15 | + # Grab Doxyrest if missing |
| 16 | + if not $has_doxyrest and not ($install_dir | path exists) { |
| 17 | + print "Downloading Doxyrest binary release..." |
| 18 | + let version = "2.1.3" |
| 19 | + let target = "linux-amd64" |
| 20 | + let archive = $"doxyrest-($version)-($target).tar.xz" |
| 21 | + let url = $"https://github.com/vovkos/doxyrest/releases/download/doxyrest-($version)/($archive)" |
| 22 | + |
| 23 | + cd $deps_dir |
| 24 | + http get $url | save $archive |
| 25 | + tar -xJf $archive |
| 26 | + |
| 27 | + if ($install_dir | path exists) { rm -rf $install_dir } |
| 28 | + mv $"doxyrest-($version)-($target)" $install_dir |
| 29 | + |
| 30 | + rm $archive |
| 31 | + cd $root |
| 32 | + } |
| 33 | + |
| 34 | + # Still needed for the frames.. |
| 35 | + if not ($doxyrest_src | path exists) { |
| 36 | + print $"Cloning doxyrest into ($doxyrest_src)..." |
| 37 | + git clone --depth 1 --single-branch https://github.com/vovkos/doxyrest $doxyrest_src |
| 38 | + } |
| 39 | + |
| 40 | + # Run the Pipeline |
| 41 | + print "Generating XML with Doxygen..." |
| 42 | + cd docs |
| 43 | + mkdir build/doxygen/xml |
| 44 | + doxygen Doxyfile.metatomic |
| 45 | + |
| 46 | + print "Generating RST with local Doxyrest..." |
| 47 | + # Add local bin to path for this execution |
| 48 | + with-env { PATH: ($env.PATH | prepend ($install_dir | path join "bin")) } { |
| 49 | + doxyrest -c doxyrest-config.lua |
| 50 | + } |
| 51 | + |
| 52 | + print "Building HTML with Sphinx (tox)..." |
| 53 | + tox -e docs |
| 54 | +} |
0 commit comments