<commit_before>include ".\wget.ps1"



Properties {

    $BuildDirectory = Split-Path $psake.build_script_file

    $BinDir = "$BuildDirectory\..\Bin"

    $CodeDir = "$BuildDirectory\..\Src"

    $ToolsDirectory = "$BuildDirectory\..\Tools"

    $MysqlDirectory = "$ToolsDirectory\Mysql"

    $Mysql40Directory = "$MysqlDirectory\4.0"

    $Mysql40DirectoryName = (resolve-path $Mysql40Directory).Path

    $Mysql40Executable = "`"$Mysql40DirectoryName\bin\mysqld-nt.exe`""

    $Mysql40Shell = "$Mysql40DirectoryName\bin\mysql.exe"

    $Mysql55Directory = "$MysqlDirectory\5.5"

    $Mysql55DirectoryName = (resolve-path $Mysql55Directory).Path

    $Mysql55Executable = "`"$Mysql55DirectoryName\bin\mysqld.exe`""

    $Mysql55Shell = "$Mysql55DirectoryName\bin\mysql.exe"

    $DbinitializationScript = "$BuildDirectory\InitializeDatabase.sql"

    $TestRunnerExecutable = "C:\Users\Vidar\Documents\Visual Studio 2010\Projects\Simple.Data.Mysql\Src\packages\NUnit.2.5.9.10348\Tools\nunit-console.exe"

}



FormatTaskName (("-"*25) + "[{0}]" + ("-"*25))



function UnzipFiles($zipfile, $targetDir) {

    $shell = new-object -com shell.application

    $zipFileObject = $shell.namespace($zipfile)

    $targetDirObject = $shell.namespace($targetDir)

    $targetDirObject.CopyHere($zipFileObject.items())

}



function StartMysql40() {

    Write-Host "Starting MySql 4.0"

    Start-Process -FilePath $Mysql40Executable "--no-defaults --basedir=`"$Mysql40DirectoryName`" --standalone"

    Write-Host "MySql 4.0 started"

}



function StopMysql40() {

    Write-Host "Stopping MySql 4.0"

    start-sleep -s 3

    Stop-Process -Name "mysqld-nt"

    Write-Host "MySql 4.0 stopped"

}



function StartMysql55() {

    Write-Host "Starting MySql 5.5"

    Start-Process -FilePath $Mysql55Executable "--no-defaults --basedir=`"$Mysql55DirectoryName`" --standalone"    

    Write-Host "MySql 5.5 started"

}



function StopMysql55() {

    Write-Host "Stopping MySql 5.5"

    start-sleep -s 3

    Stop-Process -Name "mysqld"

    Write-Host "MySql 5.5 stopped"

}



Task Default -depends Test



Task InitializeTestDatabases -depends Initialize_mysql_40_database, Stop_mysql_40, Initialize_mysql_55_database, Stop_mysql55 



Task Initialize_mysql_40_database -depends Start_mysql_40 {

    &$Mysql40Shell  -u root -e "`"source $DbinitializationScript`""

}



Task Initialize_mysql_55_database -depends Start_mysql_55 {

    &$Mysql55Shell  -u root -e "`"source $DbinitializationScript`""

}<commit_msg>Fixed bug in psake script<commit_after>include ".\wget.ps1"



Properties {

    $BuildDirectory = Split-Path $psake.build_script_file

    $BinDir = "$BuildDirectory\..\Bin"

    $CodeDir = "$BuildDirectory\..\Src"

    $ToolsDirectory = "$BuildDirectory\..\Tools"

    $MysqlDirectory = "$ToolsDirectory\Mysql"

    $Mysql40Directory = "$MysqlDirectory\4.0"

    $Mysql55Directory = "$MysqlDirectory\5.5"  

    $DbinitializationScript = "$BuildDirectory\InitializeDatabase.sql"

    $TestRunnerExecutable = "C:\Users\Vidar\Documents\Visual Studio 2010\Projects\Simple.Data.Mysql\Src\packages\NUnit.2.5.9.10348\Tools\nunit-console.exe"

}



FormatTaskName (("-"*25) + "[{0}]" + ("-"*25))



function UnzipFiles($zipfile, $targetDir) {

    $shell = new-object -com shell.application

    $zipFileObject = $shell.namespace($zipfile)

    $targetDirObject = $shell.namespace($targetDir)

    $targetDirObject.CopyHere($zipFileObject.items())

}



function StartMysql40() {

    Write-Host "Starting MySql 4.0"

    $path = GetExecutablePath $Mysql40Directory "mysqld-nt.exe"

    $basedir = GetFullPathAsString $Mysql40Directory

    Start-Process -FilePath $path "--no-defaults --basedir=`"$basedir`" --standalone"

    Write-Host "MySql 4.0 started"

}



function StopMysql40() {

    Write-Host "Stopping MySql 4.0"

    start-sleep -s 3

    Stop-Process -Name "mysqld-nt"

    Write-Host "MySql 4.0 stopped"

}



function StartMysql55() {

    Write-Host "Starting MySql 5.5"

    $path = GetExecutablePath $Mysql55Directory "mysqld.exe"

    $basedir = GetFullPathAsString $Mysql55Directory

    Start-Process -FilePath $path  "--no-defaults --basedir=`"$basedir`" --standalone"    

    Write-Host "MySql 5.5 started"

}



function StopMysql55() {

    Write-Host "Stopping MySql 5.5"

    start-sleep -s 3

    Stop-Process -Name "mysqld"

    Write-Host "MySql 5.5 stopped"

}



function GetFullPathAsString($path) {

    (resolve-path $path).Path

}



function GetShellExecutablePath($serverPath) {

    $directoryPathAsString = GetFullPathAsString $serverPath

    "$directoryPathAsString\bin\mysql.exe"

}



function GetExecutablePath($serverDirecory, $executableName) {

    $directoryPathAsString = GetFullPathAsString $serverDirecory

    "$directoryPathAsString\bin\$executableName"

}



Task Default -depends Test



Task InitializeTestDatabases -depends Initialize_mysql_40_database, Stop_mysql_40, Initialize_mysql_55_database, Stop_mysql55 



Task Initialize_mysql_40_database -depends Start_mysql_40 {

    & (GetShellExecutablePath $Mysql40Directory)   -u root -e "`"source $DbinitializationScript`""

}



Task Initialize_mysql_55_database -depends Start_mysql_55 {

    & (GetShellExecutablePath $Mysql55Directory)  -u root -e "`"source $DbinitializationScript`""

}
{'fraction_non_alphanumeric': 0.5609502176793488, 'fraction_numerical': 0.017414347908385388, 'mean_word_length': 8.51981981981982, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6296742', 'n_tokens_mistral': 10522, 'n_tokens_neox': 10521, 'n_words': 321}