Skip to content

Commit

Permalink
Add Feed package to Arcade
Browse files Browse the repository at this point in the history
  • Loading branch information
chcosta committed Feb 16, 2018
1 parent c275514 commit a4f529d
Show file tree
Hide file tree
Showing 39 changed files with 4,121 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Arcade.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27411.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Build.Tasks.Feed", "src\Microsoft.DotNet.Build.Tasks.Feed\Microsoft.DotNet.Build.Tasks.Feed.csproj", "{941D335B-AA65-4089-9502-F306B108D182}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Build.Tasks.Feed.net45", "src\Microsoft.DotNet.Build.Tasks.Feed\net45\Microsoft.DotNet.Build.Tasks.Feed.net45.csproj", "{127C160B-16ED-4311-A66B-1582A5515643}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{941D335B-AA65-4089-9502-F306B108D182}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{941D335B-AA65-4089-9502-F306B108D182}.Debug|Any CPU.Build.0 = Debug|Any CPU
{941D335B-AA65-4089-9502-F306B108D182}.Release|Any CPU.ActiveCfg = Release|Any CPU
{941D335B-AA65-4089-9502-F306B108D182}.Release|Any CPU.Build.0 = Release|Any CPU
{127C160B-16ED-4311-A66B-1582A5515643}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{127C160B-16ED-4311-A66B-1582A5515643}.Debug|Any CPU.Build.0 = Debug|Any CPU
{127C160B-16ED-4311-A66B-1582A5515643}.Release|Any CPU.ActiveCfg = Release|Any CPU
{127C160B-16ED-4311-A66B-1582A5515643}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {06E6CFF5-C54E-4623-9587-71A9E3F041D9}
EndGlobalSection
EndGlobal
3 changes: 3 additions & 0 deletions Build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
powershell -ExecutionPolicy ByPass %~dp0build\Build.ps1 -restore -build %*
exit /b %ErrorLevel%
11 changes: 11 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project>
<PropertyGroup>
<VersionsPropsPath>$(RepoRoot)build\Versions.props</VersionsPropsPath>

<RepositoryUrl>https://github.com/dotnet/arcade</RepositoryUrl>
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>

<RestoreSources>$(RestoreSources);https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json</RestoreSources>
</PropertyGroup>
</Project>
14 changes: 14 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<config>
<add key="repositoryPath" value="packages" />
</config>
<packageSources>
<clear />
<add key="myget.org roslyn-tools" value="https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json" />
<add key="dotnetfeed dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
</packageSources>
</configuration>
3 changes: 3 additions & 0 deletions Restore.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
powershell -ExecutionPolicy ByPass %~dp0build\Build.ps1 -restore %*
exit /b %ErrorLevel%
3 changes: 3 additions & 0 deletions build/CIBuild.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
powershell -ExecutionPolicy ByPass %~dp0Build.ps1 -restore -build -test -sign -pack -ci %*
exit /b %ErrorLevel%
9 changes: 9 additions & 0 deletions build/NuGet.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project>
<PropertyGroup>
<!-- Respect environment variable for the NuGet Packages Root if set; otherwise, use the current default location -->
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == ''">$(NUGET_PACKAGES)</NuGetPackageRoot>
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == ''">$(MSBuildThisFileDirectory)packages\</NuGetPackageRoot>
<NuGetPackageRoot Condition="!HasTrailingSlash('$(NuGetPackageRoot)')">$(NuGetPackageRoot)\</NuGetPackageRoot>
</PropertyGroup>
</Project>
10 changes: 10 additions & 0 deletions build/Toolset.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
<RestoreSources>https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json</RestoreSources>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="RoslynTools.RepoToolset" Version="$(RoslynToolsRepoToolsetVersion)" />
</ItemGroup>
</Project>
27 changes: 27 additions & 0 deletions build/Versions.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- This repo version -->
<VersionBase>1.0.0</VersionBase>
<PreReleaseVersionLabel>beta</PreReleaseVersionLabel>

<!-- Toolset -->
<RoslynToolsRepoToolsetVersion>1.0.0-beta-62614-02</RoslynToolsRepoToolsetVersion>
<DotNetCliVersion>2.0.2</DotNetCliVersion>


<!-- Libs -->
<NewtonsoftJsonVersion>9.0.1</NewtonsoftJsonVersion>
<MoqVersion>4.5.21</MoqVersion>
<NuGetVersioningVersion>4.4.0</NuGetVersioningVersion>
<MicrosoftBuildVersion>14.3.0</MicrosoftBuildVersion>
<MicrosoftBuildTasksCoreVersion>14.3.0</MicrosoftBuildTasksCoreVersion>
</PropertyGroup>

