Skip to content

Commit

Permalink
Make Visual Studio 2019 a prerequisite to building this repo (#7005)
Browse files Browse the repository at this point in the history
Changes:

* Make Visual Studio 2019 a prerequisite for building this repo
* Update .sln files
* Update Windows SDK to 17134
* Update developer docs
* Disable ANCM tests
* Update to .NET Core SDK 3.0 Preview 2
* Use Microsoft.NET.Sdk.Razor as a package consistently accross the repo
* React to changes in metadata from Microsoft.NETCore.App
* React to changes in .NET Core SDK
* Attempt to workaround CodeCheck.ps1 failure which doesn't repro locally or on different agents. Possibly due to differences in the version of the PowerShell task?
* Remove dead YML file
* Rename usages of win7-{x64,x86} to win-{x64,x86}
* Update KoreBuild to 3.0.0-build-20190219.1
  • Loading branch information
natemcmaster committed Feb 20, 2019
1 parent 3a785e0 commit 85ae18c
Show file tree
Hide file tree
Showing 133 changed files with 353 additions and 368 deletions.
54 changes: 18 additions & 36 deletions .azure/pipelines/ci.yml
Expand Up @@ -20,15 +20,16 @@ pr:
- '*'

jobs:
- job: Code_check
displayName: Code check
workspace:
clean: all
pool:
vmImage: vs2017-win2016
steps:
- powershell: ./eng/scripts/CodeCheck.ps1 -ci
displayName: Run eng/scripts/CodeCheck.ps1
- template: jobs/default-build.yml
parameters:
jobName: Code_check
jobDisplayName: Code check
agentOs: Windows
installJdk: false
installNodeJs: false
steps:
- powershell: ./eng/scripts/CodeCheck.ps1 -ci
displayName: Run eng/scripts/CodeCheck.ps1

# Build Windows (x64/x86)
- template: jobs/default-build.yml
Expand All @@ -37,7 +38,7 @@ jobs:
jobName: Windows_build
jobDisplayName: "Build: Windows x64/x86"
agentOs: Windows
buildSteps:
steps:
- script: "echo ##vso[build.addbuildtag]daily-build"
condition: and(ne(variables['Build.Reason'], 'PullRequest'), ne(variables['IsFinalBuild'], 'true'))
displayName: 'Set CI tags'
Expand All @@ -56,7 +57,7 @@ jobs:

# Build the x86 shared framework
# Set DisableSignCheck because we'll run sign check in an explicit step after installers build
- script: ./eng/scripts/cibuild.cmd -arch x86 /t:BuildSharedFx /p:DisableCodeSigning=true /bl:artifacts/logs/build.x86.binlog
- script: ./eng/scripts/cibuild.cmd -arch x86 -NoRestore /t:BuildSharedFx /p:DisableCodeSigning=true /bl:artifacts/logs/build.x86.binlog
displayName: Build x86

# This is in a separate build step with -forceCoreMsbuild to workaround MAX_PATH limitations - https://github.com/Microsoft/msbuild/issues/53
Expand All @@ -66,15 +67,15 @@ jobs:
# This runs code-signing on all packages, zips, and jar files as defined in build/CodeSign.targets. If https://github.com/dotnet/arcade/issues/1957 is resolved,
# consider running code-signing inline with the other previous steps.
# Sign check is disabled because it is run in a separate step below, after installers are built.
- script: ./build.cmd -ci -sign /t:CodeSign /p:SignType=$(_SignType) /p:DisableSignCheck=true /bl:artifacts/logs/build.codesign.binlog
- script: ./build.cmd -ci -sign -NoRestore /t:CodeSign /p:SignType=$(_SignType) /p:DisableSignCheck=true /bl:artifacts/logs/build.codesign.binlog
displayName: Code sign packages

# Windows installers bundle both x86 and x64 assets
- powershell: ./src/Installers/Windows/build.ps1 -ci /p:SignType=$(_SignType)
displayName: Build Installers

# Run sign check to verify everything was code signed.
- script: ./build.cmd -ci -sign /t:SignCheck /p:SignType=$(_SignType) /bl:artifacts/logs/build.signcheck.binlog
- script: ./build.cmd -ci -sign -NoRestore /t:SignCheck /p:SignType=$(_SignType) /bl:artifacts/logs/build.signcheck.binlog
displayName: Run sign check
condition: eq(variables['_SignType'], 'real')

Expand Down Expand Up @@ -102,8 +103,8 @@ jobs:
jobName: Windows_arm_build
jobDisplayName: "Build: Windows ARM"
agentOs: Windows
buildScript: ./eng/scripts/cibuild.cmd -NoBuildNodeJS -NoBuildJava
buildArgs: -arch arm /p:SignType=$(_SignType)
buildScript: ./eng/scripts/cibuild.cmd
buildArgs: -arch arm -NoBuildNodeJS -NoBuildJava /p:SignType=$(_SignType)
installNodeJs: false
installJdk: false
afterBuild:
Expand Down Expand Up @@ -156,7 +157,7 @@ jobs:
jobDisplayName: "Build: Linux x64"
agentOs: Linux
installNodeJs: false
buildSteps:
steps:
- script: ./eng/scripts/cibuild.sh --arch x64 --no-build-nodejs --no-build-java
displayName: Run cibuild.sh
- script: |
Expand All @@ -166,6 +167,7 @@ jobs:
--ci --pack --all --no-build-nodejs --no-build-java \
--arch x64 \
-e KOREBUILD_SKIP_INSTALL_NETFX=0 \
--no-restore \
/t:BuildSharedFx \
/p:BuildRuntimeArchive=false \
/p:LinuxInstallerType=deb
Expand Down Expand Up @@ -330,23 +332,3 @@ jobs:
- name: Linux_Test_Logs
path: artifacts/logs/
publishOnError: true
- template: jobs/iisintegration-job.yml
parameters:
condition: ne(variables['SkipTests'], 'true')
TestGroupName: IIS
skipArgs: " /p:SkipIISBackwardsCompatibilityTests=true /p:SkipIISTests=false /p:SkipIISExpressTests=true /p:SkipIISForwardsCompatibilityTests=true"
- template: jobs/iisintegration-job.yml
parameters:
condition: ne(variables['SkipTests'], 'true')
TestGroupName: IISExpress
skipArgs: "/p:SkipIISBackwardsCompatibilityTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=false /p:SkipIISForwardsCompatibilityTests=true"
- template: jobs/iisintegration-job.yml
parameters:
condition: ne(variables['SkipTests'], 'true')
TestGroupName: IISForwardCompat
skipArgs: "/p:SkipIISBackwardsCompatibilityTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISForwardsCompatibilityTests=false"
- template: jobs/iisintegration-job.yml
parameters:
condition: ne(variables['SkipTests'], 'true')
TestGroupName: IISBackCompat
skipArgs: "/p:SkipIISBackwardsCompatibilityTests=false /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISForwardsCompatibilityTests=true"
31 changes: 13 additions & 18 deletions .azure/pipelines/helix-test.yml
Expand Up @@ -8,21 +8,16 @@ pr:
- '*'

jobs:
- job: Helix
timeoutInMinutes: 240
pool:
name: Hosted VS2017
vmImage: vs2017-win2016
steps:
- checkout: self
clean: true
- script: .\build.cmd -all -ci /t:Helix /p:IsHelixJob=true /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\SendToHelix.binlog
displayName: Run build.cmd helix target
- task: PublishBuildArtifacts@1
displayName: Publish Logs to VSTS
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log'
PublishLocation: Container
ArtifactName: $(Agent.Os)_$(Agent.JobName)
continueOnError: true
condition: always()
- template: jobs/default-build.yml
parameters:
jobName: Helix
jobDisplayName: 'Tests: Helix'
agentOs: Windows
timeoutInMinutes: 240
steps:
- script: .\build.cmd -all -ci /t:Helix /p:IsHelixJob=true /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\logs\SendToHelix.binlog
displayName: Run build.cmd helix target
artifacts:
- name: Helix_logs
path: artifacts/logs/
publishOnError: true
17 changes: 9 additions & 8 deletions .azure/pipelines/jobs/default-build.yml
Expand Up @@ -14,7 +14,7 @@
# Note: -ci is always passed
# beforeBuild: [steps]
# Additional steps to run before build.sh/cmd
# buildSteps: [steps]
# steps: [steps]
# Instead of running build.cmd/sh, run these build steps.
# afterBuild: [steps]
# Additional steps to run after build.sh/cmd
Expand Down Expand Up @@ -50,7 +50,7 @@ parameters:
buildArgs: ''
configuration: 'Release'
beforeBuild: []
# buildSteps: [] don't define an empty object default because there is no way in template expression yet to check "if isEmpty(parameters.buildSteps)"
# steps: [] don't define an empty object default because there is no way in template expression yet to check "if isEmpty(parameters.steps)"
afterBuild: []
codeSign: false
variables: {}
Expand All @@ -64,14 +64,15 @@ parameters:
buildScript: ''
installNodeJs: true
installJdk: true
timeoutInMinutes: 120

jobs:
- job: ${{ coalesce(parameters.jobName, parameters.agentOs) }}
displayName: ${{ coalesce(parameters.jobDisplayName, parameters.agentOs) }}
dependsOn: ${{ parameters.dependsOn }}
${{ if ne(parameters.condition, '') }}:
condition: ${{ parameters.condition }}
timeoutInMinutes: 120
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
workspace:
clean: all
strategy:
Expand All @@ -91,9 +92,9 @@ jobs:
name: ${{ parameters.poolName }}
${{ if and(eq(parameters.poolName, ''), eq(parameters.agentOs, 'Windows')) }}:
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: dotnet-internal-temp
name: dotnet-internal-vs2019-preview
${{ if ne(variables['System.TeamProject'], 'internal') }}:
name: dotnet-external-temp
name: dotnet-external-vs2019-preview
variables:
AgentOsName: ${{ parameters.agentOs }}
ASPNETCORE_TEST_LOG_MAXPATH: "200" # Keep test log file name length low enough for artifact zipping
Expand Down Expand Up @@ -132,9 +133,9 @@ jobs:

- ${{ parameters.beforeBuild }}

- ${{ if ne(parameters.buildSteps, '')}}:
- ${{ parameters.buildSteps }}
- ${{ if eq(parameters.buildSteps, '')}}:
- ${{ if ne(parameters.steps, '')}}:
- ${{ parameters.steps }}
- ${{ if eq(parameters.steps, '')}}:
- ${{ if eq(parameters.buildScript, '') }}:
- ${{ if eq(parameters.agentOs, 'Windows') }}:
- script: .\$(BuildDirectory)\build.cmd -ci /p:SignType=$(_SignType) /p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)
Expand Down
20 changes: 0 additions & 20 deletions .azure/pipelines/jobs/iisintegration-job.yml

