Skip to content

Commit

Permalink
Merge pull request DbUp#93 from dazinator/SQLite-mono
Browse files Browse the repository at this point in the history
Sq lite mono
  • Loading branch information
JakeGinnivan committed May 5, 2015
2 parents 70d9092 + 5a7efa4 commit 928818c
Show file tree
Hide file tree
Showing 66 changed files with 1,192 additions and 9 deletions.
10 changes: 10 additions & 0 deletions build/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
<MakeDir Directories="$(MSBuildProjectDirectory)\Published\DbUp-SQLite" Condition="!Exists('$(MSBuildProjectDirectory)\DbUp-SQLite\Published')" />
<MakeDir Directories="$(MSBuildProjectDirectory)\Published\DbUp-SQLite\lib" Condition="!Exists('$(MSBuildProjectDirectory)\DbUp-SQLite\Published\lib')" />
<MakeDir Directories="$(MSBuildProjectDirectory)\Published\DbUp-SQLite\lib\NET35" Condition="!Exists('$(MSBuildProjectDirectory)\DbUp-SQLite\Published\lib\NET35')" />
<MakeDir Directories="$(MSBuildProjectDirectory)\Published\DbUp-SQLite-Mono" Condition="!Exists('$(MSBuildProjectDirectory)\DbUp-SQLite-Mono\Published')" />
<MakeDir Directories="$(MSBuildProjectDirectory)\Published\DbUp-SQLite-Mono\lib" Condition="!Exists('$(MSBuildProjectDirectory)\DbUp-SQLite-Mono\Published\lib')" />
<MakeDir Directories="$(MSBuildProjectDirectory)\Published\DbUp-SQLite-Mono\lib\NET35" Condition="!Exists('$(MSBuildProjectDirectory)\DbUp-SQLite-Mono\Published\lib\NET35')" />
<MakeDir Directories="$(MSBuildProjectDirectory)\Published\DbUp-Postgresql\lib" Condition="!Exists('$(MSBuildProjectDirectory)\DbUp-Postgresql\Published\lib')" />
<MakeDir Directories="$(MSBuildProjectDirectory)\Published\DbUp-Postgresql\lib\NET35" Condition="!Exists('$(MSBuildProjectDirectory)\DbUp-Postgresql\Published\lib\NET35')" />
<MakeDir Directories="$(MSBuildProjectDirectory)\Published\DbUp-Firebird\lib" Condition="!Exists('$(MSBuildProjectDirectory)\DbUp-Firebird\Published\lib')" />
Expand Down Expand Up @@ -88,12 +91,15 @@
<Net35FirebirdFiles Include="$(Root)\src\DbUp.Firebird\bin\Release\DbUp.Firebird.xml" />
<Net35MySqlFiles Include="$(Root)\src\DbUp.MySql\bin\Release\DbUp.MySql.xml" />
<Net35MySqlFiles Include="$(Root)\src\DbUp.MySql\bin\Release\DbUp.MySql.dll" />
<Net35SqlLiteMonoFiles Include="$(Root)\src\DbUp.SQLite.Mono\bin\Release\DbUp.SQLite.Mono.dll" />
<Net35SqlLiteMonoFiles Include="$(Root)\src\DbUp.SQLite.Mono\bin\Release\DbUp.SQLite.Mono.xml" />
</ItemGroup>
<Copy SourceFiles="@(Net35Files)" DestinationFolder="$(Root)\build\Published\DbUp\lib\NET35" />
<Copy SourceFiles="@(Net35SqlCeFiles)" DestinationFolder="$(Root)\build\Published\DbUp-SqlCe\lib\NET35" />
<Copy SourceFiles="@(Net35PostgresqlFiles)" DestinationFolder="$(Root)\build\Published\DbUp-Postgresql\lib\NET35" />
<Copy SourceFiles="@(Net35FirebirdFiles)" DestinationFolder="$(Root)\build\Published\DbUp-Firebird\lib\NET35" />
<Copy SourceFiles="@(Net35MySqlFiles)" DestinationFolder="$(Root)\build\Published\DbUp-MySql\lib\NET35" />
<Copy SourceFiles="@(Net35SqlLiteMonoFiles)" DestinationFolder="$(Root)\build\Published\DbUp-SQLite-Mono\lib\NET35" />

