summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ghiondea <ghiondea.alexandru@microsoft.com>2015-02-18 16:26:30 -0800
committerAlex Ghiondea <ghiondea.alexandru@microsoft.com>2015-02-19 11:24:20 -0800
commitfbc318cfd987694d04431aa4858e299d712af940 (patch)
treeaee74df1df62da0486580d743a120182c4e9f1c3
parentf846ccff6be6b47f139a6b910cae20de54f54329 (diff)
downloadcoreclr-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
-rw-r--r--build.cmd2
-rw-r--r--build.proj80
-rwxr-xr-xbuild.sh2
-rw-r--r--dir.props34
-rw-r--r--dir.targets43
-rw-r--r--src/.nuget/packages.config1
-rw-r--r--src/build.proj41
-rw-r--r--src/mscorlib/Tools/BclRewriter/BclRewriter.targets2
8 files changed, 119 insertions, 86 deletions
diff --git a/build.cmd b/build.cmd
index 5e84112e44..6b6b266baa 100644
--- a/build.cmd
+++ b/build.cmd
@@ -11,7 +11,7 @@ set "__ProjectDir=%~dp0"
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
set "__ProjectFilesDir=%__ProjectDir%"
set "__SourceDir=%__ProjectDir%\src"
-set "__PackagesDir=%__SourceDir%\.nuget"
+set "__PackagesDir=%__ProjectDir%\packages"
set "__RootBinDir=%__ProjectDir%\binaries"
set "__LogsDir=%__RootBinDir%\Logs"
set "__CMakeSlnDir=%__RootBinDir%\CMake"
diff --git a/build.proj b/build.proj
index b1d6dfacaf..95b7a6ec68 100644
--- a/build.proj
+++ b/build.proj
@@ -2,86 +2,12 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="dir.props" />
- <!-- 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="$(BuildToolsTargetInputs)"
- Outputs="$(BuildToolsTargetOutputs)"
- >
-
- <!-- Download latest nuget.exe -->
- <DownloadFile
- Condition="!Exists($(NuGetToolPath))"
- Address="http://nuget.org/nuget.exe"
- FileName="$(NuGetToolPath)" />
-
- <!-- Restore build tools -->
- <Exec
- StandardOutputImportance="Low"
- Command="&quot;$(NuGetToolPath)&quot; install &quot; $(SourceDir).nuget\packages.config &quot; -o &quot; $(ToolsDir) &quot; $(NuGetConfigCommandLine)" />
-
- <Touch Files="$(BuildToolsInstallSemaphore)" AlwaysCreate="true" />
- </Target>
-
- <!-- Setup Nuget properties -->
- <ItemGroup>
- <NuSpecSrcs Include="$(PackagesDir)Microsoft.DotNet.CoreCLR.nuspec" />
- <NuSpecSrcs Condition="'$(Configuration)'=='Release'" Include="$(PackagesDir)Microsoft.DotNet.CoreCLR.Development.nuspec" />
- <NuSpecSrcs Condition="'$(Configuration)'=='Debug'" Include="$(PackagesDir)Microsoft.DotNet.CoreCLR.Debug.Development.nuspec" />
- </ItemGroup>
<ItemGroup>
- <!-- Backslash appended, see note in dir.props about the PackagesBinDir property -->
- <NuSpecs Include="$(PackagesBinDir)\Microsoft.DotNet.CoreCLR.nuspec" />
- <NuSpecs Condition="'$(Configuration)'=='Release'" Include="$(PackagesBinDir)\Microsoft.DotNet.CoreCLR.Development.nuspec" />
- <NuSpecs Condition="'$(Configuration)'=='Debug'" Include="$(PackagesBinDir)\Microsoft.DotNet.CoreCLR.Debug.Development.nuspec" />
+ <!-- We use build.proj instead of dirs.proj so we don't conflict with the TFS build-->
+ <Project Include="src\build.proj" />
</ItemGroup>
- <!-- Generate Microsoft.Dotnet.CoreCLR nuget package and associated development package -->
- <Target Name="BuildNuGetPackages" AfterTargets="MovePDB" Condition="'$(BuildNugetPackage)' != 'false'">
- <MakeDir Directories="$(PackagesBinDir)" Condition="!Exists('$(PackagesBinDir)')" />
- <Copy SourceFiles="@(NuSpecSrcs)" DestinationFolder="$(PackagesBinDir)" />
- <Exec Command="&quot;$(NuGetToolPath)&quot; pack &quot;%(NuSpecs.Identity)&quot; -NoPackageAnalysis -NoDefaultExcludes -OutputDirectory &quot;$(PackagesBinDir)&quot;" />
- </Target>
-
- <ItemGroup>
- <PDBSToMove Include="$(BinDir)mscorlib.pdb"/>
- </ItemGroup>
-
- <PropertyGroup>
- <MscorlibPDBPath>$(BinDir)mscorlib.pdb</MscorlibPDBPath>
- </PropertyGroup>
-
- <Target Name="MovePDB" AfterTargets="Build">
- <Move Condition="Exists($(MscorlibPDBPath))"
- SourceFiles="@(PDBSToMove)"
- DestinationFolder="$(BinDir)PDB"
- />
- </Target>
-
- <!-- Build mscorlib -->
- <ItemGroup>
- <Project Include="src\mscorlib\mscorlib.csproj" />
- </ItemGroup>
+ <Import Project="dir.targets" />
<Import Project="dir.traversal.targets" />
diff --git a/build.sh b/build.sh
index 8d0164fec2..290097de5d 100755
--- a/build.sh
+++ b/build.sh
@@ -114,7 +114,7 @@ __CMakeArgs=DEBUG
# Set the various build properties here so that CMake and MSBuild can pick them up
__ProjectDir="$__ProjectRoot"
__SourceDir="$__ProjectDir/src"
-__PackagesDir="$__SourceDir/.nuget"
+__PackagesDir="$__ProjectDir/packages"
__RootBinDir="$__ProjectDir/binaries"
__LogsDir="$__RootBinDir/Logs"
__CMakeSlnDir="$__RootBinDir/CMake"
diff --git a/dir.props b/dir.props
index ed034d6a29..5a5dfc2d06 100644
--- a/dir.props
+++ b/dir.props
@@ -16,7 +16,7 @@
<SourceDir Condition="'$(__SourceDir)'==''">$(ProjectDir)\src\</SourceDir>
<PackagesDir>$(__PackagesDir)\</PackagesDir>
- <PackagesDir Condition="'$(__PackagesDir)'==''">$(SourceDir)\.nuget\</PackagesDir>
+ <PackagesDir Condition="'$(__PackagesDir)'==''">$(ProjectDir)\packages\</PackagesDir>
<RootBinDir>$(__RootBinDir)\</RootBinDir>
<RootBinDir Condition="'$(__RootBinDir)'==''">$(ProjectDir)\binaries\</RootBinDir>
@@ -37,6 +37,20 @@
<TestWorkingDir Condition="'$(__TestWorkingDir)'==''">$(RootBinDir)\tests\$(BuildArch)\$(BuildType)\</TestWorkingDir>
</PropertyGroup>
+ <!-- Setup Nuget properties -->
+ <ItemGroup>
+ <NuSpecSrcs Include="$(SourceDir)\.nuget\Microsoft.DotNet.CoreCLR.nuspec" />
+ <NuSpecSrcs Condition="'$(Configuration)'=='Release'" Include="$(SourceDir)\.nuget\Microsoft.DotNet.CoreCLR.Development.nuspec" />
+ <NuSpecSrcs Condition="'$(Configuration)'=='Debug'" Include="$(SourceDir)\.nuget\Microsoft.DotNet.CoreCLR.Debug.Development.nuspec" />
+ </ItemGroup>
+ <ItemGroup>
+ <!-- Backslash appended, see note in dir.props about the PackagesBinDir property -->
+ <NuSpecs Include="$(PackagesBinDir)\Microsoft.DotNet.CoreCLR.nuspec" />
+ <NuSpecs Condition="'$(Configuration)'=='Release'" Include="$(PackagesBinDir)\Microsoft.DotNet.CoreCLR.Development.nuspec" />
+ <NuSpecs Condition="'$(Configuration)'=='Debug'" Include="$(PackagesBinDir)\Microsoft.DotNet.CoreCLR.Debug.Development.nuspec" />
+ </ItemGroup>
+
+
<!-- Common NuGet properties -->
<PropertyGroup>
<NuGetToolPath>$(ToolsDir)NuGet.exe</NuGetToolPath>
@@ -47,10 +61,18 @@
<!-- Common build tool properties -->
<PropertyGroup>
- <BuildToolsPackageName>Microsoft.DotNet.BuildTools.CoreCLR</BuildToolsPackageName>
- <BuildToolsVersion>1.0.1-prerelease</BuildToolsVersion>
- <BuildToolsInstallSempahore>$(ToolsDir)BuildTools.$(BuildToolsVersion).installed.semaphore</BuildToolsInstallSempahore>
- <BuildToolsTargetInputs>$(MSBuildThisFileFullPath);$(MSBuildThisFileDirectory)build.proj</BuildToolsTargetInputs>
- <BuildToolsTargetOutputs>$(BuildToolsInstallSempahore)</BuildToolsTargetOutputs>
+
+ <BuildToolsCoreCLRPackageName>Microsoft.DotNet.BuildTools.CoreCLR</BuildToolsCoreCLRPackageName>
+ <BuildToolsCoreCLRVersion>1.0.1-prerelease</BuildToolsCoreCLRVersion>
+ <BuildToolsCoreCLRInstallSempahore>$(ToolsDir)BuildTools.$(BuildToolsCoreCLRVersion).installed.semaphore</BuildToolsCoreCLRInstallSempahore>
+
+ <BuildToolsPackageName>Microsoft.DotNet.BuildTools</BuildToolsPackageName>
+ <BuildToolsVersion>1.0.25-prerelease-00009</BuildToolsVersion>
+
+ <BuildToolsCoreCLRTargetInputs>$(MSBuildThisFileFullPath);$(MSBuildThisFileDirectory)build.proj</BuildToolsCoreCLRTargetInputs>
+ <BuildToolsCoreCLRTargetOutputs>$(BuildToolsCoreCLRInstallSempahore)</BuildToolsCoreCLRTargetOutputs>
+
+ <BuildToolsCoreCLRLocation>$(ToolsDir)\$(BuildToolsCoreCLRPackageName).$(BuildToolsCoreCLRVersion)</BuildToolsCoreCLRLocation>
+ <BuildToolsLocation>$(ToolsDir)\$(BuildToolsPackageName).$(BuildToolsVersion)</BuildToolsLocation>
</PropertyGroup>
</Project> \ No newline at end of file
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="&quot;$(NuGetToolPath)&quot; install &quot; $(SourceDir).nuget\packages.config &quot; -o &quot; $(ToolsDir) &quot; $(NuGetConfigCommandLine)" />
+
+ <Touch Files="$(BuildToolsInstallSemaphore)" AlwaysCreate="true" />
+ </Target>
+</Project> \ No newline at end of file
diff --git a/src/.nuget/packages.config b/src/.nuget/packages.config
index 662f95ca5c..f4b06889ba 100644
--- a/src/.nuget/packages.config
+++ b/src/.nuget/packages.config
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.DotNet.BuildTools.CoreCLR" version="1.0.1-prerelease" />
+ <package id="Microsoft.DotNet.BuildTools" version="1.0.25-prerelease-00009" />
</packages> \ No newline at end of file
diff --git a/src/build.proj b/src/build.proj
new file mode 100644
index 0000000000..dff408ea1a
--- /dev/null
+++ b/src/build.proj
@@ -0,0 +1,41 @@
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="..\dir.props"/>
+
+ <!-- List the projects that need to be built -->
+ <ItemGroup>
+ <Project Include="mscorlib\mscorlib.csproj" />
+ </ItemGroup>
+
+ <Import Project="..\dir.targets" />
+
+ <Import Project="..\dir.traversal.targets" />
+
+
+ <!-- Hook into the local publishing by providing the task that needs to run before we can do the local publishing -->
+ <Import Project="$(BuildToolsLocation)\lib\packages.targets" Condition="Exists('$(BuildToolsLocation)\lib\packages.targets')" />
+ <PropertyGroup>
+ <NugetPackageBuildTargets>BuildNuGetPackages</NugetPackageBuildTargets>
+ </PropertyGroup>
+
+ <!-- Generate Microsoft.Dotnet.CoreCLR nuget package and associated development package -->
+ <Target Name="BuildNuGetPackages" AfterTargets="MovePDB" Condition="'$(BuildNugetPackage)' != 'false'">
+ <MakeDir Directories="$(PackagesBinDir)" Condition="!Exists('$(PackagesBinDir)')" />
+ <Copy SourceFiles="@(NuSpecSrcs)" DestinationFolder="$(PackagesBinDir)" />
+ <Exec Command="&quot;$(NuGetToolPath)&quot; pack &quot;%(NuSpecs.Identity)&quot; -NoPackageAnalysis -NoDefaultExcludes -OutputDirectory &quot;$(PackagesBinDir)&quot;" />
+ </Target>
+
+ <ItemGroup>
+ <PDBSToMove Include="$(BinDir)mscorlib.pdb"/>
+ </ItemGroup>
+
+ <PropertyGroup>
+ <MscorlibPDBPath>$(BinDir)mscorlib.pdb</MscorlibPDBPath>
+ </PropertyGroup>
+
+ <Target Name="MovePDB" AfterTargets="Build">
+ <Move Condition="Exists($(MscorlibPDBPath))"
+ SourceFiles="@(PDBSToMove)"
+ DestinationFolder="$(BinDir)PDB"
+ />
+ </Target>
+</Project> \ No newline at end of file
diff --git a/src/mscorlib/Tools/BclRewriter/BclRewriter.targets b/src/mscorlib/Tools/BclRewriter/BclRewriter.targets
index 62c16f5e3c..a0f67a6528 100644
--- a/src/mscorlib/Tools/BclRewriter/BclRewriter.targets
+++ b/src/mscorlib/Tools/BclRewriter/BclRewriter.targets
@@ -5,7 +5,7 @@
<!-- ********************************************************************************************* -->
<PropertyGroup>
- <BclRewriterCommand Condition="'$(BclRewriterCommand)'==''">$(ToolsDir)\$(BuildToolsPackageName).$(BuildToolsVersion)\BclRewriter.exe</BclRewriterCommand>
+ <BclRewriterCommand Condition="'$(BclRewriterCommand)'==''">$(BuildToolsCoreCLRLocation)\BclRewriter.exe</BclRewriterCommand>
<BclRewriterModelFile>$(MscorlibDir)model.xml</BclRewriterModelFile>
<BclRewriterWorkDir>$(IntermediateOutputPath)\BclRewriter</BclRewriterWorkDir>
<BclRewriterSymbolOutput>$(IntermediateOutputPath)\BclRewriter\$(TargetName).pdb</BclRewriterSymbolOutput>