This file was deleted.

1 change: 1 addition & 0 deletions Directory.Build.props
Expand Up @@ -176,6 +176,7 @@
<TargetingPackLayoutRoot>$(ArtifactsObjDir)TargetingPack.Layout\$(Configuration)\</TargetingPackLayoutRoot>
</PropertyGroup>

<Import Project="eng\Workarounds.props" />
<Import Project="eng\Dependencies.props" />
<Import Project="eng\PatchConfig.props" />
<Import Project="eng\ProjectReferences.props" />
Expand Down
19 changes: 19 additions & 0 deletions Directory.Build.targets
Expand Up @@ -15,6 +15,11 @@
<SuppressDependenciesWhenPacking Condition="'$(SuppressDependenciesWhenPacking)' == '' AND '$(IsAnalyzersProject)' == 'true'">true</SuppressDependenciesWhenPacking>
</PropertyGroup>

<PropertyGroup Condition="'$(PackAsTool)' == 'true' AND '$(IsShippingPackage)' == 'true'">
<!-- This is a requirement for Microsoft tool packages only. -->
<PackAsToolShimRuntimeIdentifiers>win-x64;win-x86</PackAsToolShimRuntimeIdentifiers>
</PropertyGroup>

<PropertyGroup Condition=" '$(MSBuildProjectExtension)' == '.csproj' ">
<PackageId Condition=" '$(PackageId)' == '' ">$(AssemblyName)</PackageId>
<IsPackable Condition="'$(IsPackable)' == '' AND ( '$(IsTestProject)' == 'true' OR '$(IsTestAssetProject)' == 'true' OR '$(IsBenchmarkProject)' == 'true' OR '$(IsSampleProject)' == 'true' ) ">false</IsPackable>
Expand Down Expand Up @@ -67,6 +72,20 @@
<BuildHelixPayload Condition="'$(BuildHelixPayload)' == '' AND '$(IsTestProject)' == 'true'">true</BuildHelixPayload>
</PropertyGroup>

