Skip to content

Commit

Permalink
Implement darc dependency flow without adopting Arcade (yet) (#626)
Browse files Browse the repository at this point in the history
  • Loading branch information
natemcmaster authored Dec 12, 2018
1 parent 537bda8 commit 3b6488c
Show file tree
Hide file tree
Showing 75 changed files with 4,656 additions and 79 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ node_modules/
**/[Cc]ompiler/[Rr]esources/**/*.js
.vscode/
.testPublish/
global.json
BenchmarkDotNet.Artifacts/
*.binlog
7 changes: 6 additions & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<configuration>
<packageSources>
<clear />
<!-- Restore sources should be defined in build/sources.props. -->
<!--
Restore sources should be defined in build/sources.props.
The only allowed feed here is MSBuild SDK packages which is required to work around
https://github.com/Microsoft/msbuild/issues/2914
-->
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
</packageSources>
</configuration>
3 changes: 1 addition & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ jobs:
agentOs: Windows
configuration: Release
codeSign: true
buildArgs: |
'/p:PublishBlobFeedKey=$(PB_PublishBlobFeedKey)'
publishToBar: true
artifacts:
publish: true
name: packages
Expand Down
14 changes: 5 additions & 9 deletions build/repo.targets
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
<Project InitialTargets="TagCiBuilds">
<PropertyGroup>
<BuildDependsOn Condition="'$(Configuration)' == 'Release' AND '$(OS)' == 'Windows_NT' AND $(PublishType.Contains('blob'))" >$(BuildDependsOn);PublishToProdCon</BuildDependsOn>
</PropertyGroup>

<Target Name="TagCiBuilds" Condition=" '$(CI)' == 'true' AND '$(BUILD_REASON)' != 'PullRequest' ">
<Message Importance="high" Text="##vso[build.addbuildtag]daily-build" Condition=" '$(IsFinalBuild)' != 'true' " />
<Message Importance="high" Text="##vso[build.addbuildtag]release-candidate" Condition=" '$(IsFinalBuild)' == 'true' " />
</Target>

<Target Name="PublishToProdCon">
<MSBuild Projects="$(MSBuildThisFileDirectory)..\eng\ProdConPublish.csproj"
<Target Name="PublishToBAR">
<MSBuild Projects="$(MSBuildThisFileDirectory)..\eng\tools.proj"
Targets="Restore"
Properties="$(BuildProperties);_Dummy=Restore" />
Properties="$(BuildProperties);RestorePackagesPath=$(RepositoryRoot).packages\" />

<MSBuild Projects="$(MSBuildThisFileDirectory)..\eng\ProdConPublish.csproj"
<MSBuild Projects="$(MSBuildThisFileDirectory)..\eng\publish.proj"
Targets="Publish"
Properties="$(BuildProperties)" />
Properties="$(BuildProperties);RestorePackagesPath=$(RepositoryRoot).packages\" />
</Target>

<Target Name="GenerateProjectList" DependsOnTargets="ResolveProjects">
Expand Down
53 changes: 0 additions & 53 deletions eng/ProdConPublish.csproj

This file was deleted.

10 changes: 10 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies></ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.18610.4">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>6f6f4e5b974772c9949ed0f0baaf521a8c7991e4</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
5 changes: 5 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<MicrosoftDotNetBuildTasksFeedVersion>2.2.0-beta.18607.6</MicrosoftDotNetBuildTasksFeedVersion>
</PropertyGroup>
</Project>
3 changes: 3 additions & 0 deletions eng/common/CIBuild.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -test -sign -pack -publish -ci %*"
exit /b %ErrorLevel%
3 changes: 3 additions & 0 deletions eng/common/PublishBuildAssets.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -msbuildEngine dotnet -restore -execute /p:PublishBuildAssets=true /p:SdkTaskProjects=PublishBuildAssets.proj %*"
exit /b %ErrorLevel%
28 changes: 28 additions & 0 deletions eng/common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Don't touch this folder

uuuuuuuuuuuuuuuuuuuu
u" uuuuuuuuuuuuuuuuuu "u
u" u$$$$$$$$$$$$$$$$$$$$u "u
u" u$$$$$$$$$$$$$$$$$$$$$$$$u "u
u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u
u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u
u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u
$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $
$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $
$ $$$" ... "$... ...$" ... "$$$ ... "$$$ $
$ $$$u `"$$$$$$$ $$$ $$$$$ $$ $$$ $$$ $
$ $$$$$$uu "$$$$ $$$ $$$$$ $$ """ u$$$ $
$ $$$""$$$ $$$$ $$$u "$$$" u$$ $$$$$$$$ $
$ $$$$....,$$$$$..$$$$$....,$$$$..$$$$$$$$ $
$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $
"u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u"
"u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u"
"u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u"
"u "$$$$$$$$$$$$$$$$$$$$$$$$" u"
"u "$$$$$$$$$$$$$$$$$$$$" u"
"u """""""""""""""""" u"
""""""""""""""""""""

!!! Changes made in this directory are subject to being overwritten by automation !!!

The files in this directory are shared by all Arcade repos and managed by automation. If you need to make changes to these files, open an issue or submit a pull request to https://github.com/dotnet/arcade first.
134 changes: 134 additions & 0 deletions eng/common/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string][Alias('c')]$configuration = "Debug",
[string] $projects = "",
[string][Alias('v')]$verbosity = "minimal",
[string] $msbuildEngine = $null,
[bool] $warnAsError = $true,
[bool] $nodeReuse = $true,
[switch] $execute,
[switch][Alias('r')]$restore,
[switch] $deployDeps,
[switch][Alias('b')]$build,
[switch] $rebuild,
[switch] $deploy,
[switch] $test,
[switch] $integrationTest,
[switch] $performanceTest,
[switch] $sign,
[switch] $pack,
[switch] $publish,
[switch] $publishBuildAssets,
[switch][Alias('bl')]$binaryLog,
[switch] $ci,
[switch] $prepareMachine,
[switch] $help,
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
)

. $PSScriptRoot\tools.ps1

function Print-Usage() {
Write-Host "Common settings:"
Write-Host " -configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"
Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)"
Write-Host " -binaryLog Output binary log (short: -bl)"
Write-Host " -help Print help and exit"
Write-Host ""

Write-Host "Actions:"
Write-Host " -restore Restore dependencies (short: -r)"
Write-Host " -build Build solution (short: -b)"
Write-Host " -rebuild Rebuild solution"
Write-Host " -deploy Deploy built VSIXes"
Write-Host " -deployDeps Deploy dependencies (e.g. VSIXes for integration tests)"
Write-Host " -test Run all unit tests in the solution"
Write-Host " -pack Package build outputs into NuGet packages and Willow components"
Write-Host " -integrationTest Run all integration tests in the solution"
Write-Host " -performanceTest Run all performance tests in the solution"
Write-Host " -sign Sign build outputs"
Write-Host " -publish Publish artifacts (e.g. symbols)"
Write-Host " -publishBuildAssets Push assets to BAR"
Write-Host ""

Write-Host "Advanced settings:"
Write-Host " -projects <value> Semi-colon delimited list of sln/proj's to build. Globbing is supported (*.sln)"
Write-Host " -ci Set when running on CI server"
Write-Host " -prepareMachine Prepare machine for CI run"
Write-Host " -msbuildEngine <value> Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)."
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.)."
}


function InitializeCustomToolset {
if (-not $restore) {
return
}

$script = Join-Path $EngRoot "restore-toolset.ps1"

if (Test-Path $script) {
. $script
}
}

function Build {
$toolsetBuildProj = InitializeToolset
InitializeCustomToolset
$bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "Build.binlog") } else { "" }

MSBuild $toolsetBuildProj `
$bl `
/p:Configuration=$configuration `
/p:Projects=$projects `
/p:RepoRoot=$RepoRoot `
/p:Restore=$restore `
/p:DeployDeps=$deployDeps `
/p:Build=$build `
/p:Rebuild=$rebuild `
/p:Deploy=$deploy `
/p:Test=$test `
/p:Pack=$pack `
/p:IntegrationTest=$integrationTest `
/p:PerformanceTest=$performanceTest `
/p:Sign=$sign `
/p:Publish=$publish `
/p:Execute=$execute `
/p:ContinuousIntegrationBuild=$ci `
@properties
}

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

if ($projects -eq "") {
$projects = Join-Path $RepoRoot "*.sln"
}

if ($ci) {
$binaryLog = $true
$nodeReuse = $false
}

# Import custom tools configuration, if present in the repo.
# Note: Import in global scope so that the script set top-level variables without qualification.
$configureToolsetScript = Join-Path $EngRoot "configure-toolset.ps1"
if (Test-Path $configureToolsetScript) {
. $configureToolsetScript
}

Build
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
ExitWithExitCode 1
}

ExitWithExitCode 0
Loading

0 comments on commit 3b6488c

Please sign in to comment.