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
10 changes: 10 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the MIT license. See License.txt in the project root for full license information. -->
<Project>
<PropertyGroup>
<!--
Disable nullable warnings when targeting anything other than our supported .NET core version(s).
This condition will be evaluated multiple times in multi-targeted projects hence need to be careful
to only set in the inner builds, not the outer build where only $(TargetFrameworks) is defined.
We still check $(TargetFrameworks) for empty though, because for single-targeted builds we want to
allow nullable warnings regardless of target framework.
-->
<NoWarn Condition="'$(DisableNullableWarnings)' == '' AND '$(TargetFrameworks)' != '' AND '$(TargetFramework)' != '' AND '$(TargetFrameworkIdentifier)' != '.NETCoreApp'">$(NoWarn);Nullable</NoWarn>
</PropertyGroup>

<ItemGroup>
<SupportedPlatform Remove="Android" />
Expand Down
3 changes: 2 additions & 1 deletion src/Cli/Microsoft.DotNet.Cli.Utils/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ public CommandResult Execute(Action<Process>? processStarted)

if (CommandLoggingContext.IsVerbose)
{
Debug.Assert(sw is not null);
var message = string.Format(
LocalizableStrings.ProcessExitedWithCode,
FormatProcessInfo(_process.StartInfo),
exitCode,
sw?.ElapsedMilliseconds);
sw.ElapsedMilliseconds);
if (exitCode == 0)
{
Reporter.Verbose.WriteLine(message.Green());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void CanBuildProjectWithPackageReferencesWithConflictingTypes()
var testAsset = _testAssetsManager.CreateTestProject(testProject);

var packagesPaths = packageReferences.Select(e => Path.GetDirectoryName(e.NupkgPath));
List<string> sources = new() { NuGetConfigWriter.DotnetCoreBlobFeed };
List<string> sources = new();
sources.AddRange(packagesPaths);
NuGetConfigWriter.Write(testAsset.TestRoot, sources);

Expand Down Expand Up @@ -85,7 +85,7 @@ public void CanBuildProjectWithMultiplePackageReferencesWithAliases()
testProject.SourceFiles[$"{testProject.Name}.cs"] = ClassLibAandBUsage;
var testAsset = _testAssetsManager.CreateTestProject(testProject);

List<string> sources = new() { NuGetConfigWriter.DotnetCoreBlobFeed, Path.GetDirectoryName(packageReferenceA.NupkgPath), Path.GetDirectoryName(packageReferenceB.NupkgPath) };
List<string> sources = new() { Path.GetDirectoryName(packageReferenceA.NupkgPath), Path.GetDirectoryName(packageReferenceB.NupkgPath) };
NuGetConfigWriter.Write(testAsset.TestRoot, sources);

var buildCommand = new BuildCommand(testAsset)
Expand Down Expand Up @@ -122,7 +122,7 @@ public void CanBuildProjectWithAPackageReferenceWithMultipleAliases()
testProject.SourceFiles[$"{testProject.Name}.cs"] = ClassLibAandBUsage;
var testAsset = _testAssetsManager.CreateTestProject(testProject);

List<string> sources = new() { NuGetConfigWriter.DotnetCoreBlobFeed, Path.GetDirectoryName(packageReferenceA.NupkgPath) };
List<string> sources = new() { Path.GetDirectoryName(packageReferenceA.NupkgPath) };
NuGetConfigWriter.Write(testAsset.TestRoot, sources);

var buildCommand = new BuildCommand(testAsset)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private void It_targets_the_right_framework(

var testAsset = _testAssetsManager.CreateTestProject(testProject, testIdentifier);

NuGetConfigWriter.Write(testAsset.TestRoot, NuGetConfigWriter.DotnetCoreBlobFeed);
NuGetConfigWriter.Write(testAsset.TestRoot);

var buildCommand = new BuildCommand(testAsset);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private CommandResult GenerateDepsAndRunTool(TestProject toolProject, [CallerMem

var toolProjectInstance = _testAssetsManager.CreateTestProject(toolProject, callingMethod, identifier: toolProject.Name);

NuGetConfigWriter.Write(toolProjectInstance.TestRoot, NuGetConfigWriter.DotnetCoreBlobFeed);
NuGetConfigWriter.Write(toolProjectInstance.TestRoot);

// Workaround https://github.com/dotnet/cli/issues/9701
var useBundledNETCoreAppPackage = "/p:UseBundledNETCoreAppPackageVersionAsDefaultNetCorePatchVersion=true";
Expand Down Expand Up @@ -116,7 +116,7 @@ private CommandResult GenerateDepsAndRunTool(TestProject toolProject, [CallerMem
new XAttribute("Version", "1.0.0")));
});

List<string> sources = new() { NuGetConfigWriter.DotnetCoreBlobFeed };
List<string> sources = new();
sources.Add(nupkgPath);

NuGetConfigWriter.Write(toolReferencerInstance.TestRoot, sources);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,37 +121,6 @@ public void compose_dependencies_noopt()
storeDirectory.Should().OnlyHaveFiles(files_on_disk);
}

[Fact]
public void store_nativeonlyassets()
{
TestAsset simpleDependenciesAsset = _testAssetsManager
.CopyTestAsset("UnmanagedStore")
.WithSource();

var storeCommand = new ComposeStoreCommand(Log, simpleDependenciesAsset.TestRoot);

var OutputFolder = Path.Combine(simpleDependenciesAsset.TestRoot, "outdir");
var WorkingDir = Path.Combine(simpleDependenciesAsset.TestRoot, "w");

NuGetConfigWriter.Write(simpleDependenciesAsset.TestRoot, NuGetConfigWriter.DotnetCoreBlobFeed);

storeCommand
.Execute($"/p:RuntimeIdentifier={_runtimeRid}", $"/p:TargetFramework={_tfm}", $"/p:ComposeWorkingDir={WorkingDir}", $"/p:ComposeDir={OutputFolder}", $"/p:DoNotDecorateComposeDir=true")
.Should()
.Pass();

DirectoryInfo storeDirectory = new(OutputFolder);

List<string> files_on_disk = new()
{
"artifact.xml",
$"runtime.{_runtimeRid}.microsoft.netcore.coredistools/1.0.1-prerelease-00001/runtimes/{_runtimeRid}/native/{_libPrefix}coredistools{FileConstants.DynamicLibSuffix}",
$"runtime.{_runtimeRid}.microsoft.netcore.coredistools/1.0.1-prerelease-00001/runtimes/{_runtimeRid}/native/coredistools.h"
};

storeDirectory.Should().OnlyHaveFiles(files_on_disk);
}

[Fact]
public void compose_multifile()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void It_issues_warning_and_skips_restore_for_obsolete_DotNetCliToolRefere
new XAttribute("Include", obsoletePackageId)));
});

