diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 4d0c0337f..d57074dc7 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -50,6 +50,7 @@ jobs: strategy: matrix: os: [windows, macos, ubuntu] + deno_version: [1.x, 2.x] include: - os: windows build: | @@ -75,11 +76,13 @@ jobs: runs-on: ${{ matrix.os }}-latest steps: - uses: actions/checkout@v4 - - uses: denoland/setup-deno@v1 + - uses: denoland/setup-deno@v2 with: - deno-version: v1.x + deno-version: v${{ matrix.deno_version }} - name: deno compile run: | + deno info bin/cdxgen.js + deno info bin/evinse.js mkdir build ${{ matrix.build }} continue-on-error: true diff --git a/.github/workflows/repotests.yml b/.github/workflows/repotests.yml index 940be1b9d..83638359c 100644 --- a/.github/workflows/repotests.yml +++ b/.github/workflows/repotests.yml @@ -28,9 +28,9 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - - uses: denoland/setup-deno@v1 + - uses: denoland/setup-deno@v2 with: - deno-version: v1.x + deno-version: v2.x - uses: oven-sh/setup-bun@v1 - name: Trim CI agent run: | diff --git a/ci/Dockerfile b/ci/Dockerfile index d7e3391f5..11f9ded44 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -13,8 +13,8 @@ LABEL maintainer="cyclonedx" \ ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F ARG SWIFT_PLATFORM=ubi9 -ARG SWIFT_BRANCH=swift-6.0-release -ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_BRANCH=swift-6.0.1-release +ARG SWIFT_VERSION=swift-6.0.1-RELEASE ARG SWIFT_WEBROOT=https://download.swift.org ARG JAVA_VERSION=23-tem ARG SBT_VERSION=1.10.2 @@ -23,6 +23,7 @@ ARG GRADLE_VERSION=8.10 ARG GO_VERSION=1.23.1 ARG NODE_VERSION=22.9.0 ARG PYTHON_VERSION=3.12 +ARG SOURCEKITTEN_VERSION=0.36.0 ENV GOPATH=/opt/app-root/go \ JAVA_VERSION=$JAVA_VERSION \ @@ -112,6 +113,14 @@ RUN set -e; \ && chmod +x /usr/bin/swift \ && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ && swift --version \ + && mkdir -p /opt/kitten \ + && curl -L https://github.com/jpsim/SourceKitten/releases/download/${SOURCEKITTEN_VERSION}/SourceKitten-${SOURCEKITTEN_VERSION}.tar.gz -o /opt/kitten/SourceKitten.tar.gz \ + && cd /opt/kitten/ && tar -xvf SourceKitten.tar.gz \ + && cd /opt/kitten/SourceKitten-${SOURCEKITTEN_VERSION} \ + && swift build -c release \ + && cp /opt/kitten/SourceKitten-${SOURCEKITTEN_VERSION}/.build/release/sourcekitten /usr/local/bin/sourcekitten \ + && cd /root && rm -rf /opt/kitten \ + && sourcekitten --help \ && microdnf install -y epel-release \ && mkdir -p ${ANDROID_HOME}/cmdline-tools \ && curl -L https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -o ${ANDROID_HOME}/cmdline-tools/android_tools.zip \ @@ -154,4 +163,4 @@ RUN set -e; \ && rm -rf /var/cache/yum /root/.cache/pypoetry \ && microdnf clean all -ENTRYPOINT ["node", "/opt/cdxgen/bin/cdxgen.js"] \ No newline at end of file +ENTRYPOINT ["node", "/opt/cdxgen/bin/cdxgen.js"] diff --git a/ci/Dockerfile-bun b/ci/Dockerfile-bun index c71b70d26..9f041d502 100644 --- a/ci/Dockerfile-bun +++ b/ci/Dockerfile-bun @@ -13,8 +13,8 @@ LABEL maintainer="cyclonedx" \ ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F ARG SWIFT_PLATFORM=ubi9 -ARG SWIFT_BRANCH=swift-6.0-release -ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_BRANCH=swift-6.0.1-release +ARG SWIFT_VERSION=swift-6.0.1-RELEASE ARG SWIFT_WEBROOT=https://download.swift.org ARG JAVA_VERSION=23-tem ARG SBT_VERSION=1.10.2 diff --git a/ci/Dockerfile-deno b/ci/Dockerfile-deno index f6dd7f6b1..79d7ed704 100644 --- a/ci/Dockerfile-deno +++ b/ci/Dockerfile-deno @@ -13,8 +13,8 @@ LABEL maintainer="cyclonedx" \ ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F ARG SWIFT_PLATFORM=ubi9 -ARG SWIFT_BRANCH=swift-6.0-release -ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_BRANCH=swift-6.0.1-release +ARG SWIFT_VERSION=swift-6.0.1-RELEASE ARG SWIFT_WEBROOT=https://download.swift.org ARG JAVA_VERSION=23-tem ARG SBT_VERSION=1.10.2 @@ -22,6 +22,7 @@ ARG MAVEN_VERSION=3.9.9 ARG GRADLE_VERSION=8.10 ARG GO_VERSION=1.23.1 ARG PYTHON_VERSION=3.12 +ARG SOURCEKITTEN_VERSION=0.36.0 ENV GOPATH=/opt/app-root/go \ JAVA_VERSION=$JAVA_VERSION \ @@ -41,7 +42,7 @@ ENV GOPATH=/opt/app-root/go \ ANDROID_HOME=/opt/android-sdk-linux \ JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF-8" \ GLOBAL_NODE_MODULES_PATH=/root/.cache/deno/npm/registry.npmjs.org \ - CDXGEN_PLUGINS_DIR=/root/.cache/deno/npm/registry.npmjs.org/@cyclonedx/cdxgen-plugins-bin/1.2.0/plugins \ + CDXGEN_PLUGINS_DIR=/root/.cache/deno/npm/registry.npmjs.org/@cyclonedx/cdxgen-plugins-bin/1.6.3/plugins \ SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ SWIFT_PLATFORM=$SWIFT_PLATFORM \ SWIFT_BRANCH=$SWIFT_BRANCH \ @@ -79,7 +80,7 @@ RUN set -e; \ && python${PYTHON_VERSION} -m pip install --no-cache-dir --upgrade pip virtualenv \ && python${PYTHON_VERSION} -m pip install --no-cache-dir --upgrade pipenv poetry blint --target /opt/pypi \ && curl -fsSL https://deno.land/x/install/install.sh | sh \ - && deno install -g --allow-read --allow-env --allow-run --allow-sys=uid,systemMemoryInfo,gid,homedir --allow-write --allow-net -n cdxgen "npm:@cyclonedx/cdxgen/cdxgen" \ + && deno install -g --allow-read --allow-env --allow-run --allow-sys=uid,systemMemoryInfo,gid,homedir --allow-write --allow-net -n cdxgen --node-modules-dir=auto "npm:@cyclonedx/cdxgen/cdxgen" \ && deno install -g --allow-read --allow-env --allow-run --allow-sys=uid,systemMemoryInfo,gid,homedir --allow-write -n atom "npm:@appthreat/atom/atom" \ && deno install -g --allow-read --allow-env --allow-run --allow-sys=uid,systemMemoryInfo,gid,homedir --allow-write -n astgen "npm:@appthreat/atom/astgen" \ && deno install -g --allow-read --allow-env --allow-run --allow-sys=uid,systemMemoryInfo,gid,homedir --allow-write -n phpastgen "npm:@appthreat/atom/phpastgen" \ @@ -110,6 +111,14 @@ RUN set -e; \ && chmod +x /usr/bin/swift \ && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ && swift --version \ + && mkdir -p /opt/kitten \ + && curl -L https://github.com/jpsim/SourceKitten/releases/download/${SOURCEKITTEN_VERSION}/SourceKitten-${SOURCEKITTEN_VERSION}.tar.gz -o /opt/kitten/SourceKitten.tar.gz \ + && cd /opt/kitten/ && tar -xvf SourceKitten.tar.gz \ + && cd /opt/kitten/SourceKitten-${SOURCEKITTEN_VERSION} \ + && swift build -c release \ + && cp /opt/kitten/SourceKitten-${SOURCEKITTEN_VERSION}/.build/release/sourcekitten /usr/local/bin/sourcekitten \ + && cd /root && rm -rf /opt/kitten \ + && sourcekitten --help \ && microdnf install -y epel-release \ && mkdir -p ${ANDROID_HOME}/cmdline-tools \ && curl -L https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -o ${ANDROID_HOME}/cmdline-tools/android_tools.zip \ diff --git a/deno.json b/deno.json index fa7a32676..66ce44ca5 100644 --- a/deno.json +++ b/deno.json @@ -37,7 +37,7 @@ "exclude": ["test/", "data/", "contrib/"] }, "lock": false, - "nodeModulesDir": true, + "nodeModulesDir": "auto", "unstable": [], "test": { "include": ["*.test.js"] diff --git a/lib/cli/index.js b/lib/cli/index.js index e91bb911c..d45fb8b91 100644 --- a/lib/cli/index.js +++ b/lib/cli/index.js @@ -27,6 +27,7 @@ import { getOriginUrl, gitTreeHashes, listFiles, + runSwiftCommand, } from "../helpers/envcontext.js"; import { CARGO_CMD, @@ -3158,7 +3159,7 @@ export async function createGoBom(path, options) { } catch (err) { maybeBinary = false; } - if (maybeBinary || options.lifecycle === "post-build") { + if (maybeBinary || options?.lifecycle?.includes("post-build")) { return createBinaryBom(path, options); } @@ -3558,7 +3559,7 @@ export async function createRustBom(path, options) { } catch (err) { maybeBinary = false; } - if (maybeBinary || options.lifecycle === "post-build") { + if (maybeBinary || options?.lifecycle?.includes("post-build")) { return createBinaryBom(path, options); } @@ -4342,19 +4343,24 @@ export async function createSwiftBom(path, options) { continue; } let treeData = undefined; + let packageArgs = ["package", "show-dependencies", "--format", "json"]; + let swiftCommand = SWIFT_CMD; + if (swiftCommand.startsWith("xcrun")) { + swiftCommand = "xcrun"; + packageArgs = ["swift"].concat(packageArgs); + } if (DEBUG_MODE) { - console.log("Executing 'swift package show-dependencies' in", basePath); + console.log( + `Executing '${swiftCommand} ${packageArgs.join(" ")}' in`, + basePath, + ); } - const result = spawnSync( - SWIFT_CMD, - ["package", "show-dependencies", "--format", "json"], - { - cwd: basePath, - encoding: "utf-8", - timeout: TIMEOUT_MS, - maxBuffer: MAX_BUFFER, - }, - ); + const result = spawnSync(swiftCommand, packageArgs, { + cwd: basePath, + encoding: "utf-8", + timeout: TIMEOUT_MS, + maxBuffer: MAX_BUFFER, + }); if (result.status === 0 && result.stdout) { completedPath.push(basePath); treeData = Buffer.from(result.stdout).toString(); @@ -4974,7 +4980,7 @@ export async function createCsharpBom(path, options) { let manifestFiles = []; let pkgData = undefined; let dependencies = []; - if (options.lifecycle === "post-build") { + if (options?.lifecycle?.includes("post-build")) { return createBinaryBom(path, options); } let parentComponent = createDefaultParentComponent(path, "nuget", options); diff --git a/lib/evinser/swiftsem.js b/lib/evinser/swiftsem.js new file mode 100644 index 000000000..1797ec363 --- /dev/null +++ b/lib/evinser/swiftsem.js @@ -0,0 +1,53 @@ +// Swift entity kinds +// https://github.com/swiftlang/swift/blob/main/tools/SourceKit/docs/SwiftSupport.txt +const SWIFT_ENTITY_KINDS = { + IMPORT_CLANG: "source.lang.swift.import.module.clang", + IMPORT_SWIFT: "source.lang.swift.import.module.swift", + IMPORT_SOURCE: "source.lang.swift.import.sourcefile", + DECL_EXTN_STRUCT: "source.lang.swift.decl.extension.struct", + DECL_EXTN_CLASS: "source.lang.swift.decl.extension.class", + DECL_EXTN_ENUM: "source.lang.swift.decl.extension.enum", + DECL_FREE: "source.lang.swift.decl.function.free", + REF_FREE: "source.lang.swift.ref.function.free", + DECL_METHOD_INSTANCE: "source.lang.swift.decl.function.method.instance", + REF_METHOD_INSTANCE: "source.lang.swift.ref.function.method.instance", + DECL_METHOD_STATIC: "source.lang.swift.decl.function.method.static", + REF_METHOD_STATIC: "source.lang.swift.ref.function.method.static", + DECL_CONSTRUCTOR: "source.lang.swift.decl.function.constructor", + REF_CONSTRUCTOR: "source.lang.swift.ref.function.constructor", + DECL_DESTRUCTOR: "source.lang.swift.decl.function.destructor", + REF_DESTRUCTOR: "source.lang.swift.ref.function.destructor", + DECL_OPERATOR: "source.lang.swift.decl.function.operator", + REF_OPERATOR: "source.lang.swift.ref.function.operator", + DECL_SUBSCRIPT: "source.lang.swift.decl.function.subscript", + REF_SUBSCRIPT: "source.lang.swift.ref.function.subscript", + DECL_GETTER: "source.lang.swift.decl.function.accessor.getter", + REF_GETTER: "source.lang.swift.ref.function.accessor.getter", + DECL_SETTER: "source.lang.swift.decl.function.accessor.setter", + REF_SETTER: "source.lang.swift.ref.function.accessor.setter", + DECL_CLASS: "source.lang.swift.decl.class", + REF_CLASS: "source.lang.swift.ref.class", + DECL_STRUCT: "source.lang.swift.decl.struct", + REF_STRUCT: "source.lang.swift.ref.struct", + DECL_ENUM: "source.lang.swift.decl.enum", + REF_ENUM: "source.lang.swift.ref.enum", + DECL_ENUM_ELEMENT: "source.lang.swift.decl.enumelement", + REF_ENUM_ELEMENT: "source.lang.swift.ref.enumelement", + DECL_PROTOCOL: "source.lang.swift.decl.protocol", + REF_PROTOCOL: "source.lang.swift.ref.protocol", + DECL_TYPE_ALIAS: "source.lang.swift.decl.typealias", + REF_TYPE_ALIAS: "source.lang.swift.ref.typealias", + DECL_VAR_GLOBAL: "source.lang.swift.decl.var.global", + REF_VAR_GLOBAL: "source.lang.swift.ref.var.global", + DECL_VAR_INSTANCE: "source.lang.swift.decl.var.instance", + REF_VAR_INSTANCE: "source.lang.swift.ref.var.instance", + DECL_VAR_STATIC: "source.lang.swift.decl.var.static", + REF_VAR_STATIC: "source.lang.swift.ref.var.static", + DECL_VAR_LOCAL: "source.lang.swift.decl.var.local", + REF_VAR_LOCAL: "source.lang.swift.ref.var.local", +}; +for (const key of Object.keys(SWIFT_ENTITY_KINDS)) { + if (key.toUpperCase() === key) { + SWIFT_ENTITY_KINDS[SWIFT_ENTITY_KINDS[key]] = key; + } +} diff --git a/lib/helpers/envcontext.js b/lib/helpers/envcontext.js index 7dbfcaacd..d8afdcea7 100644 --- a/lib/helpers/envcontext.js +++ b/lib/helpers/envcontext.js @@ -10,9 +10,12 @@ import { DOTNET_CMD, GCC_CMD, GO_CMD, + MAX_BUFFER, NODE_CMD, NPM_CMD, RUSTC_CMD, + SWIFT_CMD, + TIMEOUT_MS, getJavaCommand, getPythonCommand, isWin, @@ -21,13 +24,13 @@ import { export const GIT_COMMAND = process.env.GIT_CMD || "git"; // sdkman tool aliases -export const SDKMAN_TOOL_ALIASES = { - java8: "8.0.422-tem", - java11: "11.0.24-tem", - java17: "17.0.12-tem", - java21: "21.0.4-tem", - java22: "22.0.2-tem", - java23: "23-tem", +export const SDKMAN_JAVA_TOOL_ALIASES = { + java8: process.env.JAVA8_TOOL || "8.0.422-tem", + java11: process.env.JAVA11_TOOL || "11.0.24-tem", + java17: process.env.JAVA17_TOOL || "17.0.12-tem", + java21: process.env.JAVA21_TOOL || "21.0.4-tem", + java22: process.env.JAVA22_TOOL || "22.0.2-tem", + java23: process.env.JAVA23_TOOL || "23-tem", }; /** @@ -286,6 +289,34 @@ export function collectGoInfo(dir) { return undefined; } +/** + * Collect swift version + * + * @param {string} dir Working directory + * @returns Object containing swift details + */ +export function collectSwiftInfo(dir) { + const versionDesc = getCommandOutput(SWIFT_CMD, dir, ["--version"]); + if (versionDesc) { + return { + type: "platform", + name: "swift", + version: versionDesc.trim(), + }; + } + return undefined; +} + +/** + * Method to run a swift command + * + * @param {string} dir Working directory + * @returns Object containing swift details + */ +export function runSwiftCommand(dir, args) { + return getCommandOutput(SWIFT_CMD, dir, args); +} + export function collectEnvInfo(dir) { const infoComponents = []; let cmp = collectJavaInfo(dir); @@ -328,10 +359,21 @@ export function collectEnvInfo(dir) { * @returns String output from the command or undefined in case of error */ const getCommandOutput = (cmd, dir, args) => { - const result = spawnSync(cmd, args, { + let commandToUse = cmd; + // If the command includes space, automatically move it to the front of the args. + if (cmd?.trim().includes(" ")) { + const tmpA = cmd.split(" "); + commandToUse = tmpA.shift(); + if (args?.length && tmpA.length) { + args = tmpA.concat(args); + } + } + const result = spawnSync(commandToUse, args, { cwd: dir, encoding: "utf-8", shell: isWin, + timeout: TIMEOUT_MS, + maxBuffer: MAX_BUFFER, }); if (result.status !== 0 || result.error) { return undefined; @@ -431,6 +473,7 @@ export function installSdkmanTool(toolType, toolName) { { encoding: "utf-8", shell: process.env.SHELL || true, + timeout: TIMEOUT_MS, }, ); if (DEBUG_MODE) { @@ -521,6 +564,7 @@ export function getNvmToolDirectory(toolName) { { encoding: "utf-8", shell: process.env.SHELL || true, + timeout: TIMEOUT_MS, }, ); if (DEBUG_MODE) { @@ -555,6 +599,7 @@ export function getOrInstallNvmTool(toolVersion) { { encoding: "utf-8", shell: process.env.SHELL || true, + timeout: TIMEOUT_MS, }, ); @@ -585,5 +630,5 @@ export function getOrInstallNvmTool(toolVersion) { * Retrieve sdkman tool full name */ function getSdkmanToolFullname(toolName) { - return SDKMAN_TOOL_ALIASES[toolName] || toolName; + return SDKMAN_JAVA_TOOL_ALIASES[toolName] || toolName; } diff --git a/lib/helpers/envcontext.test.js b/lib/helpers/envcontext.test.js index 765eb8758..40395f08d 100644 --- a/lib/helpers/envcontext.test.js +++ b/lib/helpers/envcontext.test.js @@ -9,6 +9,7 @@ import { collectNodeInfo, collectPythonInfo, collectRustInfo, + collectSwiftInfo, getBranch, getNvmToolDirectory, getOrInstallNvmTool, @@ -34,12 +35,13 @@ test("tools tests", () => { expect(collectGccInfo()).toBeDefined(); expect(collectRustInfo()).toBeDefined(); expect(collectGoInfo()).toBeDefined(); + expect(collectSwiftInfo()).toBeDefined(); }); test("sdkman tests", () => { if (process.env?.SDKMAN_VERSION) { expect(isSdkmanAvailable()).toBeTruthy(); - expect(isSdkmanToolAvailable("java", "22.0.1-tem")).toBeTruthy(); + expect(isSdkmanToolAvailable("java", "23-tem")).toBeTruthy(); } }); diff --git a/lib/helpers/utils.js b/lib/helpers/utils.js index 7f0034ab4..50061f6ca 100644 --- a/lib/helpers/utils.js +++ b/lib/helpers/utils.js @@ -224,10 +224,10 @@ if (process.env.LEIN_CMD) { LEIN_CMD = process.env.LEIN_CMD; } -export let SWIFT_CMD = "swift"; -if (process.env.SWIFT_CMD) { - SWIFT_CMD = process.env.SWIFT_CMD; -} +// On a mac, use xcrun +// xcrun: Find and execute the named command line tool from the active developer directory +export const SWIFT_CMD = + process.env.SWIFT_CMD || isMac ? "xcrun swift" : "swift"; // Python components that can be excluded export const PYTHON_EXCLUDED_COMPONENTS = [ @@ -398,6 +398,13 @@ export function hasAnyProjectType(projectTypes, options, defaultStatus = true) { ) { return defaultStatus; } + // Convert string project types to an array + if ( + projectTypes && + (typeof projectTypes === "string" || projectTypes instanceof String) + ) { + projectTypes = projectTypes.split(","); + } // If only exclude type is specified, then do not allow oci type if ( (projectTypes?.length === 1 || !defaultStatus) && diff --git a/lib/stages/pregen/pregen.js b/lib/stages/pregen/pregen.js index 71744e7f5..fcee80d5a 100644 --- a/lib/stages/pregen/pregen.js +++ b/lib/stages/pregen/pregen.js @@ -1,15 +1,23 @@ import { spawnSync } from "node:child_process"; import { mkdtempSync, readdirSync } from "node:fs"; import { arch, platform, tmpdir } from "node:os"; -import { delimiter, join } from "node:path"; +import { delimiter, dirname, join, resolve } from "node:path"; +import process from "node:process"; import { - SDKMAN_TOOL_ALIASES, + SDKMAN_JAVA_TOOL_ALIASES, getOrInstallNvmTool, installSdkmanTool, isNvmAvailable, isSdkmanAvailable, + runSwiftCommand, } from "../../helpers/envcontext.js"; -import { DEBUG_MODE, hasAnyProjectType } from "../../helpers/utils.js"; +import { + DEBUG_MODE, + MAX_BUFFER, + TIMEOUT_MS, + getAllFiles, + hasAnyProjectType, +} from "../../helpers/utils.js"; /** * Method to prepare the build environment for BOM generation purposes. @@ -22,14 +30,18 @@ export function prepareEnv(filePath, options) { return; } for (const pt of options.projectType) { - if (SDKMAN_TOOL_ALIASES[pt]) { + if (SDKMAN_JAVA_TOOL_ALIASES[pt]) { prepareSdkmanBuild(pt); break; } } - // Check the pre-requisites for python + if (filePath) { + filePath = resolve(filePath); + } + // Check the pre-requisites for various types preparePythonEnv(filePath, options); prepareNodeEnv(filePath, options); + prepareSwiftEnv(filePath, options); } /** @@ -55,10 +67,10 @@ export function prepareSdkmanBuild(projectType) { * @param {Object} options CLI Options */ export function preparePythonEnv(_filePath, options) { - if (hasAnyProjectType("python", options, false)) { - if (arch() !== "x64") { + if (hasAnyProjectType(["python"], options, false)) { + if (process.env?.CDXGEN_IN_CONTAINER !== "true" && arch() !== "x64") { console.log( - `INFO: Many pypi packages have poor support for ${arch()} architecture.\nRun the cdxgen container image with --platform=linux/amd64 for best experience.`, + `INFO: Many pypi packages have limited support for ${arch()} architecture.\nRun the cdxgen container image with --platform=linux/amd64 for best experience.`, ); } if (platform() === "win32") { @@ -81,9 +93,7 @@ export function preparePythonEnv(_filePath, options) { !process.env.PIP_INSTALL_ARGS ) { const tempDir = mkdtempSync(join(tmpdir(), "cdxgen-pip-")); - const py_version_number = pyversion - .replace("python", "") - .replace("3", "3."); + const py_version_number = pyversion.replace("python3", "3."); process.env.PIP_INSTALL_ARGS = `--python-version ${py_version_number} --ignore-requires-python --no-warn-conflicts --only-binary=:all:`; process.env.PIP_TARGET = tempDir; if (DEBUG_MODE) { @@ -107,7 +117,7 @@ export function prepareNodeEnv(filePath, options) { for (const pt of options.projectType) { const nodeVersion = pt.replace(/\D/g, ""); if ( - pt.startsWith("nodejs") && + pt.startsWith("node") && nodeVersion && !process.env.NODE_INSTALL_ARGS ) { @@ -199,12 +209,10 @@ export function tryLoadNvmAndInstallTool(nodeVersion) { */ export function doNpmInstall(filePath, nvmNodePath) { // we do not install if INSTALL_ARGS set false - if (process.env.NODE_INSTALL_ARGS === false) { + if (["0", "false"].includes(process.env?.NODE_INSTALL_ARGS)) { return; } - const newPath = `${nvmNodePath}${delimiter}${process.env.PATH}`; - const resultNpmInstall = spawnSync( process.env.SHELL || "bash", [ @@ -215,6 +223,7 @@ export function doNpmInstall(filePath, nvmNodePath) { { encoding: "utf-8", shell: process.env.SHELL || true, + timeout: TIMEOUT_MS, cwd: filePath, env: { ...process.env, @@ -223,15 +232,72 @@ export function doNpmInstall(filePath, nvmNodePath) { }, ); - if (resultNpmInstall.status !== 0 || resultNpmInstall.stderr) { + if (resultNpmInstall.status !== 0 || resultNpmInstall.error) { // There was some problem with NpmInstall if (DEBUG_MODE) { - if (console.stdout) { + if (resultNpmInstall.stdout) { console.log(resultNpmInstall.stdout); } - if (console.stderr) { + if (resultNpmInstall.stderr) { console.log(resultNpmInstall.stderr); } } } } + +/** + * Method to check and build the swift project + * + * @param {String} filePath Path + * @param {Object} options CLI Options + */ +export function prepareSwiftEnv(filePath, options) { + if (hasAnyProjectType(["swift"], options, false)) { + if (platform() === "win32") { + console.log( + "Ensure Swift for Windows is installed by following the instructions at https://www.swift.org/install/windows/", + ); + } + if ( + process.env?.CDXGEN_IN_CONTAINER !== "true" && + platform() === "linux" && + arch() !== "x64" + ) { + console.log( + "INFO: Swift for Linux has known issues on non x64 machines.\nRun the cdxgen container image with --platform=linux/amd64 for best experience.", + ); + } + if (options.deep || options?.lifecycle?.includes("post-build")) { + const swiftFiles = getAllFiles( + filePath, + `${options.multiProject ? "**/" : ""}Package*.swift`, + options, + ); + const pkgResolvedFiles = getAllFiles( + filePath, + `${options.multiProject ? "**/" : ""}Package.resolved`, + options, + ); + const outputFileMaps = getAllFiles( + filePath, + ".build/**/debug/**/output-file-map.json", + options, + ); + if ( + (!pkgResolvedFiles.length || !outputFileMaps.length) && + swiftFiles.length + ) { + for (const f of swiftFiles) { + const basePath = dirname(f); + console.log("Building the project in debug mode", basePath); + const cmdOutput = runSwiftCommand(basePath, ["build", "-c", "debug"]); + if (!cmdOutput) { + console.log( + "Swift build was not successful. Build this project manually before invoking cdxgen.", + ); + } + } + } + } + } +} diff --git a/types/lib/cli/index.d.ts.map b/types/lib/cli/index.d.ts.map index e7125267c..2f1ec4661 100644 --- a/types/lib/cli/index.d.ts.map +++ b/types/lib/cli/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/cli/index.js"],"names":[],"mappings":"AA0wBA;;;;;;;;GAQG;AACH,gFAFW,MAAM,SAchB;AAyUD;;;;;;;GAOG;AACH,mCALW,MAAM,qBAiEhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM;;;;EAKhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM;;;;EAkBhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,8BA04BhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,8BA2chB;AAED;;;;;;;;;;GAUG;AACH,+DAyEC;AAED;;;;;GAKG;AACH,sCAHW,MAAM,8BA6bhB;AAED;;;;;GAKG;AACH,kCAHW,MAAM,8BA6YhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,8BAqIhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,8BAiDhB;AAED;;;;;GAKG;AACH,mCAHW,MAAM,qBA+KhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM,qBAsHhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM,qBA2BhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,qBA2BhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,qBA2BhB;AAED;;;;;GAKG;AACH,0CAHW,MAAM,qBAuBhB;AAED;;;;;GAKG;AACH,oEAkDC;AAED;;;;;GAKG;AACH,uCAHW,MAAM,8BA4ChB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,qBA2BhB;AAED;;;;;GAKG;AACH,qCAHW,MAAM,8BAwFhB;AAED;;;;;GAKG;AACH,iDAHW,MAAM,qBAiUhB;AAED;;;;;GAKG;AACH,mCAHW,MAAM,qBAwJhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,8BAmFhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,8BA6XhB;AAED;;;;;GAKG;AACH,2CAHW,MAAM;;;;;;;;;;;;;;;;;;;;GAoChB;AAED;;;;;;;;KA+DC;AAED;;;;;;GAMG;AACH,yDAuCC;AAED;;;;;;;;;GASG;AACH,2GA6BC;AAED;;;;;GAKG;AACH,0CAHW,MAAM,EAAE,8BAmclB;AAED;;;;;GAKG;AACH,iCAHW,MAAM,8BAiUhB;AAED;;;;;GAKG;AACH,gCAHW,MAAM,qBAsOhB;AAED;;;;;;GAMG;AACH,wDAFY,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,SAAS,CAAC,CAwHxE"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/cli/index.js"],"names":[],"mappings":"AA2wBA;;;;;;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AM,EAAE,8BAmclB;AAED;;;;;GAKG;AACH,iCAHW,MAAM,8BAiUhB;AAED;;;;;GAKG;AACH,gCAHW,MAAM,qBAsOhB;AAED;;;;;;GAMG;AACH,wDAFY,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,SAAS,CAAC,CAwHxE"} \ No newline at end of file diff --git a/types/lib/evinser/swiftsem.d.ts b/types/lib/evinser/swiftsem.d.ts new file mode 100644 index 000000000..2b7269ff1 --- /dev/null +++ b/types/lib/evinser/swiftsem.d.ts @@ -0,0 +1,47 @@ +declare namespace SWIFT_ENTITY_KINDS { + let IMPORT_CLANG: string; + let IMPORT_SWIFT: string; + let IMPORT_SOURCE: string; + let DECL_EXTN_STRUCT: string; + let DECL_EXTN_CLASS: string; + let DECL_EXTN_ENUM: string; + let DECL_FREE: string; + let REF_FREE: string; + let DECL_METHOD_INSTANCE: string; + let REF_METHOD_INSTANCE: string; + let DECL_METHOD_STATIC: string; + let REF_METHOD_STATIC: string; + let DECL_CONSTRUCTOR: string; + let REF_CONSTRUCTOR: string; + let DECL_DESTRUCTOR: string; + let REF_DESTRUCTOR: string; + let DECL_OPERATOR: string; + let REF_OPERATOR: string; + let DECL_SUBSCRIPT: string; + let REF_SUBSCRIPT: string; + let DECL_GETTER: string; + let REF_GETTER: string; + let DECL_SETTER: string; + let REF_SETTER: string; + let DECL_CLASS: string; + let REF_CLASS: string; + let DECL_STRUCT: string; + let REF_STRUCT: string; + let DECL_ENUM: string; + let REF_ENUM: string; + let DECL_ENUM_ELEMENT: string; + let REF_ENUM_ELEMENT: string; + let DECL_PROTOCOL: string; + let REF_PROTOCOL: string; + let DECL_TYPE_ALIAS: string; + let REF_TYPE_ALIAS: string; + let DECL_VAR_GLOBAL: string; + let REF_VAR_GLOBAL: string; + let DECL_VAR_INSTANCE: string; + let REF_VAR_INSTANCE: string; + let DECL_VAR_STATIC: string; + let REF_VAR_STATIC: string; + let DECL_VAR_LOCAL: string; + let REF_VAR_LOCAL: string; +} +//# sourceMappingURL=swiftsem.d.ts.map \ No newline at end of file diff --git a/types/lib/evinser/swiftsem.d.ts.map b/types/lib/evinser/swiftsem.d.ts.map new file mode 100644 index 000000000..70924aba0 --- /dev/null +++ b/types/lib/evinser/swiftsem.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"swiftsem.d.ts","sourceRoot":"","sources":["../../../lib/evinser/swiftsem.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/lib/helpers/envcontext.d.ts b/types/lib/helpers/envcontext.d.ts index 51ff04aec..66f9deee5 100644 --- a/types/lib/helpers/envcontext.d.ts +++ b/types/lib/helpers/envcontext.d.ts @@ -131,6 +131,24 @@ export function collectGoInfo(dir: string): { name: string; version: any; }; +/** + * Collect swift version + * + * @param {string} dir Working directory + * @returns Object containing swift details + */ +export function collectSwiftInfo(dir: string): { + type: string; + name: string; + version: any; +}; +/** + * Method to run a swift command + * + * @param {string} dir Working directory + * @returns Object containing swift details + */ +export function runSwiftCommand(dir: string, args: any): any; export function collectEnvInfo(dir: any): { type: string; name: string; @@ -184,12 +202,12 @@ export function getNvmToolDirectory(toolName: string): string; */ export function getOrInstallNvmTool(toolVersion: string): string; export const GIT_COMMAND: any; -export namespace SDKMAN_TOOL_ALIASES { - let java8: string; - let java11: string; - let java17: string; - let java21: string; - let java22: string; - let java23: string; +export namespace SDKMAN_JAVA_TOOL_ALIASES { + let java8: any; + let java11: any; + let java17: any; + let java21: any; + let java22: any; + let java23: any; } //# sourceMappingURL=envcontext.d.ts.map \ No newline at end of file diff --git a/types/lib/helpers/envcontext.d.ts.map b/types/lib/helpers/envcontext.d.ts.map index 2317aead4..4ed913367 100644 --- a/types/lib/helpers/envcontext.d.ts.map +++ b/types/lib/helpers/envcontext.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"envcontext.d.ts","sourceRoot":"","sources":["../../../lib/helpers/envcontext.js"],"names":[],"mappings":"AAgCA;;;;;;GAMG;AACH,wCALW,MAAM,OACN,MAAM,OAMhB;AAED;;;;;GAKG;AACH,kCAJW,MAAM,OAMhB;AAED;;;;;;GAMG;AACH,gDAJW,MAAM,OAMhB;AAED;;;;;GAKG;AACH,mCAJW,MAAM,MAsBhB;AAED;;;;;GAKG;AACH,+BAJW,MAAM,SAgChB;AAED;;;;;;;GAOG;AACH,oCALW,MAAM,oBAOhB;AAED;;;;;GAKG;AACH,qCAHW,MAAM;;;;;;;;;EAsBhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM;;;;;EAgBhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM;;;;;EAgBhB;AAED;;;;;GAKG;AACH,qCAHW,MAAM;;;;;EAkBhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM;;;;;EAehB;AAED;;;;;GAKG;AACH,qCAHW,MAAM;;;;;EAehB;AAED;;;;;GAKG;AACH,mCAHW,MAAM;;;;EAahB;AAED;;;;;;;;;IA+BC;AA0BD;;GAEG;AACH,6CAeC;AAED;;GAEG;AACH,0CAUC;AAED;;;;;;;GAOG;AACH,mFAqBC;AAED;;;;;;;GAOG;AACH,+EAwFC;AAED;;;;;;GAMG;AACH,8DAsBC;AAED;;;;;;GAMG;AACH,iEAkCC;AAjjBD,8BAAwD"} \ No newline at end of file +{"version":3,"file":"envcontext.d.ts","sourceRoot":"","sources":["../../../lib/helpers/envcontext.js"],"names":[],"mappings":"AAmCA;;;;;;GAMG;AACH,wCALW,MAAM,OACN,MAAM,OAMhB;AAED;;;;;GAKG;AACH,kCAJW,MAAM,OAMhB;AAED;;;;;;GAMG;AACH,gDAJW,MAAM,OAMhB;AAED;;;;;GAKG;AACH,mCAJW,MAAM,MAsBhB;AAED;;;;;GAKG;AACH,+BAJW,MAAM,SAgChB;AAED;;;;;;;GAOG;AACH,oCALW,MAAM,oBAOhB;AAED;;;;;GAKG;AACH,qCAHW,MAAM;;;;;;;;;EAsBhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM;;;;;EAgBhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM;;;;;EAgBhB;AAED;;;;;GAKG;AACH,qCAHW,MAAM;;;;;EAkBhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM;;;;;EAehB;AAED;;;;;GAKG;AACH,qCAHW,MAAM;;;;;EAehB;AAED;;;;;GAKG;AACH,mCAHW,MAAM;;;;EAahB;AAED;;;;;GAKG;AACH,sCAHW,MAAM;;;;EAahB;AAED;;;;;GAKG;AACH,qCAHW,MAAM,kBAKhB;AAED;;;;;;;;;IA+BC;AAqCD;;GAEG;AACH,6CAeC;AAED;;GAEG;AACH,0CAUC;AAED;;;;;;;GAOG;AACH,mFAqBC;AAED;;;;;;;GAOG;AACH,+EAyFC;AAED;;;;;;GAMG;AACH,8DAuBC;AAED;;;;;;GAMG;AACH,iEAmCC;AA3lBD,8BAAwD"} \ No newline at end of file diff --git a/types/lib/helpers/utils.d.ts b/types/lib/helpers/utils.d.ts index b655a2275..571541493 100644 --- a/types/lib/helpers/utils.d.ts +++ b/types/lib/helpers/utils.d.ts @@ -1306,7 +1306,7 @@ export let GO_CMD: string; export let CARGO_CMD: string; export let CLJ_CMD: string; export let LEIN_CMD: string; -export let SWIFT_CMD: string; +export const SWIFT_CMD: "xcrun swift" | "swift"; export const PYTHON_EXCLUDED_COMPONENTS: string[]; export const PROJECT_TYPE_ALIASES: { java: string[]; diff --git a/types/lib/helpers/utils.d.ts.map b/types/lib/helpers/utils.d.ts.map index 3c09a7683..a1c3cc45c 100644 --- a/types/lib/helpers/utils.d.ts.map +++ b/types/lib/helpers/utils.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/helpers/utils.js"],"names":[],"mappings":"AA+JA,yCAYC;AAED,2CAQC;AA8KD;;;;;;;GAOG;AACH,4EAoBC;AAED;;;;;;GAMG;AACH,mGAmEC;AAED;;;;;;;;GAQG;AACH,yGASC;AAgBD;;;;;GAKG;AACH,qC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A6B;AAK7B,6BAA+B;AAM/B,kDAWE;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsGE;;;;AAyIF,8BAQG;AAwuJH,8CAUE"} \ No newline at end of file +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/helpers/utils.js"],"names":[],"mappings":"AA+JA,yCAYC;AAED,2CAQC;AA8KD;;;;;;;GAOG;AACH,4EAoBC;AAED;;;;;;GAMG;AACH,mGA0EC;AAED;;;;;;;;GAQG;AACH,yGASC;AAgBD;;;;;GAKG;AACH,qCAHW,MAAM,WACN,MAAM,0BAqBhB;AAED;;;;;;GAMG;AACH,+CAJW,MAAM,WACN,MAAM,+BAoBhB;AAYD;;;;GAIG;AACH,gCAFa,MAAM,CAIlB;AAED;;;;;;IAMI;AACJ,iDAJW,MAAM,GACJ,OAAO,CAiBnB;AAED;;;;;;;;;GASG;AACH,iEA2BC;AAED;;;;;GAKG;AACH,6CAqDC;AAED;;;;;;GAMG;AACH,sEA0DC;AAED;;;;GAIG;AACH,4EAoCC;AAED;;;GAGG;AACH;;EAUC;AAED,sEA0BC;AAED;;;;GAIG;AACH,+DA4CC;AAED;;;;;GAKG;AACH,0CAHW,MAAM,WACN,OAAO,kBAkFjB;AAED;;;;;GAKG;AACH,0CAHW,MAAM,YACN,MAAM;;;GAqVhB;AAED;;;;;;;GAOG;AACH,6CAFW,MAAM,MA2DhB;AAwBD;;;;GAIG;AACH,4CAFW,MAAM;;;GAkOhB;AAED;;;;GAIG;AACH,4CAFW,MAAM,kBAiEhB;AAuCD;;;;;GAKG;AACH,wCAHW,MAAM,oBACN,MAAM;;;;;;;;;GA0dhB;AAED;;;;GAIG;AACH,8CAFW,MAAM,kBA+ChB;AAED;;;;GAIG;AACH,sCAFW,MAAM,kBAgFhB;AAED;;;;GAIG;AACH;;;;;;;;;;;;;;;;;;;;;;IAqDC;AAED;;;;;;GAMG;AACH,0CALW,MAAM,WACN,MAAM,OA0JhB;AAED;;;;;;GAMG;AACH,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4BAA6C;AAC7C,2BAAmE;AAsBnE,iCAEE;AAqBF,iCAIyC;AAGzC,gCACmE;AAGnE,gCACsE;AAGtE,8BAA+B;AAK/B,4CAEmE;AAGnE,6CAE6D;AAG7D,oCAEoD;AAGpD,uCAEuD;AAYvD,8BAAyC;AAczC,gCAA6C;AAU7C,8BAAiC;AAIjC,4BAA6B;AAI7B,2BAA2B;AAI3B,4BAA6B;AAI7B,2BAA2B;AAI3B,6BAA+B;AAI/B,0BAAyB;AAIzB,6BAA+B;AAM/B,2BAA2B;AAK3B,4BAA6B;AAO7B,gDAC2D;AAG3D,kDAWE;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsGE;;;;AAgJF,8BAQG;AAwuJH,8CAUE"} \ No newline at end of file diff --git a/types/lib/stages/pregen/pregen.d.ts b/types/lib/stages/pregen/pregen.d.ts index e7c8b3f79..b14381f34 100644 --- a/types/lib/stages/pregen/pregen.d.ts +++ b/types/lib/stages/pregen/pregen.d.ts @@ -42,4 +42,11 @@ export function tryLoadNvmAndInstallTool(nodeVersion: string): boolean; * @param {String} nvmNodePath Path to node version in nvm */ export function doNpmInstall(filePath: string, nvmNodePath: string): void; +/** + * Method to check and build the swift project + * + * @param {String} filePath Path + * @param {Object} options CLI Options + */ +export function prepareSwiftEnv(filePath: string, options: any): void; //# sourceMappingURL=pregen.d.ts.map \ No newline at end of file diff --git a/types/lib/stages/pregen/pregen.d.ts.map b/types/lib/stages/pregen/pregen.d.ts.map index fb1a455f5..68bf5bb6a 100644 --- a/types/lib/stages/pregen/pregen.d.ts.map +++ b/types/lib/stages/pregen/pregen.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"pregen.d.ts","sourceRoot":"","sources":["../../../../lib/stages/pregen/pregen.js"],"names":[],"mappings":"AAaA;;;;;GAKG;AACH,iEAaC;AAED;;;;GAIG;AACH,iEASC;AAED;;;;;GAKG;AACH,qEAwCC;AAED;;;;;GAKG;AACH,qEAyDC;AAED;;;;;;;;GAQG;AACH,uEAmBC;AAED;;;;;GAKG;AACH,0EAqCC"} \ No newline at end of file +{"version":3,"file":"pregen.d.ts","sourceRoot":"","sources":["../../../../lib/stages/pregen/pregen.js"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,iEAiBC;AAED;;;;GAIG;AACH,iEASC;AAED;;;;;GAKG;AACH,qEAsCC;AAED;;;;;GAKG;AACH,qEAyDC;AAED;;;;;;;;GAQG;AACH,uEAmBC;AAED;;;;;GAKG;AACH,0EAoCC;AAED;;;;;GAKG;AACH,sEAiDC"} \ No newline at end of file