<ItemGroup>
<KnownFrameworkReference Update="Microsoft.NETCore.App">
<LatestRuntimeFrameworkVersion>$(MicrosoftNETCoreAppPackageVersion)</LatestRuntimeFrameworkVersion>
<DefaultRuntimeFrameworkVersion Condition="'$(IsServicingBuild)' != 'true'">$(MicrosoftNETCoreAppPackageVersion)</DefaultRuntimeFrameworkVersion>
<TargetingPackVersion Condition="'$(IsServicingBuild)' != 'true'">$(MicrosoftNETCoreAppPackageVersion)</TargetingPackVersion>
</KnownFrameworkReference>

<KnownFrameworkReference Update="Microsoft.AspNetCore.App">
<LatestRuntimeFrameworkVersion>$(SharedFxVersion)</LatestRuntimeFrameworkVersion>
<DefaultRuntimeFrameworkVersion Condition="'$(IsServicingBuild)' != 'true'">$(SharedFxVersion)</DefaultRuntimeFrameworkVersion>
<TargetingPackVersion Condition="'$(IsServicingBuild)' != 'true'">$(SharedFxVersion)</TargetingPackVersion>
</KnownFrameworkReference>
</ItemGroup>

<Import Project="eng\Workarounds.targets" />
<Import Project="eng\targets\ResolveIisReferences.targets" Condition=" '$(MSBuildProjectExtension)' != '.vcxproj' " />
<Import Project="eng\targets\Cpp.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.vcxproj'" />
Expand Down
5 changes: 4 additions & 1 deletion build.ps1
Expand Up @@ -291,7 +291,10 @@ $RunRestore = if ($NoRestore) { $false }
else { $true }

