diff --git a/appveyor.yml b/.appveyor.yml similarity index 100% rename from appveyor.yml rename to .appveyor.yml diff --git a/.travis.yml b/.travis.yml index 5bc7696..56ae0dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,15 @@ language: csharp -sudo: false +mono: none +dotnet: 2.0.0 dist: trusty env: global: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: 1 -mono: none os: - linux - osx osx_image: xcode8.2 -before_install: - - if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/; fi before_script: - chmod +x ./build.sh script: diff --git a/build.ps1 b/build.ps1 index 30cbe3e..5588d77 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,67 +1,2 @@ -$ErrorActionPreference = "Stop" - -function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries) -{ - while($true) - { - try - { - Invoke-WebRequest $url -OutFile $downloadLocation - break - } - catch - { - $exceptionMessage = $_.Exception.Message - Write-Host "Failed to download '$url': $exceptionMessage" - if ($retries -gt 0) { - $retries-- - Write-Host "Waiting 10 seconds before retrying. Retries left: $retries" - Start-Sleep -Seconds 10 - - } - else - { - $exception = $_.Exception - throw $exception - } - } - } -} - -cd $PSScriptRoot - -$repoFolder = $PSScriptRoot -$env:REPO_FOLDER = $repoFolder - -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/8fbf3a9151eb555cedbfe8be8df9082a64c2fecb.zip" -if ($env:KOREBUILD_ZIP) -{ - $koreBuildZip=$env:KOREBUILD_ZIP -} - -$buildFolder = ".build" -$buildFile="$buildFolder\KoreBuild.ps1" - -if (!(Test-Path $buildFolder)) { - Write-Host "Downloading KoreBuild from $koreBuildZip" - - $tempFolder=$env:TEMP + "\KoreBuild-" + [guid]::NewGuid() - New-Item -Path "$tempFolder" -Type directory | Out-Null - - $localZipFile="$tempFolder\korebuild.zip" - - DownloadWithRetry -url $koreBuildZip -downloadLocation $localZipFile -retries 6 - - Add-Type -AssemblyName System.IO.Compression.FileSystem - [System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder) - - New-Item -Path "$buildFolder" -Type directory | Out-Null - copy-item "$tempFolder\**\build\*" $buildFolder -Recurse - - # Cleanup - if (Test-Path $tempFolder) { - Remove-Item -Recurse -Force $tempFolder - } -} - -&"$buildFile" @args \ No newline at end of file +dotnet build +dotnet test .\test\Dapper.FluentMap.Tests\Dapper.FluentMap.Tests.csproj diff --git a/build.sh b/build.sh index 82f1225..d76d336 100755 --- a/build.sh +++ b/build.sh @@ -1,46 +1,4 @@ -#!/usr/bin/env bash -repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd $repoFolder - -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/8fbf3a9151eb555cedbfe8be8df9082a64c2fecb.zip" -if [ ! -z $KOREBUILD_ZIP ]; then - koreBuildZip=$KOREBUILD_ZIP -fi - -buildFolder=".build" -buildFile="$buildFolder/KoreBuild.sh" - -if test ! -d $buildFolder; then - echo "Downloading KoreBuild from $koreBuildZip" - - tempFolder="/tmp/KoreBuild-$(uuidgen)" - mkdir $tempFolder - - localZipFile="$tempFolder/korebuild.zip" - - retries=6 - until (wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip 2>/dev/null) - do - echo "Failed to download '$koreBuildZip'" - if [ "$retries" -le 0 ]; then - exit 1 - fi - retries=$((retries - 1)) - echo "Waiting 10 seconds before retrying. Retries left: $retries" - sleep 10s - done - - unzip -q -d $tempFolder $localZipFile - - mkdir $buildFolder - cp -r $tempFolder/**/build/** $buildFolder - - chmod +x $buildFile - - # Cleanup - if test -d $tempFolder; then - rm -rf $tempFolder - fi -fi - -$buildFile -r $repoFolder "$@" \ No newline at end of file +dotnet restore +dotnet build ./src/Dapper.FluentMap/Dapper.FluentMap.csproj -f netstandard1.3 +dotnet build ./src/Dapper.FluentMap.Dommel/Dapper.FluentMap.Dommel.csproj -f netstandard1.3 +dotnet test ./test/Dapper.FluentMap.Tests/Dapper.FluentMap.Tests.csproj diff --git a/global.json b/global.json deleted file mode 100644 index e17a688..0000000 --- a/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdk": { - "version": "1.1.0" - } -} diff --git a/src/Dapper.FluentMap.Dommel/Dapper.FluentMap.Dommel.csproj b/src/Dapper.FluentMap.Dommel/Dapper.FluentMap.Dommel.csproj index 0a63492..20894db 100644 --- a/src/Dapper.FluentMap.Dommel/Dapper.FluentMap.Dommel.csproj +++ b/src/Dapper.FluentMap.Dommel/Dapper.FluentMap.Dommel.csproj @@ -1,19 +1,17 @@  - Dapper.FluentMap extension for Dommel support. Copyright © Henk Mollema 2017 - 1.4.5 + 1.5.0 Henk Mollema net45;net451;netstandard1.3 true dapper;fluentmap;dommel https://github.com/henkmollema/Dapper-FluentMap https://github.com/henkmollema/Dapper-FluentMap/blob/master/LICENSE - 1.6.0 - + \ No newline at end of file diff --git a/src/Dapper.FluentMap/Configuration/FluentConventionConfiguration.cs b/src/Dapper.FluentMap/Configuration/FluentConventionConfiguration.cs index 328a475..e5a1ec2 100644 --- a/src/Dapper.FluentMap/Configuration/FluentConventionConfiguration.cs +++ b/src/Dapper.FluentMap/Configuration/FluentConventionConfiguration.cs @@ -40,7 +40,7 @@ public FluentConventionConfiguration ForEntity() return this; } -#if !COREFX +#if !NETSTANDARD1_3 /// /// Configures the current convention for all the entities in current assembly filtered by the specified namespaces. /// diff --git a/src/Dapper.FluentMap/Dapper.FluentMap.csproj b/src/Dapper.FluentMap/Dapper.FluentMap.csproj index f1d070e..44e95bd 100644 --- a/src/Dapper.FluentMap/Dapper.FluentMap.csproj +++ b/src/Dapper.FluentMap/Dapper.FluentMap.csproj @@ -2,19 +2,15 @@ Simple API to fluently map POCO properties to database columns when using Dapper. Copyright © Henk Mollema 2017 - 1.5.4 + 1.6.0 Henk Mollema net45;net451;netstandard1.3 true c#;dapper;mapping;fluentmap https://github.com/henkmollema/Dapper-FluentMap https://github.com/henkmollema/Dapper-FluentMap/blob/master/LICENSE - 1.6.0 - - $(DefineConstants);COREFX - \ No newline at end of file diff --git a/test/Dapper.FluentMap.Tests/ConventionTests.cs b/test/Dapper.FluentMap.Tests/ConventionTests.cs index 0536233..c197328 100644 --- a/test/Dapper.FluentMap.Tests/ConventionTests.cs +++ b/test/Dapper.FluentMap.Tests/ConventionTests.cs @@ -17,10 +17,6 @@ public void ShouldMapEntitiesInAssembly() // Assert var conventions = FluentMapper.TypeConventions.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - foreach (var x in conventions) - { - System.Console.WriteLine("Type: " + x.Key.ToString()); - } Assert.NotEmpty(conventions); Assert.True(conventions.ContainsKey(typeof(TestEntity))); var map = conventions[typeof(TestEntity)]; diff --git a/test/Dapper.FluentMap.Tests/Dapper.FluentMap.Tests.csproj b/test/Dapper.FluentMap.Tests/Dapper.FluentMap.Tests.csproj index 50afc70..b1f0034 100644 --- a/test/Dapper.FluentMap.Tests/Dapper.FluentMap.Tests.csproj +++ b/test/Dapper.FluentMap.Tests/Dapper.FluentMap.Tests.csproj @@ -1,17 +1,20 @@  - netcoreapp1.1 + netcoreapp2.0 false - - - - - - + + + + + + \ No newline at end of file diff --git a/test/Dapper.FluentMap.Tests/ManualMappingTests.cs b/test/Dapper.FluentMap.Tests/ManualMappingTests.cs index 5f82d7b..d2e1cd6 100644 --- a/test/Dapper.FluentMap.Tests/ManualMappingTests.cs +++ b/test/Dapper.FluentMap.Tests/ManualMappingTests.cs @@ -43,8 +43,7 @@ public void EntityMapShouldHavePropertyMap() var map = new MapWithOnePropertyMap(); // Assert - Assert.NotEmpty(map.PropertyMaps); - Assert.Equal(1, map.PropertyMaps.Count); + Assert.Single(map.PropertyMaps); } [Fact] @@ -101,7 +100,7 @@ public void FluentMapperInitializeShouldAddEntityMap() var entityMap = FluentMapper.EntityMaps.Single(); // Assert - Assert.Equal(1, FluentMapper.EntityMaps.Count); + Assert.Single(FluentMapper.EntityMaps); Assert.Equal(typeof(TestEntity), entityMap.Key); Assert.IsType(entityMap.Value); }