Skip to content

Commit f214a89

Browse files
authored
Merge pull request #51 from Research-Institute/develop
Upgrade tooling to .Net Core SDK v1.0.1
2 parents 32b6b56 + fba7da3 commit f214a89

File tree

13 files changed

+105
-245
lines changed

13 files changed

+105
-245
lines changed

.gitlab-ci.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ services:
66
before_script:
77
- psql -c 'create database JsonApiDotNetCoreExample;' -U postgres
88
mono: none
9-
dotnet: 1.0.0-preview2-1-003177
9+
dotnet: 1.0.1
1010
branches:
1111
only:
1212
- master
13-
- staging
13+
- develop
1414
script:
1515
- ./build.sh

Build.ps1

Lines changed: 3 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,6 @@
1-
<#
2-
.SYNOPSIS
3-
You can add this to you build script to ensure that psbuild is available before calling
4-
Invoke-MSBuild. If psbuild is not available locally it will be downloaded automatically.
5-
#>
6-
function EnsurePsbuildInstalled{
7-
[cmdletbinding()]
8-
param(
9-
[string]$psbuildInstallUri = 'https://raw.githubusercontent.com/ligershark/psbuild/master/src/GetPSBuild.ps1'
10-
)
11-
process{
12-
if(-not (Get-Command "Invoke-MsBuild" -errorAction SilentlyContinue)){
13-
'Installing psbuild from [{0}]' -f $psbuildInstallUri | Write-Verbose
14-
(new-object Net.WebClient).DownloadString($psbuildInstallUri) | iex
15-
}
16-
else{
17-
'psbuild already loaded, skipping download' | Write-Verbose
18-
}
19-
20-
# make sure it's loaded and throw if not
21-
if(-not (Get-Command "Invoke-MsBuild" -errorAction SilentlyContinue)){
22-
throw ('Unable to install/load psbuild from [{0}]' -f $psbuildInstallUri)
23-
}
24-
}
25-
}
26-
27-
# Taken from psake https://github.com/psake/psake
28-
29-
<#
30-
.SYNOPSIS
31-
This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode
32-
to see if an error occcured. If an error is detected then an exception is thrown.
33-
This function allows you to run command-line programs without having to
34-
explicitly check the $lastexitcode variable.
35-
.EXAMPLE
36-
exec { svn info $repository_trunk } "Error executing SVN. Please verify SVN command-line client is installed"
37-
#>
38-
function Exec
39-
{
40-
[CmdletBinding()]
41-
param(
42-
[Parameter(Position=0,Mandatory=1)][scriptblock]$cmd,
43-
[Parameter(Position=1,Mandatory=0)][string]$errorMessage = ($msgs.error_bad_command -f $cmd)
44-
)
45-
& $cmd
46-
if ($lastexitcode -ne 0) {
47-
throw ("Exec: " + $errorMessage)
48-
}
49-
}
50-
51-
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
52-
53-
EnsurePsbuildInstalled
54-
55-
exec { & dotnet restore }
56-
57-
#Invoke-MSBuild
58-
591
$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
602
$revision = "{0:D4}" -f [convert]::ToInt32($revision, 10)
613

62-
exec { & dotnet build .\src\JsonApiDotNetCore -c Release }
63-
64-
exec { & dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=$revision }
4+
dotnet restore .\src\JsonApiDotNetCore\JsonApiDotNetCore.csproj
5+
dotnet build .\src\JsonApiDotNetCore -c Release
6+
dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=$revision

appveyor.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
version: '{build}'
2+
os: Visual Studio 2017
23
pull_requests:
34
do_not_increment_build_number: true
45
branches:
56
only:
67
- master
7-
- staging
8+
- develop
89
nuget:
910
disable_publish_on_pr: true
1011
build_script:
12+
- ps: dotnet --version
1113
- ps: .\Build.ps1
1214
test: off
1315
artifacts:
@@ -20,7 +22,7 @@ deploy:
2022
secure: 6CeYcZ4Ze+57gxfeuHzqP6ldbUkPtF6pfpVM1Gw/K2jExFrAz763gNAQ++tiacq3
2123
skip_symbols: true
2224
on:
23-
branch: staging
25+
branch: develop
2426
- provider: NuGet
2527
name: production
2628
api_key:

