Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
75d8b7f5
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
75d8b7f5
编写于
7月 29, 2016
作者:
J
Jared Parsons
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Changed the terminology to fixed over static
上级
68e4eb2d
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
26 addition
and
124 deletion
+26
-124
src/Tools/RepoUtil/ConsumesCommand.cs
src/Tools/RepoUtil/ConsumesCommand.cs
+4
-4
src/Tools/RepoUtil/Data.cs
src/Tools/RepoUtil/Data.cs
+0
-98
src/Tools/RepoUtil/RepoConfig.cs
src/Tools/RepoUtil/RepoConfig.cs
+15
-14
src/Tools/RepoUtil/RepoData.cs
src/Tools/RepoUtil/RepoData.cs
+5
-5
src/Tools/RepoUtil/RepoData.json
src/Tools/RepoUtil/RepoData.json
+1
-1
src/Tools/RepoUtil/RepoUtil.csproj
src/Tools/RepoUtil/RepoUtil.csproj
+0
-1
src/Tools/RepoUtil/VerifyCommand.cs
src/Tools/RepoUtil/VerifyCommand.cs
+1
-1
未找到文件。
src/Tools/RepoUtil/ConsumesCommand.cs
浏览文件 @
75d8b7f5
...
...
@@ -31,20 +31,20 @@ public bool Run(TextWriter writer, string[] args)
private
JObject
GoCore
()
{
var
obj
=
new
JObject
();
obj
.
Add
(
Get
Static
Packages
());
obj
.
Add
(
Get
Fixed
Packages
());
obj
.
Add
(
GetBuildPackages
());
obj
.
Add
(
GetToolsetPackages
());
return
obj
;
}
private
JProperty
Get
Static
Packages
()
private
JProperty
Get
Fixed
Packages
()
{
var
obj
=
new
JObject
();
foreach
(
var
pair
in
_repoData
.
Static
PackagesMap
.
OrderBy
(
x
=>
x
.
Key
))
foreach
(
var
pair
in
_repoData
.
Fixed
PackagesMap
.
OrderBy
(
x
=>
x
.
Key
))
{
obj
.
Add
(
GetProperty
(
pair
.
Key
,
pair
.
Value
));
}
return
new
JProperty
(
"
static
"
,
obj
);
return
new
JProperty
(
"
fixed
"
,
obj
);
}
private
JProperty
GetBuildPackages
()
...
...
src/Tools/RepoUtil/Data.cs
已删除
100644 → 0
浏览文件 @
68e4eb2d
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Immutable
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
RepoUtil
{
internal
static
class
Data
{
/// <summary>
/// The dependencies in these project.json files are expected to be regularly updated by
/// repo full stack builds.
/// </summary>
private
static
readonly
string
[]
s_floatingList
=
new
[]
{
@"build\MSBuildToolset\project.json"
,
@"build\ToolsetPackages\project.json"
,
@"src\Compilers\Core\MSBuildTask\Desktop\project.json"
,
@"src\Compilers\Core\MSBuildTask\Portable\project.json"
,
@"src\Compilers\Core\MSBuildTaskTests\project.json"
,
@"src\Compilers\CSharp\csc\project.json"
,
@"src\Compilers\Extension\project.json"
,
@"src\Compilers\Server\VBCSCompilerTests\project.json"
,
@"src\Compilers\VisualBasic\vbc\project.json"
,
@"src\Dependencies\Composition\project.json"
,
@"src\Dependencies\DiaSymReader\project.json"
,
@"src\Dependencies\DiaSymReader.PortablePdb\project.json"
,
@"src\Dependencies\Immutable\project.json"
,
@"src\Dependencies\Metadata\project.json"
,
@"src\Dependencies\Moq.net\project.json"
,
@"src\Dependencies\VisualStudio\project.json"
,
@"src\Dependencies\VisualStudioEditor\project.json"
,
@"src\Dependencies\VisualStudioText\project.json"
,
@"src\Dependencies\xUnit.net\project.json"
,
@"src\EditorFeatures\Core\project.json"
,
@"src\EditorFeatures\Next\project.json"
,
@"src\EditorFeatures\Test\project.json"
,
@"src\ExpressionEvaluator\Core\Source\ResultProvider\NetFX20\project.json"
,
@"src\ExpressionEvaluator\Core\Test\ExpressionCompiler\project.json"
,
@"src\ExpressionEvaluator\Core\Test\ResultProvider\project.json"
,
@"src\ExpressionEvaluator\CSharp\Source\ResultProvider\NetFX20\project.json"
,
@"src\ExpressionEvaluator\CSharp\Test\ExpressionCompiler\project.json"
,
@"src\ExpressionEvaluator\VisualBasic\Source\ResultProvider\NetFX20\project.json"
,
@"src\InteractiveWindow\EditorTest\project.json"
,
@"src\InteractiveWindow\VisualStudio\project.json"
,
@"src\Scripting\Core\project.json"
,
@"src\Scripting\CSharp\project.json"
,
@"src\Scripting\CSharpTest\project.json"
,
@"src\Scripting\CSharpTest.Desktop\project.json"
,
@"src\Scripting\VisualBasic\project.json"
,
@"src\Scripting\VisualBasicTest\project.json"
,
@"src\Test\DeployCoreClrTestRuntime\project.json"
,
@"src\Test\PdbUtilities\project.json"
,
@"src\Test\Perf\Runner\project.json"
,
@"src\Test\Utilities\Desktop\project.json"
,
@"src\Test\Utilities\Portable\project.json"
,
@"src\Test\Utilities\Portable.FX45\project.json"
,
@"src\VisualStudio\Core\Def\project.json"
,
@"src\VisualStudio\Core\Impl\project.json"
,
@"src\VisualStudio\Core\SolutionExplorerShim\project.json"
,
@"src\VisualStudio\Setup\project.json"
,
@"src\VisualStudio\TestSetup\project.json"
,
@"src\Workspaces\Core\Desktop\project.json"
,
@"src\Workspaces\Core\Portable\project.json"
,
};
/// <summary>
/// The dependencies listed in this file are not expected to change on repo builds. Only when
/// the tool itself needs to be updated.
/// </summary>
private
static
readonly
string
[]
s_staticList
=
new
[]
{
@"src\Tools\BuildUtil\BuildUtil\project.json"
,
@"src\Tools\CommonCoreClrRuntime\project.json"
,
@"src\Tools\CommonNetCoreReferences\project.json"
,
@"src\Tools\ProcessWatchdog\project.json"
,
@"src\Tools\RepoUtil\project.json"
,
@"src\Tools\SignRoslyn\project.json"
,
@"src\Tools\Source\CompilerGeneratorTools\DeployCompilerGeneratorToolsRuntime\project.json"
,
@"src\Tools\Source\CompilerGeneratorTools\Source\BoundTreeGenerator\project.json"
,
@"src\Tools\Source\CompilerGeneratorTools\Source\CSharpErrorFactsGenerator\project.json"
,
@"src\Tools\Source\CompilerGeneratorTools\Source\CSharpSyntaxGenerator\project.json"
,
@"src\Tools\Source\CompilerGeneratorTools\Source\VisualBasicErrorFactsGenerator\project.json"
,
@"src\Tools\Source\CompilerGeneratorTools\Source\VisualBasicSyntaxGenerator\project.json"
,
@"src\Tools\Source\RunTests\project.json"
,
};
internal
static
readonly
ImmutableArray
<
string
>
FloatingList
=
s_floatingList
.
OrderBy
(
x
=>
x
).
ToImmutableArray
();
internal
static
readonly
ImmutableArray
<
string
>
StaticList
=
s_staticList
.
OrderBy
(
x
=>
x
).
ToImmutableArray
();
internal
static
ImmutableArray
<
FileName
>
GetFloatingFileNames
(
string
sourcesPath
)
{
return
s_floatingList
.
Select
(
x
=>
new
FileName
(
sourcesPath
,
x
)).
ToImmutableArray
();
}
}
}
src/Tools/RepoUtil/RepoConfig.cs
浏览文件 @
75d8b7f5
...
...
@@ -13,7 +13,7 @@ namespace RepoUtil
/// <summary>
/// Packages in the repo fall into the following groups:
///
///
Static
Packages:
///
Fixed
Packages:
///
/// These are packages which should never change. In other words if there was a scenario where a new version of the
/// package was available the reference should not update to the new version. For all time it should remain at the
...
...
@@ -37,27 +37,28 @@ namespace RepoUtil
/// </summary>
internal
class
RepoConfig
{
internal
ImmutableArray
<
NuGetPackage
>
StaticPackages
{
get
;
}
internal
ImmutableDictionary
<
string
,
ImmutableArray
<
string
>>
StaticPackagesMap
{
get
;
}
internal
ImmutableArray
<
NuGetPackage
>
FixedPackages
{
get
;
}
// TODO: is this map needed?
internal
ImmutableDictionary
<
string
,
ImmutableArray
<
string
>>
FixedPackagesMap
{
get
;
}
internal
ImmutableArray
<
string
>
ToolsetPackages
{
get
;
}
internal
ImmutableArray
<
Regex
>
NuSpecExcludes
{
get
;
}
internal
GenerateData
?
MSBuildGenerateData
{
get
;
}
internal
RepoConfig
(
IEnumerable
<
NuGetPackage
>
static
Packages
,
IEnumerable
<
NuGetPackage
>
fixed
Packages
,
IEnumerable
<
string
>
toolsetPackages
,
IEnumerable
<
Regex
>
nuspecExcludes
,
GenerateData
?
msbuildGenerateData
)
{
MSBuildGenerateData
=
msbuildGenerateData
;
StaticPackages
=
static
Packages
.
OrderBy
(
x
=>
x
.
Name
).
ToImmutableArray
();
FixedPackages
=
fixed
Packages
.
OrderBy
(
x
=>
x
.
Name
).
ToImmutableArray
();
NuSpecExcludes
=
nuspecExcludes
.
ToImmutableArray
();
// TODO: Validate duplicate names in the floating lists
ToolsetPackages
=
toolsetPackages
.
OrderBy
(
x
=>
x
).
ToImmutableArray
();
var
map
=
new
Dictionary
<
string
,
List
<
string
>>();
foreach
(
var
nugetRef
in
static
Packages
)
foreach
(
var
nugetRef
in
fixed
Packages
)
{
List
<
string
>
list
;
if
(!
map
.
TryGetValue
(
nugetRef
.
Name
,
out
list
))
...
...
@@ -69,10 +70,10 @@ internal class RepoConfig
list
.
Add
(
nugetRef
.
Version
);
}
Static
PackagesMap
=
ImmutableDictionary
<
string
,
ImmutableArray
<
string
>>.
Empty
;
Fixed
PackagesMap
=
ImmutableDictionary
<
string
,
ImmutableArray
<
string
>>.
Empty
;
foreach
(
var
pair
in
map
)
{
StaticPackagesMap
=
Static
PackagesMap
.
Add
(
pair
.
Key
,
pair
.
Value
.
ToImmutableArray
());
FixedPackagesMap
=
Fixed
PackagesMap
.
Add
(
pair
.
Key
,
pair
.
Value
.
ToImmutableArray
());
}
}
...
...
@@ -80,22 +81,22 @@ internal static RepoConfig ReadFrom(string jsonFilePath)
{
// Need to track any file that has dependencies
var
obj
=
JObject
.
Parse
(
File
.
ReadAllText
(
jsonFilePath
));
var
staticPackages
=
(
JObject
)
obj
[
"static
Packages"
];
var
static
PackagesList
=
ImmutableArray
.
CreateBuilder
<
NuGetPackage
>();
foreach
(
var
prop
in
static
Packages
.
Properties
())
var
fixedPackages
=
(
JObject
)
obj
[
"fixed
Packages"
];
var
fixed
PackagesList
=
ImmutableArray
.
CreateBuilder
<
NuGetPackage
>();
foreach
(
var
prop
in
fixed
Packages
.
Properties
())
{
if
(
prop
.
Value
.
Type
==
JTokenType
.
String
)
{
var
version
=
(
string
)
prop
.
Value
;
var
nugetRef
=
new
NuGetPackage
(
prop
.
Name
,
version
);
static
PackagesList
.
Add
(
nugetRef
);
fixed
PackagesList
.
Add
(
nugetRef
);
}
else
{
foreach
(
var
version
in
((
JArray
)
prop
.
Value
).
Values
<
string
>())
{
var
nugetRef
=
new
NuGetPackage
(
prop
.
Name
,
version
);
static
PackagesList
.
Add
(
nugetRef
);
fixed
PackagesList
.
Add
(
nugetRef
);
}
}
}
...
...
@@ -118,7 +119,7 @@ internal static RepoConfig ReadFrom(string jsonFilePath)
}
return
new
RepoConfig
(
static
PackagesList
,
fixed
PackagesList
,
toolsetPackages
,
nuspecExcludes
,
msbuildGenerateData
);
...
...
src/Tools/RepoUtil/RepoData.cs
浏览文件 @
75d8b7f5
...
...
@@ -16,9 +16,9 @@ internal sealed class RepoData
internal
ImmutableArray
<
NuGetPackage
>
FloatingBuildPackages
{
get
;
}
internal
ImmutableArray
<
NuGetPackage
>
FloatingToolsetPackages
{
get
;
}
internal
ImmutableArray
<
NuGetPackage
>
FloatingPackages
{
get
;
}
internal
ImmutableArray
<
NuGetPackage
>
StaticPackages
=>
RepoConfig
.
Static
Packages
;
internal
ImmutableArray
<
NuGetPackage
>
FixedPackages
=>
RepoConfig
.
Fixed
Packages
;
internal
ImmutableArray
<
NuGetPackage
>
AllPackages
{
get
;
}
internal
ImmutableDictionary
<
string
,
ImmutableArray
<
string
>>
StaticPackagesMap
=>
RepoConfig
.
Static
PackagesMap
;
internal
ImmutableDictionary
<
string
,
ImmutableArray
<
string
>>
FixedPackagesMap
=>
RepoConfig
.
Fixed
PackagesMap
;
internal
RepoData
(
RepoConfig
config
,
string
sourcesPath
,
IEnumerable
<
NuGetPackage
>
floatingPackages
)
{
...
...
@@ -35,7 +35,7 @@ internal RepoData(RepoConfig config, string sourcesPath, IEnumerable<NuGetPackag
FloatingPackages
=
floatingPackages
.
OrderBy
(
x
=>
x
.
Name
)
.
ToImmutableArray
();
AllPackages
=
Combine
(
FloatingBuildPackages
,
FloatingToolsetPackages
,
Static
Packages
);
AllPackages
=
Combine
(
FloatingBuildPackages
,
FloatingToolsetPackages
,
Fixed
Packages
);
}
private
static
ImmutableArray
<
NuGetPackage
>
Combine
(
params
ImmutableArray
<
NuGetPackage
>[]
args
)
...
...
@@ -47,7 +47,7 @@ private static ImmutableArray<NuGetPackage> Combine(params ImmutableArray<NuGetP
}
/// <summary>
/// The raw RepoData contains only the
static
+ toolset packages that we need to track. This method will examine the current
/// The raw RepoData contains only the
fixed
+ toolset packages that we need to track. This method will examine the current
/// state of the repo and add in the current data.
/// </summary>
internal
static
RepoData
Create
(
RepoConfig
config
,
string
sourcesPath
)
...
...
@@ -57,7 +57,7 @@ internal static RepoData Create(RepoConfig config, string sourcesPath)
{
foreach
(
var
nuget
in
ProjectJsonUtil
.
GetDependencies
(
fileName
))
{
if
(
config
.
Static
PackagesMap
.
ContainsKey
(
nuget
.
Name
))
if
(
config
.
Fixed
PackagesMap
.
ContainsKey
(
nuget
.
Name
))
{
continue
;
}
...
...
src/Tools/RepoUtil/RepoData.json
浏览文件 @
75d8b7f5
{
"
static
Packages"
:
{
"
fixed
Packages"
:
{
"Microsoft.Build.Framework"
:
[
"0.1.0-preview-00005"
,
"0.1.0-preview-00023-160527"
],
"Microsoft.Build.Tasks.Core"
:
[
"0.1.0-preview-00005"
,
"0.1.0-preview-00023-160527"
],
"Microsoft.Build.Utilities.Core"
:
[
"0.1.0-preview-00005"
,
"0.1.0-preview-00023-160527"
],
...
...
src/Tools/RepoUtil/RepoUtil.csproj
浏览文件 @
75d8b7f5
...
...
@@ -43,7 +43,6 @@
<Compile
Include=
"ChangeCommand.cs"
/>
<Compile
Include=
"Constants.cs"
/>
<Compile
Include=
"ConsumesCommand.cs"
/>
<Compile
Include=
"Data.cs"
/>
<Compile
Include=
"FileName.cs"
/>
<Compile
Include=
"GenerateData.cs"
/>
<Compile
Include=
"GenerateUtil.cs"
/>
...
...
src/Tools/RepoUtil/VerifyCommand.cs
浏览文件 @
75d8b7f5
...
...
@@ -48,7 +48,7 @@ private bool VerifyProjectJsonContents(TextWriter writer)
{
writer
.
WriteLine
(
$"Verifying project.json contents"
);
var
allGood
=
true
;
var
staticPackageSet
=
new
HashSet
<
NuGetPackage
>(
_repoConfig
.
Static
Packages
);
var
staticPackageSet
=
new
HashSet
<
NuGetPackage
>(
_repoConfig
.
Fixed
Packages
);
var
floatingPackageMap
=
new
Dictionary
<
string
,
NuGetPackageSource
>(
Constants
.
NugetPackageNameComparer
);
foreach
(
var
filePath
in
ProjectJsonUtil
.
GetProjectJsonFiles
(
_sourcesPath
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录