From 8c8977e4b621e2c822f152a8a2f352739c56c848 Mon Sep 17 00:00:00 2001 From: Jonathan Channon Date: Wed, 6 Jul 2016 10:27:56 +0100 Subject: [PATCH] Removed json.net cake dependency --- build.cake | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/build.cake b/build.cake index a90ff62..3faa4cd 100644 --- a/build.cake +++ b/build.cake @@ -1,5 +1,3 @@ -#addin "nuget:?package=Newtonsoft.Json&version=8.0.3" - // Usings using System.Xml; using System.Xml.Linq; @@ -48,12 +46,11 @@ Task("Update-Version") } var file = new FilePath("src/Nancy.Serialization.ServiceStack/project.json"); - var project = Newtonsoft.Json.Linq.JObject.Parse( - System.IO.File.ReadAllText(file.FullPath, Encoding.UTF8)); - - project["version"].Replace(version); - - System.IO.File.WriteAllText(file.FullPath, project.ToString(), Encoding.UTF8); + var project = System.IO.File.ReadAllText(file.FullPath, Encoding.UTF8); + + project = System.Text.RegularExpressions.Regex.Replace(project, "(\"version\":\\s*)\".+\"", "$1\"" + version + "\""); + + System.IO.File.WriteAllText(file.FullPath, project, Encoding.UTF8); }); @@ -194,4 +191,4 @@ Task("Mono") /////////////////////////////////////////////////////////////// -RunTarget(target); \ No newline at end of file +RunTarget(target);