build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ if [ -d $artifactsFolder ]; then
99
rm -R $artifactsFolder
1010
fi
1111

12-
dotnet restore
12+
dotnet restore ./src/JsonApiDotNetCore/JsonApiDotNetCore.csproj
13+
dotnet restore ./src/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj
14+
dotnet restore ./test/JsonApiDotNetCoreExampleTests/JsonApiDotNetCoreExampleTests.csproj
1315

14-
dotnet test ./test/JsonApiDotNetCoreExampleTests -c Release -f netcoreapp1.0
16+
dotnet test ./test/JsonApiDotNetCoreExampleTests/JsonApiDotNetCoreExampleTests.csproj
1517

1618
revision=${TRAVIS_JOB_ID:=1}
1719
revision=$(printf "%04d" $revision)

global.json

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<VersionPrefix>1.1.0</VersionPrefix>
5+
<TargetFramework>netcoreapp1.0</TargetFramework>
6+
<AssemblyName>JsonApiDotNetCore</AssemblyName>
7+
<PackageId>JsonApiDotNetCore</PackageId>
8+
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
9+
<PackageTargetFallback>$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.1.1" />
14+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
15+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="1.1.1" />
16+
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.1" />
17+
</ItemGroup>
18+
19+
</Project>

src/JsonApiDotNetCore/project.json

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp1.0</TargetFramework>
5+
<PreserveCompilationContext>true</PreserveCompilationContext>
6+
<AssemblyName>JsonApiDotNetCoreExample</AssemblyName>
7+
<OutputType>Exe</OutputType>
8+
<PackageId>JsonApiDotNetCoreExample</PackageId>
9+
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
10+
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<ProjectReference Include="../JsonApiDotNetCore/JsonApiDotNetCore.csproj" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
19+
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.1.1" />
20+
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.1" />
21+
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.1" />
22+
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.1" />
23+
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="1.1.1" />
24+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.1" />
25+
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="1.1.1" />
26+
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.1" />
27+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
28+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
29+
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.1.1" />
30+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.0.0" />
31+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="1.1.0" />
32+
<PackageReference Include="DotNetCoreDocs" Version="0.4.0" />
33+
</ItemGroup>
34+
35+
<ItemGroup>
36+
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.0" />
37+
</ItemGroup>
38+
39+
</Project>

src/JsonApiDotNetCoreExample/project.json

Lines changed: 0 additions & 77 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp1.0</TargetFramework>
5+
<PreserveCompilationContext>true</PreserveCompilationContext>
6+
<AssemblyName>JsonApiDotNetCoreExampleTests</AssemblyName>
7+
<OutputType>Exe</OutputType>
8+
<PackageId>JsonApiDotNetCoreExampleTests</PackageId>
9+
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
10+
<ServerGarbageCollection>true</ServerGarbageCollection>
11+
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
12+
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
13+
</PropertyGroup>
14+
15+
<ItemGroup>
16+
<None Update="xunit.runner.json;appsettings.json">
17+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
18+
</None>
19+
</ItemGroup>
20+
21+
<ItemGroup>
22+
<ProjectReference Include="../../src/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj" />
23+
</ItemGroup>
24+
25+
<ItemGroup>
26+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
27+
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta5-build1225" />
28+
<PackageReference Include="xunit" Version="2.2.0-beta5-build3474" />
29+
<PackageReference Include="Bogus" Version="8.0.1-beta-1" />
30+
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />
31+
<PackageReference Include="Moq" Version="4.7.1" />
32+
</ItemGroup>
33+
34+
</Project>

test/JsonApiDotNetCoreExampleTests/Program.cs

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)