Przeglądaj źródła

New build tools

Brad Robinson 4 lat temu
rodzic
commit
427efd6918

BIN
Artwork/nuget-icon.png


+ 2 - 1
Topten.JsonKit.Test/Topten.JsonKit.Test.csproj

@@ -1,8 +1,9 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
+  <Import Project="../buildtools/Topten.props" />
+
   <PropertyGroup>
     <TargetFramework>netcoreapp2.1</TargetFramework>
-
     <IsPackable>false</IsPackable>
   </PropertyGroup>
 

+ 0 - 33
Topten.JsonKit.nuspec

@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
-  <metadata>
-    <id>Topten.JsonKit</id>
-    <title>JsonKit</title>
-    <version>1.1.100</version>
-    <authors>Topten Software</authors>
-    <owners>Topten Software</owners>
-    <projectUrl>https://www.toptensoftware.com/razorblade</projectUrl>
-    <iconUrl>https://www.toptensoftware.com/nuget_icon.png</iconUrl>
-    <requireLicenseAcceptance>false</requireLicenseAcceptance>
-    <description>Lightweight JSON Serialization Library</description>
-    <copyright>Copyright © 2014-2019 Topten Software.  All Rights Reserved</copyright>
-    <tags>JSON, Serialization</tags>
-  </metadata>
-  <files>
-
-    <!-- .NET Framework -->
-    <file src=".\Build\Release\Topten.JsonKit\net46\Topten.JsonKit.*" target="lib/net46" />
-
-    <!-- netstandard2.0 -->
-    <file src=".\Build\Release\Topten.JsonKit\net46\Topten.JsonKit.*" target="ref/netstandard2.0" />
-
-    <!-- netcore2.0 -->
-    <file src=".\Build\Release\Topten.JsonKit\netcoreapp2.0\Topten.JsonKit.*" target="ref/netcoreapp2.0" />
-    <file src=".\Build\Release\Topten.JsonKit\netcoreapp2.0\Topten.JsonKit.*" target="runtimes/any/lib/netcoreapp2.0" />
-
-    <!-- net46 -->
-    <file src=".\Build\Release\Topten.JsonKit\net46\Topten.JsonKit.*" target="ref/net46" />
-    <file src=".\Build\Release\Topten.JsonKit\net46\Topten.JsonKit.*" target="runtimes/any/lib/net46" />
-
-  </files>
-</package>

+ 0 - 37
Topten.JsonKit.sln

@@ -1,37 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.28010.2046
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FF86ACF7-E4CB-4873-96CE-CE495873073E}"
-	ProjectSection(SolutionItems) = preProject
-		build.js = build.js
-		Topten.JsonKit.nuspec = Topten.JsonKit.nuspec
-	EndProjectSection
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Topten.JsonKit", "Topten.JsonKit\Topten.JsonKit.csproj", "{BCFB1B87-8E26-440B-B160-FD15CF02522F}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Topten.JsonKit.Test", "Topten.JsonKit.Test\Topten.JsonKit.Test.csproj", "{8CD7AEA0-F920-41EC-B57A-1D5653D0297B}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Release|Any CPU = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{BCFB1B87-8E26-440B-B160-FD15CF02522F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{BCFB1B87-8E26-440B-B160-FD15CF02522F}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{BCFB1B87-8E26-440B-B160-FD15CF02522F}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{BCFB1B87-8E26-440B-B160-FD15CF02522F}.Release|Any CPU.Build.0 = Release|Any CPU
-		{8CD7AEA0-F920-41EC-B57A-1D5653D0297B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{8CD7AEA0-F920-41EC-B57A-1D5653D0297B}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{8CD7AEA0-F920-41EC-B57A-1D5653D0297B}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{8CD7AEA0-F920-41EC-B57A-1D5653D0297B}.Release|Any CPU.Build.0 = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-	GlobalSection(ExtensibilityGlobals) = postSolution
-		SolutionGuid = {C898F1A3-55A4-4C7A-AA78-DF6A99610454}
-	EndGlobalSection
-EndGlobal

+ 5 - 5
Topten.JsonKit/JsonReader.cs

@@ -586,10 +586,10 @@ namespace Topten.JsonKit
         }
 
         // Yikes!
-        public static Func<Type, Action<IJsonReader, object>> _intoParserResolver;
-        public static Func<Type, Func<IJsonReader, Type, object>> _parserResolver;
-        public static ThreadSafeCache<Type, Func<IJsonReader, Type, object>> _parsers = new ThreadSafeCache<Type, Func<IJsonReader, Type, object>>();
-        public static ThreadSafeCache<Type, Action<IJsonReader, object>> _intoParsers = new ThreadSafeCache<Type, Action<IJsonReader, object>>();
-        public static ThreadSafeCache<Type, Func<IJsonReader, string, object>> _typeFactories = new ThreadSafeCache<Type, Func<IJsonReader, string, object>>();
+        internal static Func<Type, Action<IJsonReader, object>> _intoParserResolver;
+        internal static Func<Type, Func<IJsonReader, Type, object>> _parserResolver;
+        internal static ThreadSafeCache<Type, Func<IJsonReader, Type, object>> _parsers = new ThreadSafeCache<Type, Func<IJsonReader, Type, object>>();
+        internal static ThreadSafeCache<Type, Action<IJsonReader, object>> _intoParsers = new ThreadSafeCache<Type, Action<IJsonReader, object>>();
+        internal static ThreadSafeCache<Type, Func<IJsonReader, string, object>> _typeFactories = new ThreadSafeCache<Type, Func<IJsonReader, string, object>>();
     }
 }

