From 2ddc806c2ec7e0862572d9d883e3cb1864a8ca32 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 5 May 2022 20:21:32 -0700 Subject: [PATCH] fix: update the default to doxygen 1.9.4 --- src/default_versions.ts | 2 +- src/doxygen/doxygen.ts | 25 +++++++++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/default_versions.ts b/src/default_versions.ts index ab1bac11..320ea45c 100644 --- a/src/default_versions.ts +++ b/src/default_versions.ts @@ -12,7 +12,7 @@ const DefaultVersions: Record = { python: "3.8.10", kcov: "40", // https://github.com/SimonKagstrom/kcov/releases task: "3.12.0", // https://github.com/go-task/task/releases - doxygen: "1.9.1", // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=doxygen + doxygen: process.platform === "darwin" ? "1.9.3" : "1.9.4", // https://www.doxygen.nl/download.html // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=doxygen gcc: process.platform === "win32" ? "11.2.0.07112021" : "11", // https://community.chocolatey.org/packages/mingw#versionhistory and // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=gcc } diff --git a/src/doxygen/doxygen.ts b/src/doxygen/doxygen.ts index 95dcd2dd..4a65eea4 100644 --- a/src/doxygen/doxygen.ts +++ b/src/doxygen/doxygen.ts @@ -4,7 +4,7 @@ import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin import { setupBrewPack } from "../utils/setup/setupBrewPack" import { setupChocoPack } from "../utils/setup/setupChocoPack" import { addBinExtension } from "../utils/extension/extension" -import { extractTar } from "../utils/setup/extract" +import { extractTar, extractZip } from "../utils/setup/extract" import { notice } from "../utils/io/io" import { setupGraphviz } from "../graphviz/graphviz" import { getVersion } from "../default_versions" @@ -23,6 +23,16 @@ function getDoxygenPackageInfo(version: string, platform: NodeJS.Platform, _arch url: `https://www.doxygen.nl/files/${folderName}.linux.bin.tar.gz`, } } + case "win32": { + const folderName = `doxygen-${version}` + return { + binRelativeDir: "bin/", + binFileName: addBinExtension("doxygen"), + extractedFolderName: folderName, + extractFunction: extractZip, + url: `https://www.doxygen.nl/files/${folderName}.windows.x64.bin.zip`, + } + } default: throw new Error(`Unsupported platform '${platform}'`) } @@ -31,10 +41,17 @@ function getDoxygenPackageInfo(version: string, platform: NodeJS.Platform, _arch export async function setupDoxygen(version: string, setupDir: string, arch: string) { switch (process.platform) { case "win32": { - await setupChocoPack("doxygen.install", version) + let installationInfo: InstallationInfo + try { + installationInfo = await setupBin("doxygen", version, getDoxygenPackageInfo, setupDir, arch) + } catch (err) { + notice(`Failed to download doxygen binary. ${err}. Falling back to choco.`) + await setupChocoPack("doxygen.install", version) + const binDir = activateWinDoxygen() + installationInfo = { binDir } + } await setupGraphviz(getVersion("graphviz", undefined), "", arch) - const binDir = activateWinDoxygen() - return { binDir } + return installationInfo } case "darwin": { const installationInfo = setupBrewPack("doxygen", undefined)