Skip to content

Commit

Permalink
Merge pull request #599 from AndyGerlicher/PrepUpdate3
Browse files Browse the repository at this point in the history
FI (partial) master to VS2015 Update 3
  • Loading branch information
AndyGerlicher committed May 3, 2016
2 parents 9a553aa + b13f914 commit e4a55ee
Show file tree
Hide file tree
Showing 32 changed files with 318 additions and 3,652 deletions.
57 changes: 50 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
Expand All @@ -18,14 +22,16 @@ bld/
[Bb]in/
[Oo]bj/

# Roslyn cache directories
*.ide/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

#NUNIT
# NUNIT
*.VisualState.xml
TestResult.xml

Expand All @@ -34,9 +40,16 @@ TestResult.xml
[Rr]eleasePS/
dlldata.c

# DNX
project.lock.json
*.project.lock.json
artifacts/

# Nuget v3
*.nuget.props
*.nuget.targets


*_i.c
*_p.c
*_i.h
Expand Down Expand Up @@ -89,7 +102,7 @@ _ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding addin-in
# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
Expand All @@ -101,6 +114,7 @@ _TeamCity*
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*

# MightyMoose
*.mm.*
Expand Down Expand Up @@ -139,7 +153,7 @@ publish/
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# If using the old MSBuild-Integrated Package Restore, uncomment this:
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config

# Windows Azure Build Output
Expand All @@ -149,9 +163,13 @@ csx/
# Windows Store app package directory
AppPackages/

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
Expand All @@ -161,6 +179,7 @@ ClientBin/
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# RIA/Silverlight projects
Generated_Code/
Expand All @@ -184,3 +203,27 @@ UpgradeLog*.htm

# Microsoft Fakes
FakesAssemblies/

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# Project-specific
ApiPort/
*.xlsx
ref/
Differences.txt
Tools/
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Microsoft.Build (MSBuild)
# Microsoft.Build (MSBuild)
The Microsoft Build Engine is a platform for building applications. This engine, which is also known as MSBuild, provides an XML schema for a project file that controls how the build platform processes and builds software. Visual Studio uses MSBuild, but MSBuild *does not* depend on Visual Studio. By invoking msbuild.exe on your project or solution file, you can orchestrate and build products in environments where Visual Studio isn't installed.

