<commit_before>var fs = require('fs'),
    path = require('path'),
    njake = require('./Build/njake'),
    msbuild = njake.msbuild,
    xunit = njake.xunit,
    nuget = njake.nuget,
    assemblyinfo = njake.assemblyinfo,
    config = {
        rootPath: __dirname,
        version: fs.readFileSync('VERSION', 'utf-8').split('\r\n')[0],
        fileVersion: fs.readFileSync('VERSION', 'utf-8').split('\r\n')[1]
    };

console.log('Facebook C# SDK v' + config.version + ' (' + config.fileVersion + ')')

msbuild.setDefaults({
    properties: { Configuration: 'Release' },
    processor: 'x86',
    version: 'net4.0'
})

xunit.setDefaults({
    _exe: 'Source/packages/xunit.runners.1.9.0.1566/tools/xunit.console.clr4.x86'
})

nuget.setDefaults({
    _exe: 'Source/.nuget/NuGet.exe',
    verbose: true
})

assemblyinfo.setDefaults({
    language: 'c#'
})

desc('Build all binaries, run tests and create nuget and symbolsource packages')
task('default', ['build', 'test', 'nuget:pack'])

directory('Dist/')

namespace('build', function () {

    desc('Build .NET 4.5 binaries')
    task('net45', ['assemblyinfo:facebook'], function () {
        msbuild({
            file: 'Source/Facebook-Net45.sln',
            targets: ['Build']
        })
    }, { async: true })

    desc('Build .NET 4.0 binaries')
    task('net40', ['assemblyinfo:facebook'], function () {
        msbuild({
            file: 'Source/Facebook-Net40.sln',
            targets: ['Build']
        })
    }, { async: true })

    desc('Build .NET 3.5 binaries')
    task('net35', ['assemblyinfo:facebook'], function () {
        msbuild({
            file: 'Source/Facebook-Net35.sln',
            targets: ['Build']
        })
    }, { async: true })

    desc('Build Windows Store binaries')
    task('winstore', ['assemblyinfo:facebook'], function () {
        msbuild({
            file: 'Source/Facebook-WindowsStore.sln',
            targets: ['Build']
        })
    }, { async: true })

    desc('Build Windows Phone 7.1 binaries')
    task('wp71', ['assemblyinfo:facebook'], function () {
        msbuild({
            file: 'Source/Facebook-WP7.sln',
            targets: ['Build']
        })
    }, { async: true })

    desc('Build Silverlight 5 binaries')
    task('sl5', ['assemblyinfo:facebook'], function () {
        msbuild({
            file: 'Source/Facebook-SL5.sln',
            targets: ['Build']
        })
    }, { async: true })

    task('all', ['build:net45', 'build:net40', 'build:net35', 'build:wp71', 'build:sl5', 'build:winstore'])

    task('mono', function (xbuildPath) {
        msbuild({
            _exe: xbuildPath || 'xbuild',
            file: 'Source/Facebook-Net40.sln',
            targets: ['Build'],
            properties: { TargetFrameworkProfile: '' }
        })
    }, { async: true })

})

task('build', ['build:all'])

namespace('clean', function () {

    task('net45', function () {
        msbuild({
            file: 'Source/Facebook-Net40.sln',
            targets: ['Clean']
        })
    }, { async: true })

    task('net40', function () {
        msbuild({
            file: 'Source/Facebook-Net40.sln',
            targets: ['Clean']
        })
    }, { async: true })

    task('net35', function () {
        msbuild({
            file: 'Source/Facebook-Net35.sln',
            targets: ['Clean']
        })
    }, { async: true })

    task('winstore', function () {
        msbuild({
            file: 'Source/Facebook-WindowsStore.sln',
            targets: ['Clean']
        })
    }, { async: true })

    task('wp71', function () {
        msbuild({
            file: 'Source/Facebook-WP7.sln',
            targets: ['Clean']
        })
    }, { async: true })

    task('sl5', function () {
        msbuild({
            file: 'Source/Facebook-SL5.sln',
            targets: ['Clean']
        })
    }, { async: true })

    task('all', ['clean:net45', 'clean:net40', 'clean:net35', 'clean:wp71', 'clean:sl5', 'clean:winstore'])

})

desc('Clean all')
task('clean', ['clean:all'], function () {
    jake.rmRf('Working/')
    jake.rmRf('Dist/')
})

namespace('tests', function () {

    task('net40', ['build:net40'], function () {
        xunit({
            assembly: 'Bin/Tests/Release/Facebook.Tests.dll'
        })
    }, { async: true })

    task('all', ['tests:net40'])

})

desc('Run tests')
task('test', ['tests:all'])

directory('Dist/NuGet', ['Dist/'])
directory('Dist/SymbolSource', ['Dist/'])

