forked from Faithlife/System.Data.SQLite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
47 lines (39 loc) · 2.2 KB
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
properties {
$configuration = "Release"
$gitPath = "C:\Program Files (x86)\Git\bin\git.exe"
$outputDir = "build"
$apiKey = $null
$nugetPackageSource = $null
}
$version = $null
Task Default -depends NuGetPack, NuGetPublish
Task Clean {
Get-ChildItem "src\*\bin" | Remove-Item -force -recurse -ErrorAction Stop
Get-ChildItem "src\*\obj" | Remove-Item -force -recurse -ErrorAction Stop
if (Test-Path $outputDir) {
Remove-Item $outputDir -force -recurse -ErrorAction Stop
}
}
Task Build -depends Clean {
Exec { tools\NuGet\NuGet restore }
Exec { msbuild /m:4 /p:Configuration=$configuration /p:Platform="Any CPU" /p:VisualStudioVersion=12.0 System.Data.SQLite.sln }
Exec { msbuild /m:4 /p:Configuration=$configuration /p:Platform="Xamarin iOS" /p:VisualStudioVersion=12.0 System.Data.SQLite.sln }
}
Task Tests -depends Build {
mkdir $outputDir -force
Exec { tools\NUnit\nunit-console.exe /nologo /framework=4.0 /xml=$outputDir\System.Data.SQLite.xml /config=$configuration tests\System.Data.SQLite.nunit }
}
Task SourceIndex -depends Tests {
$headSha = & $gitPath rev-parse HEAD
foreach ($project in @("System.Data.SQLite-Mac", "System.Data.SQLite-MonoAndroid", "System.Data.SQLite-MonoTouch", "System.Data.SQLite-Net45", "System.Data.SQLite-Portable")) {
Exec { tools\SourceIndex\github-sourceindexer.ps1 -symbolsFolder src\$project\bin\$configuration -userId Faithlife -repository System.Data.SQLite -branch $headSha -sourcesRoot ${pwd} -dbgToolsPath "C:\Program Files (x86)\Windows Kits\8.1\Debuggers\x86" -gitHubUrl "https://raw.github.com" -serverIsRaw -ignoreUnknown -verbose }
}
}
Task NuGetPack -depends SourceIndex {
mkdir $outputDir -force
$script:version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("src\System.Data.SQLite-Net45\bin\$configuration\System.Data.SQLite.dll").FileVersion
Exec { tools\NuGet\NuGet pack System.Data.SQLite.nuspec -Version $script:version -Prop Configuration=$configuration -Symbols -OutputDirectory $outputDir }
}
Task NuGetPublish -depends NuGetPack -precondition { return $apiKey -and $nugetPackageSource } {
Exec { tools\NuGet\NuGet push $outputDir\Logos.System.Data.SQLite.$script:version.nupkg -ApiKey $apiKey -Source $nugetPackageSource }
}