How to use the qbs.FileInfo.joinPaths function in qbs

To help you get started, we’ve selected a few qbs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github qbs / qbs / share / qbs / modules / ib / ib.js View on Github external
tracker.hostOS = product.moduleProperty("qbs", "hostOS");
    tracker.shellPath = product.moduleProperty("qbs", "shellPath");
    tracker.command = ModUtils.moduleProperty(product, "actoolPath");
    tracker.commandArgsFunction = function (outputDirectory) {
        // Last --output-format argument overrides any previous ones
        return ibtooldArguments(product, inputs, undefined,
                                undefined, outputDirectory).concat(["--output-format", "xml1"]);
    };
    tracker.processStdOutFunction = parseActoolOutput;
    var artifacts = tracker.artifacts(product.buildDirectory + "/actool.dir");

    // Newer versions of actool don't generate *anything* if there's no input;
    // in that case a partial Info.plist would not have been generated either
    if (artifacts && artifacts.length > 0) {
        artifacts.push({
            filePath: FileInfo.joinPaths(product.destinationDirectory,
                                         "assetcatalog_generated_info.plist"),
            fileTags: ["partial_infoplist"]
        });
    }

    for (var i = 0; i < artifacts.length; ++i) {
        if (artifacts[i].fileTags.contains("compiled_assetcatalog")) {
            artifacts[i].bundle = {
                _bundleFilePath: artifacts[i].filePath.replace(
                    product.buildDirectory + "/actool.dir",
                    BundleTools.destinationDirectoryForResource(product, inputs.assetcatalog[0]))
            };
        }
    }

    return artifacts;
