Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce netstandard version to 1.1 #82

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 0 additions & 3 deletions src/json-ld.net/Core/Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ namespace JsonLD.Core
/// <author>tristan</author>
//[System.Serializable]
public class Context : JObject
#if !PORTABLE && !IS_CORECLR
, ICloneable
#endif
{
private JsonLdOptions options;

Expand Down
4 changes: 0 additions & 4 deletions src/json-ld.net/Core/JsonLdApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2196,7 +2196,6 @@ public virtual RDFDataset ToRDF()
/// <exception cref="JsonLD.Core.JsonLdError"></exception>
public virtual object Normalize(RDFDataset dataset)
{
#if !PORTABLE
// create quads and map bnodes to their associated quads
IList<RDFDataset.Quad> quads = new List<RDFDataset.Quad>();
IDictionary<string,IDictionary<string,object>> bnodes = new Dictionary<string,IDictionary<string,object>>();
Expand Down Expand Up @@ -2247,9 +2246,6 @@ public virtual object Normalize(RDFDataset dataset)
NormalizeUtils normalizeUtils = new NormalizeUtils(quads, bnodes, new UniqueNamer
("_:c14n"), opts);
return normalizeUtils.HashBlankNodes(bnodes.Keys);
#else
throw new PlatformNotSupportedException();
#endif
}
}
}
8 changes: 0 additions & 8 deletions src/json-ld.net/Core/JsonLdProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -487,24 +487,16 @@ public static object ToRDF(JToken input)
/// <exception cref="JsonLDNet.Core.JsonLdError"></exception>
public static object Normalize(JToken input, JsonLdOptions options)
{
#if !PORTABLE
JsonLdOptions opts = options.Clone();
opts.format = null;
RDFDataset dataset = (RDFDataset)ToRDF(input, opts);
return new JsonLdApi(options).Normalize(dataset);
#else
throw new PlatformNotSupportedException();
#endif
}

/// <exception cref="JsonLD.Core.JsonLdError"></exception>
public static object Normalize(JToken input)
{
#if !PORTABLE
return Normalize(input, new JsonLdOptions(string.Empty));
#else
throw new PlatformNotSupportedException();
#endif
}
}
}
12 changes: 0 additions & 12 deletions src/json-ld.net/Core/NormalizeUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public NormalizeUtils(IList<RDFDataset.Quad> quads, IDictionary<string, IDiction
/// <exception cref="JsonLD.Core.JsonLdError"></exception>
public virtual object HashBlankNodes(IEnumerable<string> unnamed_)
{
#if !PORTABLE
IList<string> unnamed = new List<string>(unnamed_);
IList<string> nextUnnamed = new List<string>();
IDictionary<string, IList<string>> duplicates = new Dictionary<string, IList<string
Expand Down Expand Up @@ -203,9 +202,6 @@ public virtual object HashBlankNodes(IEnumerable<string> unnamed_)
}
}
}
#else
throw new PlatformNotSupportedException();
#endif
}

private sealed class _IComparer_145 : IComparer<NormalizeUtils.HashResult>
Expand Down Expand Up @@ -245,7 +241,6 @@ private class HashResult
/// <param name="callback">(err, result) called once the operation completes.</param>
private static NormalizeUtils.HashResult HashPaths(string id, IDictionary<string, IDictionary<string, object>> bnodes, UniqueNamer namer, UniqueNamer pathNamer)
{
#if !PORTABLE
MessageDigest md = null;

try
Expand Down Expand Up @@ -460,9 +455,6 @@ private static NormalizeUtils.HashResult HashPaths(string id, IDictionary<string
{
md?.Dispose();
}
#else
throw new PlatformNotSupportedException();
#endif
}

/// <summary>Hashes all of the quads about a blank node.</summary>
Expand Down Expand Up @@ -500,7 +492,6 @@ private static string HashQuads(string id, IDictionary<string, IDictionary<strin
/// <returns></returns>
private static string Sha1hash(ICollection<string> nquads)
{
#if !PORTABLE
try
{
// create SHA-1 digest
Expand All @@ -515,9 +506,6 @@ private static string Sha1hash(ICollection<string> nquads)
{
throw;
}
#else
throw new PlatformNotSupportedException();
#endif
}

// TODO: this is something to optimize
Expand Down
11 changes: 0 additions & 11 deletions src/json-ld.net/Util/JavaCompat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

#if !PORTABLE
using System.Security.Cryptography;
#endif

namespace JsonLD
{
Expand Down Expand Up @@ -281,13 +278,7 @@ public Matcher Matcher(string str)

public string GetPattern()
{
#if !PORTABLE && !IS_CORECLR
return this.pattern;
#elif !PORTABLE
return _rx;
#else
throw new PlatformNotSupportedException();
#endif
}

new public static bool Matches(string val, string rx)
Expand Down Expand Up @@ -357,7 +348,6 @@ public bool Find()
}


#if !PORTABLE
internal class MessageDigest : IDisposable
{
SHA1 md;
Expand Down Expand Up @@ -392,5 +382,4 @@ public void Dispose()
md.Dispose();
}
}
#endif
}
20 changes: 4 additions & 16 deletions src/json-ld.net/json-ld.net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
Implements the W3C JSON-LD 1.0 standard.</Description>
<VersionPrefix>1.0.7</VersionPrefix>
<Authors>NuGet;linked-data-dotnet</Authors>
<TargetFrameworks>netstandard1.3;netstandard2.0;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>netstandard1.1;netstandard2.0</TargetFrameworks>
<AssemblyName>json-ld.net</AssemblyName>
<PackageId>json-ld.net</PackageId>
<PackageTags>json-ld;jsonld;json;linked-data;rdf;semantic;web</PackageTags>
<PackageIconUrl>http://json-ld.org/images/json-ld-logo-64.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/linked-data-dotnet/json-ld.net/</PackageProjectUrl>
<PackageLicenseUrl>https://raw.githubusercontent.com/linked-data-dotnet/json-ld.net/master/LICENSE</PackageLicenseUrl>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.3' ">$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.3' ">1.6.0</NetStandardImplicitPackageVersion>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.1' ">$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.1' ">1.6.0</NetStandardImplicitPackageVersion>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
Expand All @@ -22,19 +22,7 @@ Implements the W3C JSON-LD 1.0 standard.</Description>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40-client' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'portable45-net45+win8' ">
<DefineConstants>$(DefineConstants);PORTABLE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<DefineConstants>$(DefineConstants);IS_CORECLR</DefineConstants>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.1' ">
<PackageReference Include="System.Security.Cryptography.Algorithms" Version="4.3.1" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>
</Project>