Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ indent_style = space

[*.{sh}]
end_of_line = lf
indent_size = 2
tab_width = 2

[*.{ps1}]
indent_size = 2
tab_width = 2

[*.{cs}]
indent_size = 4
Expand Down
1 change: 0 additions & 1 deletion Build.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore -build %*"
exit /b %ErrorLevel%
2 changes: 0 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
Tools and packages produced by this repository support infrastructure and are not shipping on NuGet or via any other official channel.
-->
<IsShipping>false</IsShipping>
</PropertyGroup>

<PropertyGroup>
<!--
'NetFxTfm' is the standard desktop Target Framework Moniker which this repo's packages are targeting
ie. Place 'NetFxTfm' in the 'TargetFramework' property of a csproj like <TargetFrameworks>$(NetFxTfm);netcoreapp2.0</TargetFrameworks>
Expand Down
3 changes: 1 addition & 2 deletions Restore.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore %*"
exit /b %ErrorLevel%
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore %*"
3 changes: 1 addition & 2 deletions Test.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -test %*"
exit /b %ErrorLevel%
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -test %*"
8 changes: 1 addition & 7 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,8 @@
<MicrosoftDotNetBuildTasksFeedVersion>2.2.0-beta.18607.6</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetMaestroTasksVersion>1.0.0-beta.18607.6</MicrosoftDotNetMaestroTasksVersion>
<MicrosoftDotNetSignToolVersion>1.0.0-beta.18607.6</MicrosoftDotNetSignToolVersion>
<!-- 3rd Part Packages Public Keys -->
<DynamicProxyGenAsm2Key>0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7</DynamicProxyGenAsm2Key>
Copy link
Copy Markdown
Member Author

@tmat tmat Dec 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This property isn't used

</PropertyGroup>
<PropertyGroup>
<MicrosoftAzureDocumentDBVersion>1.22.0</MicrosoftAzureDocumentDBVersion>
<MicrosoftAzureCosmosDBTableVersion>1.1.2</MicrosoftAzureCosmosDBTableVersion>
</PropertyGroup>
<PropertyGroup>
<MicrosoftAspNetCoreAllVersion>2.0.0</MicrosoftAspNetCoreAllVersion>
<MicrosoftDotNetGitHubIssueLabelerAssetsVersion>1.2.0</MicrosoftDotNetGitHubIssueLabelerAssetsVersion>
<MicrosoftMLVersion>0.4.0</MicrosoftMLVersion>
Expand All @@ -69,7 +63,7 @@
$(RestoreSources);
https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
https://dotnet.myget.org/F/symreader-converter/api/v3/index.json;
https:%2F%2Fdotnet.myget.org/F/symreader/api/v3/index.json
https://dotnet.myget.org/F/symreader/api/v3/index.json
</RestoreSources>
</PropertyGroup>
</Project>
78 changes: 52 additions & 26 deletions eng/common/build.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $configuration = "Debug",
[string][Alias('c')]$configuration = "Debug",
[string] $projects = "",
[string] $verbosity = "minimal",
[string][Alias('v')]$verbosity = "minimal",
[string] $msbuildEngine = $null,
[bool] $warnaserror = $true,
[bool] $nodereuse = $true,
[bool] $warnAsError = $true,
[bool] $nodeReuse = $true,
[switch] $execute,
[switch] $restore,
[switch][Alias('r')]$restore,
[switch] $deployDeps,
[switch] $build,
[switch][Alias('b')]$build,
[switch] $rebuild,
[switch] $deploy,
[switch] $test,
Expand All @@ -19,6 +19,7 @@ Param(
[switch] $pack,
[switch] $publish,
[switch] $publishBuildAssets,
[switch][Alias('bl')]$binaryLog,
[switch] $ci,
[switch] $prepareMachine,
[switch] $help,
Expand All @@ -29,14 +30,15 @@ Param(

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 " -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"
Write-Host " -build Build solution"
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)"
Expand All @@ -46,7 +48,7 @@ function Print-Usage() {
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 " -publishBuildAssets Push assets to BAR"
Write-Host ""

Write-Host "Advanced settings:"
Expand All @@ -59,22 +61,26 @@ function Print-Usage() {
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
}

try {
if ($projects -eq "") {
$projects = Join-Path $RepoRoot "*.sln"
function InitializeCustomToolset {
if (-not $restore) {
return
}

InitializeTools
$script = Join-Path $EngRoot "restore-toolset.ps1"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know Corefx is using the "configure-toolset" hook, do you have an example of a repo using "restore-toolset"? I'd like to see an example to solidify the difference between these two functions w.r.t. intent.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for restoring (installing) additional tools. E.g. https://github.com/dotnet/sdk/blob/master/eng/restore-toolset.ps1


$BuildLog = Join-Path $LogDir "Build.binlog"
if (Test-Path $script) {
. $script
}
}

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

MSBuild $ToolsetBuildProj `
/bl:$BuildLog `
MSBuild $toolsetBuildProj `
$bl `
/p:Configuration=$configuration `
/p:Projects=$projects `
/p:RepoRoot=$RepoRoot `
Expand All @@ -92,17 +98,37 @@ try {
/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 ($lastExitCode -ne 0) {
Write-Host "Build Failed (exit code '$lastExitCode'). See log: $BuildLog" -ForegroundColor Red
ExitWithExitCode $lastExitCode
if ($projects -eq "") {
$projects = Join-Path $RepoRoot "*.sln"
}

ExitWithExitCode $lastExitCode
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