For more information on MSBuild, see the [MSDN documentation](https://msdn.microsoft.com/en-us/library/dd393574(v=vs.120).aspx).

[![Build Status](http://dotnet-ci.cloudapp.net/job/Microsoft_msbuild/job/innerloop_master_Windows_NT/badge/icon)](http://dotnet-ci.cloudapp.net/job/Microsoft_msbuild/job/innerloop_master_Windows_NT/)
### Build Status
| Configuration | Windows | Ubuntu |Mac OS X|
|:------|:------:|:------:|:------:|
| **Full Framework (master)** | [![Build Status](http://dotnet-ci.cloudapp.net/job/Microsoft_msbuild/job/innerloop_master_Windows_NT/badge/icon)](http://dotnet-ci.cloudapp.net/job/Microsoft_msbuild/job/innerloop_master_Windows_NT/) | N/A | N/A |
|**.NET Core (xplat)**|[![Build Status](http://dotnet-ci.cloudapp.net/job/Microsoft_msbuild/job/innerloop_xplat_Windows_NT/badge/icon)](http://dotnet-ci.cloudapp.net/job/Microsoft_msbuild/job/innerloop_xplat_Windows_NT/)|[![Build Status](http://dotnet-ci.cloudapp.net/job/Microsoft_msbuild/job/innerloop_xplat_Ubuntu/badge/icon)](http://dotnet-ci.cloudapp.net/job/Microsoft_msbuild/job/innerloop_xplat_Ubuntu/)|[![Build Status](http://dotnet-ci.cloudapp.net/job/Microsoft_msbuild/job/innerloop_xplat_OSX/badge/icon)](http://dotnet-ci.cloudapp.net/job/Microsoft_msbuild/job/innerloop_xplat_OSX/)|

### Source code

Expand All @@ -14,13 +18,14 @@ For the full supported experience, you will need to have Visual Studio 2015. You

To get started on **Visual Studio 2015**:

1. Set up a box with Visual Studio 2015. Either
[install Visual Studio 2015](http://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs),
or grab a [prebuilt Azure VM image](http://blogs.msdn.com/b/visualstudioalm/archive/2014/06/04/visual-studio-14-ctp-now-available-in-the-virtual-machine-azure-gallery.aspx).
1. [Install Visual Studio 2015](http://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs). Select the following optional components:
- _Microsoft Web Developer Tools_
- _Universal Windows App Development Tools_
- _Tools and Windows SDK 10.0.10240_
2. Clone the source code (see above).
3. Restore NuGet packages: `msbuild /t:BulkRestoreNugetPackages build.proj`
4. Open src/MSBuild.sln solution in Visual Studio 2015.

## How to Engage, Contribute and Provide Feedback
Before you contribute, please read through the contributing and developer guides to get an idea of what kinds of pull requests we will or won't accept.

Expand Down
11 changes: 8 additions & 3 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@

<ItemGroup>
<Project Include="src\dirs.proj" />
<Project Include="Samples\dirs.proj" />
<Project Include="Samples\dirs.proj" Condition="'$(BuildSamples)'!='false'" />
</ItemGroup>

<Import Project="dir.targets" />

<Import Project="dir.traversal.targets" />

<!-- Ensure the BuildTools package has been restored when doing a Rebuild. This needs to happen
after import dir.traversal.targets. If this isn't done, Imports will fail because the Clean
target will load all projects. -->
<Target Name="Rebuild" DependsOnTargets="_RestoreBuildToolsPackagesConfig;Clean;Build" />


<Target Name="BulkRestoreNugetPackages"
BeforeTargets="Build;BuildAllProjects"
DependsOnTargets="_RestoreBuildTools">
DependsOnTargets="_RestoreBuildToolsPackagesConfig">
<Message Importance="High" Text="Restoring NuGet packages..." />
<Exec Command="$(NugetToolPath) restore &quot;$(SourceDir)MSBuild.sln&quot;" StandardOutputImportance="Low" />
</Target>
Expand Down
9 changes: 7 additions & 2 deletions dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@

<!-- Common repo directories -->
<PropertyGroup>
<BuildToolsVersion>1.0.25-prerelease-00080</BuildToolsVersion>
<BuildToolsVersion>1.0.25-prerelease-00199</BuildToolsVersion>
<CompilerToolsVersion>1.0.0</CompilerToolsVersion>
<XunitVersion>2.1.0-rc1-build3168</XunitVersion>
<MicroBuildVersion>0.2.0</MicroBuildVersion>

<ProjectDir>$(MSBuildThisFileDirectory)</ProjectDir>
<SourceDir>$(ProjectDir)src\</SourceDir>
Expand All @@ -36,9 +37,10 @@
<!-- Input Directories -->
<PackagesDir>$(ProjectDir)packages\</PackagesDir>
<ToolsDir>$(PackagesDir)Microsoft.DotNet.BuildTools.$(BuildToolsVersion)\lib\</ToolsDir>
<BuildToolsTaskDir>$(ToolsDir)net45\</BuildToolsTaskDir>
<CompilerToolsDir>$(PackagesDir)Microsoft.Net.Compilers.$(CompilerToolsVersion)\tools</CompilerToolsDir>

<BootstrapDestination>$(BinDir)Bootstrap\</BootstrapDestination>
<MicroBuildDir>$(PackagesDir)\MicroBuild.Core.$(MicroBuildVersion)\build\</MicroBuildDir>
</PropertyGroup>

<!-- If we're building with a bootstrapped MSBuild, use fresh extensions instead of the installed ones. -->
Expand All @@ -58,6 +60,8 @@
<NuGetConfigFile>$(SourceDir).nuget\NuGet.Config</NuGetConfigFile>
<NuGetPackageSource>@(NuGetSourceList -> '-source %(Identity)', ' ')</NuGetPackageSource>
<NuGetConfigCommandLine>$(NuGetPackageSource) -ConfigFile "$(NuGetConfigFile)"</NuGetConfigCommandLine>
<NuGetConfigDir>$([System.IO.Path]::Combine($(SourceDir),".nuget"))</NuGetConfigDir>
<NuGetDir>$(PackagesDir)</NuGetDir>

<NugetRestoreCommand>"$(NuGetToolPath)"</NugetRestoreCommand>
<NugetRestoreCommand>$(NugetRestoreCommand) install</NugetRestoreCommand>
Expand All @@ -66,6 +70,7 @@
<NugetRestoreCommand>$(NugetRestoreCommand) $(NuGetConfigCommandLine)</NugetRestoreCommand>
<NugetRestoreCommand>$(NugetRestoreCommand) -Verbosity detailed</NugetRestoreCommand>
<NugetRestoreCommand Condition="'$(OsEnvironment)'=='Unix'">mono $(NuGetRestoreCommand)</NugetRestoreCommand>
<_RestoreBuildToolsCommand>$(NugetRestoreCommand) "$(SourceDir).nuget/packages.config"</_RestoreBuildToolsCommand>
</PropertyGroup>

<!-- Set default Configuration and Platform -->
Expand Down
142 changes: 5 additions & 137 deletions dir.targets
Original file line number Diff line number Diff line change
@@ -1,139 +1,5 @@
<?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="_CopyCompilers" AfterTargets="_RestoreBuildTools" Condition="'$(UseRoslynCompilers)' == 'true'">
<ItemGroup>
<BuildFiles Include="$(PackagesDir)Microsoft.Net.ToolsetCompilers*\build\*" />
<ToolsFiles Include="$(PackagesDir)Microsoft.Net.ToolsetCompilers*\tools\*" />
</ItemGroup>

<Copy
SourceFiles="@(BuildFiles);@(ToolsFiles)"
DestinationFolder="$(OutputPath)tools"
SkipUnchangedFiles="true"
/>
<Exec Condition="'$(OS)' != 'Windows_NT'" Command="find '$(OutputPath)tools' -name &quot;*.exe&quot; -exec chmod &quot;+x&quot; '{}' ';'" />
</Target>

<Target Name="_RestoreBuildTools"
Inputs="$(MSBuildThisFileDirectory)dir.props;$(SourceDir).nuget/packages.config"
Outputs="$(NuGetToolPath);$(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://dist.nuget.org/win-x86-commandline/v3.3.0/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.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 ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="EnsurePrerequisitesCopied"
BeforeTargets="Build"
Condition="'$(IsTestProject)' == 'true'">
Expand All @@ -151,14 +17,16 @@
(due to open source signing). -->
<!-- No parallel execution because most of our tests do bad things
with state. They were passing because MSTest was serial. -->
<Message Importance="High" Text="xunit -> %(MainAssembly.Filename)..." />
<Exec Command="$(PackagesDir)\xunit.runner.console.$(XunitVersion)\tools\xunit.console.x86.exe @(MainAssembly, ' ') -noshadow -parallel none -xml %(MainAssembly.FullPath)_TestResults.xml -html %(MainAssembly.FullPath)_TestResults.html > %(MainAssembly.FullPath)_stdout.txt" />
</Target>

<!-- See https://github.com/Microsoft/msbuild/issues/224 -->
<Target Name="EnsureSDKTargetPresent"
BeforeTargets="_RestoreBuildToolsWrapper" >
BeforeTargets="_RestoreBuildToolsPackagesConfig" >
<Error Condition="!Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportAfter\Microsoft.NuGet.ImportAfter.targets')"
Text="MSBuild depends on the 'Tools and Windows SDK' Visual Studio plugin. Please install it. Reference: https://github.com/Microsoft/msbuild/wiki/Building+Testing+and+Debugging" />
</Target>


<Import Project="$(NuGetConfigDir)\packageLoad.targets" />
</Project>
Loading

0 comments on commit e4a55ee

Please sign in to comment.