# Target selection
$MSBuildArguments += "/p:_RunRestore=$RunRestore"
if ($RunRestore) {
$MSBuildArguments += "/restore"
}

$MSBuildArguments += "/p:_RunBuild=$RunBuild"
$MSBuildArguments += "/p:_RunPack=$Pack"
$MSBuildArguments += "/p:_RunTests=$Test"
Expand Down
10 changes: 7 additions & 3 deletions build.sh
Expand Up @@ -20,7 +20,7 @@ channel='master'
tools_source='https://aspnetcore.blob.core.windows.net/buildtools'
target_os_name=''
ci=false
run_restore=true
run_restore=''
run_build=true
run_pack=false
run_tests=false
Expand Down Expand Up @@ -190,7 +190,7 @@ while [[ $# -gt 0 ]]; do
--no-build)
run_build=false
# --no-build implies --no-restore
run_restore=false
[ -z "$run_restore" ] && run_restore=false
;;
--no-build-deps)
build_deps=false
Expand Down Expand Up @@ -313,7 +313,10 @@ fi
[ ! -z "$build_nodejs" ] && msbuild_args[${#msbuild_args[*]}]="-p:BuildNodeJS=$build_nodejs"
[ ! -z "$build_managed" ] && msbuild_args[${#msbuild_args[*]}]="-p:BuildManaged=$build_managed"

msbuild_args[${#msbuild_args[*]}]="-p:_RunRestore=$run_restore"
# Run restore by default unless --no-restore or --no-build was specified.
[ -z "$run_restore" ] && run_restore=true

[ "$run_restore" = true ] && msbuild_args[${#msbuild_args[*]}]="-restore"
msbuild_args[${#msbuild_args[*]}]="-p:_RunBuild=$run_build"
msbuild_args[${#msbuild_args[*]}]="-p:_RunPack=$run_pack"
msbuild_args[${#msbuild_args[*]}]="-p:_RunTests=$run_tests"
Expand All @@ -324,6 +327,7 @@ msbuild_args[${#msbuild_args[*]}]="-p:TargetOsName=$target_os_name"
# Disable downloading ref assemblies as a tarball. Use netfx refs from the Microsoft.NETFramework.ReferenceAssemblies NuGet package instead.
[ -z "${KOREBUILD_SKIP_INSTALL_NETFX:-}" ] && KOREBUILD_SKIP_INSTALL_NETFX=1

export KOREBUILD_KEEPGLOBALJSON=1
set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$DIR" "$config_file" "$ci"

# This incantation avoids unbound variable issues if msbuild_args is empty
Expand Down
2 changes: 1 addition & 1 deletion build/repo.props
Expand Up @@ -77,7 +77,7 @@
<!-- Project selection can be overridden on the command line by passing in -projects -->
<When Condition="'$(Projects)' != ''">
<ItemGroup>
<ProjectToBuild Include="$(Projects)" Exclude="@(ProjectToExclude)">
<ProjectToBuild Include="$(Projects)" Exclude="@(ProjectToExclude);$(RepositoryRoot)**\bin\**\*;$(RepositoryRoot)**\obj\**\*">
<RestoreInParallel Condition="'%(Extension)' == '.npmproj'">false</RestoreInParallel>
</ProjectToBuild>
</ItemGroup>
Expand Down
2 changes: 0 additions & 2 deletions build/repo.targets
Expand Up @@ -10,7 +10,6 @@
<!-- Reset the default korebuild lifecycle. -->
<BuildDependsOn>Prepare</BuildDependsOn>
<!-- Map bootstrapper flags to KoreBuild targets -->
<BuildDependsOn Condition=" '$(_RunRestore)' == 'true' ">$(BuildDependsOn);Restore</BuildDependsOn>
<BuildDependsOn Condition=" '$(_RunBuild)' == 'true' ">$(BuildDependsOn);Compile</BuildDependsOn>
<BuildDependsOn Condition=" '$(_RunPack)' == 'true' ">$(BuildDependsOn);Package</BuildDependsOn>
<BuildDependsOn Condition=" '$(_RunTests)' == 'true' ">$(BuildDependsOn);Test;Verify</BuildDependsOn>
Expand All @@ -22,7 +21,6 @@
<RestoreDependsOn>$(RestoreDependsOn);InstallDotNet;RestoreProjects</RestoreDependsOn>

<CompileDependsOn />
<CompileDependsOn Condition=" '$(_RunRestore)' == 'true' ">Restore</CompileDependsOn>
<CompileDependsOn>$(CompileDependsOn);BuildProjects</CompileDependsOn>

<PackageDependsOn>$(PackageDependsOn);PackProjects</PackageDependsOn>
Expand Down
6 changes: 3 additions & 3 deletions build/tasks/RepoTasks.csproj
Expand Up @@ -2,8 +2,8 @@
<Import Project="$(RepoTasksSdkPath)\Sdk.props" Condition="'$(RepoTasksSdkPath)' != '' "/>

<PropertyGroup>
<TargetFramework Condition="'$(MSBuildRuntimeType)' == 'Core' ">netcoreapp2.2</TargetFramework>
<TargetFramework Condition="'$(MSBuildRuntimeType)' != 'Core' ">net461</TargetFramework>
<TargetFramework Condition="'$(MSBuildRuntimeType)' == 'Core' ">netcoreapp3.0</TargetFramework>
<TargetFramework Condition="'$(MSBuildRuntimeType)' != 'Core' ">net472</TargetFramework>
<DefineConstants Condition="'$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win'">$(DefineConstants);BUILD_MSI_TASKS</DefineConstants>
<Optimize>false</Optimize>
<DebugType>embedded</DebugType>
Expand All @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Remove="Internal.AspNetCore.Sdk" />
<PackageReference Include="NuGet.Build.Tasks" Version="4.9.1" />
<PackageReference Include="NuGet.Build.Tasks" Version="4.9.3" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.1.0" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions build/tasks/tasks.sln
@@ -1,8 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
# Visual Studio Version 16
VisualStudioVersion = 16.0.0.0
MinimumVisualStudioVersion = 16.0.28608.199
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RepoTasks", "RepoTasks.csproj", "{A114791F-35B7-4E5B-8E5B-9A91E0B6E4AE}"
EndProject
Global
Expand Down
8 changes: 4 additions & 4 deletions docs/BuildFromSource.md
Expand Up @@ -11,12 +11,12 @@ See https://github.com/aspnet/AspNetCore/labels/area-infrastructure for known is

Building ASP.NET Core on Windows requires:

* Windows 7 or higher
* Windows 10
* At least 10 GB of disk space and a good internet connection (our build scripts download a lot of tools and dependencies)
* Visual Studio 2017. <https://visualstudio.com>
* To install the exact required components, run [eng/scripts/InstallVisualStudio.ps1](/eng/scripts/InstallVisualStudio.ps1). This will use VS2017.
* Visual Studio **2019 Preview**. <https://visualstudio.com>
* To install the exact required components, run [eng/scripts/InstallVisualStudio.ps1](/eng/scripts/InstallVisualStudio.ps1).
```ps1
PS> ./eng/scripts/InstallVisualStudio.ps1 -Edition Community
PS> ./eng/scripts/InstallVisualStudio.ps1
```
* Git. <https://git-scm.org>
* (Optional) some optional components, like the SignalR Java client, may require
Expand Down

0 comments on commit 85ae18c

Please sign in to comment.