當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript toolrunner.ToolRunner類代碼示例

本文整理匯總了TypeScript中vsts-task-lib/toolrunner.ToolRunner的典型用法代碼示例。如果您正苦於以下問題:TypeScript ToolRunner類的具體用法?TypeScript ToolRunner怎麽用?TypeScript ToolRunner使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ToolRunner類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: deleteProvisioningProfile

export async function deleteProvisioningProfile(uuid: string) {
    var provProfilePath : string = getProvisioningProfilePath(uuid);
    tl.warning('Deleting provisioning profile: ' + provProfilePath);
    if(fs.existsSync(provProfilePath)) {
        tl.warning('Deleting provisioning profile: ' + provProfilePath);

        var deleteProfileCommand : ToolRunner = tl.tool(tl.which('rm', true));
        deleteProfileCommand.arg(['-f', provProfilePath]);
        await deleteProfileCommand.exec();
    }
}
開發者ID:HSAR,項目名稱:vso-agent-tasks,代碼行數:11,代碼來源:ios-signing-common.ts

示例2: getDefaultKeychainPath

export async function getDefaultKeychainPath() {
    let defaultKeychainPath: string;
    let getKeychainCmd: ToolRunner = tl.tool(tl.which('security', true));
    getKeychainCmd.arg('default-keychain');
    getKeychainCmd.on('stdout', function (data) {
        if (data) {
            defaultKeychainPath = data.toString().trim().replace(/[",\n\r\f\v]/gm, '');
        }
    })
    await getKeychainCmd.exec();
    return defaultKeychainPath;
}
開發者ID:bleissem,項目名稱:vsts-tasks,代碼行數:12,代碼來源:ios-signing-common.ts

示例3: applySonarQubeIssuesModeInPrBuild

    /**
     * Applies parameters that will run SQ analysis in issues mode if this is a pull request build
     * @param toolRunner     ToolRunner to add parameters to
     * @returns {ToolRunner} ToolRunner with parameters added
     */
    private static applySonarQubeIssuesModeInPrBuild(toolrunner: ToolRunner): ToolRunner {
        if (VstsServerUtils.isPrBuild()) {
            console.log(tl.loc('sqAnalysis_IncrementalMode'));

            toolrunner.arg('-Dsonar.analysis.mode=issues');
            toolrunner.arg('-Dsonar.report.export.path=sonar-report.json');
        } else {
            tl.debug('Running a full SonarQube analysis');
        }

        return toolrunner;
    }
開發者ID:DarqueWarrior,項目名稱:vsts-tasks,代碼行數:17,代碼來源:parameter-helper.ts

示例4: applySonarQubeAnalysisParams

export function applySonarQubeAnalysisParams(toolRunner: ToolRunner, sqProjectName?, sqProjectKey?, sqProjectVersion?): ToolRunner {
    if (sqProjectName) {
        toolRunner.arg('-Dsonar.projectName=' + sqProjectName);
    }
    if (sqProjectKey) {
        toolRunner.arg('-Dsonar.projectKey=' + sqProjectKey);
    }
    if (sqProjectVersion) {
        toolRunner.arg('-Dsonar.projectVersion=' + sqProjectVersion);
    }

    return toolRunner;
}
開發者ID:Jason1978-Z,項目名稱:vsts-tasks,代碼行數:13,代碼來源:sonarqube-common.ts

示例5: applySonarQubeIssuesModeInPrBuild

export function applySonarQubeIssuesModeInPrBuild(toolrunner: ToolRunner) {

    if (isPrBuild()) {
        console.log(tl.loc('sqAnalysis_IncrementalMode'));

        toolrunner.arg("-Dsonar.analysis.mode=issues");
        toolrunner.arg("-Dsonar.report.export.path=sonar-report.json");
    }
    else
    {
        tl.debug("Running a full SonarQube analysis");
    }

    return toolrunner;
}
開發者ID:Jason1978-Z,項目名稱:vsts-tasks,代碼行數:15,代碼來源:sonarqube-common.ts

示例6: deleteProvisioningProfile

export async function deleteProvisioningProfile(uuid: string): Promise<void> {
    if (uuid && uuid.trim()) {
        const provProfiles: string[] = tl.findMatch(getUserProvisioningProfilesPath(), uuid.trim() + '*');
        if (provProfiles) {
            for (const provProfilePath of provProfiles) {
                tl.warning('Deleting provisioning profile: ' + provProfilePath);
                if (tl.exist(provProfilePath)) {
                    const deleteProfileCommand: ToolRunner = tl.tool(tl.which('rm', true));
                    deleteProfileCommand.arg(['-f', provProfilePath]);
                    await deleteProfileCommand.exec();
                }
            }
        }
    }
}
開發者ID:grawcho,項目名稱:vso-agent-tasks,代碼行數:15,代碼來源:ios-signing-common.ts

示例7: addLabel

function addLabel(command: ToolRunner, hostName: string, labelName: string, variableName: string)
{  
    var labelValue = tl.getVariable(variableName);
    if (labelValue) {
        command.arg(["--label", util.format("%s.image.%s=%s", hostName, labelName, labelValue)]);
    }
}
開發者ID:grawcho,項目名稱:vso-agent-tasks,代碼行數:7,代碼來源:containerbuild.ts

示例8: executeTypings

function executeTypings(tool?: ToolRunner) {
    tl.cd(cwd);

    tool = tool || tl.createToolRunner(typings);
    tool.arg(tl.getInput("command", false));
    tool.arg(tl.getInput("arguments", false));

    return tool.exec()
        .then((code) => {
            tl.setResult(tl.TaskResult.Succeeded, tl.loc("typingsReturnCode", code));
        })
        .catch((err) => {
            tl.debug("taskRunner fail");
            tl.setResult(tl.TaskResult.Failed, tl.loc("typingsFailed", err.message));
        });
}
開發者ID:touchifyapp,項目名稱:vsts-typings,代碼行數:16,代碼來源:typingstask.ts

示例9: applySonarQubeArgs

export function applySonarQubeArgs(mvnsq: ToolRunner, execFileJacoco?: string): ToolRunner {
    if (!sqCommon.isSonarQubeAnalysisEnabled()) {
        return mvnsq;
    }

    mvnsq = sqCommon.applySonarQubeParameters(mvnsq);

    // Apply argument for the JaCoCo tool, if enabled
    if (typeof execFileJacoco != "undefined" && execFileJacoco) {
        mvnsq.arg('-Dsonar.jacoco.reportPath=' + execFileJacoco);
    }

    mvnsq.arg("sonar:sonar");

    return mvnsq;
}
開發者ID:HSAR,項目名稱:vso-agent-tasks,代碼行數:16,代碼來源:mavensonar.ts

示例10: execute

(async function execute() {
    try {

        var execOptions: IExecOptions = {
            cwd: undefined,
            env: undefined,
            silent: undefined,
            failOnStdErr: undefined,
            ignoreReturnCode: undefined,
            errStream: undefined,
            outStream: undefined,
            windowsVerbatimArguments: undefined
        };

        var toolRunner: ToolRunner;

        var isWin32 = os.platform() == "win32";

        if (isWin32) {
            toolRunner = tl.tool(gitVersionPath);
        } else {
            toolRunner = tl.tool("mono");
            toolRunner.arg(gitVersionPath);
        }

        toolRunner.arg([
            sourcesDirectory,
            "/output",
            "buildserver",
            "/nofetch"
        ]);

        if (updateAssemblyInfo) {
            toolRunner.arg("/updateassemblyinfo")
            if (updateAssemblyInfoFilename) {
                toolRunner.arg(updateAssemblyInfoFilename);
            } else {
                toolRunner.arg("true");
            }
        }

        if (additionalArguments) {
            toolRunner.line(additionalArguments);
        }

        var result = await toolRunner.exec(execOptions);
        if (result) {
            tl.setResult(tl.TaskResult.Failed, "An error occured during GitVersion execution")
        } else {
            tl.setResult(tl.TaskResult.Succeeded, "GitVersion executed successfully")
        }
    }
    catch (err) {
        tl.debug(err.stack)
        tl.setResult(tl.TaskResult.Failed, err);
    }
})();
開發者ID:JakeGinnivan,項目名稱:GitVersion,代碼行數:57,代碼來源:GitVersion.ts


注:本文中的vsts-task-lib/toolrunner.ToolRunner類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。