//-------------------------------------------------------- var ws = null; var wsPath = tl.getPathInput('xcWorkspacePath', false, false); if (tl.filePathSupplied(wsPath)) { ws = tl.globFirst(wsPath); if (!ws) { tl.setResult(tl.TaskResult.Failed, 'Workspace specified but it does not exist or is not a directory'); } } var sdk = tl.getInput('sdk', true); var cfg = tl.getInput('configuration', true); var scheme = tl.getInput('scheme', false); var xcrpt = tl.getInput('xctoolReporter', false); var actions = tl.getDelimitedInput('actions', ' ', true); var out = path.resolve(process.cwd(), tl.getInput('outputPattern', true)); var pkgapp = tl.getBoolInput('packageApp', true); //-------------------------------------------------------- // Exec Tools //-------------------------------------------------------- // --- Xcode Version --- var xcv = new tr.ToolRunner(tool); xcv.arg('-version'); xcv.exec(null) .then(function (code) { tl.exitOnCodeIf(code, code != 0); // --- XcodeBuild --- var xcb = new tr.ToolRunner(tool); xcb.arg(['-sdk', sdk]); xcb.arg(['-configuration', cfg]); xcb.argIf(ws, ['-workspace', ws]); xcb.argIf(scheme, ['-scheme', scheme]);
var current = path.normalize(fullPath); var parentPath = path.dirname(current); var count = 0; while (parentPath !== current) { ++count; current = parentPath; parentPath = path.dirname(current); } return count; } tl.setResourcePath(path.join(__dirname, 'task.json')); // contents is a multiline input containing glob patterns var contents = tl.getDelimitedInput('Contents', '\n', true); var sourceFolder = tl.getPathInput('SourceFolder', true, true); var targetFolder = tl.getPathInput('TargetFolder', true); var cleanTargetFolder = tl.getBoolInput('CleanTargetFolder', false); var overWrite = tl.getBoolInput('OverWrite', false); // not use common root for now. //var useCommonRoot: boolean = tl.getBoolInput('UseCommonRoot', false); var useCommonRoot = false; // include filter var includeContents = []; // exclude filter var excludeContents = []; for (var i = 0; i < contents.length; i++) { var pattern = contents[i].trim(); var negate = false; var negateOffset = 0; for (var j = 0; j < pattern.length && pattern[j] === '!'; j++) { negate = !negate; negateOffset++;
/// <reference path="../../definitions/node.d.ts"/> /// <reference path="../../definitions/Q.d.ts" /> /// <reference path="../../definitions/vsts-task-lib.d.ts" /> "use strict"; var path = require('path'); var Q = require('q'); var tl = require('vsts-task-lib/task'); //read inputs var solution = tl.getPathInput('solution', true, false); var nugetConfigPath = tl.getPathInput('nugetConfigPath', false, true); var noCache = tl.getBoolInput('noCache'); var nuGetRestoreArgs = tl.getInput('nuGetRestoreArgs'); var nuGetPath = tl.getPathInput('nuGetPath', false, true); //find nuget location to use var nuGetPathToUse = tl.which('nuget'); if (nuGetPath) { nuGetPathToUse = nuGetPath + '/nuget'; } if (!nuGetPathToUse) { tl.error('Failed to find nuget.'); tl.exit(1); } tl.checkPath(nuGetPathToUse, 'nuget'); var runnuget = function (fn) { return Q.fcall(function () { var nugetTool = tl.createToolRunner(nuGetPathToUse); nugetTool.arg('restore'); nugetTool.pathArg(fn); var sourcesFolder = tl.getVariable('build.sourcesdirectory'); tl.debug('sourcesFolder = ' + sourcesFolder); if (nugetConfigPath && nugetConfigPath.toLowerCase() != sourcesFolder.toLowerCase()) {