Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1173 from wtgodbe/30SDK
Browse files Browse the repository at this point in the history
Update to the 3.0 SDK
  • Loading branch information
wtgodbe authored May 8, 2019
2 parents e94d426 + 0db86a9 commit b169999
Show file tree
Hide file tree
Showing 135 changed files with 206 additions and 180 deletions.
7 changes: 5 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<!-- Enable the analyzers for this repo -->
<PropertyGroup>
<IsSourceProject Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(MSBuildProjectDirectory), 'src%24'))">true</IsSourceProject>
<IsSourceProject>$([System.Text.RegularExpressions.Regex]::IsMatch($(MSBuildProjectDirectory), 'src%24'))</IsSourceProject>
<EnableAnalyzers Condition="'$(EnableAnalyzers)'=='' and '$(IsSourceProject)' == 'true'">true</EnableAnalyzers>
</PropertyGroup>

Expand All @@ -70,7 +70,7 @@
<!-- By default make all libraries to be AnyCPU but individual projects can override it if they need to -->
<Platform>AnyCPU</Platform>
<OutputType>Library</OutputType>
<RunApiCompat>true</RunApiCompat>
<RunApiCompat>$(IsSourceProject)</RunApiCompat>
<LangVersion>latest</LangVersion> <!-- default to allowing all language features -->
</PropertyGroup>

Expand Down Expand Up @@ -110,6 +110,9 @@
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>

<!-- Don't reference implicit framework packages, all projects in this repo must be explicit -->
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>

<!-- Suppress preview message as we are usually using preview SDK versions. -->
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
</PropertyGroup>
Expand Down
9 changes: 6 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ jobs:
steps:
- checkout: self
clean: true
- script: eng\common\cibuild.cmd
- script: build.cmd
-configuration $(_BuildConfig)
-prepareMachine
-ci
-warnaserror:0
$(_BuildArgs)
displayName: Windows Build / Publish
Expand All @@ -86,9 +87,10 @@ jobs:
steps:
- checkout: self
clean: true
- script: eng/common/cibuild.sh
- script: ./build.sh
--configuration $(_BuildConfig)
--prepareMachine
--ci
displayName: Linux Build

# OSX leg (only runs in CI)
Expand All @@ -102,7 +104,8 @@ jobs:
steps:
- checkout: self
clean: true
- script: eng/common/cibuild.sh
- script: ./build.sh
--configuration $(_BuildConfig)
--prepareMachine
--ci
displayName: OSX Build
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore -build %*"
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore -build /warnAsMessage:NU1702 %*"
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ while [[ -h $source ]]; do
done

scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
"$scriptroot/eng/common/build.sh" --build --restore $@
"$scriptroot/eng/common/build.sh" --build --restore /warnAsMessage:NU1702 $@
20 changes: 10 additions & 10 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
<ProductDependencies>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19229.8">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19256.12">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>a7a250e9c13147134543c35fef2fb81f19592edf</Sha>
<Sha>c31fac9f6899094226cb5cd77c85b8f60ecafa3d</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.ApiCompat" Version="1.0.0-beta.19229.8">
<Dependency Name="Microsoft.DotNet.ApiCompat" Version="1.0.0-beta.19256.12">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>a7a250e9c13147134543c35fef2fb81f19592edf</Sha>
<Sha>c31fac9f6899094226cb5cd77c85b8f60ecafa3d</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="1.0.0-beta.19229.8">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="1.0.0-beta.19256.12">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>a7a250e9c13147134543c35fef2fb81f19592edf</Sha>
<Sha>c31fac9f6899094226cb5cd77c85b8f60ecafa3d</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="1.0.0-beta.19229.8">
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="1.0.0-beta.19256.12">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>a7a250e9c13147134543c35fef2fb81f19592edf</Sha>
<Sha>c31fac9f6899094226cb5cd77c85b8f60ecafa3d</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.GenAPI" Version="1.0.0-beta.19229.8">
<Dependency Name="Microsoft.DotNet.GenAPI" Version="1.0.0-beta.19256.12">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>a7a250e9c13147134543c35fef2fb81f19592edf</Sha>
<Sha>c31fac9f6899094226cb5cd77c85b8f60ecafa3d</Sha>
</Dependency>
<PinnedDependency Name="NETStandard.Library" Version="2.0.3">
<Uri>https://github.com/dotnet/standard</Uri>
Expand Down
8 changes: 4 additions & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
<NetStandardLibraryPackage>netstandard.library</NetStandardLibraryPackage>
</PropertyGroup>
<PropertyGroup>
<MicrosoftDotNetApiCompatPackageVersion>1.0.0-beta.19229.8</MicrosoftDotNetApiCompatPackageVersion>
<MicrosoftDotNetBuildTasksPackagingPackageVersion>1.0.0-beta.19229.8</MicrosoftDotNetBuildTasksPackagingPackageVersion>
<MicrosoftDotNetCodeAnalysisPackageVersion>1.0.0-beta.19229.8</MicrosoftDotNetCodeAnalysisPackageVersion>
<MicrosoftDotNetGenAPIPackageVersion>1.0.0-beta.19229.8</MicrosoftDotNetGenAPIPackageVersion>
<MicrosoftDotNetApiCompatPackageVersion>1.0.0-beta.19256.12</MicrosoftDotNetApiCompatPackageVersion>
<MicrosoftDotNetBuildTasksPackagingPackageVersion>1.0.0-beta.19256.12</MicrosoftDotNetBuildTasksPackagingPackageVersion>
<MicrosoftDotNetCodeAnalysisPackageVersion>1.0.0-beta.19256.12</MicrosoftDotNetCodeAnalysisPackageVersion>
<MicrosoftDotNetGenAPIPackageVersion>1.0.0-beta.19256.12</MicrosoftDotNetGenAPIPackageVersion>
<!-- This is the LKG stable version of NetStandard.Library from myget.org. Please don't edit this version -->
<NetStandardLibraryPackageVersion>2.0.3</NetStandardLibraryPackageVersion>
</PropertyGroup>
Expand Down
4 changes: 4 additions & 0 deletions eng/common/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ try {
. $configureToolsetScript
}

if (($restore) -and ($null -eq $env:DisableNativeToolsetInstalls)) {
InitializeNativeTools
}

Build
}
catch {
Expand Down
22 changes: 6 additions & 16 deletions eng/common/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ usage()
echo " --nodeReuse <value> Sets nodereuse msbuild parameter ('true' or 'false')"
echo " --warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')"
echo ""
echo "Command line arguments starting with '/p:' are passed through to MSBuild."
echo "Command line arguments not listed above are passed thru to msbuild."
echo "Arguments can also be passed in with a single hyphen."
}

Expand Down Expand Up @@ -137,22 +137,8 @@ while [[ $# > 0 ]]; do
node_reuse=$2
shift
;;
-p:*|/p:*)
properties="$properties $1"
;;
-m:*|/m:*)
properties="$properties $1"
;;
-bl:*|/bl:*)
properties="$properties $1"
;;
-dl:*|/dl:*)
properties="$properties $1"
;;
*)
echo "Invalid argument: $1"
usage
exit 1
properties="$properties $1"
;;
esac

Expand Down Expand Up @@ -218,4 +204,8 @@ if [[ -n "${useInstalledDotNetCli:-}" ]]; then
use_installed_dotnet_cli="$useInstalledDotNetCli"
fi

if [[ "$restore" == true && -z ${DisableNativeToolsetInstalls:-} ]]; then
InitializeNativeTools
fi

