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