Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
55979af7
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,发现更多精彩内容 >>
提交
55979af7
编写于
7月 27, 2016
作者:
J
Jared Parsons
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Basic form of produces
上级
5e455efc
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
109 addition
and
6 deletion
+109
-6
src/NuGet/Roslyn.VisualStudio.Test.Utilities.nuspec
src/NuGet/Roslyn.VisualStudio.Test.Utilities.nuspec
+2
-2
src/Tools/BuildUtil/BuildUtil/BuildUtil.nuspec
src/Tools/BuildUtil/BuildUtil/BuildUtil.nuspec
+1
-1
src/Tools/RepoUtil/NuSpecUtil.cs
src/Tools/RepoUtil/NuSpecUtil.cs
+32
-0
src/Tools/RepoUtil/ProduceUtil.cs
src/Tools/RepoUtil/ProduceUtil.cs
+34
-0
src/Tools/RepoUtil/Program.cs
src/Tools/RepoUtil/Program.cs
+12
-0
src/Tools/RepoUtil/RepoConfig.cs
src/Tools/RepoUtil/RepoConfig.cs
+15
-1
src/Tools/RepoUtil/RepoData.json
src/Tools/RepoUtil/RepoData.json
+11
-2
src/Tools/RepoUtil/RepoUtil.csproj
src/Tools/RepoUtil/RepoUtil.csproj
+2
-0
未找到文件。
src/NuGet/Roslyn.VisualStudio.Test.Utilities.nuspec
浏览文件 @
55979af7
<?xml version="1.0"?>
<package
>
<package
xmlns=
"http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"
>
<metadata>
<id>
Roslyn.VisualStudio.Test.Utilities
</id>
<description>
Utility methods used to run Roslyn Visual Studio integration tests.
</description>
...
...
@@ -19,4 +19,4 @@
<files>
<file
src=
"Roslyn.VisualStudio.Test.Utilities.dll"
target=
"lib\net46"
/>
</files>
</package>
\ No newline at end of file
</package>
src/Tools/BuildUtil/BuildUtil/BuildUtil.nuspec
浏览文件 @
55979af7
<?xml version="1.0" encoding="utf-8"?>
<package>
<package
xmlns=
"http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"
>
<metadata>
<id>
Roslyn.Build.Util
</id>
<version>
0.9.4-portable
</version>
...
...
src/Tools/RepoUtil/NuSpecUtil.cs
0 → 100644
浏览文件 @
55979af7
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml.Linq
;
namespace
RepoUtil
{
internal
static
class
NuSpecUtil
{
internal
static
IEnumerable
<
FileName
>
GetNuSpecFiles
(
string
sourcesPath
)
{
return
Directory
.
EnumerateFiles
(
sourcesPath
,
"*.nuspec"
,
SearchOption
.
AllDirectories
)
.
Select
(
x
=>
FileName
.
FromFullPath
(
sourcesPath
,
x
));
}
internal
static
string
GetId
(
string
nuspecFilePath
)
{
var
doc
=
XDocument
.
Load
(
nuspecFilePath
);
var
ns
=
XNamespace
.
Get
(
"http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"
);
var
id
=
doc
.
Element
(
ns
.
GetName
(
"package"
))
.
Element
(
ns
.
GetName
(
"metadata"
))
.
Element
(
ns
.
GetName
(
"id"
))
.
Value
;
return
id
;
}
}
}
src/Tools/RepoUtil/ProduceUtil.cs
0 → 100644
浏览文件 @
55979af7
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
RepoUtil
{
internal
class
ProduceUtil
{
private
readonly
RepoConfig
_repoConfig
;
private
readonly
string
_sourcesPath
;
internal
ProduceUtil
(
RepoConfig
repoConfig
,
string
sourcesPath
)
{
_repoConfig
=
repoConfig
;
_sourcesPath
=
sourcesPath
;
}
internal
void
Go
()
{
foreach
(
var
fileName
in
NuSpecUtil
.
GetNuSpecFiles
(
_sourcesPath
))
{
if
(
_repoConfig
.
NuSpecExcludes
.
Any
(
x
=>
x
.
IsMatch
(
fileName
.
RelativePath
)))
{
continue
;
}
var
id
=
NuSpecUtil
.
GetId
(
fileName
.
FullPath
);
Console
.
WriteLine
(
id
);
}
}
}
}
src/Tools/RepoUtil/Program.cs
浏览文件 @
55979af7
...
...
@@ -16,6 +16,7 @@ private enum Mode
Verify
,
Consumes
,
Change
,
Produces
,
}
internal
static
readonly
string
[]
ProjectJsonFileRelativeNames
=
Array
.
Empty
<
string
>();
...
...
@@ -54,6 +55,12 @@ private static bool Run(string[] args)
util
.
ChangeAll
();
return
true
;
}
case
Mode
.
Produces
:
{
var
util
=
new
ProduceUtil
(
repoConfig
,
sourcesPath
);
util
.
Go
();
return
true
;
}
default
:
throw
new
Exception
(
"Unrecognized mode"
);
}
...
...
@@ -69,6 +76,7 @@ private static void Usage()
Console
.
Write
(
text
);
}
// TODO: don't use dashes here.
private
static
bool
TryParseCommandLine
(
string
[]
args
,
out
Mode
mode
,
out
string
sourcesPath
)
{
var
allGood
=
true
;
...
...
@@ -94,6 +102,10 @@ private static bool TryParseCommandLine(string[] args, out Mode mode, out string
mode
=
Mode
.
Change
;
index
++;
break
;
case
"-produces"
:
mode
=
Mode
.
Produces
;
index
++;
break
;
default
:
Console
.
Write
(
$"Option
{
arg
}
is unrecognized"
);
allGood
=
false
;
...
...
src/Tools/RepoUtil/RepoConfig.cs
浏览文件 @
55979af7
...
...
@@ -40,12 +40,18 @@ internal class RepoConfig
internal
ImmutableArray
<
NuGetPackage
>
StaticPackages
{
get
;
}
internal
ImmutableDictionary
<
string
,
ImmutableArray
<
string
>>
StaticPackagesMap
{
get
;
}
internal
ImmutableArray
<
string
>
ToolsetPackages
{
get
;
}
internal
ImmutableArray
<
Regex
>
NuSpecExcludes
{
get
;
}
internal
GenerateData
?
MSBuildGenerateData
{
get
;
}
internal
RepoConfig
(
IEnumerable
<
NuGetPackage
>
staticPackages
,
IEnumerable
<
string
>
toolsetPackages
,
GenerateData
?
msbuildGenerateData
)
internal
RepoConfig
(
IEnumerable
<
NuGetPackage
>
staticPackages
,
IEnumerable
<
string
>
toolsetPackages
,
IEnumerable
<
Regex
>
nuspecExcludes
,
GenerateData
?
msbuildGenerateData
)
{
MSBuildGenerateData
=
msbuildGenerateData
;
StaticPackages
=
staticPackages
.
OrderBy
(
x
=>
x
.
Name
).
ToImmutableArray
();
NuSpecExcludes
=
nuspecExcludes
.
ToImmutableArray
();
// TODO: Validate duplicate names in the floating lists
ToolsetPackages
=
toolsetPackages
.
OrderBy
(
x
=>
x
).
ToImmutableArray
();
...
...
@@ -104,9 +110,17 @@ internal static RepoConfig ReadFrom(string jsonFilePath)
msbuildGenerateData
=
ReadGenerateData
(
generateObj
,
"msbuild"
);
}
var
nuspecExcludes
=
new
List
<
Regex
>();
var
nuspecExcludesProp
=
obj
.
Property
(
"nuspecExcludes"
);
if
(
nuspecExcludesProp
!=
null
)
{
nuspecExcludes
.
AddRange
(((
JArray
)
nuspecExcludesProp
.
Value
).
Values
<
string
>().
Select
(
x
=>
new
Regex
(
x
)));
}
return
new
RepoConfig
(
staticPackagesList
,
toolsetPackages
,
nuspecExcludes
,
msbuildGenerateData
);
}
...
...
src/Tools/RepoUtil/RepoData.json
浏览文件 @
55979af7
...
...
@@ -45,7 +45,7 @@
"path"
:
"build
\\
Targets
\\
Dependencies.props"
,
"values"
:
[
"Microsoft.Dia.*"
,
"System
\\
.*"
,
"System.*"
,
"NETStandardLibraryVersion"
,
"MicrosoftCodeAnalysisAnalyzersVersion"
,
"ManagedEsentVersion"
,
...
...
@@ -53,5 +53,14 @@
"MicrosoftCompositionVersion"
]
}
}
},
"nuspecExcludes"
:
[
"^packages.*"
,
"^Binaries.*"
,
"^src
\\\\
Samples.*"
,
"^src
\\\\
Dependencies.*"
,
".*NuSpec.loc.*"
,
".*Templates.*"
]
}
src/Tools/RepoUtil/RepoUtil.csproj
浏览文件 @
55979af7
...
...
@@ -34,6 +34,8 @@
<Compile
Include=
"JsonTypes.cs"
/>
<Compile
Include=
"NuGetPackage.cs"
/>
<Compile
Include=
"NuGetPackageChange.cs"
/>
<Compile
Include=
"NuSpecUtil.cs"
/>
<Compile
Include=
"ProduceUtil.cs"
/>
<Compile
Include=
"Program.cs"
/>
<Compile
Include=
"ProjectJsonUtil.cs"
/>
<Compile
Include=
"RepoConfig.cs"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录