This commit is contained in:
Wes Haggard 2015-09-28 10:04:13 -07:00
Коммит 2ba78413c7
16 изменённых файлов: 988 добавлений и 0 удалений

63
.gitattributes поставляемый Normal file
Просмотреть файл

@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

246
.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,246 @@
syntax: glob
### VisualStudio ###
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
.vs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
msbuild.log
# Roslyn stuff
*.sln.ide
*.ide/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
#NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding addin-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
**/packages/*
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
*.metaproj
*.metaproj.tmp
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
### MonoDevelop ###
*.pidb
*.userprefs
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
### Linux ###
*~
# KDE directory preferences
.directory
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# vim temporary files
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~

3
CONTRIBUTING.md Normal file
Просмотреть файл

@ -0,0 +1,3 @@
# Contributing
Information on contributing is in the [Contributing Guide](https://github.com/dotnet/corefx/wiki/Contributing).

21
LICENSE Normal file
Просмотреть файл

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

2
README.md Normal file
Просмотреть файл

@ -0,0 +1,2 @@
# corefx-tools
Place to include various misc tools for .NET and .NET Core.

53
build.cmd Normal file
Просмотреть файл

@ -0,0 +1,53 @@
@echo off
setlocal
:: Note: We've disabled node reuse because it causes file locking issues.
:: The issue is that we extend the build with our own targets which
:: means that that rebuilding cannot successfully delete the task
:: assembly.
if not defined VisualStudioVersion (
if defined VS140COMNTOOLS (
call "%VS140COMNTOOLS%\VsDevCmd.bat"
goto :EnvSet
)
if defined VS120COMNTOOLS (
call "%VS120COMNTOOLS%\VsDevCmd.bat"
goto :EnvSet
)
echo Error: build.cmd requires Visual Studio 2013 or 2015.
echo Please see https://github.com/dotnet/corefx/blob/master/Documentation/developer-guide.md for build instructions.
exit /b 1
)
:EnvSet
:: Log build command line
set _buildproj=%~dp0build.proj
set _buildlog=%~dp0msbuild.log
set _buildprefix=echo
set _buildpostfix=^> "%_buildlog%"
call :build %*
:: Build
set _buildprefix=
set _buildpostfix=
call :build %*
goto :AfterBuild
:build
%_buildprefix% msbuild "%_buildproj%" /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=normal;LogFile="%_buildlog%";Append %* %_buildpostfix%
set BUILDERRORLEVEL=%ERRORLEVEL%
goto :eof
:AfterBuild
echo.
:: Pull the build summary from the log file
findstr /ir /c:".*Warning(s)" /c:".*Error(s)" /c:"Time Elapsed.*" "%_buildlog%"
echo Build Exit Code = %BUILDERRORLEVEL%
exit /b %BUILDERRORLEVEL%

40
build.proj Normal file
Просмотреть файл

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="BuildAndTest" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="dir.props" />
<ItemGroup>
<Project Include="src\dirs.proj" />
</ItemGroup>
<Import Project="dir.targets" />
<Import Project="dir.traversal.targets" />
<PropertyGroup>
<TraversalBuildDependsOn>
BatchRestorePackages;
$(TraversalBuildDependsOn);
</TraversalBuildDependsOn>
</PropertyGroup>
<Target Name="BatchRestorePackages">
<Message Importance="High" Text="Restoring all packages..." />
<!-- restore all project.jsons in one pass for perf & to avoid concurrency problems with dnu -->
<!-- include ToolsDir to restore test-runtime\project.json as well -->
<Exec Command="$(DnuRestoreCommand) $(DnuRestoreDirs)" StandardOutputImportance="Low" CustomErrorRegularExpression="^Unable to locate .*" />
<ItemGroup>
<_allPackagesConfigs Include="$(MSBuildProjectDirectory)\src\**\packages.config"/>
</ItemGroup>
<Exec Condition="'@(_allPackagesConfigs)' != ''" Command="$(NugetRestoreCommand) &quot;%(_allPackagesConfigs.FullPath)&quot;" StandardOutputImportance="Low" />
</Target>
<!-- Override RestorePackages from dir.traversal.targets and do a batch restore -->
<Target Name="RestorePackages" DependsOnTargets="BatchRestorePackages" />
<!-- Override clean from dir.traversal.targets and just remove the full BinDir -->
<Target Name="Clean">
<RemoveDir Directories="$(BinDir)" />
</Target>
</Project>

246
dir.props Normal file
Просмотреть файл

@ -0,0 +1,246 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" InitialTargets="CheckRoslyn" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Condition="Exists('..\dir.props')" Project="..\dir.props" />
<!--
$(OS) is set to Unix/Windows_NT. This comes from an environment variable on Windows and MSBuild on Unix.
-->
<PropertyGroup>
<OsEnvironment Condition="'$(OsEnvironment)'==''">$(OS)</OsEnvironment>
</PropertyGroup>
<!-- Build Tools Versions -->
<PropertyGroup>
<BuildToolsVersion>1.0.25-prerelease-00094</BuildToolsVersion>
<DnxVersion>1.0.0-beta7</DnxVersion>
<DnxPackageName Condition="'$(DnxPackageName)' == '' and '$(OsEnvironment)'!='Unix'">dnx-coreclr-win-x86.$(DnxVersion)</DnxPackageName>
<DnxPackageName Condition="'$(DnxPackageName)' == '' and '$(OsEnvironment)'=='Unix'">dnx-mono.$(DnxVersion)</DnxPackageName>
<RoslynVersion>1.0.0-rc3-20150510-01</RoslynVersion>
<RoslynPackageName>Microsoft.Net.ToolsetCompilers</RoslynPackageName>
</PropertyGroup>
<ItemGroup>
<AssemblyMetadata Include=".NETFrameworkAssembly">
<Value></Value>
</AssemblyMetadata>
<AssemblyMetadata Include="Serviceable">
<Value>True</Value>
</AssemblyMetadata>
</ItemGroup>
<!-- Common repo directories -->
<PropertyGroup>
<ProjectDir>$(MSBuildThisFileDirectory)</ProjectDir>
<SourceDir>$(ProjectDir)src/</SourceDir>
<!-- Output directories -->
<BinDir Condition="'$(BinDir)'==''">$(ProjectDir)bin/</BinDir>
<ObjDir Condition="'$(ObjDir)'==''">$(BinDir)obj/</ObjDir>
<TestWorkingDir Condition="'$(TestWorkingDir)'==''">$(BinDir)tests/</TestWorkingDir>
<PackagesOutDir Condition="'$(PackagesOutDir)'==''">$(BinDir)packages/</PackagesOutDir>
<!-- Input Directories -->
<PackagesDir Condition="'$(PackagesDir)'==''">$(ProjectDir)packages/</PackagesDir>
<ToolsDir Condition="'$(ToolsDir)'==''">$(PackagesDir)Microsoft.DotNet.BuildTools.$(BuildToolsVersion)/lib/</ToolsDir>
</PropertyGroup>
<!-- list of nuget package sources passed to nuget.exe -->
<ItemGroup>
<NuGetSourceList Include="https:%2F%2Fwww.myget.org/F/dotnet-buildtools" />
<NuGetSourceList Include="https:%2F%2Fwww.nuget.org/api/v2" />
</ItemGroup>
<!-- Common nuget properties -->
<PropertyGroup>
<NuGetToolPath Condition="'$(NuGetToolPath)'==''">$(PackagesDir)NuGet.exe</NuGetToolPath>
<NuGetPackageSource>@(NuGetSourceList -> '-source %(Identity)', ' ')</NuGetPackageSource>
<NuGetConfigCommandLine>$(NuGetPackageSource)</NuGetConfigCommandLine>
<NugetRestoreCommand>"$(NuGetToolPath)"</NugetRestoreCommand>
<NugetRestoreCommand>$(NugetRestoreCommand) install</NugetRestoreCommand>
<!-- NuGet.exe doesn't like trailing slashes in the output directory argument -->
<NugetRestoreCommand>$(NugetRestoreCommand) -OutputDirectory "$(PackagesDir.TrimEnd('/\'.ToCharArray()))"</NugetRestoreCommand>
<NugetRestoreCommand>$(NugetRestoreCommand) $(NuGetConfigCommandLine)</NugetRestoreCommand>
<NugetRestoreCommand>$(NugetRestoreCommand) -Verbosity detailed</NugetRestoreCommand>
<NugetRestoreCommand Condition="'$(OsEnvironment)'=='Unix'">mono $(NuGetRestoreCommand)</NugetRestoreCommand>
</PropertyGroup>
<!-- list of nuget package sources passed to dnu -->
<ItemGroup>
<!-- Need to escape double forward slash (%2F) or MSBuild will normalize to one slash on Unix. -->
<DnuSourceList Include="https:%2F%2Fwww.myget.org/F/dotnet-core/" />
<DnuSourceList Include="https:%2F%2Fwww.myget.org/F/dotnet-coreclr/" />
<DnuSourceList Include="https:%2F%2Fwww.myget.org/F/dotnet-corefx/" />
<DnuSourceList Include="https:%2F%2Fwww.myget.org/F/dotnet-corefxtestdata/" />
<DnuSourceList Include="https:%2F%2Fwww.myget.org/F/dotnet-buildtools/" />
<DnuSourceList Include="https:%2F%2Fwww.nuget.org/api/v2/" />
</ItemGroup>
<!-- list of directories to perform batch restore -->
<ItemGroup>
<DnuRestoreDir Include="&quot;$(MSBuildProjectDirectory)\src&quot;" />
<DnuRestoreDir Include="&quot;$(ToolsDir)&quot;" />
</ItemGroup>
<PropertyGroup>
<DnxPackageDir Condition="'$(DnxPackageDir)'==''">$(PackagesDir)/$(DnxPackageName)/</DnxPackageDir>
<DnuToolPath Condition="'$(DnuToolPath)'=='' and '$(OsEnvironment)'!='Unix'">$(DnxPackageDir)\bin\dnu.cmd</DnuToolPath>
<DnuToolPath Condition="'$(DnuToolPath)'=='' and '$(OsEnvironment)'=='Unix'">$(DnxPackageDir)/bin/dnu</DnuToolPath>
<DnuRestoreSource>@(DnuSourceList -> '--source %(Identity)', ' ')</DnuRestoreSource>
<DnuRestoreDirs>@(DnuRestoreDir -> '%(Identity)', ' ')</DnuRestoreDirs>
<DnuRestoreCommand>"$(DnuToolPath)"</DnuRestoreCommand>
<DnuRestoreCommand>$(DnuRestoreCommand) restore</DnuRestoreCommand>
<DnuRestoreCommand Condition="'$(ParallelRestore)'=='true'">$(DnuRestoreCommand) --parallel</DnuRestoreCommand>
<DnuRestoreCommand>$(DnuRestoreCommand) --packages "$(PackagesDir.TrimEnd('/\'.ToCharArray()))" $(DnuRestoreSource)</DnuRestoreCommand>
<DnuRestoreCommand Condition="'$(LockDependencies)' == 'true'">$(DnuRestoreCommand) --lock</DnuRestoreCommand>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildAllProjects)'=='true'">
<!-- When we do a traversal build we get all packages up front, don't restore them again -->
<RestorePackages>false</RestorePackages>
</PropertyGroup>
<!--
Set up Roslyn predefines
-->
<PropertyGroup>
<RoslynPackageDir>$(PackagesDir)/$(RoslynPackageName).$(RoslynVersion)/</RoslynPackageDir>
<RoslynPropsFile>$(RoslynPackageDir)build/Microsoft.Net.ToolsetCompilers.props</RoslynPropsFile>
</PropertyGroup>
<PropertyGroup Condition="'$(OsEnvironment)'=='Unix' and '$(UseRoslynCompiler)'=='true'">
<!--
PDB support isn't implemented yet. https://github.com/dotnet/roslyn/issues/2449
Note that both DebugSymbols and DebugType need set or project references will assume they need to copy pdbs and fail.
-->
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
<!--
Delay signing with the ECMA key currently doesn't work.
https://github.com/dotnet/roslyn/issues/2444
-->
<UseECMAKey>false</UseECMAKey>
</PropertyGroup>
<PropertyGroup Condition="'$(OsEnvironment)'=='Unix'">
<!--
Mono currently doesn't include VB targets for portable, notably /lib/mono/xbuild/Microsoft/Portable/v4.5/Microsoft.Portable.VisualBasic.targets.
Fixed in https://github.com/mono/mono/pull/1726.
-->
<IncludeVbProjects>false</IncludeVbProjects>
<!--
Building packages fails for two reasons.
First, nuget doesn't like the paths in the nuspec having backslashes as directory separators.
Second, we aren't yet building pdbs, which the nuspecs specify.
-->
<SkipBuildPackages>true</SkipBuildPackages>
</PropertyGroup>
<!--
Projects that have no OS-specific implementations just use Debug and Release for $(Configuration).
Projects that do have OS-specific implementations use OS_Debug and OS_Release, for all OS's we support even
if the code is the same between some OS's (so if you have some project that just calls POSIX APIs, we still have
OSX_[Debug|Release] and Linux_[Debug|Release] configurations. We do this so that we place all the output under
a single binary folder and can have a similar experience between the command line and Visual Studio.
Since now have multiple *Debug and *Release configurations, ConfigurationGroup is set to Debug for any of the
debug configurations, and to Release for any of the release configurations.
-->
<!-- Set default Configuration and Platform -->
<PropertyGroup>
<Platform Condition="'$(Platform)'==''">AnyCPU</Platform>
<Configuration Condition="'$(Configuration)'==''">Debug</Configuration>
<ConfigurationGroup Condition="$(Configuration.EndsWith('Debug'))">Debug</ConfigurationGroup>
<ConfigurationGroup Condition="$(Configuration.EndsWith('Release'))">Release</ConfigurationGroup>
<ConfigurationGroup Condition="'$(ConfigurationGroup)'==''">$(Configuration)</ConfigurationGroup>
<OSGroup Condition="'$(OSGroup)'=='' and $(Configuration.StartsWith('Windows'))">Windows_NT</OSGroup>
<OSGroup Condition="'$(OSGroup)'=='' and $(Configuration.StartsWith('Linux'))">Linux</OSGroup>
<OSGroup Condition="'$(OSGroup)'=='' and $(Configuration.StartsWith('OSX'))">OSX</OSGroup>
<OSGroup Condition="'$(OSGroup)'=='' and $(Configuration.StartsWith('FreeBSD'))">FreeBSD</OSGroup>
<OSGroup Condition="'$(OSGroup)'==''">Windows_NT</OSGroup>
</PropertyGroup>
<!-- Set up Default symbol and optimization for Configuration -->
<PropertyGroup Condition="'$(ConfigurationGroup)' == 'Debug'">
<DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
<Optimize Condition="'$(Optimize)' == ''">false</Optimize>
<DebugType Condition="'$(DebugType)' == ''">full</DebugType>
<DefineConstants>$(DefineConstants),DEBUG,TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(ConfigurationGroup)' == 'Release'">
<DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
<Optimize Condition="'$(Optimize)' == ''">true</Optimize>
<DebugType Condition="'$(DebugType)' == ''">pdbonly</DebugType>
<DefineConstants>$(DefineConstants),TRACE</DefineConstants>
</PropertyGroup>
<!-- Disable some standard properties for building our projects -->
<PropertyGroup>
<NoStdLib>true</NoStdLib>
<NoExplicitReferenceToStdLib>true</NoExplicitReferenceToStdLib>
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
</PropertyGroup>
<!-- Set up handling of build warnings -->
<PropertyGroup>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<!-- Set up some common paths -->
<PropertyGroup>
<CommonPath>$(SourceDir)Common</CommonPath>
</PropertyGroup>
<!-- Set up the default output and intermediate paths -->
<PropertyGroup>
<OSPlatformConfig>$(OSGroup).$(Platform).$(ConfigurationGroup)</OSPlatformConfig>
<BaseOutputPath Condition="'$(BaseOutputPath)'==''">$(BinDir)</BaseOutputPath>
<OutputPath Condition="'$(OutputPath)'==''">$(BaseOutputPath)$(OSPlatformConfig)\$(MSBuildProjectName)\</OutputPath>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'==''">$(ObjDir)</BaseIntermediateOutputPath>
<IntermediateOutputRootPath Condition="'$(IntermediateOutputRootPath)' == ''">$(BaseIntermediateOutputPath)$(OSPlatformConfig)\</IntermediateOutputRootPath>
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(IntermediateOutputRootPath)$(MSBuildProjectName)\</IntermediateOutputPath>
<TestPath Condition="'$(TestPath)'==''">$(TestWorkingDir)$(OSPlatformConfig)\$(MSBuildProjectName)\</TestPath>
<PackagesBasePath Condition="'$(PackagesBasePath)'==''">$(BinDir)$(OSPlatformConfig)</PackagesBasePath>
</PropertyGroup>
<!-- Set up common target properties that we use to conditionally include sources -->
<PropertyGroup>
<TargetsWindows Condition="'$(OSGroup)' == 'Windows_NT'">true</TargetsWindows>
<TargetsLinux Condition="'$(OSGroup)' == 'Linux'">true</TargetsLinux>
<TargetsOSX Condition="'$(OSGroup)' == 'OSX'">true</TargetsOSX>
<TargetsFreeBSD Condition="'$(OSGroup)' == 'FreeBSD'">true</TargetsFreeBSD>
<TargetsUnix Condition="'$(TargetsLinux)' == 'true' or '$(TargetsOSX)' == 'true' or '$(TargetsFreeBSD)' == 'true'">true</TargetsUnix>
</PropertyGroup>
<PropertyGroup>
<!-- Work around known Dev14 bug - see
https://connect.microsoft.com/VisualStudio/feedback/details/1000796/connect-file-uap-props-not-found-cant-build-a-portable-lib-on-vs14
-->
<_WindowsKitBinPath>$(MSBuildProgramFiles32)\Windows Kits\8.1\bin\x86</_WindowsKitBinPath>
<_WindowsPhoneKitBinPath>$(MSBuildProgramFiles32)\Windows Phone Kits\8.1\bin</_WindowsPhoneKitBinPath>
<MakePriExeFullPath>$(_WindowsKitBinPath)\makepri.exe</MakePriExeFullPath>
<MakeAppxExeFullPath>$(_WindowsKitBinPath)\makeappx.exe</MakeAppxExeFullPath>
<SignAppxPackageExeFullPath>$(_WindowsKitBinPath)\signtool.exe</SignAppxPackageExeFullPath>
<MakePriExtensionPath>$(_WindowsPhoneKitBinPath)\x86\MrmEnvironmentExtDl.dll</MakePriExtensionPath>
<MakePriExtensionPath_x64>$(_WindowsPhoneKitBinPath)\x64\MrmEnvironmentExtDl.dll</MakePriExtensionPath_x64>
</PropertyGroup>
<Import Project="$(RoslynPropsFile)"
Condition="'$(UseRoslynCompiler)'=='true' and Exists('$(RoslynPropsFile)')" />
<!-- Building the build.proj should restore successfully, so ignore in that case -->
<Target Name="CheckRoslyn" Condition="'$(UseRoslynCompiler)'=='true' and '$(MSBuildProjectFile)'!='build.proj'">
<Warning Condition="!Exists('$(RoslynPropsFile)')"
Text="The Roslyn targets do not exist- Roslyn will not be used for this build, but the package should be restored if you build again." />
</Target>
</Project>

122
dir.targets Normal file
Просмотреть файл

@ -0,0 +1,122 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" InitialTargets="_RestoreBuildToolsWrapper" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Inline task to bootstrap the build to enable downloading nuget.exe -->
<UsingTask TaskName="DownloadFile" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll">
<ParameterGroup>
<Address ParameterType="System.String" Required="true" />
<FileName ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System" />
<Reference Include="System.IO" />
<Code Type="Fragment" Language="cs">
<![CDATA[
var directory = System.IO.Path.GetDirectoryName(FileName);
Directory.CreateDirectory(directory);
var tempFile = Path.Combine(directory, Path.GetRandomFileName());
var client = new System.Net.WebClient();
client.Proxy = System.Net.WebRequest.DefaultWebProxy;
if (client.Proxy != null) client.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
var tryCount = 1;
var maxTries = 3;
while (tryCount <= maxTries)
{
try
{
Log.LogMessage("Attempting to download {0}...", Address);
client.DownloadFile(Address, tempFile);
break;
}
catch (System.Net.WebException e)
{
tryCount++;
if (tryCount > maxTries)
{
throw;
}
else
{
Log.LogMessage(MessageImportance.High, "Download failed, retrying: {0}", e.Message);
}
}
}
try
{
if (!File.Exists(FileName))
File.Move(tempFile, FileName);
}
finally
{
if (File.Exists(tempFile))
File.Delete(tempFile);
}
]]>
</Code>
</Task>
</UsingTask>
<!--
Use a semaphore file to determine the need to restore build tools to avoid conflicts with locked binaries.
-->
<PropertyGroup>
<BuildToolsSemaphore>$(ToolsDir)BuildTools.semaphore</BuildToolsSemaphore>
</PropertyGroup>
<!--
Needed to avoid the IntialTargets from having an Output which ends up getting
added to the output references when you have a project to project reference.
-->
<Target Name="_RestoreBuildToolsWrapper" DependsOnTargets="_RestoreBuildTools" />
<Target Name="_RestoreBuildTools"
Inputs="$(MSBuildThisFileDirectory)dir.props;$(SourceDir).nuget/packages.$(OsEnvironment).config"
Outputs="$(BuildToolsSemaphore)">
<Message Importance="High" Text="Restoring build tools..." />
<Copy Condition="Exists('$(NuGetCachedPath)')" SourceFiles="$(NuGetCachedPath)" DestinationFiles="$(NuGetToolPath)" SkipUnchangedFiles="true" />
<!-- Download latest nuget.exe -->
<DownloadFile FileName="$(NuGetToolPath)"
Address="https://www.nuget.org/nuget.exe"
Condition="!Exists('$(NuGetToolPath)') and '$(OsEnvironment)'=='Windows_NT'" />
<Exec Command="curl -sSL --create-dirs -o $(NuGetToolPath) https://api.nuget.org/downloads/nuget.exe"
Condition="!Exists('$(NuGetToolPath)') and '$(OsEnvironment)'=='Unix'" />
<PropertyGroup>
<_RestoreBuildToolsCommand>$(NugetRestoreCommand) "$(SourceDir).nuget/packages.$(OsEnvironment).config"</_RestoreBuildToolsCommand>
</PropertyGroup>
<!-- Restore build tools -->
<Exec Command="$(_RestoreBuildToolsCommand)" StandardOutputImportance="Low" />
<!-- Add DNU and Roslyn tool execute rights -->
<Exec Condition="'$(OsEnvironment)'=='Unix'"
Command="chmod a+x &quot;$(DnxPackageDir)/bin/dnu&quot;" />
<Exec Condition="'$(OsEnvironment)'=='Unix'"
Command="chmod a+x &quot;$(DnxPackageDir)/bin/dnx&quot;" />
<Exec Condition="'$(OsEnvironment)'=='Unix'"
Command="find '$(RoslynPackageDir)tools' -name &quot;*.exe&quot; -exec chmod &quot;+x&quot; '{}' ';'" />
<!--
Touch our semaphore file to ensure Inputs/Outputs comparison for this target will show that we're up to date.
Ignore failures in the unlikely, but possible, event that we hit this from two projects simultaneously.
-->
<Touch Files="$(BuildToolsSemaphore)"
ContinueOnError="WarnAndContinue"
AlwaysCreate="true"
ForceTouch="true" />
<Error Condition="'$(ErrorIfBuildToolsRestoredFromIndividualProject)'=='true'"
Text="The build tools package was just restored and so we cannot continue the build of an individual project because targets from the build tools package were not able to be imported. Please retry the build the individual project again." />
</Target>
<!-- Provide default targets which can be hooked onto or overridden as necessary -->
<Target Name="BuildAndTest" DependsOnTargets="Build;Test" />
<Target Name="RebuildAndTest" DependsOnTargets="Rebuild;Test" />
<Target Name="Test" />
</Project>

103
dir.traversal.targets Normal file
Просмотреть файл

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="BuildAllProjects">
<PropertyGroup>
<DefaultBuildAllTarget Condition="'$(DefaultBuildAllTarget)'==''">$(MSBuildProjectDefaultTargets)</DefaultBuildAllTarget>
</PropertyGroup>
<!-- To Serialize we use msbuild's batching functionality '%' to force it to batch all similar projects with the same identity
however since the project names are unique it will essentially force each to run in its own batch -->
<MSBuild Targets="$(DefaultBuildAllTarget)"
Projects="@(Project)"
Condition="'$(SerializeProjects)'=='true'"
Properties="Dummy=%(Identity);DefaultBuildAllTarget=$(DefaultBuildAllTarget);BuildAllProjects=true"
ContinueOnError="ErrorAndContinue" />
<MSBuild Targets="$(DefaultBuildAllTarget)"
Projects="@(Project)"
Condition="'$(SerializeProjects)'!='true'"
Properties="DefaultBuildAllTarget=$(DefaultBuildAllTarget);BuildAllProjects=true"
BuildInParallel="true"
ContinueOnError="ErrorAndContinue" />
<!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
<Error Condition="'$(MSBuildLastTaskResult)'=='false'" />
</Target>
<Target Name="CleanAllProjects">
<PropertyGroup>
<DefaultCleanAllTarget Condition="'$(DefaultCleanAllTarget)'==''">Clean</DefaultCleanAllTarget>
</PropertyGroup>
<!-- To Serialize we use msbuild's batching functionality '%' to force it to batch all similar projects with the same identity
however since the project names are unique it will essentially force each to run in its own batch -->
<MSBuild Targets="$(DefaultCleanAllTarget)"
Projects="@(Project)"
Condition="'$(SerializeProjects)'=='true'"
Properties="Dummy=%(Identity);CleanAllProjects=true"
ContinueOnError="ErrorAndContinue" />
<MSBuild Targets="$(DefaultCleanAllTarget)"
Projects="@(Project)"
Condition="'$(SerializeProjects)'!='true'"
Properties="CleanAllProjects=true"
BuildInParallel="true"
ContinueOnError="ErrorAndContinue" />
<!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
<Error Condition="'$(MSBuildLastTaskResult)'=='false'" />
</Target>
<Target Name="RestoreAllProjectPackages">
<Message Importance="High" Text="Restoring project packages..." />
<PropertyGroup>
<DefaultRestoreAllPackagesTarget Condition="'$(DefaultRestoreAllPackagesTarget)'==''">RestorePackages</DefaultRestoreAllPackagesTarget>
</PropertyGroup>
<!-- To Serialize we use msbuild's batching functionality '%' to force it to batch all similar projects with the same identity
however since the project names are unique it will essentially force each to run in its own batch -->
<MSBuild Targets="$(DefaultRestoreAllPackagesTarget)"
Projects="@(Project)"
Condition="'$(SerializeProjects)'=='true'"
Properties="Dummy=%(Identity);RestoreAllPackages=true"
ContinueOnError="ErrorAndContinue" />
<MSBuild Targets="$(DefaultRestoreAllPackagesTarget)"
Projects="@(Project)"
Condition="'$(SerializeProjects)'!='true'"
Properties="RestoreAllPackages=true"
BuildInParallel="true"
ContinueOnError="ErrorAndContinue" />
<!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
<Error Condition="'$(MSBuildLastTaskResult)'=='false'" />
</Target>
<PropertyGroup>
<TraversalBuildDependsOn>
BuildAllProjects;
$(TraversalBuildDependsOn);
</TraversalBuildDependsOn>
<TraversalCleanDependsOn>
CleanAllProjects;
$(TraversalCleanDependsOn);
</TraversalCleanDependsOn>
<TraversalRestorePackagesDependsOn>
RestoreAllProjectPackages;
$(TraversalRestorePackagesDependsOn)
</TraversalRestorePackagesDependsOn>
</PropertyGroup>
<Target Name="Build" DependsOnTargets="$(TraversalBuildDependsOn)" />
<Target Name="Clean" DependsOnTargets="$(TraversalCleanDependsOn)" />
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />
<Target Name="RestorePackages" DependsOnTargets="$(TraversalRestorePackagesDependsOn)" />
</Project>

Просмотреть файл

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.DotNet.BuildTools" version="1.0.25-prerelease-00094" />
<package id="dnx-coreclr-win-x86" version="1.0.0-beta7" />
</packages>

13
src/BuildValues.props Normal file
Просмотреть файл

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!--
the value of RevisionNumber must be numeric and contain enough
leading zeroes to satisfy a 16-bit integer in base-10 format. this
is needed because SemVer v1 performs a lexical comparison of the
prerelease version number and without the leading zeroes foo-20 is
smaller than foo-4.
-->
<RevisionNumber>00001</RevisionNumber>
</PropertyGroup>
</Project>

17
src/NuGet.Config Normal file
Просмотреть файл

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
</packageRestore>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
<config>
<add key="repositoryPath" value="..\packages" />
</config>
<packageSources>
<add key="myget.org dotnet-core" value="https://www.myget.org/F/dotnet-core/" />
<add key="myget.org dotnet-buildtools" value="https://www.myget.org/F/dotnet-buildtools/" />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
</packageSources>
</configuration>

3
src/dir.props Normal file
Просмотреть файл

@ -0,0 +1,3 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\dir.props" />
</Project>

22
src/dir.targets Normal file
Просмотреть файл

@ -0,0 +1,22 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ErrorIfBuildToolsRestoredFromIndividualProject Condition="!Exists('$(ToolsDir)')">true</ErrorIfBuildToolsRestoredFromIndividualProject>
</PropertyGroup>
<Import Project="..\dir.targets" />
<!-- Returns the assembly version of the project for consumption
by the NuGet package generation -->
<Target Name="GetAssemblyVersion"
Returns="$(AssemblyVersion)"/>
<!-- Returns the generated documentation file for consumption
by the NuGet package generation -->
<Target Name="GetDocumentationFile"
Returns="$(DocumentationFile)"/>
<Import Project="Microsoft.DotNet.Build.Tasks\Targets\Build.Common.targets" Condition="'$(UseLiveBuildTools)' == 'true'" />
<Import Project="$(ToolsDir)Build.Common.targets" Condition="'$(UseLiveBuildTools)' != 'true' AND Exists('$(ToolsDir)Build.Common.targets')" />
<Import Project="..\override.targets" Condition="Exists('..\override.targets')"/>
</Project>

29
src/dirs.proj Normal file
Просмотреть файл

@ -0,0 +1,29 @@
<Project ToolsVersion="12.0" DefaultTargets="BuildAndTest" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="dir.props" />
<Import Project="BuildValues.props" />
<ItemGroup>
<Project Include="*\*.csproj" />
</ItemGroup>
<Import Project="..\dir.targets" />
<Import Project="..\dir.traversal.targets" />
<Import Project="$(ToolsDir)packages.targets" Condition="Exists('$(ToolsDir)packages.targets') and '$(ImportGetNuGetPackageVersions)' != 'false'" />
<Import Project="$(ToolsDir)UpdateBuildValues.targets" Condition="Exists('$(ToolsDir)UpdateBuildValues.targets')" />
<PropertyGroup Condition="Exists('$(ToolsDir)packages.targets') and '$(ImportGetNuGetPackageVersions)' != 'false'">
<TraversalBuildDependsOn>
$(TraversalBuildDependsOn);
BuildPackages;
</TraversalBuildDependsOn>
</PropertyGroup>
<PropertyGroup>
<GenerateCodeCoverageReportForAll>true</GenerateCodeCoverageReportForAll>
</PropertyGroup>
<Import Project="$(ToolsDir)CodeCoverage.targets" Condition="Exists('$(ToolsDir)CodeCoverage.targets')" />
<Import Project="$(ToolsDir)PerfTesting.targets" Condition="Exists('$(ToolsDir)PerfTesting.targets')" />
</Project>