<commit_before>Import-Module "$PSScriptRoot\modules\msbuild\Invoke-MsBuild.psm1"

properties {
	$solutionName = "Enexure.MicroBus"
	$configuration = "Release"

	$solutionDir = Resolve-Path "$PSScriptRoot\.."
	$solutionFile = "$solutionDir\$solutionName.sln"
	$nuget = "$PSScriptRoot\nuget.exe"
	$nunit = "$PSScriptRoot\nunit\nunit-console.exe"
}

task default -depends Package

task Package -depends Test { 

	$projects = ls "$solutionDir\src" | ? { -not ($_.Name -like "*Tests") }

	foreach($project in $projects) {

		dnu pack $project.FullName --configuration $configuration
	}
}

task Test -depends Compile { 

	$projects = ls "$solutionDir\src" | ? { $_.Name -like "*Tests" }

	foreach($project in $projects) {

		ls "$($project.FullName)\bin\$configuration\net45" | ? { $_.Name -like "*Tests.dll" } | % { & $nunit $_.FullName }
	}
}

task Compile { 

	$projects = ls "$solutionDir\src"

	foreach($project in $projects) {<commit_msg>Get dnx using dnvm<commit_after>Import-Module "$PSScriptRoot\modules\msbuild\Invoke-MsBuild.psm1"

properties {
	$solutionName = "Enexure.MicroBus"
	$configuration = "Release"

	$solutionDir = Resolve-Path "$PSScriptRoot\.."
	$solutionFile = "$solutionDir\$solutionName.sln"
	$nuget = "$PSScriptRoot\nuget.exe"
	$nunit = "$PSScriptRoot\nunit\nunit-console.exe"
}

task default -depends Package

task Package -depends Test { 

	$projects = ls "$solutionDir\src" | ? { -not ($_.Name -like "*Tests") }

	foreach($project in $projects) {

		dnu pack $project.FullName --configuration $configuration
	}
}

task Test -depends Compile { 

	$projects = ls "$solutionDir\src" | ? { $_.Name -like "*Tests" }

	foreach($project in $projects) {

		ls "$($project.FullName)\bin\$configuration\net45" | ? { $_.Name -like "*Tests.dll" } | % { & $nunit $_.FullName }
	}
}

task Compile { 

	nuget sources add -Name "api.nuget.org" -Source "https://api.nuget.org/v3/index.json"
	iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))
	dnvm update-self
	dnvm upgrade
	dnvm install 1.0.0-rc1-final
	dnvm list
	dnvm use 1.0.0-rc1-final

	$projects = ls "$solutionDir\src"

	foreach($project in $projects) {
{'fraction_non_alphanumeric': 0.16468435498627632, 'fraction_numerical': 0.007319304666056725, 'mean_word_length': 4.133802816901408, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2525133', 'n_tokens_mistral': 846, 'n_tokens_neox': 768, 'n_words': 159}