<commit_before>/// <reference path="../../definitions/node.d.ts"/>
/// <reference path="../../definitions/Q.d.ts" />
/// <reference path="../../definitions/vsts-task-lib.d.ts" />

import path = require('path');
import Q = require('q');
import tl = require('vsts-task-lib/task');

//read inputs
var solution = tl.getPathInput('solution', true, false);
var platform = tl.getInput('platform');
var configuration = tl.getInput('configuration');
var msbuildArguments = tl.getInput('msbuildArguments');
var clean = tl.getBoolInput('clean');
var logsolutionEvents = tl.getBoolInput('logsolutionEvents');
if(logsolutionEvents) {
    tl.warning('logSolutionEvents property is not supported on the VSTS node agent.');
}
var msbuildLocationMethod = tl.getInput('msbuildLocationMethod');
if(!msbuildLocationMethod) {
    msbuildLocationMethod = 'version';
}

var xbuildToolPath = tl.which('xbuild'); //ignore msbuild version on non-Windows platforms, use xbuild
if(msbuildLocationMethod == 'location') {
    xbuildToolPath = tl.getInput('msbuildLocation');
}

var runxbuild = function (fn, clean) {
    return Q.fcall( () => {
        var xbuild = tl.createToolRunner(xbuildToolPath);
        xbuild.pathArg(fn);
        if(clean) {
            xbuild.arg('/t:Clean');
        }
        if (platform) {
            xbuild.arg('/p:Platform=\"' + platform + '\"');
        }
        if (configuration) {
            xbuild.arg('/p:Configuration=\"' + configuration + '\"');
        }
        if (msbuildArguments) {
            xbuild.arg(msbuildArguments);
        }

        return xbuild.exec();
    });
}

// Resolve files for the specified value or pattern
var filesList : string [];
if (solution.indexOf('*') == -1 && solution.indexOf('?') == -1) {
    // No pattern found, check literal path to a single file
    tl.checkPath(solution, 'files');
<commit_msg>msbuild xplat implementation using xbuild<commit_after>/// <reference path="../../definitions/node.d.ts"/>
/// <reference path="../../definitions/Q.d.ts" />
/// <reference path="../../definitions/vsts-task-lib.d.ts" />

import path = require('path');
import Q = require('q');
import tl = require('vsts-task-lib/task');

//read inputs
var solution = tl.getPathInput('solution', true, false);
var platform = tl.getInput('platform');
var configuration = tl.getInput('configuration');
var msbuildArguments = tl.getInput('msbuildArguments');
var clean = tl.getBoolInput('clean');
var logsolutionEvents = tl.getBoolInput('logsolutionEvents');
if(logsolutionEvents) {
    tl.warning('logSolutionEvents property is not supported on the VSTS node agent.');
}
var msbuildLocationMethod = tl.getInput('msbuildLocationMethod');
if(!msbuildLocationMethod) {
    msbuildLocationMethod = 'version';
}

var xbuildToolPath = tl.which('xbuild'); //ignore msbuild version on non-Windows platforms, use xbuild
if(msbuildLocationMethod == 'location') {
    xbuildToolPath = tl.getInput('msbuildLocation');
}

var runxbuild = function (fn, clean) {
    return Q.fcall( () => {
        var xbuild = tl.createToolRunner(xbuildToolPath);
        xbuild.pathArg(fn);
        if(clean) {
            xbuild.arg('/t:Clean');
        }
        if (platform) {
            xbuild.arg('/p:Platform="' + platform + '"');
        }
        if (configuration) {
            xbuild.arg('/p:Configuration="' + configuration + '"');
        }
        if (msbuildArguments) {
            xbuild.arg(msbuildArguments);
        }

        return xbuild.exec();
    });
}

// Resolve files for the specified value or pattern
var filesList : string [];
if (solution.indexOf('*') == -1 && solution.indexOf('?') == -1) {
    // No pattern found, check literal path to a single file
    tl.checkPath(solution, 'files');

{'fraction_non_alphanumeric': 0.1647879763821793, 'fraction_numerical': 0.0010735373054213634, 'mean_word_length': 3.308670520231214, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2097720', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1106, 'n_words': 252}