本文整理汇总了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);
}
}
示例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 = "";