Skip to content
Merged
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: 1 addition & 1 deletion Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<DebugType Condition=" '$(DebugType)' == '' ">portable</DebugType>
<Deterministic Condition=" '$(Deterministic)' == '' ">True</Deterministic>
<LangVersion Condition=" '$(LangVersion)' == '' ">latest</LangVersion>
<AndroidNet6Version Condition=" '$(AndroidNet6Version)' == '' ">32.0.476</AndroidNet6Version>
<AndroidNet6Version Condition=" '$(AndroidNet6Version)' == '' ">32.0.485</AndroidNet6Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(HostOS)' == '' ">
<HostOS Condition="$([MSBuild]::IsOSPlatform('windows'))">Windows</HostOS>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,8 @@ public String Say (String quote) {
}",
},
},
ExtraNuGetConfigSources = {
// Projects targeting net6.0 require ref/runtime packs on NuGet.org
"https://api.nuget.org/v3/index.json",
"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json",
},
};
proj.AddNuGetSourcesForOlderTargetFrameworks ();
if (IsPreviewFrameworkVersion (targetFramework)) {
proj.SetProperty ("EnablePreviewFeatures", "true");
}
Expand Down Expand Up @@ -841,12 +837,8 @@ public void DotNetPublish ([Values (false, true)] bool isRelease, [ValueSource(n
var proj = new XASdkProject {
TargetFramework = targetFramework,
IsRelease = isRelease,
ExtraNuGetConfigSources = {
// Projects targeting net6.0 require ref/runtime packs on NuGet.org
"https://api.nuget.org/v3/index.json",
"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json",
},
};
proj.AddNuGetSourcesForOlderTargetFrameworks ();
proj.SetProperty (KnownProperties.RuntimeIdentifier, runtimeIdentifier);

var preview = IsPreviewFrameworkVersion (targetFramework);
Expand Down Expand Up @@ -935,13 +927,9 @@ public void XamarinLegacySdk ([Values ("net6.0-android32.0", "net7.0-android33.0
new AndroidItem.AndroidLibrary ("javaclasses.jar") {
BinaryContent = () => ResourceData.JavaSourceJarTestJar,
}
},
ExtraNuGetConfigSources = {
// Projects targeting net6.0 require ref/runtime packs on NuGet.org
"https://api.nuget.org/v3/index.json",
"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json",
},
}
};
proj.AddNuGetSourcesForOlderTargetFrameworks (dotnetTargetFramework);

using var b = new Builder ();
var legacyTargetFrameworkVersion = "13.0";
Expand Down Expand Up @@ -969,12 +957,8 @@ public void MauiTargetFramework (string dotnetVersion, string platform, int apiL
var targetFramework = $"{dotnetVersion}-{platform}";
var library = new XASdkProject (outputType: "Library") {
TargetFramework = targetFramework,
ExtraNuGetConfigSources = {
// Projects targeting net6.0 require ref/runtime packs on NuGet.org
"https://api.nuget.org/v3/index.json",
"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json",
},
};
library.AddNuGetSourcesForOlderTargetFrameworks ();

var preview = IsPreviewFrameworkVersion (targetFramework);
if (preview) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -34,6 +34,21 @@ public string TargetFramework {
get { return GetProperty ("TargetFramework"); }
set { SetProperty ("TargetFramework", value); }
}

/// <summary>
/// Projects targeting net6.0/net7.0 require ref/runtime packs on NuGet.org or dotnet6/dotnet7
/// </summary>
public void AddNuGetSourcesForOlderTargetFrameworks (string targetFramework = null)
{
targetFramework ??= TargetFramework;
if (targetFramework.IndexOf ("net6.0", StringComparison.OrdinalIgnoreCase) != -1) {
ExtraNuGetConfigSources = new List<string> {
"https://api.nuget.org/v3/index.json",
"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json",
};
}
}

public string Sdk { get; set; }

public IList<BuildItem> OtherBuildItems { get; private set; }
Expand Down
16 changes: 2 additions & 14 deletions tests/MSBuildDeviceIntegration/Tests/XASdkDeployTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,7 @@ public void DotNetInstallAndRun (bool isRelease, bool xamarinForms, string targe
};
}
proj.TargetFramework = targetFramework;
if (targetFramework.Contains ("net6.0")) {
proj.ExtraNuGetConfigSources = new List<string> () {
// Projects targeting net6.0 require ref/runtime packs on NuGet.org or dotnet6
"https://api.nuget.org/v3/index.json",
"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json",
};
}
proj.AddNuGetSourcesForOlderTargetFrameworks ();
proj.SetRuntimeIdentifier (DeviceAbi);

var relativeProjDir = Path.Combine ("temp", TestName);
Expand Down Expand Up @@ -160,13 +154,7 @@ public void DotNetDebug ([Values("net6.0-android", "net7.0-android")] string tar

var proj = new XASdkProject ();
proj.TargetFramework = targetFramework;
if (targetFramework.Contains ("net6.0")) {
proj.ExtraNuGetConfigSources = new List<string> () {
// Projects targeting net6.0 require ref/runtime packs on NuGet.org or dotnet6
"https://api.nuget.org/v3/index.json",
"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json",
};
}
proj.AddNuGetSourcesForOlderTargetFrameworks ();
proj.SetRuntimeIdentifier (DeviceAbi);
string runtimeId = proj.GetProperty (KnownProperties.RuntimeIdentifier);

Expand Down