Skip to content

Commit

Permalink
Retarget to netcore5.0 (#3162)
Browse files Browse the repository at this point in the history
* retarget to netcore5.0;  Linux script workaround need to apply for downloading SDK for build
  • Loading branch information
heng-liu authored and kartheekp-ms committed Mar 28, 2020
1 parent ae7b430 commit beec7dd
Show file tree
Hide file tree
Showing 9 changed files with 210 additions and 166 deletions.
4 changes: 2 additions & 2 deletions build/common.project.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<NETFXTargetFramework>net472</NETFXTargetFramework>
<NETCoreTargetFramework>netcoreapp2.1</NETCoreTargetFramework>
<NETCoreTargetFrameworks Condition=" '$(RequiresSigningXplatAPIs)' != 'true' ">netcoreapp2.1</NETCoreTargetFrameworks>
<NETCoreTargetFrameworks Condition=" '$(RequiresSigningXplatAPIs)' == 'true' and '$(TestForLatestNetCoreOnly)' != 'true' ">netcoreapp2.1;netcoreapp3.0</NETCoreTargetFrameworks>
<NETCoreTargetFrameworks Condition=" '$(RequiresSigningXplatAPIs)' == 'true' and '$(TestForLatestNetCoreOnly)' == 'true' ">netcoreapp3.0</NETCoreTargetFrameworks>
<NETCoreTargetFrameworks Condition=" '$(RequiresSigningXplatAPIs)' == 'true' and '$(TestForLatestNetCoreOnly)' != 'true' ">netcoreapp2.1;netcoreapp5.0</NETCoreTargetFrameworks>
<NETCoreTargetFrameworks Condition=" '$(RequiresSigningXplatAPIs)' == 'true' and '$(TestForLatestNetCoreOnly)' == 'true' ">netcoreapp5.0</NETCoreTargetFrameworks>
<NetStandardVersion>netstandard2.0</NetStandardVersion>
<TargetFrameworksExe>$(NETFXTargetFramework);$(NETCoreTargetFrameworks)</TargetFrameworksExe>
<TargetFrameworksLibrary Condition=" '$(RequiresSigningXplatAPIs)' != 'true' ">$(NETFXTargetFramework);$(NetStandardVersion)</TargetFrameworksLibrary>
Expand Down
4 changes: 2 additions & 2 deletions build/common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<IsCore>true</IsCore>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">
<DefineConstants>$(DefineConstants);NETCORE3_0</DefineConstants>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp5.0' ">
<DefineConstants>$(DefineConstants);NETCORE5_0</DefineConstants>
</PropertyGroup>

<!-- Include shared files for netcore projects -->
Expand Down
17 changes: 9 additions & 8 deletions build/config.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,21 @@
<VsTargetMajorVersion>$([MSBuild]::Add(11, $(MajorNuGetVersion)))</VsTargetMajorVersion>
<VsTargetBranch>master</VsTargetBranch>
<VsTargetChannel>int.$(VsTargetBranch)</VsTargetChannel>

<!-- This branches are used for creating insertion PRs -->
<VsTargetBranch Condition="'$(IsEscrowMode)' == 'true'">rel/d$(VsTargetMajorVersion).$(MinorNuGetVersion)</VsTargetBranch>
<VsTargetChannel Condition="'$(IsEscrowMode)' == 'true'">int.d$(VsTargetMajorVersion).$(MinorNuGetVersion)</VsTargetChannel>

<!-- .NET Core SDK Insertion Logic -->
<!-- when LockSDKVersion is true, it will use the specific version in CliVersionForBuilding for building, and specific version in OverrideCliBranchForTesting for testing, -->
<!-- when LockSDKVersion is flase, it will ignore the properties and just use the latest version for the channel specified in CliVersionForBuilding for building, CliBranchForTesting for testing -->
<LockSDKVersion>false</LockSDKVersion>
<!-- when LockSDKVersion is false, it will ignore the properties and just use the latest version for the channel specified in CliVersionForBuilding for building, CliBranchForTesting for testing -->
<LockSDKVersion>true</LockSDKVersion>
<OverrideCliBranchForTesting Condition="'$(LockSDKVersion)' == 'false'"></OverrideCliBranchForTesting>
<OverrideCliBranchForTesting Condition="'$(LockSDKVersion)' == 'true'">release/3.0.1xx 3.0.100-preview7-012802</OverrideCliBranchForTesting>
<CliVersionForBuilding Condition="'$(LockSDKVersion)' == 'false'">3.1.x</CliVersionForBuilding>
<CliVersionForBuilding Condition="'$(LockSDKVersion)' == 'true'">3.0.100-preview6-012264</CliVersionForBuilding>

<!-- .NET Core SDK Insertion Logic -->
<OverrideCliBranchForTesting Condition="'$(LockSDKVersion)' == 'true'">master 5.0.100-alpha1-015516</OverrideCliBranchForTesting>
<CliVersionForBuilding Condition="'$(LockSDKVersion)' == 'false'">master</CliVersionForBuilding>
<CliVersionForBuilding Condition="'$(LockSDKVersion)' == 'true'">"master 5.0.100-alpha1-015516"</CliVersionForBuilding>
<CliBranchForTesting Condition="'$(OverrideCliBranchForTesting)' != ''">$(OverrideCliBranchForTesting)</CliBranchForTesting>
<CliBranchForTesting Condition="'$(OverrideCliBranchForTesting)' == ''">release/3.1.2xx</CliBranchForTesting>
<CliBranchForTesting Condition="'$(OverrideCliBranchForTesting)' == ''">master</CliBranchForTesting>
<CliTargetBranches Condition="'$(OverrideCliTargetBranches)' != ''">$(OverrideCliTargetBranches)</CliTargetBranches>
<CliTargetBranches Condition="'$(OverrideCliTargetBranches)' == ''">master</CliTargetBranches>
<SdkTargetBranches Condition="'$(OverrideCliTargetBranches)' != ''">$(OverrideCliTargetBranches)</SdkTargetBranches>
Expand Down
109 changes: 74 additions & 35 deletions build/vsts_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,11 @@ phases:
- msbuild

steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
- task: PowerShell@1
inputs:
packageType: sdk
version: $(SDKVersionForBuild)
includePreviewVersions: true
installationPath: $(Agent.TempDirectory)/dotnet
scriptName: "$(Build.Repository.LocalPath)\\scripts\\utils\\InstallCLIforBuild.ps1"
arguments: '$(SDKVersionForBuild)'
displayName: "Install .NET 5.0 for build"

- task: PowerShell@1
displayName: "Update Build Number"
Expand All @@ -116,6 +114,7 @@ phases:
scriptType: "inlineScript"
inlineScript: |
Write-Host "##vso[task.setvariable variable=ManifestFilePath]$(Build.Repository.LocalPath)\artifacts\manifests\nuget.client.xml"
Write-Host "##vso[task.setvariable variable=Path]${env:AGENT_TEMPDIRECTORY}\dotnet\;${env:Path}"
- task: NuGetToolInstaller@0
displayName: "Use NuGet 5.0.0"
Expand Down Expand Up @@ -573,13 +572,18 @@ phases:
SkipDesktopAssemblies: "true"

steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
- task: PowerShell@1
inputs:
scriptName: "$(Build.Repository.LocalPath)\\scripts\\utils\\InstallCLIforBuild.ps1"
arguments: '$(SDKVersionForBuild)'
displayName: "Install .NET 5.0 for build"

- task: PowerShell@1
displayName: "Define variables"
inputs:
packageType: sdk
version: $(SDKVersionForBuild)
includePreviewVersions: true
installationPath: $(Agent.TempDirectory)/dotnet
scriptType: "inlineScript"
inlineScript: |
Write-Host "##vso[task.setvariable variable=Path]${env:AGENT_TEMPDIRECTORY}\dotnet\;${env:Path}"
- task: PowerShell@1
displayName: "Print Environment Variables"
Expand Down Expand Up @@ -657,14 +661,23 @@ phases:
demands: sh

steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: $(SDKVersionForBuild)
includePreviewVersions: true
installationPath: $(Agent.TempDirectory)/dotnet


- task: ShellScript@2
displayName: "Install .NET 5.0 for build"
continueOnError: "true"
inputs:
scriptPath: "scripts/utils/InstallCLIforBuild.sh"
disableAutoCwd: "true"
cwd: "$(Build.Repository.LocalPath)"
args: '$(SDKVersionForBuild)'

- task: PowerShell@2
displayName: "Define variables"
inputs:
targetType: "inline"
script: |
Write-Host "##vso[task.setvariable variable=PATH]${env:AGENT_TEMPDIRECTORY}/dotnet/:${env:PATH}"
- task: PowerShell@2
displayName: "Update Build Number"
inputs:
Expand Down Expand Up @@ -718,15 +731,16 @@ phases:
- VSTS_OS -equals Mac_Mojave_10.14
- Mono -equals 6.4.0

steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: $(SDKVersionForBuild)
includePreviewVersions: true
installationPath: $(Agent.TempDirectory)/dotnet

steps:
- task: ShellScript@2
displayName: "Install .NET 5.0 for build"
continueOnError: "true"
inputs:
scriptPath: "scripts/utils/InstallCLIforBuild.sh"
disableAutoCwd: "true"
cwd: "$(Build.Repository.LocalPath)"
args: '$(SDKVersionForBuild)'

- task: PowerShell@2
displayName: "Update Build Number"
inputs:
Expand All @@ -736,6 +750,13 @@ phases:
failOnStderr: "true"
condition: "always()"

- task: PowerShell@2
displayName: "Define variables"
inputs:
targetType: "inline"
script: |
Write-Host "##vso[task.setvariable variable=PATH]${env:AGENT_TEMPDIRECTORY}/dotnet/:${env:PATH}"
- task: DownloadBuildArtifacts@0
displayName: "Download NuGet.CommandLine.Test artifacts"
inputs:
Expand Down Expand Up @@ -785,13 +806,18 @@ phases:
demands: DotNetFramework

steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
- task: PowerShell@1
inputs:
scriptName: "$(Build.Repository.LocalPath)\\scripts\\utils\\InstallCLIforBuild.ps1"
arguments: '$(SDKVersionForBuild)'
displayName: "Install .NET 5.0 for build"

- task: PowerShell@1
displayName: "Define variables"
inputs:
packageType: sdk
version: $(SDKVersionForBuild)
includePreviewVersions: true
installationPath: $(Agent.TempDirectory)/dotnet
scriptType: "inlineScript"
inlineScript: |
Write-Host "##vso[task.setvariable variable=Path]${env:AGENT_TEMPDIRECTORY}\dotnet\;${env:Path}"
- task: PowerShell@1
displayName: "Print Environment Variables"
Expand Down Expand Up @@ -913,6 +939,19 @@ phases:
inputs:
versionSpec: "4.5.0"

- task: PowerShell@1
inputs:
scriptName: "$(Build.Repository.LocalPath)\\scripts\\utils\\InstallCLIforBuild.ps1"
arguments: '$(SDKVersionForBuild)'
displayName: "Install .NET 5.0 for build"

- task: PowerShell@1
displayName: "Define variables"
inputs:
scriptType: "inlineScript"
inlineScript: |
Write-Host "##vso[task.setvariable variable=Path]${env:AGENT_TEMPDIRECTORY}\dotnet\;${env:Path}"
- task: MSBuild@1
displayName: "Bootstrap NuGet packages"
inputs:
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "5.0.100-alpha1"
}
}
2 changes: 1 addition & 1 deletion test/NuGet.Clients.Tests/NuGet.CommandLine.Test/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ public static void CreateTempGlobalJson(string solutionRoot)
var globalJsonFile =
@"{
""sdk"": {
""version"": ""3.0.100 - preview""
""version"": ""5.0.100-alpha1""
}
}";

Expand Down
Loading

0 comments on commit beec7dd

Please sign in to comment.