Skip to content

Commit

Permalink
Merge pull request #71 from henkmollema/dotnet-sdk-2.0
Browse files Browse the repository at this point in the history
Update to .NET Core SDK 2.0
  • Loading branch information
henkmollema authored Aug 18, 2017
2 parents 1c510a2 + a90234a commit 0bf9b5e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 129 deletions.
File renamed without changes.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
68 changes: 1 addition & 67 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,67 +1 @@
$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
dotnet build
47 changes: 1 addition & 46 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,46 +1 @@
#!/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 "$@"
dotnet build --framework netstandard1.3
15 changes: 3 additions & 12 deletions src/Dommel/Dommel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Description>Simple CRUD operations for Dapper.</Description>
<Copyright>Copyright © Henk Mollema 2017</Copyright>
<AssemblyTitle>Dommel</AssemblyTitle>
<VersionPrefix>1.8.1</VersionPrefix>
<VersionPrefix>1.9.0</VersionPrefix>
<Authors>Henk Mollema</Authors>
<TargetFrameworks>net45;net451;netstandard1.3</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -12,18 +12,9 @@
<PackageLicenseUrl>https://github.com/henkmollema/Dommel/blob/master/LICENSE</PackageLicenseUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/henkmollema/Dommel</RepositoryUrl>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.3' ">1.6.0</NetStandardImplicitPackageVersion>
</PropertyGroup>

</PropertyGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="1.50.2" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net451' ">
<Reference Include="System.ComponentModel.DataAnnotations" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<PackageReference Include="System.ComponentModel.Annotations" Version="4.1.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.4.0" />
</ItemGroup>
</Project>

0 comments on commit 0bf9b5e

Please sign in to comment.