<PropertyGroup>
<RestoreSources>
$(RestoreSources);
https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json
</RestoreSources>
</PropertyGroup>
</Project>
173 changes: 173 additions & 0 deletions build/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $configuration = "Debug",
[string] $solution = "",
[string] $verbosity = "minimal",
[switch] $restore,
[switch] $deployDeps,
[switch] $build,
[switch] $rebuild,
[switch] $deploy,
[switch] $test,
[switch] $integrationTest,
[switch] $sign,
[switch] $pack,
[switch] $ci,
[switch] $prepareMachine,
[switch] $log,
[switch] $help,
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
)

set-strictmode -version 2.0
$ErrorActionPreference = "Stop"

function Print-Usage() {
Write-Host "Common settings:"
Write-Host " -configuration <value> Build configuration Debug, Release"
Write-Host " -verbosity <value> Msbuild verbosity (q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic])"
Write-Host " -help Print help and exit"
Write-Host ""

Write-Host "Actions:"
Write-Host " -restore Restore dependencies"
Write-Host " -build Build solution"
Write-Host " -rebuild Rebuild solution"
Write-Host " -deploy Deploy built VSIXes"
Write-Host " -deployDeps Deploy dependencies (Roslyn VSIXes for integration tests)"
Write-Host " -test Run all unit tests in the solution"
Write-Host " -integrationTest Run all integration tests in the solution"
Write-Host " -sign Sign build outputs"
Write-Host " -pack Package build outputs into NuGet packages and Willow components"
Write-Host ""

Write-Host "Advanced settings:"
Write-Host " -solution <value> Path to solution to build"
Write-Host " -ci Set when running on CI server"
Write-Host " -log Enable logging (by default on CI)"
Write-Host " -prepareMachine Prepare machine for CI run"
Write-Host ""
Write-Host "Command line arguments not listed above are passed thru to msbuild."
Write-Host "The above arguments can be shortened as much as to be unambiguous (e.g. -co for configuration, -t for test, etc.)."
}

if ($help -or (($properties -ne $null) -and ($properties.Contains("/help") -or $properties.Contains("/?")))) {
Print-Usage
exit 0
}

function CreateDirectory([string[]] $path) {
if (!(Test-Path $path)) {
New-Item -path $path -force -itemType "Directory" | Out-Null
}
}

function InstallDotNetCli {
$installScript = "$DotNetRoot\dotnet-install.ps1"
if (!(Test-Path $installScript)) {
CreateDirectory $DotNetRoot
Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile $installScript
}

& $installScript -Version $globalJson.sdk.version -InstallDir $DotNetRoot
if ($lastExitCode -ne 0) {
throw "Failed to install dotnet cli (exit code '$lastExitCode')."
}
}

# This is a temporary workaround for https://github.com/Microsoft/msbuild/issues/2095 and
# https://github.com/dotnet/cli/issues/6589
# Currently, SDK's always get resolved to the global location, but we want our packages
# to all be installed into a local folder (prevent machine contamination from global state).
#
# We are restoring all of our packages locally and setting NuGetPackageRoot to reference the
# local location, but this breaks Custom SDK's which are expecting the SDK to be available
# from the global user folder.
function MakeGlobalSdkAvailableLocal {
$RepoToolsetSource = Join-Path $DefaultNuGetPackageRoot "roslyntools.repotoolset\$ToolsetVersion\"
$RepoToolsetDestination = Join-Path $NuGetPackageRoot "roslyntools.repotoolset\$ToolsetVersion\"
if (!(Test-Path $RepoToolsetDestination)) {
Copy-Item $RepoToolsetSource -Destination $RepoToolsetDestination -Recurse
}
}
function InstallToolset {
if (!(Test-Path $ToolsetBuildProj)) {
CreateDirectory $TempDir
$proj = Join-Path $TempDir "_restore.proj"
'<Project Sdk="RoslynTools.RepoToolset"><Target Name="NoOp"/></Project>' | Set-Content $proj
& $DotNetExe msbuild $proj /t:NoOp /m /nologo /clp:None /warnaserror /flp:v=diag /v:$verbosity /p:NuGetPackageRoot=$NuGetPackageRoot /p:__ExcludeSdkImports=true
}
}