<!-- Zip binaries -->
<ItemGroup>
Expand All @@ -110,20 +116,23 @@
<NuSpecFiles Include="$(Root)\build\dbup.nuspec" />
<SqlCeNuSpecFiles Include="$(Root)\build\dbup.sqlce.nuspec" />
<SQLiteNuSpecFiles Include="$(Root)\build\dbup.sqlite.nuspec" />
<SQLiteMonoNuSpecFiles Include="$(Root)\build\dbup.sqlite.mono.nuspec" />
<PostgresqlNuSpecFiles Include="$(Root)\build\dbup.postgresql.nuspec" />
<FirebirdNuSpecFiles Include="$(Root)\build\dbup.firebird.nuspec" />
<MySqlNuSpecFiles Include="$(Root)\build\dbup.mysql.nuspec" />
</ItemGroup>
<Copy SourceFiles="@(NuSpecFiles)" DestinationFolder="$(Root)\build\Published\DbUp" />
<Copy SourceFiles="@(SqlCeNuSpecFiles)" DestinationFolder="$(Root)\build\Published\DbUp-SqlCe" />
<Copy SourceFiles="@(SQLiteNuSpecFiles)" DestinationFolder="$(Root)\build\Published\DbUp-SQLite" />
<Copy SourceFiles="@(SQLiteMonoNuSpecFiles)" DestinationFolder="$(Root)\build\Published\DbUp-SQLite-Mono" />
<Copy SourceFiles="@(PostgresqlNuSpecFiles)" DestinationFolder="$(Root)\build\Published\DbUp-Postgresql" />
<Copy SourceFiles="@(FirebirdNuSpecFiles)" DestinationFolder="$(Root)\build\Published\DbUp-Firebird" />
<Copy SourceFiles="@(MySqlNuSpecFiles)" DestinationFolder="$(Root)\build\Published\DbUp-MySql" />

<FileUpdate Files="$(Root)\build\Published\DbUp\dbup.nuspec" Regex="0.0.0" ReplacementText="$(NuGetVersionNumber)" />
<FileUpdate Files="$(Root)\build\Published\DbUp-SqlCe\dbup.sqlce.nuspec" Regex="0.0.0" ReplacementText="$(NuGetVersionNumber)" />
<FileUpdate Files="$(Root)\build\Published\DbUp-SQLite\dbup.sqlite.nuspec" Regex="0.0.0" ReplacementText="$(NuGetVersionNumber)" />
<FileUpdate Files="$(Root)\build\Published\DbUp-SQLite-Mono\dbup.sqlite.mono.nuspec" Regex="0.0.0" ReplacementText="$(NuGetVersionNumber)" />
<FileUpdate Files="$(Root)\build\Published\DbUp-Postgresql\dbup.postgresql.nuspec" Regex="0.0.0" ReplacementText="$(NuGetVersionNumber)" />
<FileUpdate Files="$(Root)\build\Published\DbUp-Firebird\dbup.firebird.nuspec" Regex="0.0.0" ReplacementText="$(NuGetVersionNumber)" />
<FileUpdate Files="$(Root)\build\Published\DbUp-MySql\dbup.mysql.nuspec" Regex="0.0.0" ReplacementText="$(NuGetVersionNumber)" />
Expand All @@ -132,6 +141,7 @@
<Exec Command="$(Root)\lib\nuget\nuget.exe pack $(Root)\build\Published\DbUp\dbup.nuspec -BasePath $(Root)\build\Published\DbUp -o $(Root)\build\Artifacts" />
<Exec Command="$(Root)\lib\nuget\nuget.exe pack $(Root)\build\Published\DbUp-SqlCe\dbup.sqlce.nuspec -BasePath $(Root)\build\Published\DbUp-SqlCe -o $(Root)\build\Artifacts" />
<Exec Command="$(Root)\lib\nuget\nuget.exe pack $(Root)\build\Published\DbUp-SQLite\dbup.sqlite.nuspec -BasePath $(Root)\build\Published\DbUp-SQLite -o $(Root)\build\Artifacts" />
<Exec Command="$(Root)\lib\nuget\nuget.exe pack $(Root)\build\Published\DbUp-SQLite-Mono\dbup.sqlite.mono.nuspec -BasePath $(Root)\build\Published\DbUp-SQLite-Mono -o $(Root)\build\Artifacts" />
<Exec Command="$(Root)\lib\nuget\nuget.exe pack $(Root)\build\Published\DbUp-Postgresql\dbup.postgresql.nuspec -BasePath $(Root)\build\Published\DbUp-Postgresql -o $(Root)\build\Artifacts" />
<Exec Command="$(Root)\lib\nuget\nuget.exe pack $(Root)\build\Published\DbUp-Firebird\dbup.firebird.nuspec -BasePath $(Root)\build\Published\DbUp-Firebird -o $(Root)\build\Artifacts" />
<Exec Command="$(Root)\lib\nuget\nuget.exe pack $(Root)\build\Published\DbUp-MySql\dbup.mysql.nuspec -BasePath $(Root)\build\Published\DbUp-MySql -o $(Root)\build\Artifacts" />
Expand Down
18 changes: 18 additions & 0 deletions build/dbup.sqlite.mono.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<package>
<metadata>
<id>dbup-sqlite-mono</id>
<title>DbUp SQLite Support targeting Mono</title>
<version>0.0.0</version>
<authors>Paul Stovell, Jim Burger, Jake Ginnivan, Damian Maclennan</authors>
<description>DbUp makes it easy to deploy and upgrade SQL Server databases. This package adds SQLite support targeting mono.</description>
<language>en-US</language>
<licenseUrl>http://www.opensource.org/licenses/mit-license.php</licenseUrl>
<projectUrl>http://dbup.github.com</projectUrl>
<iconUrl>https://raw.github.com/DbUp/DbUp/master/src/Information/dbup-icon.png</iconUrl>
<dependencies>
<dependency id="Mono.Data.Sqlite.Portable" version="1.0.3.5" />
<dependency id="DbUp" version="0.0.0" />
</dependencies>
</metadata>
</package>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- Windows Phone 8 properties -->
<PropertyGroup>
<MonoDataSqlitePortableHardware>netcore</MonoDataSqlitePortableHardware>
</PropertyGroup>

