From e1c5c7a43d8addb3c40a64716978cae385d185f3 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 21 Jul 2016 19:36:45 -0700 Subject: [PATCH 1/5] Add Test for removing readonly flag when copying readonly library assets --- .../GivenThatICopyLibraryAssets.cs | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 test/Microsoft.DotNet.Compiler.Common.Tests/GivenThatICopyLibraryAssets.cs diff --git a/test/Microsoft.DotNet.Compiler.Common.Tests/GivenThatICopyLibraryAssets.cs b/test/Microsoft.DotNet.Compiler.Common.Tests/GivenThatICopyLibraryAssets.cs new file mode 100644 index 000000000..7a3661d36 --- /dev/null +++ b/test/Microsoft.DotNet.Compiler.Common.Tests/GivenThatICopyLibraryAssets.cs @@ -0,0 +1,68 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using FluentAssertions; +using Xunit; +using Microsoft.DotNet.Cli.Compiler.Common; +using Microsoft.DotNet.ProjectModel.Compilation; +using System.IO; +using System; +using System.Linq; +using System.Collections.Generic; + +namespace Microsoft.DotNet.Cli.Compiler.Common.Tests +{ + public class GivenThatICopyLibraryAssets + { + [Fact] + public void LibraryAsset_CopyTo_Clears_Readonly() + { + var libraryAsset = GetMockLibraryAsset(nameof(LibraryAsset_CopyTo_Clears_Readonly)); + MakeFileReadonly(libraryAsset.ResolvedPath); + + IEnumerable assets = new LibraryAsset[] { libraryAsset }; + + var outputDirectory = Path.Combine(AppContext.BaseDirectory,$"{nameof(LibraryAsset_CopyTo_Clears_Readonly)}_out"); + assets.CopyTo(outputDirectory); + + var copiedFile = Directory.EnumerateFiles(outputDirectory, Path.GetFileName(libraryAsset.RelativePath)).First(); + FileIsReadonly(copiedFile).Should().BeFalse(); + } + + [Fact] + public void LibraryAsset_StructuredCopyTo_Clears_Readonly() + { + var libraryAsset = GetMockLibraryAsset(nameof(LibraryAsset_StructuredCopyTo_Clears_Readonly)); + MakeFileReadonly(libraryAsset.ResolvedPath); + + IEnumerable assets = new LibraryAsset[] { libraryAsset }; + + var intermediateDirectory = Path.Combine(AppContext.BaseDirectory,$"{nameof(LibraryAsset_StructuredCopyTo_Clears_Readonly)}_obj"); + var outputDirectory = Path.Combine(AppContext.BaseDirectory,$"{nameof(LibraryAsset_StructuredCopyTo_Clears_Readonly)}_out"); + assets.StructuredCopyTo(outputDirectory, intermediateDirectory); + + var copiedFile = Directory.EnumerateFiles(outputDirectory, Path.GetFileName(libraryAsset.RelativePath)).First(); + FileIsReadonly(copiedFile).Should().BeFalse(); + } + + private void MakeFileReadonly(string file) + { + File.SetAttributes(file, File.GetAttributes(file) | FileAttributes.ReadOnly); + } + + private bool FileIsReadonly(string file) + { + return (File.GetAttributes(file) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly; + } + + private LibraryAsset GetMockLibraryAsset(string mockedLibraryAssetName) + { + var mockedLibraryAssetFileName = $"{mockedLibraryAssetName}.dll"; + + var fakeFile = Path.Combine(AppContext.BaseDirectory, mockedLibraryAssetFileName); + File.WriteAllText(fakeFile, mockedLibraryAssetName); + + return new LibraryAsset(mockedLibraryAssetName, mockedLibraryAssetFileName, fakeFile); + } + } +} From f829d8cb93d524ee044f4658d2ea52c1349fc2e3 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 21 Jul 2016 21:12:50 -0700 Subject: [PATCH 2/5] change namespace --- test/Microsoft.DotNet.Compiler.Common.Tests/Tests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.DotNet.Compiler.Common.Tests/Tests.cs b/test/Microsoft.DotNet.Compiler.Common.Tests/Tests.cs index b678464b1..20a57d77b 100644 --- a/test/Microsoft.DotNet.Compiler.Common.Tests/Tests.cs +++ b/test/Microsoft.DotNet.Compiler.Common.Tests/Tests.cs @@ -5,7 +5,7 @@ using Microsoft.DotNet.ProjectModel; using Microsoft.DotNet.Tools.Test.Utilities; using Xunit; -namespace Microsoft.DotNet.Cli.Compiler.Common +namespace Microsoft.DotNet.Cli.Compiler.Common.Tests { public class Tests : TestBase { From 5cb8be5143e2d4e2f9e994cdf9193755284ecf52 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 21 Jul 2016 22:09:07 -0700 Subject: [PATCH 3/5] PR Feedback --- .../{Tests.cs => GivenCommonCompilerOptions.cs} | 2 +- .../GivenThatICopyLibraryAssets.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename test/Microsoft.DotNet.Compiler.Common.Tests/{Tests.cs => GivenCommonCompilerOptions.cs} (95%) diff --git a/test/Microsoft.DotNet.Compiler.Common.Tests/Tests.cs b/test/Microsoft.DotNet.Compiler.Common.Tests/GivenCommonCompilerOptions.cs similarity index 95% rename from test/Microsoft.DotNet.Compiler.Common.Tests/Tests.cs rename to test/Microsoft.DotNet.Compiler.Common.Tests/GivenCommonCompilerOptions.cs index 20a57d77b..6757af610 100644 --- a/test/Microsoft.DotNet.Compiler.Common.Tests/Tests.cs +++ b/test/Microsoft.DotNet.Compiler.Common.Tests/GivenCommonCompilerOptions.cs @@ -7,7 +7,7 @@ using Xunit; namespace Microsoft.DotNet.Cli.Compiler.Common.Tests { - public class Tests : TestBase + public class GivenCommonCompilerOptions : TestBase { [Fact] public void SimpleSerialize() diff --git a/test/Microsoft.DotNet.Compiler.Common.Tests/GivenThatICopyLibraryAssets.cs b/test/Microsoft.DotNet.Compiler.Common.Tests/GivenThatICopyLibraryAssets.cs index 7a3661d36..b8421c27b 100644 --- a/test/Microsoft.DotNet.Compiler.Common.Tests/GivenThatICopyLibraryAssets.cs +++ b/test/Microsoft.DotNet.Compiler.Common.Tests/GivenThatICopyLibraryAssets.cs @@ -26,7 +26,7 @@ namespace Microsoft.DotNet.Cli.Compiler.Common.Tests assets.CopyTo(outputDirectory); var copiedFile = Directory.EnumerateFiles(outputDirectory, Path.GetFileName(libraryAsset.RelativePath)).First(); - FileIsReadonly(copiedFile).Should().BeFalse(); + IsFileReadonly(copiedFile).Should().BeFalse(); } [Fact] @@ -42,7 +42,7 @@ namespace Microsoft.DotNet.Cli.Compiler.Common.Tests assets.StructuredCopyTo(outputDirectory, intermediateDirectory); var copiedFile = Directory.EnumerateFiles(outputDirectory, Path.GetFileName(libraryAsset.RelativePath)).First(); - FileIsReadonly(copiedFile).Should().BeFalse(); + IsFileReadonly(copiedFile).Should().BeFalse(); } private void MakeFileReadonly(string file) @@ -50,7 +50,7 @@ namespace Microsoft.DotNet.Cli.Compiler.Common.Tests File.SetAttributes(file, File.GetAttributes(file) | FileAttributes.ReadOnly); } - private bool FileIsReadonly(string file) + private bool IsFileReadonly(string file) { return (File.GetAttributes(file) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly; } From d14fda084b65bc276dcab8b6eb96a2a786a0ca2d Mon Sep 17 00:00:00 2001 From: Zlatko Knezevic Date: Thu, 21 Jul 2016 23:00:26 -0700 Subject: [PATCH 4/5] Fix newlines in the first run experience message The newlines in the first run experience were missing which made the text look a little squashed. Fixes #3909 --- src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs b/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs index c2bfa1784..39a42f72b 100644 --- a/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs +++ b/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs @@ -38,11 +38,13 @@ namespace Microsoft.DotNet.Configurer const string firstTimeUseWelcomeMessage = @"Welcome to .NET Core! --------------------- Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. + Telemetry -------------- The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include commandline arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. + Configuring... ------------------- A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once."; From 77136a11eecabdb1d140dfb8e0dbfe517b86c148 Mon Sep 17 00:00:00 2001 From: Zlatko Knezevic Date: Fri, 22 Jul 2016 14:21:15 -0700 Subject: [PATCH 5/5] Update README.md (#3904) * Update README.md * Responding to PR feedback * Responding to PR feedback --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 6cf4f8630..ec99858a2 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,17 @@ check out our [Getting started page](http://go.microsoft.com/fwlink/?LinkID=7983 Also, don't forget to check out [the documentation](https://aka.ms/dotnet-cli-docs). +Changes in issue triaging +------------------------- +We are making significant changes to the CLI tooling by supporting MSBuild as the build engine and `csproj` as the project format. You can read ["Changes to project.json" blog post](https://blogs.msdn.microsoft.com/dotnet/2016/05/23/changes-to-project-json/) for more context. We've realized that this also means that many of the shortcomings of the current tooling will be solved by this move so we've decided to introduce two new labels to indicate that in the issues: + +* `msbuild-mitigated` - this label indicates the issue will be mitigated via move to MSBuild. +* `msbuild-notapplicable` - this label indicates the issue will not be applicable after moving to MSBuild. + +We will close issues that are labelled with one of these labels. Proactive triaging will help us reduce the number of issues and enable us to focus on issues that require fixing independent of the move to msbuild. + +Please feel free to re-open and comment on any issue that you believe was triaged incorrectly. + Found an issue? --------------- You can consult the [known issues page](https://github.com/dotnet/core/blob/master/cli/known-issues.md) to find out the current issues and