当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ToolRunner.line方法代码示例

本文整理汇总了TypeScript中azure-pipelines-task-lib/toolrunner.ToolRunner.line方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ToolRunner.line方法的具体用法?TypeScript ToolRunner.line怎么用?TypeScript ToolRunner.line使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在azure-pipelines-task-lib/toolrunner.ToolRunner的用法示例。


在下文中一共展示了ToolRunner.line方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: execute

    public static async execute() {
        try {

            const updateAssemblyInfo = tl.getBoolInput('updateAssemblyInfo');
            const updateAssemblyInfoFilename = tl.getInput('updateAssemblyInfoFilename');
            const additionalArguments = tl.getInput('additionalArguments');
            const targetPath = tl.getInput('targetPath');
            const preferBundledVersion = tl.getBoolInput('preferBundledVersion');

            const currentDirectory = __dirname;
            const workingDirectory = !targetPath
                    ? tl.getVariable("Build.SourcesDirectory")
                    : path.join(tl.getVariable("Build.SourcesDirectory"), targetPath);

            let gitVersionPath = tl.getInput('gitVersionPath');
            if (!gitVersionPath) {
                gitVersionPath = tl.which("GitVersion.exe");
                if (preferBundledVersion || !gitVersionPath) {
                    gitVersionPath = path.join(currentDirectory, "GitVersion.exe");
                }
            }

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

            let toolRunner: ToolRunner;

            const parser = new ArgumentParser();
            parser.addArgument(
                [ '-r', '--runtime'],
                {
                    help: '[full|netcore]',
                    defaultValue: 'full'
                }
            );

            const args = parser.parseArgs();
            switch (args.runtime) {
                case 'netcore':
                    gitVersionPath = path.join(currentDirectory, "netcore", "GitVersion.dll");
                    toolRunner = tl.tool("dotnet");
                    toolRunner.arg(gitVersionPath);
                    break;

                case 'full':
                default:
                    const isWin32 = os.platform() == "win32";
                    if (isWin32) {
                        toolRunner = tl.tool(gitVersionPath);
                    } else {
                        toolRunner = tl.tool("mono");
                        toolRunner.arg(gitVersionPath);
                    }

                    break;
            }

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

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

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

            const 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:GitTools,项目名称:GitVersion,代码行数:96,代码来源:GitVersion.ts

示例2: run


//.........这里部分代码省略.........
            if (match) {
                const versionString = match.toString().replace('Xcode', '').trim();
                const majorVersion: number = parseInt(versionString);
                tl.debug('majorVersion = ' + majorVersion);
                telemetryData.xcodeVersion = versionString;

                if (!isNaN(majorVersion)) {
                    xcodeMajorVersion = majorVersion;
                }
            }
        });

        await xcv.exec();
        tl.debug('xcodeMajorVersion = ' + xcodeMajorVersion);

        // --- Xcode build arguments ---
        let xcb: ToolRunner = tl.tool(tool);
        xcb.argIf(sdk, ['-sdk', sdk]);
        xcb.argIf(configuration, ['-configuration', configuration]);
        if (ws && tl.filePathSupplied('xcWorkspacePath')) {
            xcb.argIf(isProject, '-project');
            xcb.argIf(!isProject, '-workspace');
            xcb.arg(ws);
        }
        xcb.argIf(scheme, ['-scheme', scheme]);
        // Add a -destination argument for each device and simulator.
        if (destinations) {
            destinations.forEach(destination => {
                xcb.arg(['-destination', destination]);
            });
        }
        xcb.arg(actions);
        if (args) {
            xcb.line(args);
        }

        //--------------------------------------------------------
        // iOS signing and provisioning
        //--------------------------------------------------------
        let signingOption: string = tl.getInput('signingOption', true);
        let xcode_codeSigningAllowed: string;
        let xcode_codeSignStyle: string;
        let xcode_otherCodeSignFlags: string;
        let xcode_codeSignIdentity: string;
        let xcode_provProfile: string;
        let xcode_provProfileSpecifier: string;
        let xcode_devTeam: string;

        telemetryData.signingOption = signingOption;

        if (signingOption === 'nosign') {
            xcode_codeSigningAllowed = 'CODE_SIGNING_ALLOWED=NO';
        }
        else if (signingOption === 'manual') {
            xcode_codeSignStyle = 'CODE_SIGN_STYLE=Manual';

            const signIdentity: string = tl.getInput('signingIdentity');
            if (signIdentity) {
                xcode_codeSignIdentity = 'CODE_SIGN_IDENTITY=' + signIdentity;
            }

            let provProfileUUID: string = tl.getInput('provisioningProfileUuid');
            let provProfileName: string = tl.getInput('provisioningProfileName');

            if (!provProfileUUID) {
                provProfileUUID = "";
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:67,代码来源:xcode.ts


注:本文中的azure-pipelines-task-lib/toolrunner.ToolRunner.line方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。