Skip to content

Commit

Permalink
Update build script and remove dependency on Microsoft.AspNet.WebApi.…
Browse files Browse the repository at this point in the history
…Client
  • Loading branch information
Krusen committed Aug 6, 2017
1 parent 2593ccc commit 0e2591b
Show file tree
Hide file tree
Showing 11 changed files with 533 additions and 38 deletions.
112 changes: 96 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# User-specific files
*.suo
Expand All @@ -17,13 +19,15 @@
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# MSTest test Results
[Tt]est[Rr]esult*/
Expand All @@ -38,9 +42,11 @@ TestResult.xml
[Rr]eleasePS/
dlldata.c

# DNX
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json

*_i.c
*_p.c
Expand Down Expand Up @@ -74,14 +80,18 @@ _Chutzpah*
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb

# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap

# TFS 2012 Local Workspace
$tf/
Expand All @@ -103,10 +113,14 @@ _TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover

# Visual Studio code coverage results
*.coverage
*.coveragexml

# NCrunch
_NCrunch_*
*.ncrunch*
.*crunch*.local.xml
nCrunchTemp_*

# MightyMoose
*.mm.*
Expand Down Expand Up @@ -134,13 +148,16 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
## TODO: Comment the next line if you want to checkin your
## web deploy settings but do note that will include unencrypted
## passwords
#*.pubxml

# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
Expand All @@ -149,13 +166,23 @@ publish/
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets

# Windows Azure Build Output
# Microsoft Azure Build Output
csx/
*.build.csdef

# Windows Store app package directory
# Microsoft Azure Emulator
ecf/
rcf/

# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt

# Visual Studio cache files
# files ending in .cache can be ignored
Expand All @@ -165,16 +192,19 @@ AppPackages/

# Others
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/

# RIA/Silverlight projects
Generated_Code/

Expand All @@ -189,6 +219,7 @@ UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
*.ndf

# Business Intelligence projects
*.rdl.data
Expand All @@ -198,16 +229,65 @@ UpgradeLog*.htm
# Microsoft Fakes
FakesAssemblies/

# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/

# Typescript v1 declaration files
typings/

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# Paket dependency manager
.paket/paket.exe
paket-files/

# FAKE - F# Make
.fake/

# JetBrains Rider
.idea/
*.sln.iml

# CodeRush
.cr/

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc

# Cake - Uncomment if you are using it
tools/**
!tools/packages.config

# Telerik's JustMock configuration file
*.jmconfig

# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs




/coverage.xml
27 changes: 16 additions & 11 deletions PinSharp.Tests/PinSharp.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,29 @@

<PropertyGroup>
<TargetFramework>net452</TargetFramework>
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
</PropertyGroup>

<ItemGroup>
<None Update="xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\PinSharp\PinSharp.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
<PackageReference Include="AutoFixture" Version="3.50.2" />
<PackageReference Include="AutoFixture.AutoNSubstitute" Version="3.50.2" />
<PackageReference Include="AutoFixture.Xunit2" Version="3.50.2" />
<PackageReference Include="FluentAssertions" Version="4.19.2" />
<PackageReference Include="NSubstitute" Version="2.0.2" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.extensibility.execution" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="AutoFixture" Version="3.50.3" />
<PackageReference Include="AutoFixture.AutoNSubstitute" Version="3.50.3" />
<PackageReference Include="AutoFixture.Xunit2" Version="3.50.3" />
<PackageReference Include="FluentAssertions" Version="4.19.3" />
<PackageReference Include="NSubstitute" Version="2.0.3" />
<PackageReference Include="xunit" Version="2.3.0-beta3-build3705" />
<PackageReference Include="xunit.core" Version="2.3.0-beta3-build3705" />
<PackageReference Include="xunit.extensibility.execution" Version="2.3.0-beta3-build3705" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta3-build3705" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0-beta3-build3705" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions PinSharp.Tests/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"shadowCopy": false
}
6 changes: 5 additions & 1 deletion PinSharp.sln
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.10
VisualStudioVersion = 15.0.26430.16
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution files", "Solution files", "{B75C688B-8995-429E-9680-59D391B89792}"
ProjectSection(SolutionItems) = preProject
.gitattributes = .gitattributes
.gitignore = .gitignore
build.cake = build.cake
build.ps1 = build.ps1
LICENSE.MD = LICENSE.MD
README.md = README.md
EndProjectSection
Expand Down
1 change: 1 addition & 0 deletions PinSharp/Api/PinterestApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Newtonsoft.Json;
using PinSharp.Api.Exceptions;
using PinSharp.Api.Responses;
using PinSharp.Extensions;
using PinSharp.Http;

namespace PinSharp.Api
Expand Down
18 changes: 18 additions & 0 deletions PinSharp/Extensions/HttpContentExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace PinSharp.Extensions
{
internal static class HttpContentExtensions
{
public static async Task<T> ReadAsAsync<T>(this HttpContent content)
{
if (content.Headers.ContentLength == 0)
return default(T);

var data = await content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<T>(data);
}
}
}
20 changes: 10 additions & 10 deletions PinSharp/PinSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@

<PropertyGroup>
<TargetFrameworks>net45;netstandard1.3</TargetFrameworks>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.3' ">1.6.0</NetStandardImplicitPackageVersion>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.3' ">$(PackageTargetFallback);portable-net451+win8</PackageTargetFallback>
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<!-- Needed for code coverage -->
<PropertyGroup>
<DebugType>full</DebugType>
</PropertyGroup>

<PropertyGroup>
<PackageId>PinSharp</PackageId>
<Version>2.1.0</Version>
<Version>$(SemVer)</Version>
<Authors>Søren Kruse</Authors>
<Company />
<Product>PinSharp</Product>
Expand All @@ -27,20 +34,13 @@
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net45|AnyCPU'">
<DebugType>pdbonly</DebugType>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="System.Net.Http" />
<Reference Include="Microsoft.CSharp" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.3" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.3" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="System.Net.Http" Version="4.1.1" />
<PackageReference Include="System.Reflection" Version="4.3.0" />
Expand Down
1 change: 1 addition & 0 deletions PinSharp/PinSharpAuthClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Security.Cryptography;
using System.Threading.Tasks;
using PinSharp.Api;
using PinSharp.Extensions;

namespace PinSharp
{
Expand Down
Loading

0 comments on commit 0e2591b

Please sign in to comment.