本文整理匯總了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);
}
})();