diff options
author | Alex Ghiondea <ghiondea.alexandru@microsoft.com> | 2015-02-18 16:26:30 -0800 |
---|---|---|
committer | Alex Ghiondea <ghiondea.alexandru@microsoft.com> | 2015-02-19 11:24:20 -0800 |
commit | fbc318cfd987694d04431aa4858e299d712af940 (patch) | |
tree | aee74df1df62da0486580d743a120182c4e9f1c3 /dir.targets | |
parent | f846ccff6be6b47f139a6b910cae20de54f54329 (diff) | |
download | coreclr-fbc318cfd987694d04431aa4858e299d712af940.tar.gz coreclr-fbc318cfd987694d04431aa4858e299d712af940.tar.bz2 coreclr-fbc318cfd987694d04431aa4858e299d712af940.zip |
Setup the CoreCLR repo to use the LocalPackagePublish mechanism.
This will enable the 'local publish' of the CoreCLR package to a location where
it can be picked up by the CoreFx build. What this means is that you will be able
to build the CoreCLR package and use that to run the CoreFx tests on top of it.
Changes required to make this happen:
- Refactor the managed build to make sure the buildtools gets restored before
we attempt to use the targets it provides.
- Take a dependency to the Microsoft.DotNet.BuildTools to bring in the packages.targets
- Update the $(PackagesDir) to point to the <repo root>\packages to make it consistent with CoreFx
- Hook-up the LocalPackagePublish targets to the build of the CoreCLR NuGet packages
Diffstat (limited to 'dir.targets')
-rw-r--r-- | dir.targets | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/dir.targets b/dir.targets new file mode 100644 index 0000000000..a5c1888f93 --- /dev/null +++ b/dir.targets @@ -0,0 +1,43 @@ +<Project DefaultTargets="Build" 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" /> + <Code Type="Fragment" Language="cs"> + <![CDATA[ + var directory = System.IO.Path.GetDirectoryName(FileName); + System.IO.Directory.CreateDirectory(directory); + var client = new System.Net.WebClient(); + client.Proxy = System.Net.WebRequest.DefaultWebProxy; + client.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials; + client.DownloadFile(Address, FileName); + ]]> + </Code> + </Task> + </UsingTask> + + <Target Name="_RestoreBuildTools" + BeforeTargets="Build" + Inputs="$(BuildToolsCoreCLRTargetInputs)" + Outputs="$(BuildToolsCoreCLRTargetOutputs)" + > + + <!-- Download latest nuget.exe --> + <DownloadFile + Condition="!Exists($(NuGetToolPath))" + Address="http://nuget.org/nuget.exe" + FileName="$(NuGetToolPath)" /> + + <!-- Restore build tools --> + <Exec + StandardOutputImportance="Low" + Command=""$(NuGetToolPath)" install " $(SourceDir).nuget\packages.config " -o " $(ToolsDir) " $(NuGetConfigCommandLine)" /> + + <Touch Files="$(BuildToolsInstallSemaphore)" AlwaysCreate="true" /> + </Target> +</Project>
\ No newline at end of file |