github qbs / qbs / share / qbs / modules / Exporter / qbs / qbsexporter.js View on Github external
checkValuePrefix(prop.name, value, project.buildDirectory, "project build directory");
        checkValuePrefix(prop.name, value, project.sourceDirectory, "project source directory");
    }

    // Adapt file paths pointing into the install dir, that is, make them relative to the
    // module file for relocatability. We accept them with or without the install root.
    // The latter form will typically be a result of applying the prefixMapping property,
    // while the first one could be an untransformed path, for instance if the project
    // file is written in such a way that include paths are picked up from the installed
    // location rather than the source directory.
    var valuePrefixToStrip;
    var fullInstallPrefix = FileInfo.joinPaths(product.qbs.installRoot, product.qbs.installPrefix);
    if (fullInstallPrefix.length > 1 && value.startsWith(fullInstallPrefix)) {
        valuePrefixToStrip = fullInstallPrefix;
    } else {
        var installPrefix = FileInfo.joinPaths("/", product.qbs.installPrefix);
        if (installPrefix.length > 1 && value.startsWith(installPrefix))
            valuePrefixToStrip = installPrefix;
    }
    if (valuePrefixToStrip) {
        var deployedModuleInstallDir = moduleInstallDir.slice(fullInstallPrefix.length);
        return "FileInfo.cleanPath(FileInfo.joinPaths(path, FileInfo.relativePath("
                + JSON.stringify(deployedModuleInstallDir) + ", "
                + JSON.stringify(value.slice(valuePrefixToStrip.length) || "/") + ")))";
    }

    return JSON.stringify(value);
}
github qbs / qbs / share / qbs / modules / Exporter / qbs / qbsexporter.js View on Github external
// Catch user oversights: Paths that point into the project source or build directories
    // make no sense in the module.
    if (!value.startsWith(product.qbs.installRoot)) {
        checkValuePrefix(prop.name, value, project.buildDirectory, "project build directory");
        checkValuePrefix(prop.name, value, project.sourceDirectory, "project source directory");
    }

    // Adapt file paths pointing into the install dir, that is, make them relative to the
    // module file for relocatability. We accept them with or without the install root.
    // The latter form will typically be a result of applying the prefixMapping property,
    // while the first one could be an untransformed path, for instance if the project
    // file is written in such a way that include paths are picked up from the installed
    // location rather than the source directory.
    var valuePrefixToStrip;
    var fullInstallPrefix = FileInfo.joinPaths(product.qbs.installRoot, product.qbs.installPrefix);
    if (fullInstallPrefix.length > 1 && value.startsWith(fullInstallPrefix)) {
        valuePrefixToStrip = fullInstallPrefix;
    } else {
        var installPrefix = FileInfo.joinPaths("/", product.qbs.installPrefix);
        if (installPrefix.length > 1 && value.startsWith(installPrefix))
            valuePrefixToStrip = installPrefix;
    }
    if (valuePrefixToStrip) {
        var deployedModuleInstallDir = moduleInstallDir.slice(fullInstallPrefix.length);
        return "FileInfo.cleanPath(FileInfo.joinPaths(path, FileInfo.relativePath("
                + JSON.stringify(deployedModuleInstallDir) + ", "
                + JSON.stringify(value.slice(valuePrefixToStrip.length) || "/") + ")))";
    }

    return JSON.stringify(value);
}
github qt-creator / qt-creator / share / qtcreator / templates / wizards / autotest / files / googlecommon.js View on Github external
function getGTestDir(qbs, str) {
    if (!str) {
        if (qbs.hostOS.contains("linux") && File.exists("/usr/src/gtest"))
            return "/usr/src/gtest";
    } else {
        return FileInfo.joinPaths(str, "googletest");
    }
    return "";
}
github qbs / qbs / share / qbs / modules / cpp / iar.js View on Github external
function applicationLinkerOutputArtifacts(product) {
    var app = {
        fileTags: ["application"],
        filePath: FileInfo.joinPaths(
                      product.destinationDirectory,
                      PathTools.applicationFilePath(product))
    };
    var mem_map = {
        fileTags: ["mem_map"],
        filePath: FileInfo.joinPaths(
                      product.destinationDirectory,
                      product.targetName + ".map")
    };
    return [app, mem_map]
}
github qbs / qbs / share / qbs / modules / ib / ib.js View on Github external
function tiffutilOutputFilePath(product, basePath) {
    return FileInfo.joinPaths(product.destinationDirectory,
                              "hidpi-images",
                              FileInfo.relativePath(product.sourceDirectory, basePath) +
                              product.ib.tiffSuffix);
}
github qbs / qbs / share / qbs / modules / java / utils.js View on Github external
return helperFullyQualifiedNames("class").map(function (name) {
        return {
            filePath: FileInfo.joinPaths(ModUtils.moduleProperty(product, "internalClassFilesDir"),
                                         name + ".class"),
            fileTags: ["java.class-internal"]
        };
    });
}
github qbs / qbs / share / qbs / imports / qbs / PathTools / path-tools.js View on Github external
function debugInfoFilePath(product, variantSuffix, fileTag) {
    var name = debugInfoFileName(product, variantSuffix, fileTag);
    if (product.moduleProperty("qbs", "targetOS").contains("darwin") && debugInfoIsBundle(product)) {
        return FileInfo.joinPaths(debugInfoBundlePath(product, fileTag),
                                  "Contents", "Resources", "DWARF", name);
    } else if (product.moduleProperty("bundle", "isBundle")) {
        return FileInfo.joinPaths(product.moduleProperty("bundle", "executableFolderPath"), name);
    }

    return name;
}
github qbs / qbs / share / qbs / modules / cpp / iar.js View on Github external
function applicationLinkerOutputArtifacts(product) {
    var app = {
        fileTags: ["application"],
        filePath: FileInfo.joinPaths(
                      product.destinationDirectory,
                      PathTools.applicationFilePath(product))
    };
    var mem_map = {
        fileTags: ["mem_map"],
        filePath: FileInfo.joinPaths(
                      product.destinationDirectory,
                      product.targetName + ".map")
    };
    return [app, mem_map]
}
github eprikazchikov / thunder / thirdparty / qbs / share / qbs / modules / cpp / gcc.js View on Github external
variants = variants || [{}];

    var artifacts = [];
    if (product.cpp.separateDebugInformation) {
        variants.map(function (variant) {
            artifacts.push({
                filePath: FileInfo.joinPaths(product.destinationDirectory,
                                                 PathTools.debugInfoFilePath(product,
                                                                             variant.suffix,
                                                                             fileTag)),
                fileTags: ["debuginfo_" + debugInfoTagSuffix]
            });
        });
        if (PathTools.debugInfoIsBundle(product)) {
            artifacts.push({
                filePath: FileInfo.joinPaths(product.destinationDirectory,
                                             PathTools.debugInfoBundlePath(product, fileTag)),
                fileTags: ["debuginfo_bundle"]
            });
            artifacts.push({
                filePath: FileInfo.joinPaths(product.destinationDirectory,
                                             PathTools.debugInfoPlistFilePath(product, fileTag)),
                fileTags: ["debuginfo_plist"]
            });
        }
    }
    return artifacts;
}

qbs

Build tool that helps simplify the build process for developing projects across multiple platforms.

LGPL-3.0
Latest version published 9 years ago

Package Health Score

22 / 100
Full package analysis

Popular qbs functions