Skip to content

Commit

Permalink
Merge pull request #71 from aminya/doxygen [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya authored May 10, 2022
2 parents 4b6411c + 9504707 commit 9614260
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 32 deletions.
2 changes: 1 addition & 1 deletion dist/setup_cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/setup_cpp.js.map

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/default_versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const DefaultVersions: Record<string, string> = {
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
}

Expand Down
32 changes: 26 additions & 6 deletions src/doxygen/doxygen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ 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"
import { existsSync } from "fs"

/** Get the platform data for cmake */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand All @@ -23,6 +24,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: "",
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}'`)
}
Expand All @@ -32,9 +43,10 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
switch (process.platform) {
case "win32": {
await setupChocoPack("doxygen.install", version)
await setupGraphviz(getVersion("graphviz", undefined), "", arch)
const binDir = activateWinDoxygen()
return { binDir }
const installationInfo = { binDir }
await setupGraphviz(getVersion("graphviz", undefined), "", arch)
return installationInfo
}
case "darwin": {
const installationInfo = setupBrewPack("doxygen", undefined)
Expand Down Expand Up @@ -63,9 +75,17 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
function activateWinDoxygen() {
switch (process.platform) {
case "win32": {
const binDir = "C:/Program Files/doxygen/bin"
addPath(binDir)
return binDir
for (const binDir of [
"C:/ProgramData/chocolatey/bin",
"C:/Program Files/doxygen/bin",
"C:/Program Files (x86)/doxygen",
]) {
if (existsSync(binDir)) {
addPath(binDir)
return binDir
}
}
throw new Error("Failed to find doxygen binary")
}
default: {
throw new Error(`Unsupported platform`)
Expand Down

0 comments on commit 9614260

Please sign in to comment.