Skip to content

Commit

Permalink
降低脚本对新版C#语法的依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Jun 20, 2018
1 parent 52da8a7 commit 4bc7c15
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions 发布NuGet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ static void Main()
cfg.Metadata.Repository = rep;*/

// 清空依赖
var dgs = cfg.Metadata?.DependencySets;
dgs?.Clear();
var dgs = cfg.Metadata.DependencySets;
if (dgs != null) dgs.Clear();
//var dgs = cfg.Metadata.DependencyGroups;
//dps.RemoveAll(e => e.Id == "SampleDependency");

Expand Down Expand Up @@ -149,7 +149,7 @@ static void AddFile(Manifest cfg, String name, String exts, String src, String t
//XTrace.WriteLine("目录:{0} 文件:{1}", src.AsDirectory().FullName, fs.Count);
if(fs.Count == 0) return;

var dgs = cfg.Metadata?.DependencySets;
var dgs = cfg.Metadata.DependencySets;
var dg = new ManifestDependencySet();
switch(target.Substring(@"\"))
{
Expand All @@ -172,7 +172,7 @@ static void AddFile(Manifest cfg, String name, String exts, String src, String t
dg.Dependencies.Add(md);
}*/

if(!dg.TargetFramework.IsNullOrEmpty()) dgs.Add(dg);
if(dgs !=null && !dg.TargetFramework.IsNullOrEmpty()) dgs.Add(dg);

XTrace.WriteLine("目录:{0} 框架:{1} 文件:{2}", src, dg.TargetFramework, fs.Count);

Expand Down

0 comments on commit 4bc7c15

Please sign in to comment.