Skip to content

Commit 9614260

Browse files
authored
Merge pull request #71 from aminya/doxygen [skip ci]
2 parents 4b6411c + 9504707 commit 9614260

File tree

5 files changed

+52
-32
lines changed

5 files changed

+52
-32
lines changed

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-lock.yaml

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/default_versions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const DefaultVersions: Record<string, string> = {
1212
python: "3.8.10",
1313
kcov: "40", // https://github.com/SimonKagstrom/kcov/releases
1414
task: "3.12.0", // https://github.com/go-task/task/releases
15-
doxygen: "1.9.1", // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=doxygen
15+
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
1616
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
1717
}
1818

src/doxygen/doxygen.ts

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin
44
import { setupBrewPack } from "../utils/setup/setupBrewPack"
55
import { setupChocoPack } from "../utils/setup/setupChocoPack"
66
import { addBinExtension } from "../utils/extension/extension"
7-
import { extractTar } from "../utils/setup/extract"
7+
import { extractTar, extractZip } from "../utils/setup/extract"
88
import { notice } from "../utils/io/io"
99
import { setupGraphviz } from "../graphviz/graphviz"
1010
import { getVersion } from "../default_versions"
11+
import { existsSync } from "fs"
1112

1213
/** Get the platform data for cmake */
1314
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -23,6 +24,16 @@ function getDoxygenPackageInfo(version: string, platform: NodeJS.Platform, _arch
2324
url: `https://www.doxygen.nl/files/${folderName}.linux.bin.tar.gz`,
2425
}
2526
}
27+
case "win32": {
28+
const folderName = `doxygen-${version}`
29+
return {
30+
binRelativeDir: "",
31+
binFileName: addBinExtension("doxygen"),
32+
extractedFolderName: folderName,
33+
extractFunction: extractZip,
34+
url: `https://www.doxygen.nl/files/${folderName}.windows.x64.bin.zip`,
35+
}
36+
}
2637
default:
2738
throw new Error(`Unsupported platform '${platform}'`)
2839
}
@@ -32,9 +43,10 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
3243
switch (process.platform) {
3344
case "win32": {
3445
await setupChocoPack("doxygen.install", version)
35-
await setupGraphviz(getVersion("graphviz", undefined), "", arch)
3646
const binDir = activateWinDoxygen()
37-
return { binDir }
47+
const installationInfo = { binDir }
48+
await setupGraphviz(getVersion("graphviz", undefined), "", arch)
49+
return installationInfo
3850
}
3951
case "darwin": {
4052
const installationInfo = setupBrewPack("doxygen", undefined)
@@ -63,9 +75,17 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
6375
function activateWinDoxygen() {
6476
switch (process.platform) {
6577
case "win32": {
66-
const binDir = "C:/Program Files/doxygen/bin"
67-
addPath(binDir)
68-
return binDir
78+
for (const binDir of [
79+
"C:/ProgramData/chocolatey/bin",
80+
"C:/Program Files/doxygen/bin",
81+
"C:/Program Files (x86)/doxygen",
82+
]) {
83+
if (existsSync(binDir)) {
84+
addPath(binDir)
85+
return binDir
86+
}
87+
}
88+
throw new Error("Failed to find doxygen binary")
6989
}
7090
default: {
7191
throw new Error(`Unsupported platform`)

0 commit comments

Comments
 (0)