Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add net9.0 #5042

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 2 additions & 0 deletions .azure-pipelines/build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ jobs:
targetFramework: 'net6.0'
NET8.0:
targetFramework: 'net8.0'
NET9.0:
targetFramework: 'net9.0'


${{ if ne(parameters.container, '') }}:
Expand Down
2 changes: 2 additions & 0 deletions .azure-pipelines/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ extends:
targetFramework: 'net6.0'
NET8.0:
targetFramework: 'net8.0'
NET9.0:
targetFramework: 'net9.0'
pool:
name: 1ES-ABTT-Shared-Pool
image: abtt-ubuntu-2204
Expand Down
12 changes: 9 additions & 3 deletions .vsts.release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ parameters:
values:
- net6.0
- net8.0
- net9.0
- name: derivedFrom
type: string
displayName: Derived From Version
Expand Down Expand Up @@ -149,9 +150,14 @@ extends:

## Verify target framework for specified version
$majorVersion = $agentVersion.Split('.')[0]
if (("${{ parameters.targetFramework }}" -eq "net6.0" -and $majorVersion -ne "3") -or
("${{ parameters.targetFramework }}" -eq "net8.0" -and $majorVersion -ne "4")) {
Write-Error "The major version should be 3 for net6.0 and 4 for net8.0" -ErrorAction Stop
if (
("${{ parameters.targetFramework }}" -eq "net6.0" -and $majorVersion -ne "3") -or
(
("${{ parameters.targetFramework }}" -eq "net8.0" -and $majorVersion -ne "4") -or
("${{ parameters.targetFramework }}" -eq "net9.0" -and $majorVersion -ne "4")
)
) {
Write-Error "The major version should be 3 for net6.0 and 4 for net8.0 or net9.0" -ErrorAction Stop
}
}
if ($isTestRun) {
Expand Down
2 changes: 2 additions & 0 deletions src/Agent.Plugins/TFCliManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ public void SetupProxy(string proxyUrl, string proxyUsername, string proxyPasswo
public void SetupClientCertificate(string clientCert, string clientCertKey, string clientCertArchive, string clientCertPassword)
{
ArgUtil.File(clientCert, nameof(clientCert));
#pragma warning disable SYSLIB0057
X509Certificate2 cert = new X509Certificate2(clientCert);
#pragma warning restore SYSLIB0057
ExecutionContext.Debug($"Set VstsClientCertificate={cert.Thumbprint} for Tf.exe to support client certificate.");
AdditionalEnvironmentVariables["VstsClientCertificate"] = cert.Thumbprint;

Expand Down
2 changes: 2 additions & 0 deletions src/Agent.Sdk/AgentClientCertificateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public void AddClientCertificate(string clientCertificateArchiveFile, string cli
{
if (!string.IsNullOrEmpty(clientCertificateArchiveFile))
{
#pragma warning disable SYSLIB0057
_clientCertificates.Add(new X509Certificate2(clientCertificateArchiveFile, clientCertificatePassword));
#pragma warning restore SYSLIB0057
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/Agent.Worker/Build/TFCommandManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ public void SetupProxy(string proxyUrl, string proxyUsername, string proxyPasswo
public void SetupClientCertificate(string clientCert, string clientCertKey, string clientCertArchive, string clientCertPassword)
{
ArgUtil.File(clientCert, nameof(clientCert));
#pragma warning disable SYSLIB0057
X509Certificate2 cert = new X509Certificate2(clientCert);
#pragma warning restore SYSLIB0057
ExecutionContext.Debug($"Set VstsClientCertificate={cert.Thumbprint} for Tf.exe to support client certificate.");
AdditionalEnvironmentVariables["VstsClientCertificate"] = cert.Thumbprint;

Expand Down
2 changes: 1 addition & 1 deletion src/Common.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>10.0</LangVersion>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0;net9.0</TargetFrameworks>
<RuntimeIdentifier Condition="'$(BuildingInsideVisualStudio)' != 'true'">$(PackageRuntime)</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
Expand Down
5 changes: 4 additions & 1 deletion src/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,15 @@ function get_net_version() {

net8.0-sdk=8.0.401
net8.0-runtime=8.0.8

net9.0-sdk=9.0.100
net9.0-runtime=9.0.0
"

echo "$dotnet_versions" | grep -o "$1=[^ ]*" | cut -d '=' -f2
}

DOTNET_SDK_VERSION=$(get_net_version "net8.0-sdk")
DOTNET_SDK_VERSION=$(get_net_version "${TARGET_FRAMEWORK}-sdk")
DOTNET_RUNTIME_VERSION=$(get_net_version "${TARGET_FRAMEWORK}-runtime")

if [[ ($DOTNET_SDK_VERSION == "") || ($DOTNET_RUNTIME_VERSION == "") ]]; then
Expand Down
Loading