namespace('nuget', function () {

    namespace('pack', function () {

        task('nuget', ['Dist/NuGet', 'build'], function () {
            nuget.pack({
                nuspec: 'Build/NuGet/Facebook/Facebook.nuspec',<commit_msg>Updated jakefile with new tests<commit_after>var fs = require('fs'),
    path = require('path'),
    njake = require('./Build/njake'),
    msbuild = njake.msbuild,
    xunit = njake.xunit,
    nuget = njake.nuget,
    assemblyinfo = njake.assemblyinfo,
    config = {
        rootPath: __dirname,
        version: fs.readFileSync('VERSION', 'utf-8').split('\r\n')[0],
        fileVersion: fs.readFileSync('VERSION', 'utf-8').split('\r\n')[1]
    };

console.log('Facebook C# SDK v' + config.version + ' (' + config.fileVersion + ')')

msbuild.setDefaults({
    properties: { Configuration: 'Release' },
    processor: 'x86',
    version: 'net4.0'
})

xunit.setDefaults({
    _exe: 'Source/packages/xunit.runners.1.9.0.1566/tools/xunit.console.clr4.x86'
})

nuget.setDefaults({
    _exe: 'Source/.nuget/NuGet.exe',
    verbose: true
})

assemblyinfo.setDefaults({
    language: 'c#'
})

desc('Build all binaries, run tests and create nuget and symbolsource packages')
task('default', ['build', 'test', 'nuget:pack'])

directory('Dist/')

namespace('build', function () {

    desc('Build .NET 4.5 binaries')
    task('net45', ['assemblyinfo:facebook'], function () {
        msbuild({
            file: 'Source/Facebook-Net45.sln',
            targets: ['Build']
        })
    }, { async: true })

    desc('Build .NET 4.0 binaries')
    task('net40', ['assemblyinfo:facebook'], function () {
        msbuild({
            file: 'Source/Facebook-Net40.sln',
            targets: ['Build']
        })
    }, { async: true })

    desc('Build .NET 3.5 binaries')
    task('net35', ['assemblyinfo:facebook'], function () {
        msbuild({
            file: 'Source/Facebook-Net35.sln',
            targets: ['Build']
        })
    }, { async: true })

    desc('Build Windows Store binaries')
    task('winstore', ['assemblyinfo:facebook'], function () {
        msbuild({
            file: 'Source/Facebook-WindowsStore.sln',
            targets: ['Build']
        })
    }, { async: true })

    desc('Build Windows Phone 7.1 binaries')
    task('wp71', ['assemblyinfo:facebook'], function () {
        msbuild({
            file: 'Source/Facebook-WP7.sln',
            targets: ['Build']
        })
    }, { async: true })

    desc('Build Silverlight 5 binaries')
    task('sl5', ['assemblyinfo:facebook'], function () {
        msbuild({
            file: 'Source/Facebook-SL5.sln',
            targets: ['Build']
        })
    }, { async: true })

    task('all', ['build:net45', 'build:net40', 'build:net35', 'build:wp71', 'build:sl5', 'build:winstore'])

    task('mono', function (xbuildPath) {
        msbuild({
            _exe: xbuildPath || 'xbuild',
            file: 'Source/Facebook-Net40.sln',
            targets: ['Build'],
            properties: { TargetFrameworkProfile: '' }
        })
    }, { async: true })

})

task('build', ['build:all'])

namespace('clean', function () {

    task('net45', function () {
        msbuild({
            file: 'Source/Facebook-Net40.sln',
            targets: ['Clean']
        })
    }, { async: true })

    task('net40', function () {
        msbuild({
            file: 'Source/Facebook-Net40.sln',
            targets: ['Clean']
        })
    }, { async: true })

    task('net35', function () {
        msbuild({
            file: 'Source/Facebook-Net35.sln',
            targets: ['Clean']
        })
    }, { async: true })

    task('winstore', function () {
        msbuild({
            file: 'Source/Facebook-WindowsStore.sln',
            targets: ['Clean']
        })
    }, { async: true })

    task('wp71', function () {
        msbuild({
            file: 'Source/Facebook-WP7.sln',
            targets: ['Clean']
        })
    }, { async: true })

    task('sl5', function () {
        msbuild({
            file: 'Source/Facebook-SL5.sln',
            targets: ['Clean']
        })
    }, { async: true })

    task('all', ['clean:net45', 'clean:net40', 'clean:net35', 'clean:wp71', 'clean:sl5', 'clean:winstore'])

})

desc('Clean all')
task('clean', ['clean:all'], function () {
    jake.rmRf('Working/')
    jake.rmRf('Dist/')
})

namespace('tests', function () {

    task('net45', ['build:net45'], function () {
        xunit({
            assembly: 'Bin/Tests/Release/Facebook.Tests.dll'
        })
    }, { async: true })

    task('all', ['tests:net45'])

})

desc('Run tests')
task('test', ['tests:all'])

directory('Dist/NuGet', ['Dist/'])
directory('Dist/SymbolSource', ['Dist/'])

namespace('nuget', function () {

    namespace('pack', function () {

        task('nuget', ['Dist/NuGet', 'build'], function () {
            nuget.pack({
                nuspec: 'Build/NuGet/Facebook/Facebook.nuspec',
{'fraction_non_alphanumeric': 0.1901002773629187, 'fraction_numerical': 0.018561979944527417, 'mean_word_length': 2.342245989304813, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 34, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '166752', 'n_tokens_mistral': 3145, 'n_tokens_neox': 2926, 'n_words': 557}