Forráskód Böngészése

Lite edition for netstandard2.0

Brad Robinson 4 éve
szülő
commit
df5020b41c

+ 16 - 0
.vscode/tasks.json

@@ -20,6 +20,22 @@
             },
             "problemMatcher": "$msCompile"
         },
+        {
+            "label": "Build JsonKit.Lite",
+            "command": "dotnet",
+            "type": "shell",
+            "args": [
+                "build",
+                "/consoleloggerparameters:NoSummary",
+                "./Topten.JsonKit/Topten.JsonKit.Lite.csproj"
+            ],
+            "group": "build",
+            "presentation": {
+                "reveal": "always",
+                "clear": true
+            },
+            "problemMatcher": "$msCompile"
+        },
         {
             "label": "Build Tests",
             "command": "dotnet",

+ 4 - 0
Topten.JsonKit/Emit.cs

@@ -12,6 +12,8 @@
 // either express or implied. See the License for the specific language governing permissions 
 // and limitations under the License.
 
+#if !JSONKIT_NO_EMIT
+
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -801,3 +803,5 @@ namespace Topten.JsonKit
         }
     }
 }
+
+#endif

+ 2 - 0
Topten.JsonKit/JsonKit.cs

@@ -25,9 +25,11 @@ namespace Topten.JsonKit
             WriteWhitespaceDefault = true;
             StrictParserDefault = false;
 
+#if !JSONKIT_NO_EMIT
             Json.SetFormatterResolver(Emit.MakeFormatter);
             Json.SetParserResolver(Emit.MakeParser);
             Json.SetIntoParserResolver(Emit.MakeIntoParser);
+#endif
         }
 
         // Pretty format default

+ 22 - 0
Topten.JsonKit/Topten.JsonKit.Lite.csproj

@@ -0,0 +1,22 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <Import Project="../buildtools/Topten.props" />
+
+  <PropertyGroup>
+    <TargetFrameworks>netstandard2.0</TargetFrameworks>
+    <DefineConstants>$(DefineConstants);JSONKIT_NO_EMIT</DefineConstants>
+  </PropertyGroup>
+
+  <PropertyGroup Condition="'$(Configuration)'=='Release'">
+    <TtsCodeSign>True</TtsCodeSign>
+    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
+    <Copyright>Copyright © 2014-2020 Topten Software.  All Rights Reserved</Copyright>
+    <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
+    <PackageIcon>nuget-icon.png</PackageIcon>
+    <PackageProjectUrl>https://github.com/toptensoftware/jsonkit</PackageProjectUrl>
+    <PackageTags>JSON, Serialization</PackageTags>
+    <Description>Lightweight JSON Serialization Library (Lite Edition for .NET Standard 2.0)</Description>
+    <RepositoryUrl>https://github.com/toptensoftware/jsonkit</RepositoryUrl>
+  </PropertyGroup>
+
+</Project>

+ 2 - 1
build.js

@@ -13,7 +13,8 @@ if (bt.options.official)
 }
 
 // Build
-bt.run("dotnet build Topten.JsonKit -c Release")
+bt.run("dotnet build Topten.JsonKit\\Topten.JsonKit.csproj -c Release")
+bt.run("dotnet build Topten.JsonKit\\Topten.JsonKit.Lite.csproj -c Release")
 
 if (bt.options.official)
 {