NuGetConfigWriter.Write(toolProjectInstance.TestRoot, NuGetConfigWriter.DotnetCoreBlobFeed);
NuGetConfigWriter.Write(toolProjectInstance.TestRoot);

RestoreCommand restoreCommand = toolProjectInstance.GetRestoreCommand(Log, toolProject.Name);
restoreCommand.Execute("/v:n").Should()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void It_can_restore_with_netcoreapp2_2()

DeleteFolder(Path.Combine(TestContext.Current.NuGetCachePath, toolProject.Name.ToLowerInvariant()));
DeleteFolder(Path.Combine(TestContext.Current.NuGetCachePath, ".tools", toolProject.Name.ToLowerInvariant()));
NuGetConfigWriter.Write(toolReferenceProjectInstance.TestRoot, NuGetConfigWriter.DotnetCoreBlobFeed, nupkgPath);
NuGetConfigWriter.Write(toolReferenceProjectInstance.TestRoot, nupkgPath);

RestoreCommand restoreCommand =
toolReferenceProjectInstance.GetRestoreCommand(log: Log, relativePath: toolReferenceProject.Name);
Expand Down
1 change: 0 additions & 1 deletion test/Microsoft.NET.TestFramework/NuGetConfigWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace Microsoft.NET.TestFramework
{
public static class NuGetConfigWriter
{
public static readonly string DotnetCoreBlobFeed = "https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json";
public static readonly string AspNetCoreDevFeed = "https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json";

public static void Write(string folder, params string[] nugetSources)
Expand Down

This file was deleted.

Loading