Skip to content

Commit ff57ebe

Browse files
authored
Merge pull request #82 from sblom/experiment/minimum-netstandard
Reduce netstandard version to 1.1
2 parents db11318 + 6add465 commit ff57ebe

File tree

6 files changed

+8
-54
lines changed

6 files changed

+8
-54
lines changed

src/json-ld.net/Core/Context.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ namespace JsonLD.Core
1414
/// <author>tristan</author>
1515
//[System.Serializable]
1616
public class Context : JObject
17-
#if !PORTABLE && !IS_CORECLR
18-
, ICloneable
19-
#endif
2017
{
2118
private JsonLdOptions options;
2219

src/json-ld.net/Core/JsonLdApi.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,7 +2196,6 @@ public virtual RDFDataset ToRDF()
21962196
/// <exception cref="JsonLD.Core.JsonLdError"></exception>
21972197
public virtual object Normalize(RDFDataset dataset)
21982198
{
2199-
#if !PORTABLE
22002199
// create quads and map bnodes to their associated quads
22012200
IList<RDFDataset.Quad> quads = new List<RDFDataset.Quad>();
22022201
IDictionary<string,IDictionary<string,object>> bnodes = new Dictionary<string,IDictionary<string,object>>();
@@ -2247,9 +2246,6 @@ public virtual object Normalize(RDFDataset dataset)
22472246
NormalizeUtils normalizeUtils = new NormalizeUtils(quads, bnodes, new UniqueNamer
22482247
("_:c14n"), opts);
22492248
return normalizeUtils.HashBlankNodes(bnodes.Keys);
2250-
#else
2251-
throw new PlatformNotSupportedException();
2252-
#endif
22532249
}
22542250
}
22552251
}

src/json-ld.net/Core/JsonLdProcessor.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -487,24 +487,16 @@ public static object ToRDF(JToken input)
487487
/// <exception cref="JsonLDNet.Core.JsonLdError"></exception>
488488
public static object Normalize(JToken input, JsonLdOptions options)
489489
{
490-
#if !PORTABLE
491490
JsonLdOptions opts = options.Clone();
492491
opts.format = null;
493492
RDFDataset dataset = (RDFDataset)ToRDF(input, opts);
494493
return new JsonLdApi(options).Normalize(dataset);
495-
#else
496-
throw new PlatformNotSupportedException();
497-
#endif
498494
}
499495

500496
/// <exception cref="JsonLD.Core.JsonLdError"></exception>
501497
public static object Normalize(JToken input)
502498
{
503-
#if !PORTABLE
504499
return Normalize(input, new JsonLdOptions(string.Empty));
505-
#else
506-
throw new PlatformNotSupportedException();
507-
#endif
508500
}
509501
}
510502
}

src/json-ld.net/Core/NormalizeUtils.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public NormalizeUtils(IList<RDFDataset.Quad> quads, IDictionary<string, IDiction
2929
/// <exception cref="JsonLD.Core.JsonLdError"></exception>
3030
public virtual object HashBlankNodes(IEnumerable<string> unnamed_)
3131
{
32-
#if !PORTABLE
3332
IList<string> unnamed = new List<string>(unnamed_);
3433
IList<string> nextUnnamed = new List<string>();
3534
IDictionary<string, IList<string>> duplicates = new Dictionary<string, IList<string
@@ -203,9 +202,6 @@ public virtual object HashBlankNodes(IEnumerable<string> unnamed_)
203202
}
204203
}
205204
}
206-
#else
207-
throw new PlatformNotSupportedException();
208-
#endif
209205
}
210206

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

251246
try
@@ -460,9 +455,6 @@ private static NormalizeUtils.HashResult HashPaths(string id, IDictionary<string
460455
{
461456
md?.Dispose();
462457
}
463-
#else
464-
throw new PlatformNotSupportedException();
465-
#endif
466458
}
467459