Build
2 changes: 2 additions & 0 deletions eng/common/dotnet-install.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0dotnet-install.ps1""" %*"
22 changes: 22 additions & 0 deletions eng/common/dotnet-install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $verbosity = "minimal",
[string] $architecture = "",
[string] $version = "Latest",
[string] $runtime = "dotnet"
)

. $PSScriptRoot\tools.ps1

try {
$dotnetRoot = Join-Path $RepoRoot ".dotnet"
InstallDotNet $dotnetRoot $version $architecture $runtime $true
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
ExitWithExitCode 1
}

ExitWithExitCode 0
49 changes: 49 additions & 0 deletions eng/common/dotnet-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env bash

source="${BASH_SOURCE[0]}"
# resolve $source until the file is no longer a symlink
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"

version='Latest'
architecture=''
runtime='dotnet'
while [[ $# > 0 ]]; do
opt="$(echo "$1" | awk '{print tolower($0)}')"
case "$opt" in
-version|-v)
shift
version="$1"
;;
-architecture|-a)
shift
architecture="$1"
;;
-runtime|-r)
shift
runtime="$1"
;;
*)
echo "Invalid argument: $1"
usage
exit 1
;;
esac
shift
done

. "$scriptroot/tools.sh"
dotnetRoot="$repo_root/.dotnet"
InstallDotNet $dotnetRoot $version "$architecture" $runtime true || {
local exit_code=$?
echo "dotnet-install.sh failed (exit code '$exit_code')." >&2
ExitWithExitCode $exit_code
}

ExitWithExitCode 0
6 changes: 5 additions & 1 deletion eng/common/init-tools-native.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ Param (
[switch] $Force = $False,
[int] $DownloadRetries = 5,
[int] $RetryWaitTimeInSeconds = 30,
[string] $GlobalJsonFile = "$PSScriptRoot\..\..\global.json"
[string] $GlobalJsonFile
)

if (!$GlobalJsonFile) {
$GlobalJsonFile = Join-Path (Get-Item $PSScriptRoot).Parent.Parent.FullName "global.json"
}

Set-StrictMode -version 2.0
$ErrorActionPreference="Stop"

Expand Down
12 changes: 4 additions & 8 deletions eng/common/init-tools-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ clean=false
force=false
download_retries=5
retry_wait_time_seconds=30
global_json_file="${scriptroot}/../../global.json"
global_json_file="$(dirname "$(dirname "${scriptroot}")")/global.json"
declare -A native_assets

. $scriptroot/native/common-library.sh
Expand Down Expand Up @@ -71,6 +71,7 @@ function ReadGlobalJsonNativeTools {
local native_tools_list=$(echo $native_tools_section | awk -F"[{}]" '{print $2}')
native_tools_list=${native_tools_list//[\" ]/}
native_tools_list=${native_tools_list//,/$'\n'}
native_tools_list="$(echo -e "${native_tools_list}" | tr -d '[:space:]')"

local old_IFS=$IFS
while read -r line; do
Expand Down Expand Up @@ -116,8 +117,6 @@ else
installer_command+=" --clean"
fi

echo "Installing $tool version $tool_version"
echo "Executing '$installer_command'"
$installer_command

if [[ $? != 0 ]]; then
Expand All @@ -127,19 +126,16 @@ else
done
fi

if [[ ! -z $clean ]]; then
if [[ $clean = true ]]; then
exit 0
fi

if [[ -d $install_bin ]]; then
echo "Native tools are available from $install_bin"
if [[ !-z BUILD_BUILDNUMBER ]]; then
echo "##vso[task.prependpath]$install_bin"
fi
echo "##vso[task.prependpath]$install_bin"
else
echo "Native tools install directory does not exist, installation failed" >&2
exit 1
fi

exit 0

3 changes: 3 additions & 0 deletions eng/common/templates/job/job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ jobs:
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}

variables:
- ${{ if eq(parameters.enableTelemetry, 'true') }}:
- name: DOTNET_CLI_TELEMETRY_PROFILE
value: '$(Build.Repository.Uri)'
- ${{ each variable in parameters.variables }}:
# handle name-value variable syntax
# example:
Expand Down
Loading

0 comments on commit b169999

Please sign in to comment.