+ 1 - 1
Topten.JsonKit/ThreadSafeCache.cs

@@ -23,7 +23,7 @@ using System.Threading;
 
 namespace Topten.JsonKit
 {
-    public class ThreadSafeCache<TKey, TValue>
+    class ThreadSafeCache<TKey, TValue>
     {
         public ThreadSafeCache()
         {

+ 21 - 0
Topten.JsonKit/Token.cs

@@ -24,16 +24,37 @@ namespace Topten.JsonKit
     [Obfuscation(Exclude = true, ApplyToMembers = true)]
     public enum Token
     {
+        /// <summary>End of file</summary>
         EOF,
+
+        /// <summary>An identifier</summary>
         Identifier,
+
+        /// <summary>A literal value</summary>
         Literal,
+
+        /// <summary>An open brace '{'</summary>
         OpenBrace,
+
+        /// <summary>A closing brace '}'</summary>
         CloseBrace,
+
+        /// <summary>An open square bracket '['</summary>
         OpenSquare,
+
+        /// <summary>A closing square bracket ']'</summary>
         CloseSquare,
+
+        /// <summary>An equal sign '='</summary>
         Equal,
+
+        /// <summary>A colon ':'</summary>
         Colon,
+
+        /// <summary>A semi-colon ';'</summary>
         SemiColon,
+
+        /// <summary>A comma ','</summary>
         Comma,
     }
 }

+ 1 - 1
Topten.JsonKit/Tokenizer.cs

@@ -24,7 +24,7 @@ using System.Globalization;
 
 namespace Topten.JsonKit
 {
-    public class Tokenizer
+    class Tokenizer
     {
         public Tokenizer(TextReader r, JsonOptions options)
         {

+ 2 - 20
Topten.JsonKit/Topten.JsonKit.csproj

@@ -1,20 +1,14 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-  <Import Project="../version.props" />
+  <Import Project="../buildtools/Topten.props" />
 
   <PropertyGroup>
     <TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
-    <Configurations>Debug;Release</Configurations>
-    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
-    <OutputPath>..\Build\$(Configuration)\$(MSBuildProjectName)</OutputPath>
-    <IntermediateOutputPath>..\Build\$(Configuration)\$(MSBuildProjectName)\obj</IntermediateOutputPath>
-    <GenerateFullPaths>True</GenerateFullPaths>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(Configuration)'=='Release'">
+    <TtsCodeSign>True</TtsCodeSign>
     <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
-    <Company>Topten Software</Company>
-    <Authors>Topten Software</Authors>
     <Copyright>Copyright © 2014-2020 Topten Software.  All Rights Reserved</Copyright>
     <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
     <PackageIcon>nuget-icon.png</PackageIcon>
@@ -24,16 +18,4 @@
     <RepositoryUrl>https://github.com/toptensoftware/jsonkit</RepositoryUrl>
   </PropertyGroup>
 
-  <ItemGroup>
-    <Compile Include="..\version.cs" Link="version.cs" />
-  </ItemGroup>
-
-  <Target Name="Code Sign" AfterTargets="Build" Condition="'$(Configuration)'=='Release' And '$(TargetFileName)'!=''">
-      <Exec Command="ttssign $(TargetDir)$(TargetFileName)" />
-  </Target>
-
-  <ItemGroup>
-      <None Include="../Artwork/nuget-icon.png" Pack="true" PackagePath=""/>
-  </ItemGroup>
-
 </Project>

+ 6 - 8
build.js

@@ -1,8 +1,5 @@
 var bt = require('./buildtools/buildTools.js')
 
-// Load version info
-bt.version();
-
 if (bt.options.official)
 {
     // Check everything committed
@@ -12,21 +9,22 @@ if (bt.options.official)
     bt.clock_version();
 
     // Clean build directory
-    bt.cli("rm -rf ./Build");
+    bt.run("rm -rf ./Build");
 }
 
 // Build
-bt.cli("dotnet build Topten.JsonKit -c Release")
+bt.run("dotnet build Topten.JsonKit -c Release")
 
 if (bt.options.official)
 {
-    bt.cli("dotnet test Topten.JsonKit.Test -c Release");
+    // Run tests
+    bt.run("dotnet test Topten.JsonKit.Test -c Release");
 
     // Tag and commit
     bt.git_tag();
 
     // Push nuget package
-    bt.cli(`dotnet nuget push`,
-           `./Build/Release/Topten.JsonKit/*.${bt.options.version.build}.nupkg`,
+    bt.run(`dotnet nuget push`,
+           `./Build/Release/*.${bt.options.version.build}.nupkg`,
            `--source "Topten GitHub"`);
 }

+ 5 - 5
version.cs

@@ -2,14 +2,14 @@
 // Generated by build tool, do not edit
 using System;
 using System.Reflection;
-[assembly: AssemblyCopyright("Copyright © 2014-2020 undefined. All Rights Reserved")]
-[assembly: AssemblyVersion("1.1.117")]
-[assembly: AssemblyFileVersion("1.1.117")]
-[assembly: AssemblyCompany("undefined")]
+[assembly: AssemblyCopyright("Copyright © 2014-2020 Topten Software. All Rights Reserved")]
+[assembly: AssemblyVersion("1.1.119")]
+[assembly: AssemblyFileVersion("1.1.119")]
+[assembly: AssemblyCompany("Topten Software")]
 [assembly: AssemblyProduct("JsonKit")]
 
 static class BuildInfo
 {
-	public static DateTime Date = new DateTime(2020, 6, 22, 5, 51, 12, DateTimeKind.Utc);
+	public static DateTime Date = new DateTime(2020, 6, 23, 1, 39, 34, DateTimeKind.Utc);
 }
 	

+ 0 - 7
version.h

@@ -1,7 +0,0 @@
-
-#define VER_A		1
-#define VER_B		1
-#define VER_C		117
-#define VER_D		0
-#define COPYRIGHT_STRING "Copyright © 2014-2020 undefined. All Rights Reserved\0"
-	

+ 3 - 2
version.json

@@ -1,7 +1,8 @@
 {
     "major": 1,
     "minor": 1,
-    "build": 117,
+    "build": 119,
     "copyrightYear": 2014,
-    "productName": "JsonKit"
+    "productName": "JsonKit",
+    "companyName": "Topten Software"
 }

+ 1 - 1
version.props

@@ -2,7 +2,7 @@
 <!-- Generated by build tool, do not edit -->
 <Project>
   <PropertyGroup>
-  	<Version Condition="'$(Variable)' == ''">1.1.117</Version>
+  	<Version Condition="'$(Variable)' == ''">1.1.119</Version>
   </PropertyGroup>
 </Project>