468460
/// <summary>Hashes all of the quads about a blank node.</summary>
@@ -500,7 +492,6 @@ private static string HashQuads(string id, IDictionary<string, IDictionary<strin
500492
/// <returns></returns>
501493
private static string Sha1hash(ICollection<string> nquads)
502494
{
503-
#if !PORTABLE
504495
try
505496
{
506497
// create SHA-1 digest
@@ -515,9 +506,6 @@ private static string Sha1hash(ICollection<string> nquads)
515506
{
516507
throw;
517508
}
518-
#else
519-
throw new PlatformNotSupportedException();
520-
#endif
521509
}
522510

523511
// TODO: this is something to optimize

src/json-ld.net/Util/JavaCompat.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
using System.Linq;
77
using System.Text;
88
using System.Text.RegularExpressions;
9-
10-
#if !PORTABLE
119
using System.Security.Cryptography;
12-
#endif
1310

1411
namespace JsonLD
1512
{
@@ -281,13 +278,7 @@ public Matcher Matcher(string str)
281278

282279
public string GetPattern()
283280
{
284-
#if !PORTABLE && !IS_CORECLR
285-
return this.pattern;
286-
#elif !PORTABLE
287281
return _rx;
288-
#else
289-
throw new PlatformNotSupportedException();
290-
#endif
291282
}
292283

293284
new public static bool Matches(string val, string rx)
@@ -357,7 +348,6 @@ public bool Find()
357348
}
358349

359350

360-
#if !PORTABLE
361351
internal class MessageDigest : IDisposable
362352
{
363353
SHA1 md;
@@ -392,5 +382,4 @@ public void Dispose()
392382
md.Dispose();
393383
}
394384
}
395-
#endif
396385
}

src/json-ld.net/json-ld.net.csproj

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
Implements the W3C JSON-LD 1.0 standard.</Description>
66
<VersionPrefix>1.0.7</VersionPrefix>
77
<Authors>NuGet;linked-data-dotnet</Authors>
8-
<TargetFrameworks>netstandard1.3;netstandard2.0;netcoreapp2.1</TargetFrameworks>
8+
<TargetFrameworks>netstandard1.1;netstandard2.0;net40</TargetFrameworks>
99
<AssemblyName>json-ld.net</AssemblyName>
1010
<PackageId>json-ld.net</PackageId>
1111
<PackageTags>json-ld;jsonld;json;linked-data;rdf;semantic;web</PackageTags>
1212
<PackageIconUrl>http://json-ld.org/images/json-ld-logo-64.png</PackageIconUrl>
1313
<PackageProjectUrl>https://github.com/linked-data-dotnet/json-ld.net/</PackageProjectUrl>
1414
<PackageLicenseUrl>https://raw.githubusercontent.com/linked-data-dotnet/json-ld.net/master/LICENSE</PackageLicenseUrl>
15-
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.3' ">$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
16-
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.3' ">1.6.0</NetStandardImplicitPackageVersion>
15+
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.1' ">$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
1716
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
1817
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1918
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
@@ -22,19 +21,12 @@ Implements the W3C JSON-LD 1.0 standard.</Description>
2221
<ItemGroup>
2322
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
2423
</ItemGroup>
25-
<ItemGroup Condition=" '$(TargetFramework)' == 'net40-client' ">
26-
<Reference Include="System" />
27-
<Reference Include="Microsoft.CSharp" />
28-
</ItemGroup>
29-
<PropertyGroup Condition=" '$(TargetFramework)' == 'portable45-net45+win8' ">
30-
<DefineConstants>$(DefineConstants);PORTABLE</DefineConstants>
31-
</PropertyGroup>
32-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
33-
<DefineConstants>$(DefineConstants);IS_CORECLR</DefineConstants>
34-
</PropertyGroup>
35-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
36-
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
24+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.1' ">
3725
<PackageReference Include="System.Security.Cryptography.Algorithms" Version="4.3.1" />
38-
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
26+
</ItemGroup>
27+
<ItemGroup Condition="'$(TargetFramework)' == 'net40'">
28+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
29+
<PackageReference Include="Microsoft.Net.Http" Version="2.2.29" />
30+
<PackageReference Include="Microsoft.Bcl.Async" Version="1.0.168" />
3931
</ItemGroup>
4032
</Project>

0 commit comments

Comments
 (0)