Skip to content
This repository was archived by the owner on Jan 19, 2022. It is now read-only.

Upgrade to .NET Standard 2.0 #10

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ obj
buildlog.txt
build
package
/.vs/Spring.Rest.2019/DesignTimeBuild
/packages
*.nupkg
/.vs
463 changes: 463 additions & 0 deletions NetStandard-Spring.Rest.build

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions Spring.Rest.2019.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.202
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spring.Http.Converters.NJson", "netstandard\Spring.Http.Converters.NJson\Spring.Http.Converters.NJson.csproj", "{913F4241-F1CC-41F8-BF57-9FC50C0A7438}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "net-standard", "net-standard", "{F8F3A420-F5AC-402A-8F96-32134079EAD0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spring.Rest", "netstandard\Spring.Rest\Spring.Rest.csproj", "{A965978B-4A95-47D1-872E-34ACF2B289C9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spring.Rest.Testing", "netstandard\Spring.Rest.Testing\Spring.Rest.Testing.csproj", "{CFFEC718-01D5-4816-9361-1145811A280E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spring.Rest.Tests", "netstandard\Spring.Rest.Tests\Spring.Rest.Tests.csproj", "{A5CA3523-08A4-4EA4-B082-12F6659365DA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{913F4241-F1CC-41F8-BF57-9FC50C0A7438}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{913F4241-F1CC-41F8-BF57-9FC50C0A7438}.Debug|Any CPU.Build.0 = Debug|Any CPU
{913F4241-F1CC-41F8-BF57-9FC50C0A7438}.Release|Any CPU.ActiveCfg = Release|Any CPU
{913F4241-F1CC-41F8-BF57-9FC50C0A7438}.Release|Any CPU.Build.0 = Release|Any CPU
{A965978B-4A95-47D1-872E-34ACF2B289C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A965978B-4A95-47D1-872E-34ACF2B289C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A965978B-4A95-47D1-872E-34ACF2B289C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A965978B-4A95-47D1-872E-34ACF2B289C9}.Release|Any CPU.Build.0 = Release|Any CPU
{CFFEC718-01D5-4816-9361-1145811A280E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CFFEC718-01D5-4816-9361-1145811A280E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CFFEC718-01D5-4816-9361-1145811A280E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CFFEC718-01D5-4816-9361-1145811A280E}.Release|Any CPU.Build.0 = Release|Any CPU
{A5CA3523-08A4-4EA4-B082-12F6659365DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A5CA3523-08A4-4EA4-B082-12F6659365DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A5CA3523-08A4-4EA4-B082-12F6659365DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A5CA3523-08A4-4EA4-B082-12F6659365DA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{913F4241-F1CC-41F8-BF57-9FC50C0A7438} = {F8F3A420-F5AC-402A-8F96-32134079EAD0}
{A965978B-4A95-47D1-872E-34ACF2B289C9} = {F8F3A420-F5AC-402A-8F96-32134079EAD0}
{CFFEC718-01D5-4816-9361-1145811A280E} = {F8F3A420-F5AC-402A-8F96-32134079EAD0}
{A5CA3523-08A4-4EA4-B082-12F6659365DA} = {F8F3A420-F5AC-402A-8F96-32134079EAD0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
NAntAddinLastFileName = Spring.build
SolutionGuid = {B28287A7-8FB3-443E-99A7-C43E0233F282}
EndGlobalSection
EndGlobal
366 changes: 366 additions & 0 deletions Spring.Rest.NetCore.build

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions build-netcore-nuget.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off
@echo Running full Build Script, capturing output to buildlog.txt file...
tools\NAnt\bin\nant.exe nuget -f:Spring.Rest.NetCore.build > buildlog.txt
@echo Launching text file viewer to display buildlog.txt contents...
start "ignored but required placeholder window title argument" buildlog.txt
Binary file added lib/net/2.0/Common.Logging.Core.dll
Binary file not shown.
876 changes: 876 additions & 0 deletions lib/net/2.0/Common.Logging.Core.xml

Large diffs are not rendered by default.

Binary file modified lib/net/2.0/Common.Logging.dll
Binary file not shown.
5,868 changes: 2,774 additions & 3,094 deletions lib/net/2.0/Common.Logging.xml

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions netstandard-build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@echo off
@echo Running full Build Script, capturing output to buildlog.txt file...
#tools\NAnt\bin\nant.exe build -f:NetStandard-Spring.Rest.build > buildlog.txt

tools\NAnt\bin\nant.exe package-nuget -f:NetStandard-Spring.Rest.build > buildlog.txt
@echo Launching text file viewer to display buildlog.txt contents...
start "ignored but required placeholder window title argument" buildlog.txt

24 changes: 24 additions & 0 deletions netstandard/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Reflection;
using System.Runtime.InteropServices;

//------------------------------------------------------------------------------
// <auto-generated>
// �˴����ɹ������ɡ�
// ����ʱ�汾:4.0.30319.42000
//
// �Դ��ļ��ĸ��Ŀ��ܻᵼ�²���ȷ����Ϊ���������
// �������ɴ��룬��Щ���Ľ��ᶪʧ��
// </auto-generated>
//------------------------------------------------------------------------------

[assembly: CLSCompliantAttribute(true)]
[assembly: ComVisibleAttribute(false)]
[assembly: AssemblyProductAttribute("Spring.NET REST Client Framework 2.0.0 for .NET Standard 2.0")]
[assembly: AssemblyCompanyAttribute("http://www.springframework.net/")]
[assembly: AssemblyCopyrightAttribute("Copyright 2020 SpringSource")]
[assembly: AssemblyTrademarkAttribute("Apache License, Version 2.0")]
[assembly: AssemblyCultureAttribute("")]
[assembly: AssemblyVersionAttribute("2.0.0.522")]
[assembly: AssemblyConfigurationAttribute("net-standard-2.0; 2.0.0.522; dev")]

20 changes: 20 additions & 0 deletions netstandard/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project>
<PropertyGroup>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>

<CommonLoggingVersion>3.4.1</CommonLoggingVersion>

<Authors>SpringSource</Authors>
<PackageIconUrl>http://springframework.net/images/SpringSource_Leaves32x32.png</PackageIconUrl>
<PackageLicenseUrl>http://www.springframework.net/license.html</PackageLicenseUrl>
<PackageProjectUrl>http://www.springframework.net/</PackageProjectUrl>
<PackageTags>Library</PackageTags>


<LangVersion>latest</LangVersion>
<TargetFullFrameworkVersion>net45</TargetFullFrameworkVersion>
<TargetNetStandardVersion>netstandard2.0</TargetNetStandardVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#region License

/*
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#endregion

using System;
using System.IO;

using Newtonsoft.Json;

namespace Spring.Http.Converters.Json
{
/// <summary>
/// Implementation of <see cref="IHttpMessageConverter"/> that can read and write JSON
/// using the Json.NET (Newtonsoft.Json) library.
/// </summary>
/// <remarks>
/// <para>
/// This implementation supports getting/setting values from JSON directly,
/// without the need to deserialize/serialize to a .NET class.
/// </para>
/// <para>
/// By default, this converter supports 'application/json' media type.
/// This can be overridden by setting the <see cref="P:SupportedMediaTypes"/> property.
/// </para>
/// </remarks>
/// <author>Bruno Baia</author>
public class NJsonHttpMessageConverter : AbstractHttpMessageConverter
{
/// <summary>
/// Creates a new instance of the <see cref="NJsonHttpMessageConverter"/>
/// with the media type 'application/json'.
/// </summary>
public NJsonHttpMessageConverter() :
base(new MediaType("application", "json"))
{
}

/// <summary>
/// Indicates whether the given class is supported by this converter.
/// </summary>
/// <param name="type">The type to test for support.</param>
/// <returns><see langword="true"/> if supported; otherwise <see langword="false"/></returns>
protected override bool Supports(Type type)
{
return true;
}

/// <summary>
/// Abstract template method that reads the actualy object. Invoked from <see cref="M:Read"/>.
/// </summary>
/// <typeparam name="T">The type of object to return.</typeparam>
/// <param name="message">The HTTP message to read from.</param>
/// <returns>The converted object.</returns>
/// <exception cref="HttpMessageNotReadableException">In case of conversion errors</exception>
protected override T ReadInternal<T>(IHttpInputMessage message)
{
// Read from the message stream
using (StreamReader reader = new StreamReader(message.Body))
using (JsonTextReader jsonReader = new JsonTextReader(reader))
{
JsonSerializer jsonSerializer = new JsonSerializer();
return jsonSerializer.Deserialize<T>(jsonReader);
}
}

/// <summary>
/// Abstract template method that writes the actual body. Invoked from <see cref="M:Write"/>.
/// </summary>
/// <param name="content">The object to write to the HTTP message.</param>
/// <param name="message">The HTTP message to write to.</param>
/// <exception cref="HttpMessageNotWritableException">In case of conversion errors</exception>
protected override void WriteInternal(object content, IHttpOutputMessage message)
{
// Write to the message stream
message.Body = delegate(Stream stream)
{
using (StreamWriter writer = new StreamWriter(stream))
using (JsonTextWriter jsonWriter = new JsonTextWriter(writer))
{
JsonSerializer jsonSerializer = new JsonSerializer();
jsonSerializer.Serialize(jsonWriter, content);
}
};
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(TargetNetStandardVersion);$(TargetFullFrameworkVersion)</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\src\Spring.Http.Converters.NJson\AssemblyInfo.cs" Link="AssemblyInfo.cs" />
<Compile Include="..\CommonAssemblyInfo.cs" Link="CommonAssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Spring.Rest\Spring.Rest.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#region License

/*
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#endregion

using System;
using System.Runtime.Serialization;

namespace Spring.Rest.Client.Testing
{
/// <summary>
/// The exception that is thrown when an assertion fails.
/// </summary>
/// <author>Bruno Baia</author>
#if !SILVERLIGHT && !CF_3_5
[Serializable]
#endif
public class AssertionException : Exception
{
/// <summary>
/// Creates a new instance of the <see cref="AssertionException"/> class.
/// </summary>
public AssertionException()
{
}

/// <summary>
/// Creates a new instance of the <see cref="AssertionException"/> class.
/// </summary>
/// <param name="message">
/// A message about the exception.
/// </param>
public AssertionException(string message)
: base(message)
{
}

/// <summary>
/// Creates a new instance of the <see cref="AssertionException"/> class.
/// </summary>
/// <param name="message">A message about the exception.</param>
/// <param name="rootCause">The root exception that is being wrapped.</param>
public AssertionException(string message, Exception rootCause)
: base(message, rootCause)
{
}

#if !SILVERLIGHT && !CF_3_5
/// <summary>
/// Creates a new instance of the <see cref="AssertionException"/> class.
/// </summary>
/// <param name="info">
/// The <see cref="System.Runtime.Serialization.SerializationInfo"/>
/// that holds the serialized object data about the exception being thrown.
/// </param>
/// <param name="context">
/// The <see cref="System.Runtime.Serialization.StreamingContext"/>
/// that contains contextual information about the source or destination.
/// </param>
protected AssertionException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
#endif
}
}
Loading