diff --git a/.travis.yml b/.travis.yml index 95dbd9ba3b..dea6a483b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ services: before_script: - psql -c 'create database JsonApiDotNetCoreExample;' -U postgres mono: none -dotnet: 1.0.0-preview2-1-003177 +dotnet: 1.0.1 branches: only: - master diff --git a/Build.ps1 b/Build.ps1 index 4088454799..d094dd4bf3 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -1,64 +1,6 @@ -<# -.SYNOPSIS - You can add this to you build script to ensure that psbuild is available before calling - Invoke-MSBuild. If psbuild is not available locally it will be downloaded automatically. -#> -function EnsurePsbuildInstalled{ - [cmdletbinding()] - param( - [string]$psbuildInstallUri = 'https://raw.githubusercontent.com/ligershark/psbuild/master/src/GetPSBuild.ps1' - ) - process{ - if(-not (Get-Command "Invoke-MsBuild" -errorAction SilentlyContinue)){ - 'Installing psbuild from [{0}]' -f $psbuildInstallUri | Write-Verbose - (new-object Net.WebClient).DownloadString($psbuildInstallUri) | iex - } - else{ - 'psbuild already loaded, skipping download' | Write-Verbose - } - - # make sure it's loaded and throw if not - if(-not (Get-Command "Invoke-MsBuild" -errorAction SilentlyContinue)){ - throw ('Unable to install/load psbuild from [{0}]' -f $psbuildInstallUri) - } - } -} - -# Taken from psake https://github.com/psake/psake - -<# -.SYNOPSIS - This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode - to see if an error occcured. If an error is detected then an exception is thrown. - This function allows you to run command-line programs without having to - explicitly check the $lastexitcode variable. -.EXAMPLE - exec { svn info $repository_trunk } "Error executing SVN. Please verify SVN command-line client is installed" -#> -function Exec -{ - [CmdletBinding()] - param( - [Parameter(Position=0,Mandatory=1)][scriptblock]$cmd, - [Parameter(Position=1,Mandatory=0)][string]$errorMessage = ($msgs.error_bad_command -f $cmd) - ) - & $cmd - if ($lastexitcode -ne 0) { - throw ("Exec: " + $errorMessage) - } -} - -if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse } - -EnsurePsbuildInstalled - -exec { & dotnet restore } - -#Invoke-MSBuild - $revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL]; $revision = "{0:D4}" -f [convert]::ToInt32($revision, 10) -exec { & dotnet build .\src\JsonApiDotNetCore -c Release } - -exec { & dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=$revision } \ No newline at end of file +dotnet restore .\src\JsonApiDotNetCore\JsonApiDotNetCore.csproj +dotnet build .\src\JsonApiDotNetCore -c Release +dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=$revision \ No newline at end of file diff --git a/build.sh b/build.sh index f06d90fe6b..7fe8f58e62 100755 --- a/build.sh +++ b/build.sh @@ -9,9 +9,11 @@ if [ -d $artifactsFolder ]; then rm -R $artifactsFolder fi -dotnet restore +dotnet restore ./src/JsonApiDotNetCore/JsonApiDotNetCore.csproj +dotnet restore ./src/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj +dotnet restore ./test/JsonApiDotNetCoreExampleTests/JsonApiDotNetCoreExampleTests.csproj -dotnet test ./test/JsonApiDotNetCoreExampleTests -c Release -f netcoreapp1.0 +dotnet test ./test/JsonApiDotNetCoreExampleTests/JsonApiDotNetCoreExampleTests.csproj revision=${TRAVIS_JOB_ID:=1} revision=$(printf "%04d" $revision) diff --git a/global.json b/global.json deleted file mode 100644 index e2e29a812e..0000000000 --- a/global.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "projects": [ "src", "test" ], - "sdk": { - "version": "1.0.0-preview2-003121" - } -} - diff --git a/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj b/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj new file mode 100755 index 0000000000..4274c0b0f5 --- /dev/null +++ b/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj @@ -0,0 +1,19 @@ + + + + 1.1.0 + netcoreapp1.0 + JsonApiDotNetCore + JsonApiDotNetCore + 1.1.1 + $(PackageTargetFallback);dnxcore50;portable-net45+win8 + + + + + + + + + + diff --git a/src/JsonApiDotNetCore/project.json b/src/JsonApiDotNetCore/project.json deleted file mode 100644 index 51847a6015..0000000000 --- a/src/JsonApiDotNetCore/project.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "version": "1.0.1", - - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.1.0", - "type": "platform" - }, - "Microsoft.AspNetCore.Routing": "1.1.0", - "Microsoft.AspNetCore.Mvc": "1.1.0", - "Microsoft.EntityFrameworkCore": "1.1.0", - "Microsoft.Extensions.Logging": "1.1.0" - }, - - "frameworks": { - "netcoreapp1.0": { - "imports": [ - "dnxcore50", - "portable-net45+win8" - ] - } - }, - - "tooling": { - "defaultNamespace": "JsonApiDotNetCore" - } -} diff --git a/src/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj b/src/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj new file mode 100755 index 0000000000..60e351ab00 --- /dev/null +++ b/src/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj @@ -0,0 +1,39 @@ + + + + netcoreapp1.0 + true + JsonApiDotNetCoreExample + Exe + JsonApiDotNetCoreExample + 1.1.1 + $(PackageTargetFallback);dotnet5.6;portable-net45+win8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/JsonApiDotNetCoreExample/project.json b/src/JsonApiDotNetCoreExample/project.json deleted file mode 100644 index 113aecbec5..0000000000 --- a/src/JsonApiDotNetCoreExample/project.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.1.0", - "type": "platform" - }, - "JsonApiDotNetCore": { - "target": "project" - }, - "Microsoft.AspNetCore.Mvc": "1.1.0", - "Microsoft.AspNetCore.Routing": "1.1.0", - "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0", - "Microsoft.AspNetCore.Server.Kestrel": "1.1.0", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0", - "Microsoft.Extensions.Configuration.FileExtensions": "1.1.0", - "Microsoft.Extensions.Configuration.Json": "1.1.0", - "Microsoft.Extensions.Configuration.CommandLine": "1.1.0", - "Microsoft.Extensions.Logging": "1.1.0", - "Microsoft.Extensions.Logging.Console": "1.1.0", - "Microsoft.Extensions.Logging.Debug": "1.1.0", - "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0", - "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final", - "Npgsql.EntityFrameworkCore.PostgreSQL": "1.1.0", - "DotNetCoreDocs": "0.4.0" - }, - - "tools": { - "Microsoft.EntityFrameworkCore.Tools": { - "version": "1.0.0-preview2-final", - "imports": [ - "portable-net45+win8+dnxcore50", - "portable-net45+win8" - ] - }, - "Microsoft.DotNet.Watcher.Tools": "1.0.0-*" - }, - - "frameworks": { - "netcoreapp1.0": { - "imports": [ - "dotnet5.6", - "portable-net45+win8" - ] - } - }, - - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true, - "include": [ - "appsettings.json" - ] - }, - - "runtimeOptions": { - "configProperties": { - "System.GC.Server": true - } - }, - - "publishOptions": { - "include": [ - "wwwroot", - "**/*.cshtml", - "appsettings.json", - "web.config" - ] - }, - - "scripts": { - "postpublish": ["dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"] - }, - - "tooling": { - "defaultNamespace": "JsonApiDotNetCoreExample" - } -} \ No newline at end of file diff --git a/test/JsonApiDotNetCoreExampleTests/JsonApiDotNetCoreExampleTests.csproj b/test/JsonApiDotNetCoreExampleTests/JsonApiDotNetCoreExampleTests.csproj new file mode 100755 index 0000000000..b79d496c65 --- /dev/null +++ b/test/JsonApiDotNetCoreExampleTests/JsonApiDotNetCoreExampleTests.csproj @@ -0,0 +1,34 @@ + + + + netcoreapp1.0 + true + JsonApiDotNetCoreExampleTests + Exe + JsonApiDotNetCoreExampleTests + true + true + 1.1.1 + $(PackageTargetFallback);dotnet5.6;portable-net45+win8 + + + + + PreserveNewest + + + + + + + + + + + + + + + + + diff --git a/test/JsonApiDotNetCoreExampleTests/Program.cs b/test/JsonApiDotNetCoreExampleTests/Program.cs deleted file mode 100644 index e6c8639a21..0000000000 --- a/test/JsonApiDotNetCoreExampleTests/Program.cs +++ /dev/null @@ -1,5 +0,0 @@ -public class Program -{ - public static void Main(string[] args) - { } -} \ No newline at end of file diff --git a/test/JsonApiDotNetCoreExampleTests/project.json b/test/JsonApiDotNetCoreExampleTests/project.json deleted file mode 100644 index f7cd3ced06..0000000000 --- a/test/JsonApiDotNetCoreExampleTests/project.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "testRunner": "xunit", - "dependencies": { - "JsonApiDotNetCoreExample": { - "target": "project" - }, - "Microsoft.NETCore.App": { - "version": "1.1.0", - "type": "platform" - }, - "dotnet-test-xunit": "2.2.0-preview2-build1029", - "xunit": "2.2.0-beta5-build3474", - "Bogus": "8.0.1-beta-1", - "Microsoft.DotNet.InternalAbstractions": "1.0.0", - "Moq": "4.7.1" - }, - - "tools": { - "Microsoft.DotNet.Watcher.Tools": "1.1.0-preview4-final" - }, - - "frameworks": { - "netcoreapp1.0": { - "imports": [ - "dotnet5.6", - "portable-net45+win8" - ] - } - }, - - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true, - "copyToOutput": { - "include": ["xunit.runner.json", "appsettings.json"] - } - }, - - "runtimeOptions": { - "configProperties": { - "System.GC.Server": true - } - }, - - "tooling": { - "defaultNamespace": "JsonApiDotNetCoreExampleTests" - } -} \ No newline at end of file