<!-- pre-build error checks -->
<Target Name="ValidateMonoDataSqlitePreRequisites" BeforeTargets="BeforeBuild">
<Error Condition=" '$(Platform)' != 'ARM' and '$(Platform)' != 'x86' "
Text="Mono.Data.Sqlite.Portable for Windows Store can only be used in builds that target x86 or ARM." />
</Target>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- Windows Phone 8 properties -->
<PropertyGroup>
<MonoDataSqlitePortableHardware>wp8</MonoDataSqlitePortableHardware>
</PropertyGroup>

<!-- pre-build error checks -->
<Target Name="ValidateMonoDataSqlitePreRequisites" BeforeTargets="BeforeBuild">
<Error Condition=" '$(Platform)' != 'ARM' and '$(Platform)' != 'x86' "
Text="Mono.Data.Sqlite.Portable for Windows Phone 8 can only be used in builds that target x86 or ARM." />
</Target>

</Project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<MonoDataSqlitePortableImported>true</MonoDataSqlitePortableImported>
</PropertyGroup>

<!--
Currently, if 'MonoDataSqlitePortableHardware' == '', then skip the hardware specific assemblies.
This may be required at a later stage for other types of devices or platforms.
-->

<!-- reference paths -->
<PropertyGroup Condition="'$(MonoDataSqlitePortableHardware)' != ''">
<MonoDataSqlitePortablePath Condition="'$(Platform)' == 'x86'">$(MonoDataSqlitePortableHardware)-x86</MonoDataSqlitePortablePath>
<MonoDataSqlitePortablePath Condition="'$(Platform)' == 'ARM'">$(MonoDataSqlitePortableHardware)-arm</MonoDataSqlitePortablePath>
</PropertyGroup>

<!-- references -->
<ItemGroup Condition="'$(MonoDataSqlitePortablePath)' != ''">
<Reference Include="Mono.Data.Sqlite">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(MSBuildThisFileDirectory)lib\$(MonoDataSqlitePortablePath)\Mono.Data.Sqlite.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
38 changes: 38 additions & 0 deletions lib/Mono.Data.Sqlite.Portable.1.0.3.5/tools/install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
param($installPath, $toolsPath, $package, $project)