function Build {
MakeGlobalSdkAvailableLocal

if ($ci -or $log) {
CreateDirectory($logDir)
$logCmd = "/bl:" + (Join-Path $LogDir "Build.binlog")
} else {
$logCmd = ""
}

& $DotNetExe msbuild $ToolsetBuildProj /m /nologo /clp:Summary /warnaserror /v:$verbosity $logCmd /p:Configuration=$configuration /p:SolutionPath=$solution /p:Restore=$restore /p:DeployDeps=$deployDeps /p:Build=$build /p:Rebuild=$rebuild /p:Deploy=$deploy /p:Test=$test /p:IntegrationTest=$integrationTest /p:Sign=$sign /p:Pack=$pack /p:CIBuild=$ci /p:NuGetPackageRoot=$NuGetPackageRoot $properties
}

function Stop-Processes() {
Write-Host "Killing running build processes..."
Get-Process -Name "msbuild" -ErrorAction SilentlyContinue | Stop-Process
Get-Process -Name "vbcscompiler" -ErrorAction SilentlyContinue | Stop-Process
}


try {
$RepoRoot = Join-Path $PSScriptRoot "..\"
$DotNetRoot = Join-Path $RepoRoot ".\.dotnet"
$DotNetExe = Join-Path $DotNetRoot "dotnet.exe"
$ArtifactsDir = Join-Path $RepoRoot "artifacts"
$LogDir = Join-Path (Join-Path $ArtifactsDir $configuration) "log"
$TempDir = Join-Path (Join-Path $ArtifactsDir $configuration) "tmp"
$globalJson = Get-Content(Join-Path $RepoRoot "global.json") | ConvertFrom-Json
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = "true"

if ($solution -eq "") {
$solution = @(Get-ChildItem(Join-Path $RepoRoot "*.sln"))[0]
}

if ($env:NUGET_PACKAGES -ne $null) {
$NuGetPackageRoot = $env:NUGET_PACKAGES.TrimEnd("\") + "\"
$DefaultNuGetPackageRoot = $NuGetPackageRoot
} else {
$NuGetPackageRoot = (Join-Path $RepoRoot "packages") + "\"
$DefaultNuGetPackageRoot = Join-Path $env:UserProfile ".nuget\packages\"
}

$ToolsetVersion = $globalJson.'msbuild-sdks'.'RoslynTools.RepoToolset'
$ToolsetBuildProj = Join-Path $NuGetPackageRoot "roslyntools.repotoolset\$ToolsetVersion\tools\Build.proj"

if ($ci) {
CreateDirectory $TempDir
$env:TEMP = $TempDir
$env:TMP = $TempDir
}

if ($restore) {
InstallDotNetCli
InstallToolset
}

Build
exit $lastExitCode
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
exit 1
}
finally {
Pop-Location
if ($ci -and $prepareMachine) {
Stop-Processes
}
}

8 changes: 8 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"sdk": {
"version": "2.1.100-preview-007366"
},
"msbuild-sdks": {
"RoslynTools.RepoToolset": "1.0.0-beta-62614-02"
}
}
28 changes: 28 additions & 0 deletions src/Microsoft.DotNet.Build.Tasks.Feed/Compile.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
</PropertyGroup>

<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)**\*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)..\common\AzureBlobLease.cs">
<Link>AzureBlobLease.cs</Link>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)..\common\AzureConnectionStringBuildTask.cs">
<Link>AzureConnectionStringBuildTask.cs</Link>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)..\common\AzureHelper.cs">
<Link>AzureHelper.cs</Link>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)..\common\CreateAzureContainer.cs">
<Link>CreateAzureContainer.cs</Link>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)..\common\UploadClient.cs">
<Link>UploadClient.cs</Link>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)..\common\UploadToAzure.cs">
<Link>UploadToAzure.cs</Link>
</Compile>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="RoslynTools.RepoToolset">
<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
</PropertyGroup>
<ItemGroup>
<None Remove="Compile.props" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)Compile.props" />
<ItemGroup>
<PackageReference Include="Microsoft.Build.Framework" Version="14.3.0" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="14.3.0" />
<PackageReference Include="Microsoft.DotNet.VersionTools" Version="2.1.0-preview2-02516-02 " />
<PackageReference Include="SleetLib" Version="2.2.24" />
<PackageReference Include="System.Xml.XmlDocument" Version="4.0.1" />
<PackageReference Include="WindowsAzure.Storage" Version="8.5.0" />
</ItemGroup>
</Project>
Loading

0 comments on commit a4f529d

Please sign in to comment.