提交 ab50fff9 编写于 作者: T Tomas Matousek

Update x-plat toolset to dotnet 1.0.0-preview2-002733

上级 b46b99f9
......@@ -2,20 +2,24 @@ SHELL = /usr/bin/env bash
OS_NAME = $(shell uname -s)
BUILD_CONFIGURATION = Debug
BINARIES_PATH = $(shell pwd)/Binaries
SCRIPTS_PATH = $(shell pwd)/build/scripts
TOOLSET_PATH = $(BINARIES_PATH)/toolset
RESTORE_SEMAPHORE_PATH = $(TOOLSET_PATH)/restore.semaphore
BOOTSTRAP_PATH = $(BINARIES_PATH)/Bootstrap
BUILD_LOG_PATH =
HOME_DIR = $(shell cd ~ && pwd)
DOTNET_VERSION = 1.0.0-preview2-002733
MSBUILD_ADDITIONALARGS := /v:m /fl /fileloggerparameters:Verbosity=normal /p:Configuration=$(BUILD_CONFIGURATION)
ifeq ($(OS_NAME),Linux)
MSBUILD_ADDITIONALARGS := $(MSBUILD_ADDITIONALARGS) /p:BaseNuGetRuntimeIdentifier=ubuntu.14.04
ROSLYN_TOOLSET_NAME = roslyn.linux.7
ROSLYN_TOOLSET_NAME = roslyn.linux.8
DOTNET_PLATFORM = ubuntu-x64
else ifeq ($(OS_NAME),Darwin)
MSBUILD_ADDITIONALARGS := $(MSBUILD_ADDITIONALARGS) /p:BaseNuGetRuntimeIdentifier=osx.10.10
ROSLYN_TOOLSET_NAME = roslyn.mac.6
ROSLYN_TOOLSET_NAME = roslyn.mac.8
DOTNET_PLATFORM = osx-x64
endif
ifneq ($(BUILD_LOG_PATH),)
......@@ -69,9 +73,15 @@ toolset: $(ROSLYN_TOOLSET_PATH)
$(ROSLYN_TOOLSET_PATH): | $(TOOLSET_PATH)
@pushd $(TOOLSET_PATH) ; \
curl -O https://dotnetci.blob.core.windows.net/roslyn/$(ROSLYN_TOOLSET_NAME).tar.bz2 && \
tar -jxf $(ROSLYN_TOOLSET_NAME).tar.bz2 && \
chmod +x $(ROSLYN_TOOLSET_NAME)/corerun
curl -O https://dotnetci.blob.core.windows.net/roslyn/$(ROSLYN_TOOLSET_NAME).zip && \
curl -O https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$(DOTNET_VERSION)/dotnet-dev-$(DOTNET_PLATFORM).$(DOTNET_VERSION).tar.gz && \
mkdir -p $(ROSLYN_TOOLSET_NAME)/dotnet-cli && \
$(SCRIPTS_PATH)/unzip.sh $(ROSLYN_TOOLSET_NAME).zip $(ROSLYN_TOOLSET_NAME) && \
tar -zxf dotnet-dev-$(DOTNET_PLATFORM).$(DOTNET_VERSION).tar.gz -C $(ROSLYN_TOOLSET_NAME)/dotnet-cli && \
chmod +x $(ROSLYN_TOOLSET_NAME)/corerun && \
chmod +x $(ROSLYN_TOOLSET_NAME)/RoslynRestore && \
chmod +x $(ROSLYN_TOOLSET_NAME)/csc && \
chmod +x $(ROSLYN_TOOLSET_NAME)/vbc
$(TOOLSET_PATH):
mkdir -p $(TOOLSET_PATH)
# Builds the toolset for use in unix msbuild-coreclr
param (
[string]$NuGetTaskDir = "$PSScriptRoot\..\..\..\NuGet.BuildTasks\src\Microsoft.NuGet.Build.Tasks\bin\Debug"
[string]$NuGetTaskDir,
[string]$RoslynDropDir,
[string]$DotNetPath = "dotnet"
)
function ZipFiles($sourceDir, $zipPath)
{
If (Test-Path $zipPath)
{
Remove-Item $zipPath
}
Add-Type -Assembly System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::CreateFromDirectory($sourceDir, $zipPath, [System.IO.Compression.CompressionLevel]::Optimal, $false)
}
$ErrorActionPreference="Stop"
try
{
pushd $PSScriptRoot
dotnet restore
dotnet build
& $DotNetPath restore
$dnxcoreDir = "$PSScriptRoot\bin\Debug\dnxcore50"
$outputRoot = "$PSScriptRoot\bin\Debug\netcoreapp1.0"
foreach ($TargetRuntime in ("ubuntu.14.04-x64","osx.10.10-x64"))
{
dotnet publish -r $TargetRuntime
& $DotNetPath publish -r $TargetRuntime
$publishDir = "$dnxcoreDir\$TargetRuntime\publish"
$publishDir = "$outputRoot\$TargetRuntime\publish"
# Fix up AssignLinkMetadata
# TODO(https://github.com/Microsoft/msbuild/issues/544)
......@@ -35,46 +47,65 @@ try
Copy-Item -Force "$NuGetTaskDir\*" $NuGetExtensionsDir
# Copy the portable targets
write-host "Copy portable targets"
Copy-Item -Force -Recurse (Join-Path ([Environment]::GetFolderPath("ProgramFilesX86")) "MSBuild\Microsoft\Portable") "$extensionsMSDir"
# Copy over the portable build task
# TODO(https://github.com/dotnet/roslyn/issues/9640)
# Copy from a NuGet package instead of a build
foreach ($item in ("Microsoft.Build.Tasks.CodeAnalysis.dll","Microsoft.CSharp.Core.targets","Microsoft.VisualBasic.Core.targets"))
# Copy from a NuGet package instead of a build.
# Overwrite dlls pulled in by the references listed in project.json
# (we want a specific toolset compiler version).
write-host "Copy portable build task"
foreach ($item in (
"CodeAnalysisBuildTask\Microsoft.Build.Tasks.CodeAnalysis.dll",
"CodeAnalysisBuildTask\Microsoft.CSharp.Core.targets",
"CodeAnalysisBuildTask\Microsoft.VisualBasic.Core.targets",
"System.Reflection.Metadata.dll",
"System.Collections.Immutable.dll",
"Microsoft.CodeAnalysis.dll",
"Microsoft.CodeAnalysis.CSharp.dll",
"Microsoft.CodeAnalysis.VisualBasic.dll",
"csccore\csc.exe",
"vbccore\vbc.exe"))
{
Copy-Item (Join-Path $PSScriptRoot\..\..\Binaries\Debug\CodeAnalysisBuildTask $item) $publishDir
Copy-Item (Join-Path $RoslynDropDir "20160525.2" $item) $publishDir
}
# Copy over the reference assemblies
$frameworkRefsDir = "$publishDir\reference-assemblies\Framework"
mkdir -Force "$frameworkRefsDir\.NETFramework"
write-host "Copy .NETFramework/v4.5 reference assemblies"
Copy-Item -Force -Recurse (Join-Path ([Environment]::GetFolderPath("ProgramFilesX86")) "Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5") "$frameworkRefsDir\.NETFramework"
write-host "Copy .NETPortable reference assemblies"
Copy-Item -Force -Recurse (Join-Path ([Environment]::GetFolderPath("ProgramFilesX86")) "Reference Assemblies\Microsoft\Framework\.NETPortable") $frameworkRefsDir
# Bug: https://github.com/Microsoft/msbuild/issues/522
# Reference assembly has a bad name, fixup
pushd "$publishDir\reference-assemblies\Framework\.NETFramework\v4.5"
Move-Item System.XML.dll System.Xml.dll
popd
# TODO(https://github.com/dotnet/roslyn/issues/9641)
# Portable CSharp targets have ref with wrong case
write-host "Copy portable targets files"
foreach ($version in ("v4.5","v5.0"))
{
$file = "$extensionsMSDir\Portable\$version\Microsoft.Portable.CSharp.targets"
(Get-Content $file) | %{ $_ -replace 'Microsoft.CSharp.Targets','Microsoft.CSharp.targets' } | Out-File $file
}
# Copy the helper scripts for csc/vbc
write-host "Copy helper scripts for csc"
Copy-Item -Force "$PSScriptRoot\..\..\src\Compilers\CSharp\CscCore\csc" $publishDir
write-host "Copy helper scripts for vbc"
Copy-Item -Force "$PSScriptRoot\..\..\src\Compilers\VisualBasic\VbcCore\vbc" $publishDir
Move-Item $publishDir
$toolsetPackageZip = (Join-Path $outputRoot "$TargetRuntime.zip")
Write-Host "Zipping $publishDir to $toolsetPackageZip"
ZipFiles $publishDir $toolsetPackageZip
}
popd
......
......@@ -6,29 +6,23 @@
},
"dependencies": {
"Microsoft.Build.Framework": "0.1.0-preview-00017",
"Microsoft.Build.Tasks.Core": "0.1.0-preview-00017",
"Microsoft.Build.Utilities.Core": "0.1.0-preview-00017",
"Microsoft.Build.Targets": "0.1.0-preview-00017",
"Microsoft.Build": "0.1.0-preview-00017",
"Microsoft.Net.Compilers.netcore": "1.2.0-beta1-20160202-02",
"Microsoft.Net.Compilers.Targets.netcore": "0.1.4-dev",
"Microsoft.NETCore.Platforms": "1.0.1-rc3-24126-00",
"Microsoft.Build.Framework": "0.1.0-preview-00023-160527",
"Microsoft.Build.Tasks.Core": "0.1.0-preview-00023-160527",
"Microsoft.Build.Utilities.Core": "0.1.0-preview-00023-160527",
"Microsoft.Build.Targets": "0.1.0-preview-00023-160527",
"Microsoft.Build": "0.1.0-preview-00023-160527",
"MSBuild": "0.1.0-preview-00023-160527",
"Microsoft.NETCore.TestHost": "1.0.0-rc3-24126-00",
"NETStandard.Library": "1.0.0-rc3-24126-00",
"MSBuild": "0.1.0-preview-00017",
"System.Security.Cryptography.X509Certificates": "4.0.0-rc3-24126-00",
"System.Diagnostics.Process": "4.1.0-rc3-24126-00",
"Microsoft.NETCore.App": "1.0.0-rc3-004312",
"Newtonsoft.Json": "7.0.1"
},
"frameworks": {
"NETCoreApp1.0": {
"imports": "portable-net452"
"imports": ["portable-net452", "dotnet"]
}
},
"runtimes": {
"win7-x64": { },
"ubuntu.14.04-x64": { },
"osx.10.10-x64": { }
}
......
......@@ -17,8 +17,13 @@ To build the toolset do the following:
- If necessary, make modifications to the dependencies in the
`build/MSBuildToolset/project.json` file to bring in anything new.
- Run the `build/MSBuildToolset/build-toolset.ps1` file.
- In the `build/MSBuildToolset/bin/Debug/dnxcore50` directory:
- Rename and bzip the `osx.10.10-x64/publish` directory as roslyn.mac.`<version number>`
- Rename and bzip the `ubuntu.14.04-x65/publish` directory as roslyn.linux.`<version number>`
- Upload the file to the Azure in the dotnetci storage account in the roslyn container.
- The script produces two zip files in bin\Debug\netcoreapp1.0 subdirectory:
- Rename `osx.10.10-x64.zip` to roslyn.mac.`<version number>.zip`
- Rename `ubuntu.14.04-x64.zip` to roslyn.linux.`<version number>.zip`
- Upload the files to the Azure in the dotnetci storage account in the roslyn container:
```
azcopy /Pattern:*.zip /Source:build\MSBuildToolset\bin\Debug\netcoreapp1.0 /Dest:https://dotnetci.blob.core.windows.net/roslyn /DestKey:<<key>>
```
- Send a PR to change [Makefile](https://github.com/dotnet/roslyn/blob/master/Makefile) to use the new toolset.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册