当前位置: 首页>>代码示例>>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;未经允许,请勿转载。