Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
85ed4edc
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,发现更多精彩内容 >>
提交
85ed4edc
编写于
7月 27, 2016
作者:
J
Jared Parsons
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More fixups
上级
1bd213bb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
12 deletion
+14
-12
src/Tools/RepoUtil/ChangeCommand.cs
src/Tools/RepoUtil/ChangeCommand.cs
+3
-0
src/Tools/RepoUtil/ProjectJsonUtil.cs
src/Tools/RepoUtil/ProjectJsonUtil.cs
+1
-1
src/Tools/RepoUtil/VerifyCommand.cs
src/Tools/RepoUtil/VerifyCommand.cs
+10
-11
未找到文件。
src/Tools/RepoUtil/ChangeCommand.cs
浏览文件 @
85ed4edc
...
...
@@ -13,6 +13,9 @@ namespace RepoUtil
{
/// <summary>
/// Responsible for changing the repo to use a new set of NuGet packages.
///
/// TODO: change needs to be concious of version. Can only upgrade the items that have the old
/// version. Needed to support static packages.
/// </summary>
internal
sealed
class
ChangeCommand
:
ICommand
{
...
...
src/Tools/RepoUtil/ProjectJsonUtil.cs
浏览文件 @
85ed4edc
...
...
@@ -44,7 +44,7 @@ internal static ImmutableArray<NuGetPackage> GetDependencies(string filePath)
/// </summary>
internal
static
bool
ChangeDependencies
(
string
filePath
,
ImmutableDictionary
<
string
,
NuGetPackage
>
changeMap
)
{
var
obj
=
JObject
.
Parse
(
File
.
ReadAllText
(
filePath
));
var
obj
=
JObject
.
Parse
(
File
.
ReadAllText
(
filePath
)
,
new
JsonLoadSettings
()
{
CommentHandling
=
CommentHandling
.
Load
}
);
var
dependencies
=
(
JObject
)
obj
[
"dependencies"
];
if
(
dependencies
==
null
)
{
...
...
src/Tools/RepoUtil/VerifyCommand.cs
浏览文件 @
85ed4edc
...
...
@@ -36,13 +36,12 @@ internal VerifyCommand(RepoConfig repoConfig, string sourcesPath)
_sourcesPath
=
sourcesPath
;
}
// TODO: stop using Console.WriteLine
public
bool
Run
(
TextWriter
writer
,
string
[]
args
)
{
return
VerifyPackages
();
return
VerifyPackages
(
writer
);
}
private
bool
VerifyPackages
()
private
bool
VerifyPackages
(
TextWriter
writer
)
{
var
allGood
=
false
;
foreach
(
var
filePath
in
ProjectJsonUtil
.
GetProjectJsonFiles
(
_sourcesPath
))
...
...
@@ -52,14 +51,14 @@ private bool VerifyPackages()
{
if
(
_repoConfig
.
StaticPackages
.
Any
(
x
=>
x
.
Name
==
nugetRef
.
Name
))
{
if
(!
VerifyStaticPackage
(
nugetRef
,
fileName
))
if
(!
VerifyStaticPackage
(
writer
,
nugetRef
,
fileName
))
{
allGood
=
false
;
}
}
else
{
if
(!
VerifyFloatingPackage
(
nugetRef
,
fileName
))
if
(!
VerifyFloatingPackage
(
writer
,
nugetRef
,
fileName
))
{
allGood
=
false
;
}
...
...
@@ -70,7 +69,7 @@ private bool VerifyPackages()
return
allGood
;
}
private
bool
VerifyFloatingPackage
(
NuGetPackage
nugetRef
,
FileName
fileName
)
private
bool
VerifyFloatingPackage
(
TextWriter
writer
,
NuGetPackage
nugetRef
,
FileName
fileName
)
{
NuGetReferenceSource
source
;
if
(
_floatingPackageMap
.
TryGetValue
(
nugetRef
.
Name
,
out
source
))
...
...
@@ -80,9 +79,9 @@ private bool VerifyFloatingPackage(NuGetPackage nugetRef, FileName fileName)
return
true
;
}
Console
.
WriteLine
(
$"Package
{
nugetRef
.
Name
}
version differs in:"
);
Console
.
WriteLine
(
$"\t
{
fileName
}
at
{
nugetRef
.
Version
}
"
);
Console
.
WriteLine
(
$"\t
{
source
.
FileName
}
at
{
source
.
NuGetReference
.
Version
}
"
);
writer
.
WriteLine
(
$"Package
{
nugetRef
.
Name
}
version differs in:"
);
writer
.
WriteLine
(
$"\t
{
fileName
}
at
{
nugetRef
.
Version
}
"
);
writer
.
WriteLine
(
$"\t
{
source
.
FileName
}
at
{
source
.
NuGetReference
.
Version
}
"
);
return
false
;
}
...
...
@@ -90,13 +89,13 @@ private bool VerifyFloatingPackage(NuGetPackage nugetRef, FileName fileName)
return
true
;
}
private
bool
VerifyStaticPackage
(
NuGetPackage
nugetRef
,
FileName
fileName
)
private
bool
VerifyStaticPackage
(
TextWriter
writer
,
NuGetPackage
nugetRef
,
FileName
fileName
)
{
Debug
.
Assert
(
_repoConfig
.
StaticPackagesMap
.
ContainsKey
(
nugetRef
.
Name
));
var
versions
=
_repoConfig
.
StaticPackagesMap
[
nugetRef
.
Name
];
if
(!
versions
.
Contains
(
nugetRef
.
Version
))
{
Console
.
WriteLine
(
$"Package
{
nugetRef
.
Name
}
at version
{
nugetRef
.
Version
}
in
{
fileName
}
is not a valid version"
);
writer
.
WriteLine
(
$"Package
{
nugetRef
.
Name
}
at version
{
nugetRef
.
Version
}
in
{
fileName
}
is not a valid version"
);
return
false
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录