【问题标题】:NDepend Get Third Party references for each project in solutionNDepend 获取解决方案中每个项目的第三方引用
【发布时间】:2015-05-14 15:25:03
【问题描述】:

对于我的解决方案中的每个项目,我想获取它使用的第三方程序集的列表。

我猜是这样的:

    let landscapeAssemblies = from a in JustMyCode.Assemblies
    let thirdPartyAssemblies = from a in ThirdParty.Assemblies

    select new { landscapeAssemblies, thirdPartyAssemblies.UsedBy(landscapeAssemblies) }

但是(就像我的大多数 ndepend 查询一样)我收到错误“查询不完整” - 我不知道该查询是如何不完整的。

我想要返回的是这样的:

Project1 :
          Third Party Assembly 1
          Third Party Assembly 2
          Third Party Assembly 3
Project2:
          etc
          etc

我该怎么做?

【问题讨论】:

    标签: ndepend


    【解决方案1】:

    此查询是否满足您的需求?

    from a in Application.Assemblies
    let thirdPartyAsmUsed = ThirdParty.Assemblies.UsedBy(a)
    select new { a, thirdPartyAsmUsed } 
    

    并且有点机敏,当您处于 diff 模式时,您可以询问应用程序的每个程序集,哪些第三方程序集是自 diff 基线以来新使用的:)

    from a in Application.Assemblies
    where a.IsPresentInBothBuilds()
    let thirdPartyAsmUsedNew = ThirdParty.Assemblies.UsedBy(a)
    let thirdPartyAsmUsedOld = codeBase.OlderVersion().ThirdParty.Assemblies.UsedBy(a.OlderVersion())
    let thirdPartyAsmNewlyUsed =  thirdPartyAsmUsedNew.Except(
                     thirdPartyAsmUsedOld.Where(m=> m.IsPresentInBothBuilds()).Select(m => m.NewerVersion()))
    select new { a, thirdPartyAsmUsedNew, thirdPartyAsmUsedOld, thirdPartyAsmNewlyUsed }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-08
      • 1970-01-01
      • 2019-05-18
      • 2010-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多