fix: use extension-tools in setup-cpp

This commit is contained in:
Amin Yahyaabadi 2022-08-07 18:36:04 -07:00
parent 41bcd6a578
commit c5a2f11e38
18 changed files with 21 additions and 38 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/setup_cpp.mjs vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -58,6 +58,7 @@
"escape-path-with-spaces": "^1.0.0",
"exec-powershell": "workspace:*",
"execa": "^5.1.1",
"extension-tools": "workspace:*",
"mri": "^1.2.0",
"msvc-dev-cmd": "github:aminya/msvc-dev-cmd#9f672c1",
"numerous": "1.0.3",

View File

@ -31,6 +31,7 @@ importers:
eslint-config-atomic: ^1.18.1
exec-powershell: workspace:*
execa: ^5.1.1
extension-tools: workspace:*
gen-readme: ^1.6.0
jest: ^28.1.3
loose-ts-check: ^1.2.0
@ -63,6 +64,7 @@ importers:
escape-path-with-spaces: 1.0.0
exec-powershell: link:packages/exec-powershell
execa: 5.1.1
extension-tools: link:packages/extension-tools
mri: 1.2.0
msvc-dev-cmd: github.com/aminya/msvc-dev-cmd/9f672c1
numerous: 1.0.3
@ -112,6 +114,9 @@ importers:
devDependencies:
'@types/which': 2.0.1
packages/extension-tools:
specifiers: {}
packages/sudo-tools:
specifiers:
'@types/which': ^2.0.1

View File

@ -2,7 +2,7 @@ import { extractTar } from "@actions/tool-cache"
import semverLte from "semver/functions/lte"
import semverCoerce from "semver/functions/coerce"
import { setupBin, PackageInfo, InstallationInfo } from "../utils/setup/setupBin"
import { addBinExtension } from "../utils/extension/extension"
import { addBinExtension } from "extension-tools"
import { extractZip } from "../utils/setup/extract"
/** Get the platform data for cmake */

View File

@ -4,7 +4,7 @@ import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
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 { addBinExtension } from "extension-tools"
import { extractTar, extractZip } from "../utils/setup/extract"
import { notice } from "../utils/io/io"
import { setupGraphviz } from "../graphviz/graphviz"

View File

@ -3,7 +3,7 @@ import { setupGcc } from "../gcc"
import { getVersion } from "../../default_versions"
import path from "path"
import execa from "execa"
import { addBinExtension } from "../../utils/extension/extension"
import { addBinExtension } from "extension-tools"
import { chmodSync } from "fs"
jest.setTimeout(3000000)

View File

@ -10,7 +10,7 @@ import { setupMacOSSDK } from "../macos-sdk/macos-sdk"
import path from "path"
import { warning, info } from "../utils/io/io"
import { isGitHubCI } from "../utils/env/isCI"
import { addBinExtension } from "../utils/extension/extension"
import { addBinExtension } from "extension-tools"
import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin"
import { extract7Zip } from "../utils/setup/extract"
import { isArch } from "../utils/env/isArch"

View File

@ -3,7 +3,7 @@ import { join } from "path"
import which from "which"
import { setupCmake } from "../cmake/cmake"
import { getVersion } from "../default_versions"
import { addBinExtension } from "../utils/extension/extension"
import { addBinExtension } from "extension-tools"
import { extractTarByExe } from "../utils/setup/extract"
import { setupAptPack } from "../utils/setup/setupAptPack"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"

View File

@ -5,7 +5,7 @@ import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-help
import { isGitHubCI } from "../../utils/env/isCI"
import execa from "execa"
import path from "path"
import { addBinExtension } from "../../utils/extension/extension"
import { addBinExtension } from "extension-tools"
import { chmodSync } from "fs"
import { getVersion } from "../../default_versions"
import { ubuntuVersion } from "../../utils/env/ubuntu_version"

View File

@ -11,7 +11,7 @@ import {
semverCoerceIfInvalid,
} from "../utils/setup/version"
import { setupMacOSSDK } from "../macos-sdk/macos-sdk"
import { addBinExtension } from "../utils/extension/extension"
import { addBinExtension } from "extension-tools"
import { addEnv } from "../utils/env/addEnv"
import { setOutput } from "@actions/core"
import { setupAptPack, updateAptAlternatives } from "../utils/setup/setupAptPack"

View File

@ -1,4 +1,4 @@
import { addBinExtension } from "../utils/extension/extension"
import { addBinExtension } from "extension-tools"
import { extractZip } from "../utils/setup/extract"
import { setupBin, PackageInfo, InstallationInfo } from "../utils/setup/setupBin"

View File

@ -1,4 +1,4 @@
import { addBinExtension } from "../utils/extension/extension"
import { addBinExtension } from "extension-tools"
import { extractTarByExe, extractZip } from "../utils/setup/extract"
import { setupBin, PackageInfo, InstallationInfo } from "../utils/setup/setupBin"

View File

@ -1,23 +0,0 @@
/** Add bin extension to a binary. This will be `.exe` on Windows. */
export function addBinExtension(name: string) {
if (process.platform === "win32") {
return `${name}.exe`
}
return name
}
/** Add native shell extension. This will be `.bat` on Windows and `sh` on unix. */
export function addShellExtension(name: string) {
if (process.platform === "win32") {
return `${name}.bat`
}
return `${name}.sh`
}
/** Add ./ for unix shell */
export function addShellHere(name: string) {
if (process.platform === "win32") {
return name
}
return `./${name}`
}

View File

@ -1,7 +1,7 @@
import * as io from "@actions/io"
import { tmpdir } from "os"
import * as path from "path"
import { addBinExtension } from "../extension/extension"
import { addBinExtension } from "extension-tools"
import { join } from "path"
import spawn from "cross-spawn"
import { existsSync } from "fs"

View File

@ -3,7 +3,7 @@ import { existsSync } from "fs"
import { dirname, join } from "path"
import which from "which"
import { addPath } from "../utils/env/addEnv"
import { addShellExtension, addShellHere } from "../utils/extension/extension"
import { addShellExtension, addShellHere } from "extension-tools"
import { notice } from "../utils/io/io"
import { setupAptPack } from "../utils/setup/setupAptPack"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"