當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript task.getBoolInput函數代碼示例

本文整理匯總了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);
    }
}
開發者ID:Microsoft,項目名稱:vsts-tasks,代碼行數:35,代碼來源:androidsigning.ts

示例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);
    }
}
開發者ID:Microsoft,項目名稱:vsts-tasks,代碼行數:32,代碼來源:postinstallcert.ts

示例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;
}
開發者ID:Microsoft,項目名稱:vsts-tasks,代碼行數:32,代碼來源:runvstest.ts

示例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();
}
開發者ID:Microsoft,項目名稱:vsts-tasks,代碼行數:42,代碼來源:usedotnet.ts

示例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, '');
    }
}
開發者ID:Microsoft,項目名稱:vsts-tasks,代碼行數:12,代碼來源:nugettoolinstaller.ts

示例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);
    }
}
開發者ID:Microsoft,項目名稱:vsts-extension-build-release-tasks,代碼行數:13,代碼來源:TfxInstaller.ts

示例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);
    }
})();
開發者ID:Microsoft,項目名稱:vsts-tasks,代碼行數:14,代碼來源:main.ts

示例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);
    }
}
開發者ID:Microsoft,項目名稱:vsts-tasks,代碼行數:16,代碼來源:preandroidsigning.ts

示例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);
    }
}
開發者ID:Microsoft,項目名稱:vsts-tasks,代碼行數:23,代碼來源:usenode.ts


注:本文中的azure-pipelines-task-lib/task.getBoolInput函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。