diff --git a/Building.md b/Building.md new file mode 100644 index 00000000..11633b9d --- /dev/null +++ b/Building.md @@ -0,0 +1,41 @@ +Notes for Building Insight +=============================================== + +Now with Insight 6.0, we DO support .NET Core and no longer support databases that require funky driver installs. +It makes it a lot easier. + + +# Docker for Test Databases # + +You can run all of the supported databases through docker: + + cd insight-docker + .\docker-env.bat # windows + source ./docker-env.bat # non-windows + docker-compose up + +It takes a while the first time, so wait until all of the databases boot up fully. + +NOTE: `docker-env` will set the `INSIGHT_TEST_HOST` and `INSIGHT_TEST_PASSWORD` environment variables. You'll need them +for any process that is running the tests and needs to connect to the database. + +# Command-Line Builds # + +On Windows, you can use the powershell scripts in the root folder: + + ./build.ps1 build + ./build.ps1 test + ./build.ps1 package + +On non-Windows, you can use the `dotnet build` and `dotnet test` command for anything you want to build and run. +You'll want to specify the framework with `-f ` so you don't try to build frameworks that you don't have. + + dotnet build Insight.Database/Insight.Database.csproj -f netstandard2.0 + dotnet test Insight.Tests/Insight.Tests.csproj -f netcoreapp2.0 + +# Tagging a Version # + +1. Update the version number in SharedConfiguration.csproj. +2. Use `git tag ` to mark the changeset. +3. `build package` to make the build. +4. `git push --tags` to push the tags to the server. diff --git a/Building.txt b/Building.txt deleted file mode 100644 index 90117ca0..00000000 --- a/Building.txt +++ /dev/null @@ -1,96 +0,0 @@ -Notes for Building Insight -=============================================== - -Getting the basics up and running, e.g. for a pull request -------------------------------------------------------------- -* Install the Visual Studio extension EditorConfig. - This will read the .editorconfig file in the solution dir so when you edit files you don't mess with the tab scheme etc - and make it hard to diff and merge your code. If you don't do this it's hard to ensure that you get 'credit' - for the lines of code you are contributing. -* Everything but Insight.SQLite.Tests should build properly when you build the solution (SQLite is addressed below) - -Set up the test database -------------------------------------------------------------- -* By default Insight.Tests' config file is looking for local installed SQL server (default instance) with a database named InsightDbTests -* To use a LocalDb option instead (or skip the the next '*'): - - Install LocalDb, e.g. from here https://msdn.microsoft.com/en-us/library/hh510202.aspx - - >cd C:\Program Files\Microsoft SQL Server\130\Tools\Binn - - >SqlLocalDb create InsightDb - - >sqllocaldb share insightdb insightshare # We are only sharing so the pipe won't change on each start - - There are two option to get the tests connected your sql server when using local db: - 1) Create an alias for your instance: - a) SqlLocalDb start followed by SqlLocalDb info. Copy the pipe, excluding 'np:' - b) Open 'SQL Server Configuration Manaager' - c) Goto SQL Native Client Configuration/Alias, select 'New Alias' - d) Fill in the fields in exactly this order because otherwise the UI will 'fix' things for you! - - Protocool = Named Pipes - - Alias Name = . # (just a dot) - - Server = . # (just a dot) - - Pipe = # Eg: \\.\pipe\LOCALDB#SH66D071\tsql\query - e) repeat this for the 32 bit version of the QL Native Client Configuration/Alias - (Note that you could also do this step with cliconfg.exe, just do it in both: in /System32 & /SysWOW64) - 2) Or, instead, enable the LocalDb connection string that is commented out in app.config. (note that '(localdb)' is literal). - Repeat for Tests.Compatiblity3x, Tests.Glimpse, Tests.Json, Tests.MiniProfiler (easier, but way more annoying over time) -* Confirm all tests pass for Insight.Tests - - -Install special Database drivers -------------------------------------------------------------- -If you are doing a small edit, you can skip this section and just unload these 3 projects and their test projects. - -* SQLite. - - Resolve the error in Insight.SQLite.Tests - - The SQLite files will be downloaded by Nuget to \packages on first compile. - - SQLLite on Windows requires the SQLLite runtime to be in the project directory. - - Go to \packages\System.Data.SQLite.Core.x.x.x.x\content\net451 - - Copy the \x86 and \x64 directories to the root of Insight.Tests.SQLite -* Db2: - - Direct Link: https://1drv.ms/u/s!Aisu0-5GSeCIsjJiLV_SKSgIG_qe - - OR: Go to http://www-01.ibm.com/support/docview.wss?uid=swg24041038 and get the 'IBM Data Server Client' - - (Wags' Note: I didn't have to turn off UAC or copy the files below.) - - IF YOU ARE RUNNING UAC, YOU MUST TURN IT OFF. There is no UAC prompt, you just get error 10...You must disable UAC - - Run \CLIENT\db2\Windows\IBM Data Server Client.msi - - Choose custom install, only choose 'Base client support' and 'IBM Data Server Provider for .NET' - - Use the default path - - Uncheck 'enable OS Security' OR run cmd 'net localgroup db2users "YourUserName" /Add' (I just unchecked the check box) - - Turn UAC back on - - You must copy db2app64.dll and db2app.dll from %Program Files%\IBM\SQLLIB\BIN to ..\Insight.Tests.DB2\bin\db2app64.dll - (Thx http://stackoverflow.com/questions/7484349/sql1159-initialization-error-with-db2-net-data-provider-reason-code-2) - -* Sybase ASE: - - Direct Link: https://1drv.ms/u/s!Aisu0-5GSeCIsjay_paw3f_1GEcW - - OR: Download the "Get a Free Developer Edition" from http://scn.sap.com/community/developer-center/oltp-db - - Choose Custom Install when given the option. - - Only install the .Net ADO package from the custom install. (make sure the faint half ticks are cleared) - - Install it in the default location - -* Oracle (Not OracleManaged): - - Direct Link: https://1drv.ms/u/s!Aisu0-5GSeCIsjT6GwdJNyuwLYCb - - OR: Go to http://www.oracle.com/technetwork/topics/dotnet/index-085163.html - - Click 'Download ODP.NET via ODAC' - - Choose the ODAC download, not ODP_Managed. I downloaded the msi, but note there is also an XCopy version which may be better. - - Options are: - - install location: C:\Oracle - - Install: 'Oracle Data Provider for .NET' (again avoid the managed driver for this project) - - You should now see C:\Oracle\odp.net\bin\4\Oracle.DataAccess.dll - - -Doing a full build -------------------------------------------------------------- -Do this to ensure your code runs on all platforms (.Net 3.5, 4.0, 4.5, Mono, etc.) -* This does require install the database drivers listed above -* A full build also requires Psake - - You can get it from http://nuget.org/packages/psake/ - - Or, with PowerShell 5 run this from the PowerShell cmd prompt: - Install-Module "psake" - Note: add '-Scope CurrentUser' or run this from an elevated Powershell prompt -* To build run 'build.bat' - -Use Vagrant to get a virtual server with Db2, Sybase & Oracle so those tests work ---------------------------------------------------------------------------------------- -* Install Vagrant - https://www.vagrantup.com/ -* Install Virtual Box or other VM Provider (Note that Vagrant wants money to link up with VMware) -* From the root of Insight, run 'Vagrant up', this will provision your VM (it takes ~15 mins the first time) -* To shut down: 'Vagrant Suspend', Restart: 'Vagrant Reload' -* One issue I had to fix was that the PostgreSQL version changed and that required some small vagrant updates. - See the commit 1bfa684 for details when this happens again.