Fix deps trimming (#107)

This commit is contained in:
Pavel Krymets 2017-05-05 13:34:58 -07:00 committed by GitHub
parent 214de568a9
commit caaae2003e
1 changed files with 10 additions and 11 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -10,6 +11,7 @@ public class Program
{ {
public static void Main(string[] args) public static void Main(string[] args)
{ {
Console.WriteLine("Trimming main library from " +args[0]);
ChangeEntryPointLibraryName(args[0]); ChangeEntryPointLibraryName(args[0]);
} }
@ -22,7 +24,6 @@ public class Program
deps = JObject.ReadFrom(reader); deps = JObject.ReadFrom(reader);
} }
string version = null;
foreach (JProperty target in deps["targets"]) foreach (JProperty target in deps["targets"])
{ {
var targetLibrary = target.Value.Children<JProperty>().FirstOrDefault(); var targetLibrary = target.Value.Children<JProperty>().FirstOrDefault();
@ -33,8 +34,7 @@ public class Program
targetLibrary.Remove(); targetLibrary.Remove();
} }
if (version != null)
{
var library = deps["libraries"].Children<JProperty>().First(); var library = deps["libraries"].Children<JProperty>().First();
library.Remove(); library.Remove();
@ -45,4 +45,3 @@ public class Program
} }
} }
} }
}