mirror of https://github.com/aminya/setup-cpp
feat: move the default versions to the functions themselves
This commit is contained in:
parent
191a15123c
commit
04b70139f6
|
@ -17,11 +17,9 @@ inputs:
|
||||||
required: false
|
required: false
|
||||||
cmake:
|
cmake:
|
||||||
description: "The cmake version to install."
|
description: "The cmake version to install."
|
||||||
default: "3.20.2"
|
|
||||||
required: false
|
required: false
|
||||||
ninja:
|
ninja:
|
||||||
description: "The ninja version to install."
|
description: "The ninja version to install."
|
||||||
default: "1.10.2"
|
|
||||||
required: false
|
required: false
|
||||||
conan:
|
conan:
|
||||||
description: "The conan version to install."
|
description: "The conan version to install."
|
||||||
|
|
|
@ -58,7 +58,9 @@ function getCmakePackageInfo(version: string, platform?: NodeJS.Platform): Packa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const default_cmake_version = "3.20.2"
|
||||||
|
|
||||||
/** Setup cmake */
|
/** Setup cmake */
|
||||||
export function setupCmake(version: string, setupCppDir: string): Promise<InstallationInfo> {
|
export function setupCmake(version: string, setupCppDir: string): Promise<InstallationInfo> {
|
||||||
return setupBin("cmake", version, getCmakePackageInfo, setupCppDir)
|
return setupBin("cmake", version === "true" ? default_cmake_version : version, getCmakePackageInfo, setupCppDir)
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ function maybeGetInput(key: string) {
|
||||||
if (value !== "false" && value !== "") {
|
if (value !== "false" && value !== "") {
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
return undefined
|
return undefined // skip installation
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function main(): Promise<number> {
|
export async function main(): Promise<number> {
|
||||||
|
|
|
@ -26,6 +26,8 @@ function getNinjaPackageInfo(version: string, platform: NodeJS.Platform): Packag
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const default_ninja_version = "1.10.2"
|
||||||
|
|
||||||
export function setupNinja(version: string, setupCppDir: string): Promise<InstallationInfo> {
|
export function setupNinja(version: string, setupCppDir: string): Promise<InstallationInfo> {
|
||||||
return setupBin("ninja", version, getNinjaPackageInfo, setupCppDir)
|
return setupBin("ninja", version === "true" ? default_ninja_version : version, getNinjaPackageInfo, setupCppDir)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue