Skip to content

Commit 47e6917

Browse files
authored
Add initial checkin of infrastructure and one reference package source (#1)
* Add initial checkin of infrastructure and one reference package source * Remove unneeded files in textOnlyPackages * Change tabs to spaces * Fixup and comment warnings * Move common properties to dir.props
1 parent f8cf778 commit 47e6917

File tree

108 files changed

+22327
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+22327
-0
lines changed

NuGet.config

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="Local artifacts/bin dir" value="./artifacts/packages/" />
6+
<add key="roslyn-tools" value="https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json" />
7+
</packageSources>
8+
</configuration>

build.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
__scriptpath=$(cd "$(dirname "$0")"; pwd -P)
4+
__log_path="$__scriptpath/artifacts/log"
5+
6+
# Use Arcade script to initialize dotnet cli only
7+
source ./eng/common/tools.sh
8+
InitializeDotNetCli true
9+
10+
export __DOTNET_CMD="$_InitializeDotNetCli/dotnet"
11+
__SDK_PATH="$DOTNET_INSTALL_DIR/sdk/$_ReadGlobalVersion"
12+
13+
export RepoRoot="$__scriptpath/"
14+
15+
$__DOTNET_CMD $__SDK_PATH/MSBuild.dll $__scriptpath/src/referencePackages/buildReferencePackages.proj /bl:"$__log_path/BuildReferencePackages.binlog" $@

clean.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rm -rf ./.dotnet
2+
rm -rf ./artifacts

eng/common/CIBuild.cmd

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -test -sign -pack -publish -ci %*"

eng/common/PublishToPackageFeed.proj

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<!--
2+
This MSBuild file is intended to be used as the body of the default
3+
publishing release pipeline. The release pipeline will use this file
4+
to invoke the PushToStaticFeed task that will read the build asset
5+
manifest and publish the assets described in the manifest to
6+
informed target feeds.
7+
-->
8+
<Project Sdk="Microsoft.NET.Sdk">
9+
<PropertyGroup>
10+
<TargetFramework>netcoreapp2.1</TargetFramework>
11+
</PropertyGroup>
12+
13+
<Import Project="$(MSBuildThisFileDirectory)DefaultVersions.props" Condition="Exists('$(MSBuildThisFileDirectory)DefaultVersions.props')" />
14+
15+
<!--
16+
This won't be necessary once we solve this issue:
17+
https://github.com/dotnet/arcade/issues/2266
18+
-->
19+
<Import Project="$(MSBuildThisFileDirectory)ArtifactsCategory.props" Condition="Exists('$(MSBuildThisFileDirectory)ArtifactsCategory.props')" />
20+
21+
<Import Project="$(NuGetPackageRoot)microsoft.dotnet.build.tasks.feed\$(MicrosoftDotNetBuildTasksFeedVersion)\build\Microsoft.DotNet.Build.Tasks.Feed.targets" />
22+
23+
<Target Name="PublishToFeed">
24+
<Error Condition="'$(ArtifactsCategory)' == ''" Text="ArtifactsCategory: The artifacts' category produced by the build wasn't provided." />
25+
<Error Condition="'$(AccountKeyToStaticFeed)' == ''" Text="AccountKeyToStaticFeed: Account key for target feed wasn't provided." />
26+
<Error Condition="'$(ManifestsBasePath)' == ''" Text="Full path to asset manifests directory wasn't provided." />
27+
<Error Condition="'$(BlobBasePath)' == '' AND '$(PackageBasePath)' == ''" Text="A valid full path to BlobBasePath of PackageBasePath is required." />
28+
29+
<ItemGroup>
30+
<!-- Include all manifests found in the manifest folder. -->
31+
<ManifestFiles Include="$(ManifestsBasePath)*.xml" />
32+
</ItemGroup>
33+
34+
<Error Condition="'@(ManifestFiles)' == ''" Text="No manifest file was found in the provided path: $(ManifestsBasePath)" />
35+
36+
<!--
37+
For now the type of packages being published will be informed for the whole build.
38+
Eventually this will be specified on a per package basis:
39+
TODO: https://github.com/dotnet/arcade/issues/2266
40+
-->
41+
<PropertyGroup>
42+
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == '.NETCORE'">https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json</TargetStaticFeed>
43+
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == '.NETCOREVALIDATION'">https://dotnetfeed.blob.core.windows.net/arcade-validation/index.json</TargetStaticFeed>
44+
</PropertyGroup>
45+
46+
<Error
47+
Condition="'$(TargetStaticFeed)' == ''"
48+
Text="'$(ArtifactsCategory)' wasn't recognized as a valid artifact category. Valid categories are: '.NetCore' and '.NetCoreValidation'" />
49+
50+
<!-- Iterate publishing assets from each manifest file. -->
51+
<PushArtifactsInManifestToFeed
52+
ExpectedFeedUrl="$(TargetStaticFeed)"
53+
AccountKey="$(AccountKeyToStaticFeed)"
54+
BARBuildId="$(BARBuildId)"
55+
MaestroApiEndpoint="$(MaestroApiEndpoint)"
56+
BuildAssetRegistryToken="$(BuildAssetRegistryToken)"
57+
Overwrite="$(OverrideAssetsWithSameName)"
58+
PassIfExistingItemIdentical="$(PassIfExistingItemIdentical)"
59+
MaxClients="$(MaxParallelUploads)"
60+
UploadTimeoutInMinutes="$(MaxUploadTimeoutInMinutes)"
61+
AssetManifestPath="%(ManifestFiles.Identity)"
62+
BlobAssetsBasePath="$(BlobBasePath)"
63+
PackageAssetsBasePath="$(PackageBasePath)" />
64+
</Target>
65+
66+
<ItemGroup>
67+
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Feed" Version="$(MicrosoftDotNetBuildTasksFeedVersion)" />
68+
</ItemGroup>
69+
</Project>

eng/common/README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Don't touch this folder
2+
3+
uuuuuuuuuuuuuuuuuuuu
4+
u" uuuuuuuuuuuuuuuuuu "u
5+
u" u$$$$$$$$$$$$$$$$$$$$u "u
6+
u" u$$$$$$$$$$$$$$$$$$$$$$$$u "u
7+
u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u
8+
u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u
9+
u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u
10+
$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $
11+
$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $
12+
$ $$$" ... "$... ...$" ... "$$$ ... "$$$ $
13+
$ $$$u `"$$$$$$$ $$$ $$$$$ $$ $$$ $$$ $
14+
$ $$$$$$uu "$$$$ $$$ $$$$$ $$ """ u$$$ $
15+
$ $$$""$$$ $$$$ $$$u "$$$" u$$ $$$$$$$$ $
16+
$ $$$$....,$$$$$..$$$$$....,$$$$..$$$$$$$$ $
17+
$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $
18+
"u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u"
19+
"u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u"
20+
"u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u"
21+
"u "$$$$$$$$$$$$$$$$$$$$$$$$" u"
22+
"u "$$$$$$$$$$$$$$$$$$$$" u"
23+
"u """""""""""""""""" u"
24+
""""""""""""""""""""
25+
26+
!!! Changes made in this directory are subject to being overwritten by automation !!!
27+
28+
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.

eng/common/build.ps1

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
[CmdletBinding(PositionalBinding=$false)]
2+
Param(
3+
[string][Alias('c')]$configuration = "Debug",
4+
[string] $projects,
5+
[string][Alias('v')]$verbosity = "minimal",
6+
[string] $msbuildEngine = $null,
7+
[bool] $warnAsError = $true,
8+
[bool] $nodeReuse = $true,
9+
[switch][Alias('r')]$restore,
10+
[switch] $deployDeps,
11+
[switch][Alias('b')]$build,
12+
[switch] $rebuild,
13+
[switch] $deploy,
14+
[switch][Alias('t')]$test,
15+
[switch] $integrationTest,
16+
[switch] $performanceTest,
17+
[switch] $sign,
18+
[switch] $pack,
19+
[switch] $publish,
20+
[switch][Alias('bl')]$binaryLog,
21+
[switch] $ci,
22+
[switch] $prepareMachine,
23+
[switch] $help,
24+
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
25+
)
26+
27+
. $PSScriptRoot\tools.ps1
28+
29+
function Print-Usage() {
30+
Write-Host "Common settings:"
31+
Write-Host " -configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"
32+
Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)"
33+
Write-Host " -binaryLog Output binary log (short: -bl)"
34+
Write-Host " -help Print help and exit"
35+
Write-Host ""
36+
37+
Write-Host "Actions:"
38+
Write-Host " -restore Restore dependencies (short: -r)"
39+
Write-Host " -build Build solution (short: -b)"
40+
Write-Host " -rebuild Rebuild solution"
41+
Write-Host " -deploy Deploy built VSIXes"
42+
Write-Host " -deployDeps Deploy dependencies (e.g. VSIXes for integration tests)"
43+
Write-Host " -test Run all unit tests in the solution (short: -t)"
44+
Write-Host " -integrationTest Run all integration tests in the solution"
45+
Write-Host " -performanceTest Run all performance tests in the solution"
46+
Write-Host " -pack Package build outputs into NuGet packages and Willow components"
47+
Write-Host " -sign Sign build outputs"
48+
Write-Host " -publish Publish artifacts (e.g. symbols)"
49+
Write-Host ""
50+
51+
Write-Host "Advanced settings:"
52+
Write-Host " -projects <value> Semi-colon delimited list of sln/proj's to build. Globbing is supported (*.sln)"
53+
Write-Host " -ci Set when running on CI server"
54+
Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build"
55+
Write-Host " -warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')"
56+
Write-Host " -msbuildEngine <value> Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)."
57+
Write-Host ""
58+
59+
Write-Host "Command line arguments not listed above are passed thru to msbuild."
60+
Write-Host "The above arguments can be shortened as much as to be unambiguous (e.g. -co for configuration, -t for test, etc.)."
61+
}
62+
63+
function InitializeCustomToolset {
64+
if (-not $restore) {
65+
return
66+
}
67+
68+
$script = Join-Path $EngRoot "restore-toolset.ps1"
69+
70+
if (Test-Path $script) {
71+
. $script
72+
}
73+
}
74+
75+
function Build {
76+
$toolsetBuildProj = InitializeToolset
77+
InitializeCustomToolset
78+
79+
$bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "Build.binlog") } else { "" }
80+
81+
if ($projects) {
82+
# Re-assign properties to a new variable because PowerShell doesn't let us append properties directly for unclear reasons.
83+
# Explicitly set the type as string[] because otherwise PowerShell would make this char[] if $properties is empty.
84+
[string[]] $msbuildArgs = $properties
85+
$msbuildArgs += "/p:Projects=$projects"
86+
$properties = $msbuildArgs
87+
}
88+
89+
MSBuild $toolsetBuildProj `
90+
$bl `
91+
/p:Configuration=$configuration `
92+
/p:RepoRoot=$RepoRoot `
93+
/p:Restore=$restore `
94+
/p:DeployDeps=$deployDeps `
95+
/p:Build=$build `
96+
/p:Rebuild=$rebuild `
97+
/p:Deploy=$deploy `
98+
/p:Test=$test `
99+
/p:Pack=$pack `
100+
/p:IntegrationTest=$integrationTest `
101+
/p:PerformanceTest=$performanceTest `
102+
/p:Sign=$sign `
103+
/p:Publish=$publish `
104+
@properties
105+
}
106+
107+
try {
108+
if ($help -or (($null -ne $properties) -and ($properties.Contains("/help") -or $properties.Contains("/?")))) {
109+
Print-Usage
110+
exit 0
111+
}
112+
113+
if ($ci) {
114+
$binaryLog = $true
115+
$nodeReuse = $false
116+
}
117+
118+
# Import custom tools configuration, if present in the repo.
119+
# Note: Import in global scope so that the script set top-level variables without qualification.
120+
$configureToolsetScript = Join-Path $EngRoot "configure-toolset.ps1"
121+
if (Test-Path $configureToolsetScript) {
122+
. $configureToolsetScript
123+
}
124+
125+
Build
126+
}
127+
catch {
128+
Write-Host $_
129+
Write-Host $_.Exception
130+
Write-Host $_.ScriptStackTrace
131+
ExitWithExitCode 1
132+
}
133+
134+
ExitWithExitCode 0

0 commit comments

Comments
 (0)