本文整理汇总了TypeScript中azure-pipelines-task-lib/task.getBoolInput函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getBoolInput函数的具体用法?TypeScript getBoolInput怎么用?TypeScript getBoolInput使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getBoolInput函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: run
async function run() {
try {
// Configure localization
tl.setResourcePath(path.join(__dirname, 'task.json'));
// Get files to be signed
const filesPattern: string = tl.getInput('files', true);
// Signing the APK?
const apksign: boolean = tl.getBoolInput('apksign');
// Zipaligning the APK?
const zipalign: boolean = tl.getBoolInput('zipalign');
// Resolve files for the specified value or pattern
const filesToSign: string[] = tl.findMatch(null, filesPattern);
// Fail if no matching files were found
if (!filesToSign || filesToSign.length === 0) {
throw new Error(tl.loc('NoMatchingFiles', filesPattern));
}
for (const file of filesToSign) {
if (zipalign) {
await zipaligning(file);
}
if (apksign) {
await apksigning(file);
}
}
} catch (err) {
tl.setResult(tl.TaskResult.Failed, err);
}
}
示例2: run
async function run() {
try {
tl.setResourcePath(path.join(__dirname, 'task.json'));
// Check platform is macOS since demands are not evaluated on Hosted pools
if (os.platform() !== 'darwin') {
console.log(tl.loc('InstallRequiresMac'));
} else {
let keychain: string = tl.getInput('keychain');
let keychainPath: string = tl.getTaskVariable('APPLE_CERTIFICATE_KEYCHAIN');
let deleteCert: boolean = tl.getBoolInput('deleteCert');
let hash: string = tl.getTaskVariable('APPLE_CERTIFICATE_SHA1HASH');
if (deleteCert && hash) {
sign.deleteCert(keychainPath, hash);
}
let deleteKeychain: boolean = false;
if (keychain === 'temp') {
deleteKeychain = true;
} else if (keychain === 'custom') {
deleteKeychain = tl.getBoolInput('deleteCustomKeychain');
}
if (deleteKeychain && keychainPath) {
await sign.deleteKeychain(keychainPath);
}
}
} catch (err) {
tl.warning(err);
}
}
示例3: isServerBasedRun
function isServerBasedRun(): boolean {
const batchType = tl.getInput('distributionBatchType');
if (batchType && batchType === 'basedOnTestCases') {
const batchSize = tl.getInput('batchingBasedOnAgentsOption');
if (batchSize && batchSize === 'customBatchSize') {
return true;
}
} else if (batchType && batchType === 'basedOnExecutionTime') {
return true;
} else if (batchType && batchType === 'basedOnAssembly') {
return true;
}
const testType = tl.getInput('testSelector');
tl.debug('Value of Test Selector :' + testType);
if (testType.toLowerCase() === 'testplan' || testType.toLowerCase() === 'testrun') {
return true;
}
const parallelExecution = tl.getVariable('System.ParallelExecutionType');
tl.debug('Value of ParallelExecutionType :' + parallelExecution);
if (parallelExecution && parallelExecution.toLowerCase() === 'multimachine') {
const dontDistribute = tl.getBoolInput('dontDistribute');
if (dontDistribute) {
return false;
}
return true;
}
return false;
}
示例4: run
async function run() {
let packageType = tl.getInput('packageType') || "sdk";
let versionSpec = tl.getInput('version');
if (versionSpec) {
console.log(tl.loc("ToolToInstall", packageType, versionSpec));
let installationPath = tl.getInput('installationPath');
if (!installationPath) {
installationPath = path.join(tl.getVariable('Agent.ToolsDirectory'), "dotnet");
}
let includePreviewVersions: boolean = tl.getBoolInput('includePreviewVersions');
var versionSpecParts = new VersionParts(versionSpec);
let versionFetcher = new DotNetCoreVersionFetcher();
let versionInfo: VersionInfo = await versionFetcher.getVersionInfo(versionSpecParts.versionSpec, packageType, includePreviewVersions);
if (!versionInfo) {
throw tl.loc("MatchingVersionNotFound", versionSpecParts.versionSpec);
}
let dotNetCoreInstaller = new VersionInstaller(packageType, installationPath);
if (!dotNetCoreInstaller.isVersionInstalled(versionInfo.getVersion())) {
await dotNetCoreInstaller.downloadAndInstall(versionInfo, versionFetcher.getDownloadUrl(versionInfo));
}
tl.prependPath(installationPath);
// Set DOTNET_ROOT for dotnet core Apphost to find runtime since it is installed to a non well-known location.
tl.setVariable('DOTNET_ROOT', installationPath);
// By default disable Multi Level Lookup unless user wants it enabled.
let performMultiLevelLookup = tl.getBoolInput("performMultiLevelLookup", false);
tl.setVariable("DOTNET_MULTILEVEL_LOOKUP", !performMultiLevelLookup ? "0" : "1");
}
// Install NuGet version specified by user or 4.4.1 in case none is specified
// Also sets up the proxy configuration settings.
const nugetVersion = tl.getInput('nugetVersion') || '4.4.1';
await NuGetInstaller.installNuGet(nugetVersion);
// Add dot net tools path to "PATH" environment variables, so that tools can be used directly.
addDotNetCoreToolPath();
}
示例5: run
async function run() {
try {
taskLib.setResourcePath(path.join(__dirname, 'task.json'));
const versionSpec = taskLib.getInput('versionSpec', false) || DEFAULT_NUGET_VERSION;
const checkLatest = taskLib.getBoolInput('checkLatest', false);
await nuGetGetter.getNuGet(versionSpec, checkLatest, true);
} catch (error) {
console.error('ERR:' + error.message);
taskLib.setResult(taskLib.TaskResult.Failed, '');
}
}
示例6: run
async function run()
{
try {
const version = taskLib.getInput("version", true);
const checkLatest = taskLib.getBoolInput("checkLatest", false) || false;
await getTfx(version, checkLatest);
await taskLib.tool("tfx").arg(["version", "--no-color"]).exec();
}
catch (error) {
taskLib.setResult(taskLib.TaskResult.Failed, error.message);
}
}
示例7: usePythonVersion
(async () => {
try {
task.setResourcePath(path.join(__dirname, 'task.json'));
await usePythonVersion({
versionSpec: task.getInput('versionSpec', true),
addToPath: task.getBoolInput('addToPath', true),
architecture: task.getInput('architecture', true)
},
getPlatform());
task.setResult(task.TaskResult.Succeeded, "");
} catch (error) {
task.setResult(task.TaskResult.Failed, error.message);
}
})();
示例8: run
async function run() {
try {
tl.setResourcePath(path.join(__dirname, 'task.json'));
const apksign: boolean = tl.getBoolInput('apksign');
if (apksign) {
// download keystore file
const keystoreFileId: string = tl.getInput('keystoreFile', true);
const secureFileHelpers: secureFilesCommon.SecureFileHelpers = new secureFilesCommon.SecureFileHelpers();
const keystoreFilePath: string = await secureFileHelpers.downloadSecureFile(keystoreFileId);
tl.setTaskVariable('KEYSTORE_FILE_PATH', keystoreFilePath);
}
} catch (err) {
tl.setResult(tl.TaskResult.Failed, err);
}
}
示例9: run
async function run() {
try {
//
// Version is optional. If supplied, install / use from the tool cache
// If not supplied then task is still used to setup proxy, auth, etc...
//
const version = taskLib.getInput('version', false);
if (version) {
const checkLatest: boolean = taskLib.getBoolInput('checkLatest', false);
// TODO: installer doesn't support proxy
await installer.getNode(version, checkLatest);
}
const proxyCfg: taskLib.ProxyConfiguration = taskLib.getHttpProxyConfiguration();
if (proxyCfg) {
proxyutil.setCurlProxySettings(proxyCfg);
}
}
catch (error) {
taskLib.setResult(taskLib.TaskResult.Failed, error.message);
}
}