Skip to content

Commit e7a4466

Browse files
committed
add appveyor stuff
1 parent df88765 commit e7a4466

File tree

5 files changed

+119
-7
lines changed

5 files changed

+119
-7
lines changed

JsonApiDotNetCore/Build.ps1

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
59+
$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
60+
$revision = "{0:D4}" -f [convert]::ToInt32($revision, 10)
61+
62+
exec { & dotnet test .\JsonApiDotNetCoreTests -c Release }
63+
64+
exec { & dotnet pack .\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=$revision }

JsonApiDotNetCore/Data/GenericDataAccess.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
using System;
2-
using System.Collections.Generic;
31
using System.Linq;
4-
using System.Linq.Expressions;
5-
using JsonApiDotNetCore.Abstractions;
6-
using System.Reflection;
72
using JsonApiDotNetCore.Extensions;
8-
using JsonApiDotNetCore.Routing;
93
using Microsoft.EntityFrameworkCore;
104

115
public class GenericDataAccess

JsonApiDotNetCore/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Children's Research Institute
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

JsonApiDotNetCore/project.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
2-
"version": "1.0.0-*",
2+
"version": "0.1.0-alpha-*",
3+
"packOptions": {
4+
"licenseUrl": "https://github.com/Research-Institute/json-api-dotnet-core/tree/master/JsonApiDotNetCore/LICENSE",
5+
"projectUrl": "https://github.com/Research-Institute/json-api-dotnet-core/"
6+
},
37
"dependencies": {
48
"NETStandard.Library": "1.6.0",
59
"Microsoft.AspNetCore.Mvc": "1.0.0",

appveyor.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: '{build}'
2+
pull_requests:
3+
do_not_increment_build_number: true
4+
branches:
5+
only:
6+
- master
7+
nuget:
8+
disable_publish_on_pr: true
9+
build_script:
10+
- ps: .\Build.ps1
11+
test: off
12+
artifacts:
13+
- path: .\artifacts\**\*.nupkg
14+
name: NuGet
15+
deploy:
16+
- provider: NuGet
17+
server: https://www.myget.org/F/research-institute/api/v2/package
18+
api_key:
19+
secure: 6CeYcZ4Ze+57gxfeuHzqP6ldbUkPtF6pfpVM1Gw/K2jExFrAz763gNAQ++tiacq3
20+
skip_symbols: true
21+
on:
22+
branch: master
23+
- provider: NuGet
24+
name: production
25+
api_key:
26+
secure: /fsEOgG4EdtNd6DPmko9h3NxQwx1IGDcFreGTKd2KA56U2KEkpX/L/pCGpCIEf2s
27+
on:
28+
branch: master
29+
appveyor_repo_tag: true

0 commit comments

Comments
 (0)