Skip to content

Commit f2828c7

Browse files
committed
feat: install doxygen via official Dmg files
1 parent f9b3519 commit f2828c7

File tree

11 files changed

+113
-54
lines changed

11 files changed

+113
-54
lines changed

dist/actions/setup-cpp.js

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

dist/actions/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.

dist/legacy/setup-cpp.js

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

dist/legacy/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.

dist/modern/setup-cpp.js

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

dist/modern/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.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"@actions/io": "^1.1.3",
7777
"@actions/tool-cache": "^2.0.1",
7878
"@babel/cli": "^7.23.4",
79+
"@shockpkg/hdi-mac": "^3.1.1",
7980
"@swc/jest": "^0.2.31",
8081
"@types/cross-spawn": "^6.0.6",
8182
"@types/eslint": "^8.56.2",

pnpm-lock.yaml

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

src/doxygen/doxygen.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { pathExists } from "path-exists"
1818
import retry from "retry-as-promised"
1919
import { ubuntuVersion } from "../utils/env/ubuntu_version"
2020
import { macosVersion } from "../utils/env/macos_version"
21+
import { setupDmg } from "../utils/setup/setupDmg"
2122

2223
/** Get the platform data for cmake */
2324
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -43,6 +44,16 @@ function getDoxygenPackageInfo(version: string, platform: NodeJS.Platform, _arch
4344
url: `https://www.doxygen.nl/files/${folderName}.windows.x64.bin.zip`,
4445
}
4546
}
47+
case "darwin": {
48+
const folderName = `Doxygen-${version}`
49+
return {
50+
binRelativeDir: "bin/",
51+
binFileName: addExeExt("doxygen"),
52+
extractedFolderName: folderName,
53+
extractFunction: setupDmg,
54+
url: `https://doxygen.nl/files/${folderName}.dmg`,
55+
}
56+
}
4657
default:
4758
throw new Error(`Unsupported platform '${platform}'`)
4859
}
@@ -64,7 +75,12 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
6475
return installationInfo
6576
}
6677
case "darwin": {
67-
const installationInfo = await setupBrewPack("doxygen", undefined)
78+
let installationInfo: InstallationInfo
79+
try {
80+
installationInfo = await setupBin("doxygen", version, getDoxygenPackageInfo, setupDir, arch)
81+
} catch {
82+
installationInfo = await setupBrewPack("doxygen", undefined)
83+
}
6884
// only install graphviz if the macOS version is greater than 11
6985
if (macosVersion()[0] > 11) {
7086
await setupGraphviz(getVersion("graphviz", undefined), "", arch)
@@ -87,7 +103,11 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
87103
try {
88104
// doxygen on stable Ubuntu repositories is very old. So, we use get the binary from the website itself
89105
installationInfo = await setupBin("doxygen", version, getDoxygenPackageInfo, setupDir, arch)
90-
await setupAptPack([{ name: "libclang-cpp9" }])
106+
try {
107+
await setupAptPack([{ name: "libclang-cpp9" }])
108+
} catch (err) {
109+
info(`Failed to download libclang-cpp9 that might be needed for running doxygen. ${err}`)
110+
}
91111
} catch (err) {
92112
notice(`Failed to download doxygen binary. ${err}. Falling back to apt-get.`)
93113
installationInfo = await setupAptPack([{ name: "doxygen" }])

src/utils/setup/setupBin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export type PackageInfo = {
2626
binFileName: string
2727
/** The function to extract the downloaded archive. It can be `undefined`, if the binary itself is downloaded directly. */
2828
extractFunction?: {
29-
(file: string, dest: string): Promise<string> | Promise<void>
29+
(file: string, dest: string): Promise<unknown>
3030
}
3131
}
3232

0 commit comments

Comments
 (0)