setup-cpp/src/doxygen/doxygen.ts

30 lines
999 B
TypeScript
Raw Normal View History

import { addPath } from "@actions/core"
2021-09-16 16:47:47 +08:00
import { setupAptPack } from "../utils/setup/setupAptPack"
import { setupBrewPack } from "../utils/setup/setupBrewPack"
import { setupChocoPack } from "../utils/setup/setupChocoPack"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function setupDoxygen(version: string | undefined, _setupCppDir: string, _arch: string) {
2021-09-16 16:47:47 +08:00
switch (process.platform) {
case "win32": {
await setupChocoPack("graphviz", version)
await setupChocoPack("doxygen.install", version)
2021-09-17 07:26:57 +08:00
addPath("C:/Program Files/Graphviz/bin")
const binDir = "C:/Program Files/doxygen/bin"
2021-09-17 02:49:24 +08:00
addPath(binDir)
return { binDir }
2021-09-16 16:47:47 +08:00
}
case "darwin": {
setupBrewPack("graphviz", version)
2021-09-16 16:47:47 +08:00
return setupBrewPack("doxygen", version)
}
case "linux": {
await setupAptPack("graphviz", version)
return setupAptPack("doxygen", version)
}
default: {
throw new Error(`Unsupported platform`)
}
}
}