System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation

Artifact c89ff7f30c11ce7cea25b3ff75e8a0227e7c96cf:


Build Procedures

Build Procedures

Follow these steps to build a new release of System.Data.SQLite (SDS). Unless otherwise noted, all steps need to be done in the order specified.

You will need a Visual Studio 2008, 2010, or 2010 SP1 development environment for this build.

Thanks to the hard work of Joe Mistachkin, the build environment has been setup using modular solution and property files.

In general, files with 2008 in the name (eg. SQLite.Interop.2008.vcproj) or files ending in .vsprops are project and property files for the VS2008 solution. Files with 2010 in the name (eg. SQLite.Interop.2010.vcxproj) or files ending in .props are property and project files for the VS2010 solution. When making changes, you should make changes to both to keep them in sync.

You can either manually build the SDS using the supplied Visual Studio solutions, or follow the steps outlined in the Automated Build section below.

Build Assumptions

  1. We want to ship managed binaries that rely on the .NET Framework 2.0 SP2. The .NET Framework 2.0 is very widely deployed and binaries produced for it can also be referenced and used successfully from projects using the .NET Framework 4.0.
  2. We want to ship native binaries that rely on the Visual C++ 2008 SP1 Runtime.
  3. We do not want to ship the "monster DLL" (i.e. the "mixed-mode" System.Data.SQLite.dll that includes native and managed code). This will make it far simpler to maintain and ship the included core SQLite code (in the file "SQLite.Interop.dll").
  4. The machine used to prepare the official releases will have the .NET Framework 3.5 SP1 and the corresponding SDK installed.
  5. The machine used to prepare the official releases will have Inno Setup 5.4.2 or higher installed in "%ProgramFiles%\Inno Setup 5" or "%ProgramFiles(x86)%\Inno Setup 5" for an 64-bit machines. Alternatively, the InnoSetup directory may be included in the PATH environment variable.
  6. The string "<root>" represents the root of your source tree for System.Data.SQLite.

Manual Build

  1. Make sure the version information is correct for SQLite in the following files:
      <root>\SQLite.Interop\props\sqlite3.vsprops
      <root>\SQLite.Interop\props\sqlite3.props
    You'll need to update the SQLITE_MANIFEST_VERSION and SQLITE_RC_VERSION properties. This version number should track the release versions of SQLite (ie. 3.7.x).
  2. Make sure the version information is correct for System.Data.SQLite in the following files:
      <root>\SQLite.Interop\props\SQLite.Interop.vsprops
      <root>\SQLite.Interop\props\SQLite.Interop.props
      <root>\SQLite.Interop\src\win\interop.h
      <root>\System.Data.SQLite\AssemblyInfo.cs
      <root>\System.Data.SQLite.Linq\AssemblyInfo.cs
    You'll need to update the SQLITE_MANIFEST_VERSION and SQLITE_RC_VERSION properties in the .vsprops and .props files, and the INTEROP_VERSION define in interop.h. This version number should track the release versions of the System.Data.SQLite packages (ie. 1.0.x).
  3. Open the appropriate solution for your build platform.
      SQLite.NET.2008.sln is the top level solution for VS2008.
      SQLite.NET.2010.sln is the top level solution for VS2010.
  4. Select the desired solution configuration (eg. ReleaseNativeOnly) and and solution platform (eg. x64), then "Build->Rebuild Solution".
    Alternatively, you can select "Build->Batch Build", "Select All", and then "Rebuild".

Automated Build

  1. Make sure the version information is correct for SQLite in the following files:
      <root>\SQLite.Interop\props\sqlite3.vsprops
      <root>\SQLite.Interop\props\sqlite3.props
    You'll need to update the SQLITE_MANIFEST_VERSION and SQLITE_RC_VERSION properties. This version number should track the release versions of SQLite (ie. 3.7.x).
  2. Make sure the version information is correct for System.Data.SQLite in the following files:
      <root>\SQLite.Interop\props\SQLite.Interop.vsprops
      <root>\SQLite.Interop\props\SQLite.Interop.props
      <root>\SQLite.Interop\src\win\interop.h
      <root>\System.Data.SQLite\AssemblyInfo.cs
      <root>\System.Data.SQLite.Linq\AssemblyInfo.cs
      <root>\Setup\set_common.bat
    You'll need to update the SQLITE_MANIFEST_VERSION and SQLITE_RC_VERSION properties in the .vsprops and .props files, the INTEROP_VERSION define in interop.h, and the VERSION environment variable in set_common.bat. This version number should track the release versions of the System.Data.SQLite packages (ie. 1.0.x).
  3. Make sure the "<root>\bin" and "<root>\obj" directories are completely free of all output files. In theory, you should be able to simply delete these directories.
  4. Open a normal command prompt window with "cmd.exe".
    If you are using Visual Studio 2010, you may need to open a "Windows SDK Command Prompt" from the "Microsoft Windows SDK" start menu and perform your builds there.
  5. Change the current directory to "<root>\Setup".
  6. Enter the following command to build the binaries for Win32 (x86):
    build.bat ReleaseNativeOnly Win32
    You may need to enter the command "setenv /x86" first if you are using a Windows SDK or Visual Studio command prompt.
  7. Make sure everything succeeds with no errors; the log file "%TEMP%\System.Data.SQLite.Build_ReleaseNativeOnly_Win32_Unknown.log" may be checked if any errors should occur.
  8. Enter the following command to build the binaries for x64:
    build.bat ReleaseNativeOnly x64
    You may need to enter the command "setenv /x64" first if you are using a Windows SDK or Visual Studio command prompt.
  9. Make sure everything succeeds with no errors; the log file "%TEMP%\System.Data.SQLite.Build_ReleaseNativeOnly_x64_Unknown.log" may be checked if any errors should occur.
  10. Enter the following command to build the setup binaries for Win32 AND x64 (unfortunately, it is not possible to build the setup using the InnoSetup GUI. It must be done using the provided command line tools due to its dynamic nature):
    bake_all.bat
  11. Make sure everything succeeds with no errors. InnoSetup should produce "success" messages very similar to the following:
    Successful compile (X.XXX sec). Resulting Setup program filename is: abc

build.bat Desription

build.bat is the top level batch file for build automation and should be called with the configuration and platform to build:

This starts by setting 3 environment variables: These are used to call another .bat file (eg. set_ReleaseNativeOnly_x64.bat) which calls set_ReleaseNativeOnly.bat to setup more variables to specify which .NET Framework to use: build.bat attempts to set additional variables based on the chosen and available .NET Framework. The PATH variable is updated to include the directory specified by FRAMEWORKDIR.
At this point, several variables are setup for the call to MSBuild MSBuild.exe is called to build the solution.