# This is the MSBuild targets file to add
$targetsFile = [System.IO.Path]::Combine($toolsPath, $package.Id + '.targets')

# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

# Grab the loaded MSBuild project for the project
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1

# Make the path to the targets file relative.
$projectUri = new-object Uri($project.FullName, [System.UriKind]::Absolute)
$targetUri = new-object Uri($targetsFile, [System.UriKind]::Absolute)
$relativePath = [System.Uri]::UnescapeDataString($projectUri.MakeRelativeUri($targetUri).ToString()).Replace([System.IO.Path]::AltDirectorySeparatorChar, [System.IO.Path]::DirectorySeparatorChar)

# Add the import with a condition, to allow the project to load without the targets present.
$import = $msbuild.Xml.AddImport($relativePath)
$import.Condition = "Exists('$relativePath')"

# Add a target to fail the build when our targets are not imported
$target = $msbuild.Xml.AddTarget("EnsureMonoDataSqlitePortableImported")
$target.BeforeTargets = "BeforeBuild"
$target.Condition = "'`$(MonoDataSqlitePortableImported)' == ''"

# if the targets don't exist at the time the target runs, package restore didn't run
$errorTask = $target.AddTask("Error")
$errorTask.Condition = "!Exists('$relativePath')"
$errorTask.SetParameter("Text", "This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.");

# if the targets exist at the time the target runs, package restore ran but the build didn't import the targets.
$errorTask = $target.AddTask("Error")
$errorTask.Condition = "Exists('$relativePath')"
$errorTask.SetParameter("Text", "The build restored NuGet packages. Build the project again to include these packages in the build.");

$project.Save()

Write-Host "Successfully updated the project file."
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
13 changes: 13 additions & 0 deletions lib/Mono.Data.Sqlite.Portable.1.0.3.5/tools/netcore45/install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
param($installPath, $toolsPath, $package, $project)

# Add the SQLite SDK reference
$sqliteReference = $project.Object.References.AddSDK("SQLite for Windows Runtime", "SQLite.WinRT, version=3.8.7.4")
Write-Host "Successfully added a reference to the extension SDK SQLite for Windows Runtime."
Write-Host "Please, verify that the extension SDK SQLite for Windows Runtime v3.8.7.4, from the SQLite.org site (http://www.sqlite.org/2014/sqlite-winrt-3080704.vsix), has been properly installed."

# This is the global install file
$rootInstall = [System.IO.Path]::Combine($toolsPath, '../install.ps1')
$rootToolsPath = [System.IO.Path]::Combine($toolsPath, '../')
Write-Host $rootInstall
. $rootInstall -installPath $installPath -toolsPath $rootToolsPath -package $package -project $project

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
param($installPath, $toolsPath, $package, $project)

$sqliteReference = $project.Object.References.Find("SQLite.WinRT, version=3.8.7.4")

if ($sqliteReference -eq $null) {
Write-Host "Unable to find a reference to the extension SDK SQLite for Windows Runtime."
Write-Host "Verify that the reference to the extension SDK SQLite for Windows Runtime has already been removed."
} else {
$sqliteReference.Remove()
Write-Host "Successfully removed the reference to the extension SDK SQLite for Windows Runtime."
}

# This is the global uninstall file
$rootInstall = [System.IO.Path]::Combine($toolsPath, '../uninstall.ps1')
$rootToolsPath = [System.IO.Path]::Combine($toolsPath, '../')
Write-Host $rootInstall
. $rootInstall -installPath $installPath -toolsPath $rootToolsPath -package $package -project $project
13 changes: 13 additions & 0 deletions lib/Mono.Data.Sqlite.Portable.1.0.3.5/tools/netcore451/install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
param($installPath, $toolsPath, $package, $project)

# Add the SQLite SDK reference
$sqliteReference = $project.Object.References.AddSDK("SQLite for Windows Runtime (Windows 8.1)", "SQLite.WinRT81, version=3.8.7.4")
Write-Host "Successfully added a reference to the extension SDK SQLite for Windows Runtime (Windows 8.1)."
Write-Host "Please, verify that the extension SDK SQLite for Windows Runtime (Windows 8.1) v3.8.7.4, from the SQLite.org site (http://www.sqlite.org/2014/sqlite-winrt81-3080704.vsix), has been properly installed."

