Skip to content
This repository was archived by the owner on Feb 20, 2021. It is now read-only.

Commit d57a475

Browse files
committed
intial commit
1 parent 377c6b5 commit d57a475

File tree

419 files changed

+114466
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

419 files changed

+114466
-0
lines changed

LICENSE.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
========================================================================================
2+
Microsoft patterns & practices (http://microsoft.com/practices)
3+
SEMANTIC LOGGING APPLICATION BLOCK
4+
========================================================================================
5+
6+
Copyright (c) Microsoft. All rights reserved.
7+
Microsoft would like to thank its contributors, a list
8+
of whom are at http://aka.ms/entlib-contributors
9+
10+
Licensed under the Apache License, Version 2.0 (the "License"); you
11+
may not use this file except in compliance with the License. You may
12+
obtain a copy of the License at
13+
14+
http://www.apache.org/licenses/LICENSE-2.0
15+
16+
Unless required by applicable law or agreed to in writing, software
17+
distributed under the License is distributed on an "AS IS" BASIS,
18+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
19+
implied. See the License for the specific language governing permissions
20+
and limitations under the License.

Readme.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SEMANTIC LOGGING APPLICATION BLOCK (SLAB) PRE-RELEASE
2+
http://slab.codeplex.com
3+
4+
This is a pre-release version. It is meant for developers to try out new features or bug fixes ahead of an official release.
5+
We strongly urge you to only use official builds for production. The latest official release is available at http://msdn.microsoft.com/entlib and via the NuGet official feed (http://nuget.org).
6+
7+
Summary: The Semantic Logging Application Block provides a set of destinations (sinks) to persist application events published using a subclass of the EventSource class from the System.Diagnostics.Tracing namespace. Sinks include Windows Azure table storage, SQL Server databases, and rolling files with several formats and you can extend the block by creating your own custom formatters and sinks. For the those sinks that can store structured data, the block preserves the full structure of the event payload in order to facilitate analyzing or processing the logged data.
8+
9+
Microsoft patterns & practices
10+
http://microsoft.com/practices

build/build.proj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build" ToolsVersion="4.0" >
3+
4+
<Import Project="build.targets"/>
5+
6+
</Project>

build/build.targets

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- This file builds the Enterprise Library Application Blocks -->
3+
<!-- and runs the unit tests. -->
4+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
5+
DefaultTargets="Build"
6+
ToolsVersion="4.0" >
7+
8+
<PropertyGroup>
9+
<Configuration>Release</Configuration>
10+
<Platform>Any CPU</Platform>
11+
12+
<AssemblyOriginatorKeyFile></AssemblyOriginatorKeyFile>
13+
<SignAssembly>false</SignAssembly>
14+
<DelaySign>false</DelaySign>
15+
16+
<RunCodeAnalysis>true</RunCodeAnalysis>
17+
18+
<RepoRoot>$(MSBuildThisFileDirectory)..\</RepoRoot>
19+
<SourceRoot Condition=" '$(SourceRoot)' == '' ">$(RepoRoot)Source\</SourceRoot>
20+
<OutputRoot Condition=" '$(OutputRoot)' == '' ">$(RepoRoot)bin\$(Configuration)\</OutputRoot>
21+
</PropertyGroup>
22+
23+
<!-- DevEnvDir: Provide a sensible default and add a trailing slash if necessary -->
24+
<PropertyGroup>
25+
<DevEnvDir Condition="$(DevEnvDir) == ''">C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\</DevEnvDir>
26+
<DevEnvDir Condition="!HasTrailingSlash('$(DevEnvDir)')">$(DevEnvDir)\</DevEnvDir>
27+
</PropertyGroup>
28+
29+
<ItemGroup>
30+
<Solutions Include="$(SourceRoot)**\*.sln"/>
31+
</ItemGroup>
32+
33+
<Target Name="Rebuild" DependsOnTargets="Clean;Build"/>
34+
35+
<Target Name="Build" DependsOnTargets="Compile;RunTests;BuildNugetPackages" />
36+
37+
<Target Name="Clean" DependsOnTargets="CleanProjects;CleanNugetPackages"/>
38+
39+
<Target Name="CleanProjects">
40+
<MSBuild Projects="@(Solutions)" Properties="Configuration=$(Configuration);Platform=$(Platform);AssemblyOriginatorKeyFile=$(AssemblyOriginatorKeyFile);SignAssembly=$(SignAssembly);DelaySign=$(DelaySign);" Targets="Clean"/>
41+
</Target>
42+
43+
<Target Name="Compile" DependsOnTargets="RestoreNugetPackages">
44+
<PropertyGroup>
45+
<BuildProperties>$(BuildProperties);Configuration=$(Configuration);Platform=$(Platform)</BuildProperties>
46+
<BuildProperties>$(BuildProperties);AssemblyOriginatorKeyFile=$(AssemblyOriginatorKeyFile);SignAssembly=$(SignAssembly);DelaySign=$(DelaySign);</BuildProperties>
47+
<BuildProperties>$(BuildProperties);RunCodeAnalysis=$(RunCodeAnalysis)</BuildProperties>
48+
</PropertyGroup>
49+
<MSBuild Projects="@(Solutions)" Properties="$(BuildProperties)"/>
50+
</Target>
51+
52+
<Target Name="RunTests" DependsOnTargets="Compile">
53+
<PropertyGroup>
54+
<TestProperties>Configuration=$(Configuration)</TestProperties>
55+
<TestProperties Condition=" '$(RunTests)' != '' ">$(TestProperties);RunTests=$(RunTests)</TestProperties>
56+
<TestProperties Condition=" '$(DevEnvDir)' != '' ">$(TestProperties);DevEnvDir=$(DevEnvDir)</TestProperties>
57+
<TestProperties Condition=" '$(TestAssembliesToExclude)' != '' ">$(TestProperties);TestAssembliesToExclude=$(TestAssembliesToExclude)</TestProperties>
58+
<TestProperties Condition=" '$(MinimumCoverageRequired)' != '' ">$(TestProperties);MinimumCoverageRequired=$(MinimumCoverageRequired)</TestProperties>
59+
<TestProperties Condition=" '$(GetCoverageInformation)' != '' ">$(TestProperties);GetCoverageInformation=$(GetCoverageInformation)</TestProperties>
60+
<TestProperties Condition=" '$(GetMstestCoverage)' != '' ">$(TestProperties);GetMstestCoverage=$(GetMstestCoverage)</TestProperties>
61+
</PropertyGroup>
62+
63+
<MSBuild Projects="test.targets" Targets="RunTests" Properties="$(TestProperties)"/>
64+
</Target>
65+
66+
<Import Project="nuget.targets"/>
67+
</Project>

build/nuget.targets

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- This file builds the Enterprise Library Application Blocks -->
3+
<!-- and runs the unit tests. -->
4+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
5+
ToolsVersion="4.0" >
6+
7+
<PropertyGroup>
8+
<NuGetExeDirectory>$(MSBuildThisFileDirectory)bin\</NuGetExeDirectory>
9+
<NuGetExePath>$(NuGetExeDirectory)nuget.exe</NuGetExePath>
10+
<BuildNugetPackages>true</BuildNugetPackages>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<NuSpecFiles Include="$(SourceRoot)**\*.nuspec" Exclude="$(SourceRoot)packages\**\*.nuspec"/>
15+
</ItemGroup>
16+
17+
<Target Name="RestoreNugetPackages" DependsOnTargets="_DownloadNuGet">
18+
<Exec Command="&quot;$(NuGetExePath)&quot; restore &quot;%(Solutions.FullPath)&quot; -NonInteractive"/>
19+
<Exec Command="&quot;$(NuGetExePath)&quot; restore packages.config -PackagesDirectory packages -NonInteractive"/>
20+
</Target>
21+
22+
<Target Name="BuildNugetPackages" DependsOnTargets="_DownloadNuget;_GetPackageVersions;_BuildPackageVersionTokens"
23+
Condition=" '$(BuildNugetPackages)' == 'true' "
24+
Inputs="@(NuSpecFiles)" Outputs="%(NuSpecFiles.Identity)-runalways">
25+
26+
<PropertyGroup>
27+
<SourceRootFullPath>$([System.IO.Path]::GetFullPath('$(SourceRoot)'))</SourceRootFullPath>
28+
<PackageBasePath>$(SourceRootFullPath.TrimEnd('\'))</PackageBasePath>
29+
<PackageOutputDir Condition=" '$(PackageOutputDir)' == '' ">$([System.IO.Path]::GetFullPath('$(RepoRoot)bin\$(Configuration)\Nuget'))</PackageOutputDir>
30+
</PropertyGroup>
31+
32+
<PropertyGroup>
33+
<_NuGetPackTarget>$([System.IO.Path]::GetDirectoryName("%(NuSpecFiles.FullPath)"))\%(NuSpecFiles.Filename).csproj</_NuGetPackTarget>
34+
<_NuGetPackTarget Condition=" !Exists('$(_NuGetPackTarget)') ">%(NuSpecFiles.FullPath)</_NuGetPackTarget>
35+
</PropertyGroup>
36+
37+
<MakeDir Directories="$(PackageOutputDir)" Condition="!Exists($(PackageOutputDir))"/>
38+
39+
<Exec Command="&quot;$(NuGetExePath)&quot; pack &quot;$(_NuGetPackTarget)&quot; -Properties Configuration=$(Configuration);@(_VersionTokens) -NonInteractive -OutputDirectory &quot;$(PackageOutputDir)&quot; -Symbols -BasePath &quot;$(PackageBasePath)&quot;"
40+
IgnoreStandardErrorWarningFormat="true"/>
41+
42+
</Target>
43+
44+
<Target Name="CleanNugetPackages">
45+
46+
<PropertyGroup>
47+
<PackageOutputDir Condition=" '$(PackageOutputDir)' == '' ">$([System.IO.Path]::GetFullPath('$(RepoRoot)bin\$(Configuration)\Nuget'))</PackageOutputDir>
48+
</PropertyGroup>
49+
50+
<ItemGroup>
51+
<Packages Include="$(PackageOutputDir)\*.nupkg"/>
52+
</ItemGroup>
53+
54+
<Message Text="@(Packages)"/>
55+
<Delete Files="@(Packages)"/>
56+
57+
</Target>
58+
59+
<Target Name="_GetPackageVersions">
60+
61+
<ItemGroup>
62+
<OutputBinaries Include="$(OutputRoot)*.dll;$(OutputRoot)*.exe"/>
63+
</ItemGroup>
64+
65+
<GetAssemblyVersion VersionProviderPaths="@(OutputBinaries)">
66+
<Output TaskParameter="Versions" ItemName="AssemblyVersions"/>
67+
</GetAssemblyVersion>
68+
69+
<Message Importance="high" Text="Versions found: @(AssemblyVersions)"/>
70+
71+
</Target>
72+
73+
<Target Name="_BuildPackageVersionTokens" Inputs="@(AssemblyVersions)" Outputs="%(Identity)">
74+
<!-- Using target batching to be able to do transformations on the metadata values -->
75+
<PropertyGroup>
76+
<AssemblyToken>%(AssemblyVersions.Identity)</AssemblyToken>
77+
<AssemblyToken>$(AssemblyToken.Replace(".", "_"))</AssemblyToken>
78+
<AssemblyToken>$(AssemblyToken.Replace("-", "_"))</AssemblyToken>
79+
</PropertyGroup>
80+
81+
<ItemGroup>
82+
<_VersionTokens Include="$(VersionTokens)$(AssemblyToken)_Version=%(AssemblyVersions.InformationalVersion)"/>
83+
</ItemGroup>
84+
</Target>
85+
86+
<Target Name="_DownloadNuGet" Condition="!Exists('$(NuGetExePath)')">
87+
<MakeDir Directories="$(NuGetExeDirectory)" Condition="!Exists('$(NuGetExeDirectory)')"/>
88+
<DownloadNuGet OutputFilename="$(NuGetExePath)" />
89+
</Target>
90+
91+
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
92+
<ParameterGroup>
93+
<OutputFilename ParameterType="System.String" Required="true" />
94+
</ParameterGroup>
95+
<Task>
96+
<Reference Include="System.Core" />
97+
<Using Namespace="System" />
98+
<Using Namespace="System.IO" />
99+
<Using Namespace="System.Net" />
100+
<Using Namespace="Microsoft.Build.Framework" />
101+
<Using Namespace="Microsoft.Build.Utilities" />
102+
<Code Type="Fragment" Language="cs">
103+
<![CDATA[
104+
try
105+
{
106+
OutputFilename = Path.GetFullPath(OutputFilename);
107+
108+
Log.LogMessage("Downloading latest version of NuGet.exe to " + OutputFilename);
109+
WebClient webClient = new WebClient();
110+
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
111+
112+
return true;
113+
}
114+
catch (Exception ex) {
115+
Log.LogErrorFromException(ex);
116+
return false;
117+
}
118+
]]>
119+
</Code>
120+
</Task>
121+
</UsingTask>
122+
123+
<UsingTask TaskName="GetAssemblyVersion" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
124+
<ParameterGroup>
125+
<VersionProviderPaths ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
126+
<Versions ParameterType="Microsoft.Build.Framework.ITaskItem[]" Output="true" />
127+
</ParameterGroup>
128+
<Task>
129+
<Using Namespace="System" />
130+
<Using Namespace="System.Reflection" />
131+
<Using Namespace="Microsoft.Build.Framework" />
132+
<Using Namespace="Microsoft.Build.Utilities" />
133+
<Code Type="Fragment" Language="cs">
134+
<![CDATA[
135+
var versions = new List<ITaskItem>();
136+
try
137+
{
138+
foreach(var versionProviderPath in VersionProviderPaths)
139+
{
140+
var assembly = Assembly.LoadFrom(versionProviderPath.GetMetadata("Fullpath"));
141+
var assemblyName = assembly.GetName();
142+
var version = assemblyName.Version;
143+
var fileVersionAttribute = assembly.GetCustomAttribute<AssemblyFileVersionAttribute>();
144+
var informationalVersionAttribute = assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
145+
146+
var item = new TaskItem(assemblyName.Name);
147+
item.SetMetadata("AssemblyVersion", version.ToString());
148+
item.SetMetadata("FileVersion", fileVersionAttribute != null ? fileVersionAttribute.Version : string.Empty);
149+
item.SetMetadata("InformationalVersion", informationalVersionAttribute != null ? informationalVersionAttribute.InformationalVersion : string.Empty);
150+
151+
versions.Add(item);
152+
}
153+
154+
Versions = versions.ToArray();
155+
return true;
156+
}
157+
catch (Exception ex) {
158+
Log.LogErrorFromException(ex);
159+
return false;
160+
}
161+
]]>
162+
</Code>
163+
</Task>
164+
</UsingTask>
165+
166+
</Project>

build/packages.config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="OpenCover" version="4.5.1923" />
4+
<package id="ReportGenerator" version="1.9.0.0" />
5+
</packages>

0 commit comments

Comments
 (0)