Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
f1056adf
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,发现更多精彩内容 >>
提交
f1056adf
编写于
7月 05, 2017
作者:
J
Jared Parsons
提交者:
GitHub
7月 05, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #20636 from KirillOsenkov/UpdateBinaryLogger
Upgrade to the StructuredLogger 1.1.130.
上级
ed5a25a0
7e5de61d
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
25 addition
and
88 deletion
+25
-88
build/Targets/Packages.props
build/Targets/Packages.props
+1
-1
build/scripts/test-build-correctness.ps1
build/scripts/test-build-correctness.ps1
+2
-2
netci.groovy
netci.groovy
+2
-1
src/Tools/BuildBoss/BuildBoss.csproj
src/Tools/BuildBoss/BuildBoss.csproj
+1
-4
src/Tools/BuildBoss/Program.cs
src/Tools/BuildBoss/Program.cs
+2
-2
src/Tools/BuildBoss/StructuredLoggerCheckerUtil.cs
src/Tools/BuildBoss/StructuredLoggerCheckerUtil.cs
+17
-78
未找到文件。
build/Targets/Packages.props
浏览文件 @
f1056adf
...
...
@@ -17,7 +17,7 @@
<MicrosoftAzureKeyVaultVersion>
2.0.6
</MicrosoftAzureKeyVaultVersion>
<MicrosoftBuildVersion>
15.1.0-preview-000458-02
</MicrosoftBuildVersion>
<MicrosoftBuildFrameworkVersion>
15.1.0-preview-000458-02
</MicrosoftBuildFrameworkVersion>
<MicrosoftBuildLoggingStructuredLoggerVersion>
1.
0.58
</MicrosoftBuildLoggingStructuredLoggerVersion>
<MicrosoftBuildLoggingStructuredLoggerVersion>
1.
1.130
</MicrosoftBuildLoggingStructuredLoggerVersion>
<MicrosoftBuildRuntimeVersion>
15.1.0-preview-000458-02
</MicrosoftBuildRuntimeVersion>
<MicrosoftBuildTasksCoreVersion>
15.1.0-preview-000458-02
</MicrosoftBuildTasksCoreVersion>
<MicrosoftCodeAnalysisAnalyzersVersion>
1.1.0
</MicrosoftCodeAnalysisAnalyzersVersion>
...
...
build/scripts/test-build-correctness.ps1
浏览文件 @
f1056adf
...
...
@@ -25,7 +25,7 @@ try {
# Need to parse out the current NuGet package version of Structured Logger
$structuredLoggerPath
=
Join-Path
(
Get-PackageDir
"Microsoft.Build.Logging.StructuredLogger"
)
"lib\net46\StructuredLogger.dll"
$configDir
=
Join-Path
$binariesDir
$config
$logPath
=
Join-Path
$configDir
"
build.xml
"
$logPath
=
Join-Path
$configDir
"
roslyn.buildlog
"
$solution
=
Join-Path
$repoDir
"Roslyn.sln"
if
(
$msbuild
-eq
""
)
{
...
...
@@ -33,7 +33,7 @@ try {
}
Write-Host
"Building Roslyn.sln with logging support"
Exec-Command
$msbuild
"/v:m /m /p:Configuration=
$config
/logger:StructuredLogger,
$structuredLoggerPath
;
$logPath
/nodeReuse:false /p:DeployExtension=false
$solution
"
Exec-Command
$msbuild
"/
noconlog /
v:m /m /p:Configuration=
$config
/logger:StructuredLogger,
$structuredLoggerPath
;
$logPath
/nodeReuse:false /p:DeployExtension=false
$solution
"
Write-Host
""
# Verify the state of our various build artifacts
...
...
netci.groovy
浏览文件 @
f1056adf
...
...
@@ -18,7 +18,8 @@ static void addRoslynJob(def myJob, String jobName, String branchName, Boolean i
archiveSettings
.
addFiles
(
'Binaries/**/*.dmp'
)
archiveSettings
.
addFiles
(
'Binaries/**/*.zip'
)
archiveSettings
.
addFiles
(
'Binaries/**/*.png'
)
archiveSettings
.
addFiles
(
'Binaries/**/*.xml'
)
archiveSettings
.
addFiles
(
'Binaries/**/*.buildlog'
)
archiveSettings
.
addFiles
(
'Binaries/**/*.binlog'
)
archiveSettings
.
excludeFiles
(
'Binaries/Obj/**'
)
archiveSettings
.
excludeFiles
(
'Binaries/Bootstrap/**'
)
archiveSettings
.
excludeFiles
(
'Binaries/**/nuget*.zip'
)
...
...
src/Tools/BuildBoss/BuildBoss.csproj
浏览文件 @
f1056adf
...
...
@@ -7,7 +7,6 @@
<PlatformTarget>
AnyCPU
</PlatformTarget>
<ProjectGuid>
{9C0660D9-48CA-40E1-BABA-8F6A1F11FE10}
</ProjectGuid>
<OutputType>
Exe
</OutputType>
<AppDesignerFolder>
Properties
</AppDesignerFolder>
<RootNamespace>
BuildBoss
</RootNamespace>
<AssemblyName>
BuildBoss
</AssemblyName>
<TargetFramework>
net46
</TargetFramework>
...
...
@@ -24,6 +23,7 @@
<Reference
Include=
"WindowsBase"
/>
<PackageReference
Include=
"Newtonsoft.Json"
Version=
"$(NewtonsoftJsonVersion)"
/>
<PackageReference
Include=
"System.Collections.Immutable"
Version=
"$(SystemCollectionsImmutableVersion)"
/>
<PackageReference
Include=
"Microsoft.Build.Logging.StructuredLogger"
Version=
"$(MicrosoftBuildLoggingStructuredLoggerVersion)"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"ICheckerUtil.cs"
/>
...
...
@@ -47,8 +47,5 @@
<None
Include=
"App.config"
/>
<None
Include=
"README.md"
/>
</ItemGroup>
<ItemGroup>
<Folder
Include=
"Properties\"
/>
</ItemGroup>
<Import
Project=
"..\..\..\build\Targets\Imports.targets"
/>
</Project>
\ No newline at end of file
src/Tools/BuildBoss/Program.cs
浏览文件 @
f1056adf
...
...
@@ -40,7 +40,7 @@ private static int MainCore(string[] args)
{
allGood
&=
ProcessSolution
(
arg
);
}
else
if
(
Path
.
GetExtension
(
arg
)
==
".xml"
)
else
if
(
string
.
Equals
(
Path
.
GetExtension
(
arg
),
".buildlog"
,
StringComparison
.
OrdinalIgnoreCase
)
)
{
allGood
&=
ProcessStructuredLog
(
arg
);
}
...
...
@@ -89,7 +89,7 @@ private static bool ProcessTargets(string targets)
private
static
bool
ProcessStructuredLog
(
string
logFilePath
)
{
var
util
=
new
StructuredLoggerCheckerUtil
(
XDocument
.
Load
(
logFilePath
)
);
var
util
=
new
StructuredLoggerCheckerUtil
(
logFilePath
);
return
CheckCore
(
util
,
$"Structured log
{
logFilePath
}
"
);
}
...
...
src/Tools/BuildBoss/StructuredLoggerCheckerUtil.cs
浏览文件 @
f1056adf
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml.Linq
;
using
System.Xml.XPath
;
using
Microsoft.Build.Logging.StructuredLogger
;
namespace
BuildBoss
{
/// <summary>
/// Th
e logic from this type is largely copied from
:
/// Th
is type invokes the analyzer here
:
///
/// https://github.com/KirillOsenkov/MSBuildStructuredLog/blob/master/src/StructuredLog
Viewer/Build
Analyzer.cs
/// https://github.com/KirillOsenkov/MSBuildStructuredLog/blob/master/src/StructuredLog
ger/Analyzers/DoubleWrites
Analyzer.cs
///
/// Once structured logger has a command line verification mode this code should be
/// deleted. The caller should instead use the structured logging tool for
/// verification. Until then this is simple enough to duplicate. Feature request
/// is here:
///
/// https://github.com/KirillOsenkov/MSBuildStructuredLog/issues/42
/// </summary>
internal
sealed
class
StructuredLoggerCheckerUtil
:
ICheckerUtil
{
internal
static
readonly
StringComparer
FilePathComparer
=
StringComparer
.
OrdinalIgnoreCase
;
private
const
string
s_copyingFileFrom
=
"Copying file from \""
;
private
const
string
s_creatingHardLink
=
"Creating hard link to copy \""
;
private
const
string
s_didNotCopy
=
"Did not copy from file \""
;
private
const
string
s_to
=
"\" to \""
;
private
readonly
XDocument
_document
;
private
readonly
Dictionary
<
string
,
List
<
string
>>
_copyMap
=
new
Dictionary
<
string
,
List
<
string
>>(
FilePathComparer
);
private
readonly
string
_logFilePath
;
internal
StructuredLoggerCheckerUtil
(
XDocument
document
)
internal
StructuredLoggerCheckerUtil
(
string
logFilePath
)
{
_
document
=
document
;
_
logFilePath
=
logFilePath
;
}
public
bool
Check
(
TextWriter
textWriter
)
{
foreach
(
var
element
in
_document
.
XPathSelectElements
(
"//CopyTask"
))
var
build
=
Serialization
.
Read
(
_logFilePath
);
var
doubleWrites
=
DoubleWritesAnalyzer
.
GetDoubleWrites
(
build
).
ToArray
();
if
(
doubleWrites
.
Any
())
{
foreach
(
var
message
in
element
.
Elements
(
XName
.
Get
(
"Message"
))
)
foreach
(
var
doubleWrite
in
doubleWrites
)
{
ProcessMessage
(
message
);
}
}
var
allGood
=
true
;
foreach
(
var
pair
in
_copyMap
.
OrderBy
(
x
=>
x
.
Key
))
{
var
list
=
pair
.
Value
;
if
(
list
.
Count
>
1
)
{
textWriter
.
WriteLine
(
$"Multiple writes to
{
pair
.
Key
}
"
);
foreach
(
var
item
in
list
)
textWriter
.
WriteLine
(
$"Multiple writes to
{
doubleWrite
.
Key
}
"
);
foreach
(
var
source
in
doubleWrite
.
Value
)
{
textWriter
.
WriteLine
(
$"\t
{
item
}
"
);
textWriter
.
WriteLine
(
$"\t
{
source
}
"
);
}
textWriter
.
WriteLine
(
""
);
allGood
=
false
;
textWriter
.
WriteLine
()
;
}
}
return
allGood
;
}
private
void
ProcessMessage
(
XElement
element
)
{
var
text
=
element
.
Value
.
Trim
();
if
(
text
.
StartsWith
(
s_copyingFileFrom
))
{
ProcessCopyingFileFrom
(
text
,
s_copyingFileFrom
,
s_to
);
}
else
if
(
text
.
StartsWith
(
s_creatingHardLink
))
{
ProcessCopyingFileFrom
(
text
,
s_creatingHardLink
,
s_to
);
}
else
if
(
text
.
StartsWith
(
s_didNotCopy
))
{
// Ignore files which were not copied. This logic comes from the original
// analysis.
}
}
private
void
ProcessCopyingFileFrom
(
string
text
,
string
prefix
,
string
infix
)
{
var
split
=
text
.
IndexOf
(
infix
);
var
prefixLength
=
prefix
.
Length
;
int
toLength
=
infix
.
Length
;
var
source
=
text
.
Substring
(
prefixLength
,
split
-
prefixLength
);
var
destination
=
text
.
Substring
(
split
+
toLength
,
text
.
Length
-
2
-
split
-
toLength
);
List
<
string
>
list
;
if
(!
_copyMap
.
TryGetValue
(
destination
,
out
list
))
{
list
=
new
List
<
string
>();
_copyMap
[
destination
]
=
list
;
return
false
;
}
list
.
Add
(
source
)
;
return
true
;
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录