# This is the global install file
$rootInstall = [System.IO.Path]::Combine($toolsPath, '../install.ps1')
$rootToolsPath = [System.IO.Path]::Combine($toolsPath, '../')
Write-Host $rootInstall
. $rootInstall -installPath $installPath -toolsPath $rootToolsPath -package $package -project $project

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
param($installPath, $toolsPath, $package, $project)

$sqliteReference = $project.Object.References.Find("SQLite.WinRT81, version=3.8.7.4")

if ($sqliteReference -eq $null) {
Write-Host "Unable to find a reference to the extension SDK SQLite for Windows Runtime (Windows 8.1)."
Write-Host "Verify that the reference to the extension SDK SQLite for Windows Runtime (Windows 8.1) has already been removed."
} else {
$sqliteReference.Remove()
Write-Host "Successfully removed the reference to the extension SDK SQLite for Windows Runtime (Windows 8.1)."
}

# This is the global uninstall file
$rootInstall = [System.IO.Path]::Combine($toolsPath, '../uninstall.ps1')
$rootToolsPath = [System.IO.Path]::Combine($toolsPath, '../')
Write-Host $rootInstall
. $rootInstall -installPath $installPath -toolsPath $rootToolsPath -package $package -project $project
25 changes: 25 additions & 0 deletions lib/Mono.Data.Sqlite.Portable.1.0.3.5/tools/uninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
param($installPath, $toolsPath, $package, $project)

# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

# Grab the loaded MSBuild project for the project
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1

# Find all the imports and targets added by this package.
$itemsToRemove = @()

# Allow many in case a past package was incorrectly uninstalled
$itemsToRemove += $msbuild.Xml.Imports | Where-Object { $_.Project.EndsWith($package.Id + '.targets') }
$itemsToRemove += $msbuild.Xml.Targets | Where-Object { $_.Name -eq "EnsureMonoDataSqlitePortableImported" }

# Remove the elements and save the project
if ($itemsToRemove -and $itemsToRemove.length)
{
foreach ($itemToRemove in $itemsToRemove)
{
$msbuild.Xml.RemoveChild($itemToRemove) | out-null
}
$project.Save()
}

13 changes: 13 additions & 0 deletions lib/Mono.Data.Sqlite.Portable.1.0.3.5/tools/wp8/install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
param($installPath, $toolsPath, $package, $project)

# Add the SQLite SDK reference
$sqliteReference = $project.Object.References.AddSDK("SQLite for Windows Phone", "SQLite.WP80, version=3.8.7.4")
Write-Host "Successfully added a reference to the extension SDK SQLite for Windows Phone."
Write-Host "Please, verify that the extension SDK SQLite for Windows Phone v3.8.7.4, from the SQLite.org site (http://www.sqlite.org/2014/sqlite-wp80-winrt-3080707.vsix), has been properly installed."

# This is the global install file
$rootInstall = [System.IO.Path]::Combine($toolsPath, '../install.ps1')
$rootToolsPath = [System.IO.Path]::Combine($toolsPath, '../')
Write-Host $rootInstall
. $rootInstall -installPath $installPath -toolsPath $rootToolsPath -package $package -project $project

17 changes: 17 additions & 0 deletions lib/Mono.Data.Sqlite.Portable.1.0.3.5/tools/wp8/uninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
param($installPath, $toolsPath, $package, $project)

$sqliteReference = $project.Object.References.Find("SQLite.WP80, version=3.8.7.4")

if ($sqliteReference -eq $null) {
Write-Host "Unable to find a reference to the extension SDK SQLite for Windows Phone."
Write-Host "Verify that the reference to the extension SDK SQLite for Windows Phone has already been removed."
} else {
$sqliteReference.Remove()
Write-Host "Successfully removed the reference to the extension SDK SQLite for Windows Phone."
}

# This is the global uninstall file
$rootInstall = [System.IO.Path]::Combine($toolsPath, '../uninstall.ps1')
$rootToolsPath = [System.IO.Path]::Combine($toolsPath, '../')
Write-Host $rootInstall
. $rootInstall -installPath $installPath -toolsPath $rootToolsPath -package $package -project $project
Loading

0 comments on commit 928818c

Please sign in to comment.