diff --git a/Documentation/specs/cli-installation-scenarios.md b/Documentation/specs/cli-installation-scenarios.md index b547116cd..49be32fd6 100644 --- a/Documentation/specs/cli-installation-scenarios.md +++ b/Documentation/specs/cli-installation-scenarios.md @@ -126,8 +126,8 @@ Below table shows the mapping between the channels, branches and feeds for the D | Channel | Branch | Debian feed | Debian package name | NuGet version | NuGet feed | |------------ |----------- |------------- |--------------------- |--------------- |--------------------------------------- | | Future | master | Development | dotnet-future | 1.0.0-dev-* | https://dotnet.myget.org/f/dotnet-cli | -| Preview | rel/ | Development | dotnet-dev- | 1.0.0-beta-* | https://dotnet.myget.org/f/dotnet-cli | -| Production | rel/ | Production | dotnet-dev- | 1.0.0 | https://api.nuget.org/v3/index.json | +| Preview | rel/ | Development | dotnet-sdk- | 1.0.0-beta-* | https://dotnet.myget.org/f/dotnet-cli | +| Production | rel/ | Production | dotnet-sdk- | 1.0.0 | https://api.nuget.org/v3/index.json | ## Funnels and discovery mechanisms for CLI bits diff --git a/Microsoft.DotNet.Cli.sln b/Microsoft.DotNet.Cli.sln index f1fed5401..26d5ac266 100644 --- a/Microsoft.DotNet.Cli.sln +++ b/Microsoft.DotNet.Cli.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26419.0 +VisualStudioVersion = 15.0.26510.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ED2FE3E2-F7E7-4389-8231-B65123F2076F}" EndProject @@ -30,7 +30,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4 build\BuildDefaults.props = build\BuildDefaults.props build\BuildInfo.targets = build\BuildInfo.targets build\BundledRuntimes.props = build\BundledRuntimes.props - build\BundledSdks.proj = build\BundledSdks.proj build\BundledSdks.props = build\BundledSdks.props build\BundledTemplates.proj = build\BundledTemplates.proj build\BundledTemplates.props = build\BundledTemplates.props @@ -48,10 +47,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4 build\InstallerInfo.props = build\InstallerInfo.props build\Microsoft.DotNet.Cli.tasks = build\Microsoft.DotNet.Cli.tasks build\MSBuildExtensions.props = build\MSBuildExtensions.props + build\MSBuildExtensions.targets = build\MSBuildExtensions.targets build\OutputDirectories.props = build\OutputDirectories.props build\Package.targets = build\Package.targets build\Prepare.targets = build\Prepare.targets build\Publish.targets = build\Publish.targets + build\RestoreDependency.proj = build\RestoreDependency.proj build\sdks\sdks.csproj = build\sdks\sdks.csproj build\Signing.proj = build\Signing.proj build\Stage0.props = build\Stage0.props diff --git a/NuGet.Config b/NuGet.Config index 14d2b4959..e216f45e7 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -6,7 +6,7 @@ - + diff --git a/README.md b/README.md index ce4e32bab..900de517a 100644 --- a/README.md +++ b/README.md @@ -71,14 +71,16 @@ In order to download just the .NET Core runtime without the SDK, please visit ht | -------- | :-------------------------------------: | | **Windows x64** | [Installer][win-x64-installer] - [Checksum][win-x64-installer-checksum]
[zip][win-x64-zip] - [Checksum][win-x64-zip-checksum] | | **Windows x86** | [Installer][win-x86-installer] - [Checksum][win-x86-installer-checksum]
[zip][win-x86-zip] - [Checksum][win-x86-zip-checksum] | -| **Ubuntu 14.04 / Linux Mint 17** | [Installer][ubuntu-14.04-installer] - [Checksum][ubuntu-14.04-installer-checksum]
*See Installer Note Below
[tar.gz][ubuntu-14.04-targz] - [Checksum][ubuntu-14.04-targz-checksum] | -| **Ubuntu 16.04** | [Installer][ubuntu-16.04-installer] - [Checksum][ubuntu-16.04-installer-checksum]
*See Installer Note Below
[tar.gz][ubuntu-16.04-targz] - [Checksum][ubuntu-16.04-targz-checksum] | -| **Ubuntu 16.10** | [Installer][ubuntu-16.10-installer] - [Checksum][ubuntu-16.10-installer-checksum]
*See Installer Note Below
[tar.gz][ubuntu-16.10-targz] - [Checksum][ubuntu-16.10-targz-checksum] | -| **Debian 8** | [tar.gz][debian-8-targz] - [Checksum][debian-8-targz-checksum] | -| **macOS** | [Installer][osx-installer] - [Checksum][osx-installer-checksum]
[tar.gz][osx-targz] - [Checksum][osx-targz-checksum] | -| **CentOS 7.1 / Oracle Linux 7** | [tar.gz][centos-targz] - [Checksum][centos-targz-checksum] | -| **RHEL 7.2** | [tar.gz][rhel-targz] - [Checksum][rhel-targz-checksum] | +| **Mac OS X** | [Installer][osx-installer] - [Checksum][osx-installer-checksum]
[tar.gz][osx-targz] - [Checksum][osx-targz-checksum] | | **Linux x64** | [tar.gz][linux-targz] - [Checksum][linux-targz-checksum] | +| **Ubuntu 14.04 / Linux Mint 17** | [Installer][ubuntu-14.04-installer] - [Checksum][ubuntu-14.04-installer-checksum]
*See Installer Note Below
tar.gz - See **Linux x64** | +| **Ubuntu 16.04** | [Installer][ubuntu-16.04-installer] - [Checksum][ubuntu-16.04-installer-checksum]
*See Installer Note Below
tar.gz - See **Linux x64** | +| **Ubuntu 16.10** | [Installer][ubuntu-16.10-installer] - [Checksum][ubuntu-16.10-installer-checksum]
*See Installer Note Below
tar.gz - See **Linux x64** | +| **Debian 8** | tar.gz - See **Linux x64** | +| **CentOS 7.1 / Oracle Linux 7** | tar.gz - See **Linux x64** | +| **RHEL 7.2** | tar.gz - See **Linux x64** | +| **Fedora 24** | tar.gz - See **Linux x64** | +| **OpenSUSE 42.1** | tar.gz - See **Linux x64** | *Note: Our Debian packages are put together slightly differently than the other OS specific installers. Instead of combining everything, we have separate component packages that depend on each other. If you're installing these directly from the .deb files (via dpkg or similar), then you'll need to install the [corresponding Host, Host FX Resolver, and Shared Framework packages](https://github.com/dotnet/core-setup#daily-builds) before installing the Sdk package.* @@ -86,47 +88,32 @@ In order to download just the .NET Core runtime without the SDK, please visit ht [comment]: # (The latest versions are always the same across all platforms. Just need one to show, so picking win-x64's svg.) [version-badge]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/win_x64_Release_version_badge.svg -[win-x64-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x64.latest.exe -[win-x64-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x64.latest.exe.sha -[win-x64-zip]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x64.latest.zip -[win-x64-zip-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x64.latest.zip.sha +[win-x64-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x64.exe +[win-x64-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x64.exe.sha +[win-x64-zip]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x64.zip +[win-x64-zip-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x64.zip.sha -[win-x86-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x86.latest.exe -[win-x86-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x86.latest.exe.sha -[win-x86-zip]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x86.latest.zip -[win-x86-zip-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x86.latest.zip.sha +[win-x86-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x86.exe +[win-x86-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x86.exe.sha +[win-x86-zip]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x86.zip +[win-x86-zip-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x86.zip.sha -[ubuntu-14.04-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-ubuntu-x64.latest.deb -[ubuntu-14.04-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-ubuntu-x64.latest.deb.sha -[ubuntu-14.04-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-ubuntu-x64.latest.tar.gz -[ubuntu-14.04-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-ubuntu-x64.latest.tar.gz.sha +[osx-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-osx-x64.pkg +[osx-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-osx-x64.pkg.sha +[osx-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-osx-x64.tar.gz +[osx-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-osx-x64.tar.gz.sha -[ubuntu-16.04-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-ubuntu.16.04-x64.latest.deb -[ubuntu-16.04-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-ubuntu.16.04-x64.latest.deb.sha -[ubuntu-16.04-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-ubuntu.16.04-x64.latest.tar.gz -[ubuntu-16.04-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-ubuntu.16.04-x64.latest.tar.gz.sha +[linux-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-linux-x64.tar.gz +[linux-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-linux-x64.tar.gz.sha -[ubuntu-16.10-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-ubuntu.16.10-x64.latest.deb -[ubuntu-16.10-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-ubuntu.16.10-x64.latest.deb.sha -[ubuntu-16.10-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-ubuntu.16.10-x64.latest.tar.gz -[ubuntu-16.10-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-ubuntu.16.10-x64.latest.tar.gz.sha +[ubuntu-14.04-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-ubuntu-x64.deb +[ubuntu-14.04-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-ubuntu-x64.deb.sha -[debian-8-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-debian-x64.latest.tar.gz -[debian-8-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-debian-x64.latest.tar.gz.sha +[ubuntu-16.04-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-ubuntu.16.04-x64.deb +[ubuntu-16.04-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-ubuntu.16.04-x64.deb.sha -[osx-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-osx-x64.latest.pkg -[osx-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-osx-x64.latest.pkg.sha -[osx-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-osx-x64.latest.tar.gz -[osx-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-osx-x64.latest.tar.gz.sha - -[centos-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-centos-x64.latest.tar.gz -[centos-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-centos-x64.latest.tar.gz.sha - -[rhel-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-rhel-x64.latest.tar.gz -[rhel-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-rhel-x64.latest.tar.gz.sha - -[linux-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-linux-x64.latest.tar.gz -[linux-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-linux-x64.latest.tar.gz.sha +[ubuntu-16.10-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-ubuntu.16.10-x64.deb +[ubuntu-16.10-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-ubuntu.16.10-x64.deb.sha # Debian daily feed diff --git a/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/TestApp/Program.cs b/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/TestApp/Program.cs new file mode 100644 index 000000000..a168da37c --- /dev/null +++ b/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/TestApp/Program.cs @@ -0,0 +1,15 @@ +// 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 System; + +namespace TestApp +{ + class Program + { + public static void Main(string[] args) + { + Console.WriteLine(TestLibrary.Helper.GetMessage()); + } + } +} diff --git a/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/TestApp/TestApp.csproj b/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/TestApp/TestApp.csproj new file mode 100644 index 000000000..4f3707aba --- /dev/null +++ b/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/TestApp/TestApp.csproj @@ -0,0 +1,12 @@ + + + + Exe + net461 + + + + + + + diff --git a/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/TestLibrary/Helper.cs b/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/TestLibrary/Helper.cs new file mode 100644 index 000000000..67b32cfdb --- /dev/null +++ b/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/TestLibrary/Helper.cs @@ -0,0 +1,24 @@ +// 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 System; + +namespace TestLibrary +{ + public static class Helper + { + /// + /// Gets the message from the helper. This comment is here to help test XML documentation file generation, please do not remove it. + /// + /// A message + public static string GetMessage() + { + return "This string came from the test library!"; + } + + public static void SayHi() + { + Console.WriteLine("Hello there!"); + } + } +} \ No newline at end of file diff --git a/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/TestLibrary/TestLibrary.csproj b/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/TestLibrary/TestLibrary.csproj new file mode 100644 index 000000000..9f5c4f4ab --- /dev/null +++ b/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/TestLibrary/TestLibrary.csproj @@ -0,0 +1,7 @@ + + + + netstandard2.0 + + + diff --git a/src/dotnet/commands/dotnet-list/LocalizableStrings.cs b/TestAssets/TestProjects/FSharpTestAppSimple/Program.fs similarity index 52% rename from src/dotnet/commands/dotnet-list/LocalizableStrings.cs rename to TestAssets/TestProjects/FSharpTestAppSimple/Program.fs index 66425450d..65479d645 100644 --- a/src/dotnet/commands/dotnet-list/LocalizableStrings.cs +++ b/TestAssets/TestProjects/FSharpTestAppSimple/Program.fs @@ -1,10 +1,10 @@ // 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. +module ConsoleApplication.Program -namespace Microsoft.DotNet.Tools.List -{ - internal class LocalizableStrings - { - public const string NetListCommand = ".NET List Command"; - } -} +open System + +[] +let main argv = + printfn "Hello World!" + 0 diff --git a/TestAssets/TestProjects/FSharpTestAppSimple/TestAppSimple.fsproj b/TestAssets/TestProjects/FSharpTestAppSimple/TestAppSimple.fsproj new file mode 100644 index 000000000..e504e9b9d --- /dev/null +++ b/TestAssets/TestProjects/FSharpTestAppSimple/TestAppSimple.fsproj @@ -0,0 +1,15 @@ + + + + + netcoreapp2.0 + Exe + + true + + + + + + + diff --git a/build.proj b/build.proj index ac36138fb..bac606d59 100644 --- a/build.proj +++ b/build.proj @@ -20,7 +20,7 @@ DependsOnTargets="MSBuildWorkaroundTarget; RestoreDotnetCliBuildFramework"> - diff --git a/build/BackwardsCompatibilityRuntimes.props b/build/BackwardsCompatibilityRuntimes.props index 72eddd70d..e63013084 100644 --- a/build/BackwardsCompatibilityRuntimes.props +++ b/build/BackwardsCompatibilityRuntimes.props @@ -5,16 +5,16 @@ 1.1.0 1.1.0 - dotnet-host-$(ProductMonikerRid).$(BackwardsCompatibility110SharedHostVersion)$(InstallerExtension) - $(PackagesDirectory)/$(BackwardsCompatibility110DownloadedSharedHostInstallerFileName) + dotnet-host-$(HostMonikerRid).$(BackwardsCompatibility110SharedHostVersion)$(InstallerExtension) + $(PackagesDirectory)/$(BackwardsCompatibility110DownloadedSharedHostInstallerFileName) - dotnet-hostfxr-$(ProductMonikerRid).$(BackwardsCompatibility110HostFxrVersion)$(InstallerExtension) - $(PackagesDirectory)/$(BackwardsCompatibility110DownloadedHostFxrInstallerFileName) + dotnet-hostfxr-$(HostMonikerRid).$(BackwardsCompatibility110HostFxrVersion)$(InstallerExtension) + $(PackagesDirectory)/$(BackwardsCompatibility110DownloadedHostFxrInstallerFileName) - dotnet-sharedframework-$(ProductMonikerRid).$(BackwardsCompatibility110SharedFrameworkVersion)$(InstallerExtension) - $(PackagesDirectory)/$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName) + dotnet-sharedframework-$(HostMonikerRid).$(BackwardsCompatibility110SharedFrameworkVersion)$(InstallerExtension) + $(PackagesDirectory)/$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName) - dotnet-$(ProductMonikerRid).$(BackwardsCompatibility110SharedFrameworkVersion)$(ArchiveExtension) + dotnet-$(HostMonikerRid).$(BackwardsCompatibility110SharedFrameworkVersion)$(ArchiveExtension) $(CoreSetupBlobRootUrl)$(BackwardsCompatibility110CoreSetupChannel) $(BackwardsCompatibility110CoreSetupBlobRootUrlWithChannel)/Binaries/$(BackwardsCompatibility110SharedFrameworkVersion) @@ -34,24 +34,24 @@ <_DownloadAndExtractItem Include="BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile" - Condition="!Exists('$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile)') And '$(InstallerExtension)' != ''"> + Condition="!Exists('$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile)') And '$(OSName)' != 'linux'"> $(BackwardsCompatibility110CoreSetupInstallerBlobRootUrl)/$(BackwardsCompatibility110SharedFrameworkVersion)/$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName) $(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile) <_DownloadAndExtractItem Include="BackwardsCompatibility110DownloadedSharedHostInstallerFile" - Condition="!Exists('$(BackwardsCompatibility110DownloadedSharedHostInstallerFile)') And '$(InstallerExtension)' != ''"> + Condition="!Exists('$(BackwardsCompatibility110DownloadedSharedHostInstallerFile)') And '$(OSName)' != 'linux'"> $(BackwardsCompatibility110CoreSetupInstallerBlobRootUrl)/$(BackwardsCompatibility110SharedHostVersion)/$(BackwardsCompatibility110DownloadedSharedHostInstallerFileName) $(BackwardsCompatibility110DownloadedSharedHostInstallerFile) <_DownloadAndExtractItem Include="BackwardsCompatibility110DownloadedHostFxrInstallerFile" - Condition="!Exists('$(BackwardsCompatibility110DownloadedHostFxrInstallerFile)') And '$(InstallerExtension)' != ''"> + Condition="!Exists('$(BackwardsCompatibility110DownloadedHostFxrInstallerFile)') And '$(OSName)' != 'linux'"> $(BackwardsCompatibility110CoreSetupInstallerBlobRootUrl)/$(BackwardsCompatibility110HostFxrVersion)/$(BackwardsCompatibility110DownloadedHostFxrInstallerFileName) $(BackwardsCompatibility110DownloadedHostFxrInstallerFile) - \ No newline at end of file + diff --git a/build/Branding.props b/build/Branding.props index 6daf9a83e..f04a371c6 100644 --- a/build/Branding.props +++ b/build/Branding.props @@ -13,16 +13,21 @@ '$(Rid)' == 'fedora.24-x64' OR '$(Rid)' == 'opensuse.42.1-x64' ">$(Rid) $(OSName)-$(Architecture) + $(HostRid) + $(HostOSName)-$(Architecture) - dotnet-sdk + dotnet-sdk-internal dotnet-sdk-debug - dotnet-dev - dotnet-runtime-sdk + dotnet-sdk $(ArtifactNameSdk)-$(SdkVersion)-$(ProductMonikerRid) + + $(ArtifactNameSdkDebug)-$(SdkVersion)-$(ProductMonikerRid) $(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)-$(ProductMonikerRid) - $(ArtifactNameCombinedFrameworkSdk)-$(SdkVersion)-$(ProductMonikerRid) - + $(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)-$(HostMonikerRid) diff --git a/build/BuildInfo.targets b/build/BuildInfo.targets index 751f10737..df28e1980 100644 --- a/build/BuildInfo.targets +++ b/build/BuildInfo.targets @@ -9,10 +9,16 @@ - $(HostRid) - x64 - $(HostOSName) - $(HostOSPlatform) + True + $(HostRid) + x64 + $(HostOSName) + $(HostOSPlatform) + + linux-x64 + x64 + linux + linux <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> diff --git a/build/BundledRuntimes.props b/build/BundledRuntimes.props index 9d925e277..2d79fa46f 100644 --- a/build/BundledRuntimes.props +++ b/build/BundledRuntimes.props @@ -1,10 +1,10 @@ - $(Rid) - $(ProductMonikerRid) + $(HostRid) + $(HostMonikerRid) - -internal + -internal dotnet-host$(InstallerStartSuffix)-$(SharedHostVersion)-$(CoreSetupRid)$(InstallerExtension) @@ -34,15 +34,16 @@ $(CoreSetupBlobRootUrl)aspnetcore/store/$(AspNetCoreRuntimeVersion) - $(OSName)$(Architecture) - $(OSName) + $(HostOSName)$(Architecture) + $(HostOSName) linux - -$(AspNetCoreCoherenceTimestamp) + -$(AspNetCoreCoherenceTimestamp) + -$(AspNetCoherenceLabel)$(AspNetCoreRuntimeStoreSuffix) Build.RS.$(AspNetCoreRuntimeInstallerArchiveFileNameOSToken)$(AspNetCoreRuntimeInstallerArchiveSuffix)$(ArchiveExtension) $(PackagesDirectory)/$(AspNetCoreRuntimeInstallerArchiveFileName) - AspNetCorePackageStoreLib$(Architecture).wixlib + AspNetCorePackageStoreLib$(Architecture)$(AspNetCoreRuntimeStoreSuffix).wixlib $(PackagesDirectory)/$(AspNetCoreRuntimeInstallerWixLibFileName) diff --git a/build/BundledSdks.proj b/build/BundledSdks.proj deleted file mode 100644 index 4408ca0a4..000000000 --- a/build/BundledSdks.proj +++ /dev/null @@ -1,45 +0,0 @@ - - - - - $([MSBuild]::Unescape($(CLIBuildDll))) - - - - - - - - - - - - - - - - - - - - - - - $(NuGetPackagesDir)/$(SdkPackageName.ToLower())/$(SdkPackageVersion.ToLower()) - - - diff --git a/build/BundledTemplates.props b/build/BundledTemplates.props index 59606c8b5..549508206 100644 --- a/build/BundledTemplates.props +++ b/build/BundledTemplates.props @@ -5,5 +5,6 @@ + diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index 9d4077a58..381c9c73b 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -1,31 +1,40 @@ - 2.0.0-preview2-25331-01 - 15.3.0-preview-000246-05 + 2.0.0-preview2-25407-01 + 15.3.0-preview-000385-01 2.3.0-beta2-61716-09 1.6.0-beta2-25304 - 1.0.0-rc-170511-0 - 2.0.0-preview2-20170531-2 - 4.3.0-preview2-4082 + 4.2.0-rc-170602-0 + + + 2.0.0-preview2-20170610-3 + $(CLI_NETSDK_Version) + + 4.3.0-preview3-4154 + 2.0.0-preview2-25331-02 2.0.0-rel-20170518-512 - 15.3.0-preview-20170601-03 + 15.3.0-preview-20170609-02 $(CLI_SharedFrameworkVersion) $(CLI_SharedFrameworkVersion) $(CLI_SharedFrameworkVersion) - 1.0.0-beta2-20170531-247 - 1.0.0-beta2-20170531-247 - 1.0.0-beta2-20170531-247 - 2.0.0-preview2-25331-01 - 2.0.0-preview2-25331-01 + 1.0.0-beta2-20170608-254 + 1.0.0-beta2-20170610-257 + 1.0.0-beta2-20170610-257 + 2.0.0-preview2-25407-01 + 2.0.0-preview2-25407-01 0.1.0-alpha-142 - 1.2.1-alpha-002130 + 1.2.1-alpha-002133 0.2.0 + 1.0.0-preview-000286 timestamped - dev-134 - preview2-25332 + 2.0.0-preview2-183 + preview2 + 25615 diff --git a/build/FileExtensions.props b/build/FileExtensions.props index cc9f7e79c..a6c6fca35 100644 --- a/build/FileExtensions.props +++ b/build/FileExtensions.props @@ -1,23 +1,23 @@ - .zip - .tar.gz + .zip + .tar.gz - .msi - .pkg - .deb + .msi + .pkg + .deb - .exe - $(InstallerExtension) - $(InstallerExtension) + .exe + $(InstallerExtension) + $(InstallerExtension) lib - + .so - .dll - .dylib + .dll + .dylib .exe diff --git a/build/GenerateResxSource.targets b/build/GenerateResxSource.targets new file mode 100644 index 000000000..8323e9305 --- /dev/null +++ b/build/GenerateResxSource.targets @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + %(EmbeddedResource.Namespace).%(EmbeddedResource.Filename) + + + + + + + + + + + + + $(IntermediateOutputPath)%(EmbeddedResourceSG.ManifestResourceName).cs + + + + + diff --git a/build/MSBuildExtensions.targets b/build/MSBuildExtensions.targets index b8d2d97e9..c6dd9f7ae 100644 --- a/build/MSBuildExtensions.targets +++ b/build/MSBuildExtensions.targets @@ -1,10 +1,89 @@ + DependsOnTargets="GenerateBundledVersionsProps;RestoreMSBuildExtensionsPackages"> + + + + + + + + + + + + + + + + + + + + + + + + + $(MSBuildExtensionsLayoutDirectory)/%(VSMSBuildExtensionsContent.DeploymentSubpath)%(RecursiveDir)%(Filename)%(Extension) + + + + + + + + Microsoft.NET.Build.Extensions + 15.0 + $(NuGetPackagesDir)/$(MSBuildExtensionsPackageName.ToLower())/$(CLI_MSBuildExtensions_Version.ToLower()) + + NETStandard.Library.NETFramework + $(NuGetPackagesDir)/$(NETStandardLibraryNETFrameworkPackageName.ToLower())/$(CLI_NETStandardLibraryNETFrameworkVersion.ToLower()) + + + + + + + + + + + CLIBuildDll=$(CLIBuildDll); + NuGetPackagesDir=$(NuGetPackagesDir); + DependencyPackageName=%(ExtensionPackageToRestore.Identity); + DependencyPackageVersion=%(ExtensionPackageToRestore.Version); + Stage0Directory=$(Stage0Directory) + + + + + + diff --git a/build/Microsoft.DotNet.Cli.tasks b/build/Microsoft.DotNet.Cli.tasks index 2107f2546..901a48f84 100644 --- a/build/Microsoft.DotNet.Cli.tasks +++ b/build/Microsoft.DotNet.Cli.tasks @@ -19,6 +19,7 @@ + diff --git a/build/OutputDirectories.props b/build/OutputDirectories.props index ac291e14b..42e7d255a 100644 --- a/build/OutputDirectories.props +++ b/build/OutputDirectories.props @@ -17,6 +17,7 @@ $(RepoRoot)/artifacts/testpackages/ $(OutputDirectory)/dotnet$(ExeExtension) $(IntermediateDirectory)/GeneratedMSBuildExtensions - $(IntermediateDirectory)/MSBuildSdkResolver + $(IntermediateDirectory)/MSBuildExtensionsLayout + $(MSBuildExtensionsLayoutDirectory)/MSBuildSdkResolver diff --git a/build/RestoreDependency.proj b/build/RestoreDependency.proj new file mode 100644 index 000000000..142f5e929 --- /dev/null +++ b/build/RestoreDependency.proj @@ -0,0 +1,46 @@ + + + + + $([MSBuild]::Unescape($(CLIBuildDll))) + + + + + + + + + + + + + + + + + + + + + + + $(NuGetPackagesDir)/$(DependencyPackageName.ToLower())/$(DependencyPackageVersion.ToLower()) + + + diff --git a/build/Signing.proj b/build/Signing.proj index b896366db..16357a121 100644 --- a/build/Signing.proj +++ b/build/Signing.proj @@ -17,7 +17,7 @@ $(BaseOutputDirectory)/stage2 $(BaseOutputDirectory)/stage2compilation $(BaseOutputDirectory)/packages - $(BaseOutputDirectory)/intermediate/MSBuildSdkResolver + $(BaseOutputDirectory)/intermediate/MSBuildExtensionsLayout/MSBuildSdkResolver diff --git a/build/package/Installer.DEB.proj b/build/package/Installer.DEB.proj index 9310623cc..32721227c 100644 --- a/build/package/Installer.DEB.proj +++ b/build/package/Installer.DEB.proj @@ -10,11 +10,11 @@ TestDebuild; BuildSdkDeb; TestSdkDeb;" - Condition=" '$(OSName)' == 'ubuntu' OR '$(OSName)' == 'debian' " + Condition=" '$(HostOSName)' == 'ubuntu' OR '$(HostOSName)' == 'debian' " Outputs="@(GeneratedInstallers)"/> - dotnet-dev-$(SdkVersion) + dotnet-sdk-$(SdkVersion) @@ -27,12 +27,12 @@ $(SdkVersion) - dotnet-dev-$(SdkDebianPackageVersion) + dotnet-sdk-$(SdkDebianPackageVersion) $(SharedFrameworkVersion) - dotnet-runtime-$(SharedFxDebianPackageVersion)-$(CoreSetupRid) + dotnet-runtime-$(SharedFxDebianPackageVersion) $(SharedFxDebianPackageName.ToLower()) $(HostFxrVersion) - dotnet-hostfxr-$(HostFxrDebianPackageVersion)-$(CoreSetupRid) + dotnet-hostfxr-$(HostFxrDebianPackageVersion) $(HostFxrDebianPackageName.ToLower()) dotnet-host @@ -52,8 +52,7 @@ $(PackagesDirectory) - $(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension) - + $(InstallerOutputDirectory)/$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension) $(IntermediateDirectory)/debian/sdk $(SdkDebianIntermediateDirectory)/deb-tool-output $(SdkDebianIntermediateDirectory)/debian-testResults.xml diff --git a/build/package/Installer.MSI.targets b/build/package/Installer.MSI.targets index 7154f10d6..44f930c8b 100644 --- a/build/package/Installer.MSI.targets +++ b/build/package/Installer.MSI.targets @@ -22,6 +22,7 @@ $(RepoRoot)/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.nuspec $(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.$(FullNugetVersion).nupkg + $(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.swr @@ -146,16 +147,20 @@ + Outputs="$(SdkMSBuildExtensionsNupkgFile);$(SdkMSBuildExtensionsSwrFile)"> + + + $(LayoutDirectory)/$(ArtifactNameSdkDebug) $(LayoutDirectory)/$(ArtifactNameCombinedHostHostFxrFrameworkSdk) - $(LayoutDirectory)/$(ArtifactNameCombinedFrameworkSdk) @@ -12,10 +11,6 @@ - - - - @@ -35,11 +30,6 @@ Path2="%(CombinedHostHostFxrFrameworkSdkInput.Identity)" > - - - @@ -64,13 +54,6 @@ $(ArtifactNameCombinedHostHostFxrFrameworkSdk) - - @(CombinedFrameworkSdkInput) - @(CombinedFrameworkSdkOutputFiles -> '$(CombinedFrameworkSdkOutputDirectory)/%(Identity)') - $(ArtifactNameWithVersionCombinedFrameworkSdk) - $(ArtifactNameCombinedFrameworkSdk) - - diff --git a/build/publish/PublishDebian.targets b/build/publish/PublishDebian.targets index c920baf81..e49d8b3fd 100644 --- a/build/publish/PublishDebian.targets +++ b/build/publish/PublishDebian.targets @@ -1,11 +1,11 @@ - dotnet-dev-$(SdkVersion) + dotnet-sdk-$(SdkVersion) - $(DotnetBlobRootUrl)/$(Product)/$(FullNugetVersion)/$(ArtifactNameWithVersionSdk)$(InstallerExtension) + $(DotnetBlobRootUrl)/$(Product)/$(FullNugetVersion)/$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension) $(SdkDebianIntermediateDirectory)/package_upload.json 1 @@ -19,7 +19,7 @@ - + diff --git a/build/sdks/sdks.csproj b/build/sdks/sdks.csproj index 4c8158628..b7c9941c0 100755 --- a/build/sdks/sdks.csproj +++ b/build/sdks/sdks.csproj @@ -8,7 +8,7 @@ - + diff --git a/build_projects/dotnet-cli-build/GenerateMSBuildExtensionsSWR.cs b/build_projects/dotnet-cli-build/GenerateMSBuildExtensionsSWR.cs new file mode 100644 index 000000000..ed0d3fd62 --- /dev/null +++ b/build_projects/dotnet-cli-build/GenerateMSBuildExtensionsSWR.cs @@ -0,0 +1,81 @@ +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +namespace Microsoft.DotNet.Cli.Build +{ + public class GenerateMSBuildExtensionsSWR : Task + { + [Required] + public string MSBuildExtensionsLayoutDirectory { get; set; } + + [Required] + public string OutputFile { get; set; } + + public override bool Execute() + { + StringBuilder sb = new StringBuilder(SWR_HEADER); + + AddFolder(sb, + @"MSBuildSdkResolver", + @"MSBuild\15.0\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver"); + + AddFolder(sb, + @"msbuildExtensions", + @"MSBuild"); + + AddFolder(sb, + @"msbuildExtensions-ver", + @"MSBuild\15.0"); + + File.WriteAllText(OutputFile, sb.ToString()); + + return true; + } + + private void AddFolder(StringBuilder sb, string relativeSourcePath, string swrInstallDir) + { + string sourceFolder = Path.Combine(MSBuildExtensionsLayoutDirectory, relativeSourcePath); + var files = Directory.GetFiles(sourceFolder) + .Where(f => !Path.GetExtension(f).Equals(".pdb", StringComparison.OrdinalIgnoreCase)) + .ToList(); + if (files.Any()) + { + sb.Append(@"folder ""InstallDir:\"); + sb.Append(swrInstallDir); + sb.AppendLine(@"\"""); + + foreach (var file in files) + { + sb.Append(@" file source=""!(bindpath.sources)\Redist\Common\NetCoreSDK\MSBuildExtensions\"); + sb.Append(Path.Combine(relativeSourcePath, Path.GetFileName(file))); + sb.AppendLine("\""); + } + + sb.AppendLine(); + } + + foreach (var subfolder in Directory.GetDirectories(sourceFolder)) + { + string subfolderName = Path.GetFileName(subfolder); + string newRelativeSourcePath = Path.Combine(relativeSourcePath, subfolderName); + string newSwrInstallDir = Path.Combine(swrInstallDir, subfolderName); + + AddFolder(sb, newRelativeSourcePath, newSwrInstallDir); + } + } + + readonly string SWR_HEADER = @"use vs + +package name=Microsoft.Net.Core.SDK.MSBuildExtensions + version=$(Version) + vs.package.branch=$(VsSingletonPackageBranch) + vs.package.internalRevision=$(PackageInternalRevision) + +"; + } +} diff --git a/build_projects/dotnet-cli-build/GenerateResxSource.cs b/build_projects/dotnet-cli-build/GenerateResxSource.cs new file mode 100644 index 000000000..05cbca9a1 --- /dev/null +++ b/build_projects/dotnet-cli-build/GenerateResxSource.cs @@ -0,0 +1,58 @@ +// 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 Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace Microsoft.DotNet.Cli.Build +{ + public class GenerateResxSource : Task + { + + [Required] + public string ResxFile { get; set; } + + [Required] + public string ResourceName { get; set; } + + [Required] + public string SourceOutputPath { get; set; } + + public override bool Execute() + { + var source = new StringBuilder(); + void _(string line) { source.AppendLine(line); } + + string @namespace = Path.GetFileNameWithoutExtension(ResourceName); + string @class = Path.GetExtension(ResourceName).TrimStart('.'); + + _($"using System;"); + _($"using System.Globalization;"); + _($"using System.Reflection;"); + _($"using System.Resources;"); + _($""); + _($"namespace {@namespace}"); + _($"{{"); + _($" internal static class {@class}"); + _($" {{"); + _($" internal static CultureInfo Culture {{ get; set; }}"); + _($" internal static ResourceManager ResourceManager {{ get; }} = new ResourceManager(\"{ResourceName}\", typeof({@class}).GetTypeInfo().Assembly);"); + + foreach (var key in XDocument.Load(ResxFile) + .Descendants("data") + .Select(n => n.Attribute("name").Value)) + { + _($" internal static string {key} => ResourceManager.GetString(\"{key}\", Culture);"); + } + _($" }}"); + _($"}}"); + + File.WriteAllText(SourceOutputPath, source.ToString()); + return true; + } + } +} diff --git a/build_projects/dotnet-cli-build/ReplaceFileContents.cs b/build_projects/dotnet-cli-build/ReplaceFileContents.cs index 504175559..b0baf4179 100644 --- a/build_projects/dotnet-cli-build/ReplaceFileContents.cs +++ b/build_projects/dotnet-cli-build/ReplaceFileContents.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using System.Text.RegularExpressions; using Microsoft.Build.Utilities; using Microsoft.Build.Framework; @@ -84,7 +85,8 @@ namespace Microsoft.DotNet.Cli.Build var replacementPattern = ReplacementPatterns[i].ItemSpec; var replacementString = ReplacementStrings[i].ItemSpec; - outText = outText.Replace(replacementPattern, replacementString); + var regex = new Regex(replacementPattern); + outText = regex.Replace(outText, replacementString); } return outText; diff --git a/dir.props b/dir.props index a7e587dfb..2daa217c5 100644 --- a/dir.props +++ b/dir.props @@ -41,4 +41,5 @@ + diff --git a/packaging/deb/dotnet-debian_config.json b/packaging/deb/dotnet-debian_config.json index 22e5beb77..86adb7537 100644 --- a/packaging/deb/dotnet-debian_config.json +++ b/packaging/deb/dotnet-debian_config.json @@ -2,7 +2,7 @@ "maintainer_name":"Microsoft", "maintainer_email": "dotnetcore@microsoft.com", - "package_name": "dotnet-dev-%SDK_NUGET_VERSION%", + "package_name": "dotnet-sdk-%SDK_NUGET_VERSION%", "install_root": "/usr/share/dotnet", "short_description": "%CLI_SDK_BRAND_NAME%", diff --git a/run-build.ps1 b/run-build.ps1 index 137c93d65..d32bd1900 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -80,8 +80,8 @@ $env:VSTEST_TRACE_BUILD=1 # install a stage0 $dotnetInstallPath = Join-Path $RepoRoot "scripts\obtain\dotnet-install.ps1" -Write-Output "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" -Invoke-Expression "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" +Write-Output "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"" -Version 2.0.0-preview2-006437" +Invoke-Expression "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"" -Version 2.0.0-preview2-006437" if ($LastExitCode -ne 0) { Write-Output "The .NET CLI installation failed with exit code $LastExitCode" diff --git a/run-build.sh b/run-build.sh index f702d6e8d..7e9fe78a2 100755 --- a/run-build.sh +++ b/run-build.sh @@ -155,7 +155,8 @@ export VSTEST_TRACE_BUILD=1 DOTNET_MULTILEVEL_LOOKUP=0 # Install a stage 0 -(set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "master" --install-dir "$DOTNET_INSTALL_DIR" --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS) +(set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "release/2.0.0" --install-dir "$DOTNET_INSTALL_DIR" --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS --version "2.0.0-preview2-006437") + EXIT_CODE=$? if [ $EXIT_CODE != 0 ]; then echo "run-build: Error: installing stage0 with exit code $EXIT_CODE." >&2 diff --git a/scripts/obtain/dotnet-install.ps1 b/scripts/obtain/dotnet-install.ps1 index c7bd09a56..f4869d690 100644 --- a/scripts/obtain/dotnet-install.ps1 +++ b/scripts/obtain/dotnet-install.ps1 @@ -253,7 +253,7 @@ function Get-Download-Link([string]$AzureFeed, [string]$Channel, [string]$Specif $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-runtime-$SpecificVersion-win-$CLIArchitecture.zip" } else { - $PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-dev-$SpecificVersion-win-$CLIArchitecture.zip" + $PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-sdk-$SpecificVersion-win-$CLIArchitecture.zip" } Say-Verbose "Constructed primary payload URL: $PayloadURL" diff --git a/scripts/obtain/dotnet-install.sh b/scripts/obtain/dotnet-install.sh index 83ad96d17..c4d0c5850 100755 --- a/scripts/obtain/dotnet-install.sh +++ b/scripts/obtain/dotnet-install.sh @@ -400,7 +400,7 @@ construct_download_link() { if [ "$shared_runtime" = true ]; then download_link="$azure_feed/Runtime/$specific_version/dotnet-runtime-$specific_version-$osname-$normalized_architecture.tar.gz" else - download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$specific_version-$osname-$normalized_architecture.tar.gz" + download_link="$azure_feed/Sdk/$specific_version/dotnet-sdk-$specific_version-$osname-$normalized_architecture.tar.gz" fi echo "$download_link" diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/LocalizableStrings.cs b/src/Microsoft.DotNet.Cli.Sln.Internal/LocalizableStrings.cs deleted file mode 100644 index 013260ed8..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/LocalizableStrings.cs +++ /dev/null @@ -1,32 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Cli.Sln.Internal -{ - internal class LocalizableStrings - { - // {0} is the line number - // {1} is the error message details - public const string ErrorMessageFormatString = "Invalid format in line {0}: {1}"; - - public const string ProjectParsingErrorFormatString = "Project section is missing '{0}' when parsing the line starting at position {1}"; - - public const string InvalidPropertySetFormatString = "Property set is missing '{0}'"; - - public const string GlobalSectionMoreThanOnceError = "Global section specified more than once"; - - public const string GlobalSectionNotClosedError = "Global section not closed"; - - public const string FileHeaderMissingVersionError = "File header is missing version"; - - public const string FileHeaderMissingError = "Expected file header not found"; - - public const string ProjectSectionNotClosedError = "Project section not closed"; - - public const string InvalidSectionTypeError = "Invalid section type: {0}"; - - public const string SectionIdMissingError = "Section id missing"; - - public const string ClosingSectionTagNotFoundError = "Closing section tag not found"; - } -} diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/LocalizableStrings.resx b/src/Microsoft.DotNet.Cli.Sln.Internal/LocalizableStrings.resx new file mode 100644 index 000000000..205037931 --- /dev/null +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/LocalizableStrings.resx @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Invalid format in line {0}: {1} + + + Project section is missing '{0}' when parsing the line starting at position {1} + + + Property set is missing '{0}' + + + Global section specified more than once + + + Global section not closed + + + File header is missing version + + + Expected file header not found + + + Project section not closed + + + Invalid section type: {0} + + + Section id missing + + + Closing section tag not found + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/Microsoft.DotNet.Cli.Sln.Internal.csproj b/src/Microsoft.DotNet.Cli.Sln.Internal/Microsoft.DotNet.Cli.Sln.Internal.csproj index 1b4b8d348..fab4bb6bf 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/Microsoft.DotNet.Cli.Sln.Internal.csproj +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/Microsoft.DotNet.Cli.Sln.Internal.csproj @@ -12,6 +12,10 @@ true + + + + diff --git a/src/Microsoft.DotNet.Cli.Utils/LocalizableStrings.cs b/src/Microsoft.DotNet.Cli.Utils/LocalizableStrings.cs deleted file mode 100644 index 3b2f17829..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/LocalizableStrings.cs +++ /dev/null @@ -1,100 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Cli.Utils -{ - internal class LocalizableStrings - { - public const string MalformedText = "Malformed command text '{0}'"; - - public const string BuildOutputPathDoesNotExist = "outputpathresolver: {0} does not exist"; - - public const string AttemptingToFindCommand = "{0}: attempting to find command {1} in {2}"; - - public const string FailedToFindToolAssembly = "{0}: failed to find toolAssembly for {1}"; - - public const string FailedToFindCommandPath = "{0}: failed to find commandPath {1}"; - - public const string UnableToLocateDotnetMultiplexer = "Unable to locate dotnet multiplexer"; - - public const string LookingForPreferCliRuntimeFile = "{0}: Looking for prefercliruntime file at `{1}`"; - - public const string IgnoringPreferCLIRuntimeFile = "{0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2})"; - - public const string CouldNotFindToolRuntimeConfigFile = "{0}: Could not find runtimeconfig.json file for tool {1}"; - - public const string AttemptingToResolve = "{0}: attempting to resolve {1}"; - - public const string DidNotFindAMatchingProject = "{0}: Did not find a matching project {1}."; - - public const string InvalidCommandResolverArguments = "{0}: invalid commandResolverArguments"; - - public const string DoesNotExist = "{0}: {1} does not exist"; - - public const string AmbiguousCommandName = "Ambiguous command name: {0}"; - - public const string ToolLibraryFound = "{0}: tool library found {1}"; - - public const string MSBuildExePath = "{0}: MSBUILD_EXE_PATH = {1}"; - - public const string MSBuildProjectPath = "{0}: MSBuild project path = {1}"; - - public const string MultipleProjectFilesFound = "Specify which project file to use because this '{0}' contains more than one project file."; - - public const string DidNotFindProject = "{0}: ProjectFactory did not find Project."; - - public const string ResolvingCommandSpec = "{0}: resolving commandspec from {1} Tool Libraries."; - - public const string FailedToResolveCommandSpec = "{0}: failed to resolve commandspec from library."; - - public const string AttemptingToResolveCommandSpec = "{0}: Attempting to resolve command spec from tool {1}"; - - public const string NuGetPackagesRoot = "{0}: nuget packages root:\n{1}"; - - public const string FoundToolLockFile = "{0}: found tool lockfile at : {1}"; - - public const string LibraryNotFoundInLockFile = "{0}: library not found in lock file."; - - public const string AttemptingToCreateCommandSpec = "{0}: attempting to create commandspec"; - - public const string CommandSpecIsNull = "{0}: commandSpec is null."; - - public const string ExpectDepsJsonAt = "{0}: expect deps.json at: {1}"; - - public const string GeneratingDepsJson = "Generating deps.json at: {0}"; - - public const string UnableToGenerateDepsJson = "unable to generate deps.json, it may have been already generated: {0}"; - - public const string DepsJsonGeneratorProjectNotSet = "Unable to find deps.json generator project."; - - public const string UnableToDeleteTemporaryDepsJson = "unable to delete temporary deps.json file: {0}"; - - public const string VersionForPackageCouldNotBeResolved = "Version for package `{0}` could not be resolved."; - - public const string FileNotFound = "File not found `{0}`."; - - public const string ProjectNotRestoredOrRestoreFailed = "The project may not have been restored or restore failed - run `dotnet restore`"; - - public const string NoExecutableFoundMatchingCommand = "No executable found matching command \"{0}\""; - - public const string CommandAssembliesNotFound = "The command executable for \"{0}\" was not found. The project may not have been restored or restore failed - run `dotnet restore`"; - - public const string WaitingForDebuggerToAttach = "Waiting for debugger to attach. Press ENTER to continue"; - - public const string ProcessId = "Process ID: {0}"; - - public const string CouldNotAccessAssetsFile = "Could not access assets file."; - - public const string DotNetCommandLineTools = ".NET Command Line Tools"; - - public const string WriteLineForwarderSetPreviously = "WriteLine forwarder set previously"; - - public const string AlreadyCapturingStream = "Already capturing stream!"; - - public const string RunningFileNameArguments = "Running {0} {1}"; - - public const string ProcessExitedWithCode = "< {0} exited with {1} in {2} ms."; - - public const string UnableToInvokeMemberNameAfterCommand = "Unable to invoke {0} after the command has been run"; - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/LocalizableStrings.resx b/src/Microsoft.DotNet.Cli.Utils/LocalizableStrings.resx new file mode 100644 index 000000000..0fe90333b --- /dev/null +++ b/src/Microsoft.DotNet.Cli.Utils/LocalizableStrings.resx @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Malformed command text '{0}' + + + outputpathresolver: {0} does not exist + + + {0}: attempting to find command {1} in {2} + + + {0}: failed to find toolAssembly for {1} + + + {0}: failed to find commandPath {1} + + + Unable to locate dotnet multiplexer + + + {0}: Looking for prefercliruntime file at `{1}` + + + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + + + {0}: Could not find runtimeconfig.json file for tool {1} + + + {0}: attempting to resolve {1} + + + {0}: Did not find a matching project {1}. + + + {0}: invalid commandResolverArguments + + + {0}: {1} does not exist + + + Ambiguous command name: {0} + + + {0}: tool library found {1} + + + {0}: MSBUILD_EXE_PATH = {1} + + + {0}: MSBuild project path = {1} + + + Specify which project file to use because this '{0}' contains more than one project file. + + + {0}: ProjectFactory did not find Project. + + + {0}: resolving commandspec from {1} Tool Libraries. + + + {0}: failed to resolve commandspec from library. + + + {0}: Attempting to resolve command spec from tool {1} + + + {0}: nuget packages root: +{1} + + + {0}: found tool lockfile at : {1} + + + {0}: library not found in lock file. + + + {0}: attempting to create commandspec + + + {0}: commandSpec is null. + + + {0}: expect deps.json at: {1} + + + Generating deps.json at: {0} + + + unable to generate deps.json, it may have been already generated: {0} + + + Unable to find deps.json generator project. + + + unable to delete temporary deps.json file: {0} + + + Version for package `{0}` could not be resolved. + + + File not found `{0}`. + + + The project may not have been restored or restore failed - run `dotnet restore` + + + No executable found matching command "{0}" + + + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + + + Waiting for debugger to attach. Press ENTER to continue + + + Process ID: {0} + + + Could not access assets file. + + + .NET Command Line Tools + + + WriteLine forwarder set previously + + + Already capturing stream! + + + Running {0} {1} + + + < {0} exited with {1} in {2} ms. + + + Unable to invoke {0} after the command has been run + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj b/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj index 7d230f361..b29251ca9 100644 --- a/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj +++ b/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj @@ -11,6 +11,10 @@ true + + + + diff --git a/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs b/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs index c6081d14e..fd46cf972 100644 --- a/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs +++ b/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs @@ -35,7 +35,7 @@ namespace Microsoft.DotNet.Configurer private void PrintFirstTimeUseNotice() { - const string firstTimeUseWelcomeMessage = LocalizableStrings.FirstTimeWelcomeMessage; + string firstTimeUseWelcomeMessage = LocalizableStrings.FirstTimeWelcomeMessage; Reporter.Output.WriteLine(); Reporter.Output.WriteLine(firstTimeUseWelcomeMessage); diff --git a/src/Microsoft.DotNet.Configurer/LocalizableStrings.cs b/src/Microsoft.DotNet.Configurer/LocalizableStrings.cs deleted file mode 100644 index 5fe83556d..000000000 --- a/src/Microsoft.DotNet.Configurer/LocalizableStrings.cs +++ /dev/null @@ -1,24 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Configurer -{ - internal class LocalizableStrings - { - public const string FirstTimeWelcomeMessage = @"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 command-line 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."; - - public const string FailedToPrimeCacheError = "Failed to prime the NuGet cache. {0} failed with: {1}"; - } -} diff --git a/src/Microsoft.DotNet.Configurer/LocalizableStrings.resx b/src/Microsoft.DotNet.Configurer/LocalizableStrings.resx new file mode 100644 index 000000000..15ada4de5 --- /dev/null +++ b/src/Microsoft.DotNet.Configurer/LocalizableStrings.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 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 command-line 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. + + + Failed to prime the NuGet cache. {0} failed with: {1} + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj b/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj index 03775be47..92026b83f 100644 --- a/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj +++ b/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj @@ -12,6 +12,10 @@ git://github.com/dotnet/cli + + + + diff --git a/src/dotnet/CommandLine/HelpMessageStrings.cs b/src/dotnet/CommandLine/HelpMessageStrings.cs index 09551d2e6..3bbd0e21a 100644 --- a/src/dotnet/CommandLine/HelpMessageStrings.cs +++ b/src/dotnet/CommandLine/HelpMessageStrings.cs @@ -5,6 +5,6 @@ namespace Microsoft.DotNet.Cli.CommandLine { internal class HelpMessageStrings { - internal const string MSBuildAdditionalArgsHelpText = LocalizableStrings.MSBuildAdditionalArgsHelpText; + internal static string MSBuildAdditionalArgsHelpText => LocalizableStrings.MSBuildAdditionalArgsHelpText; } } diff --git a/src/dotnet/CommandLine/LocalizableStrings.cs b/src/dotnet/CommandLine/LocalizableStrings.cs deleted file mode 100644 index ff01edf1b..000000000 --- a/src/dotnet/CommandLine/LocalizableStrings.cs +++ /dev/null @@ -1,50 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Cli.CommandLine -{ - internal class LocalizableStrings - { - public const string LastArgumentMultiValueError = "The last argument '{0}' accepts multiple values. No more argument can be added."; - - public const string OptionRequiresSingleValueWhichIsMissing = "Required value for option '{0}' was not provided."; - - public const string UnexpectedValueForOptionError = "Unexpected value '{0}' for option '{1}'"; - - public const string UnexpectedArgumentError = "Unrecognized {0} '{1}'"; - - public const string ResponseFileNotFoundError = "Response file '{0}' doesn't exist."; - - public const string ShowHelpInfo = "Show help information"; - - public const string ShowVersionInfo = "Show version information"; - - public const string ShowHintInfo = "Specify --{0} for a list of available options and commands."; - - public const string UsageHeader = "Usage:"; - - public const string UsageArgumentsToken = " [arguments]"; - - public const string UsageArgumentsHeader = "Arguments:"; - - public const string UsageOptionsToken = " [options]"; - - public const string UsageOptionsHeader = "Options:"; - - public const string UsageCommandToken = " [command]"; - - public const string UsageCommandsHeader = "Commands:"; - - public const string UsageCommandsDetailHelp = "Use \"{0} [command] --help\" for more information about a command."; - - public const string UsageCommandArgs = " [args]"; - - public const string UsageCommandAdditionalArgs = " [[--] ...]]"; - - public const string UsageCommandsAdditionalArgsHeader = "Additional Arguments:"; - - public const string InvalidTemplateError = "Invalid template pattern '{0}'"; - - public const string MSBuildAdditionalArgsHelpText = "Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options."; - } -} diff --git a/src/dotnet/CommandLine/LocalizableStrings.resx b/src/dotnet/CommandLine/LocalizableStrings.resx new file mode 100644 index 000000000..0859e0db6 --- /dev/null +++ b/src/dotnet/CommandLine/LocalizableStrings.resx @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The last argument '{0}' accepts multiple values. No more argument can be added. + + + Required value for option '{0}' was not provided. + + + Unexpected value '{0}' for option '{1}' + + + Unrecognized {0} '{1}' + + + Response file '{0}' doesn't exist. + + + Show help information + + + Show version information + + + Specify --{0} for a list of available options and commands. + + + Usage: + + + [arguments] + + + Arguments: + + + [options] + + + Options: + + + [command] + + + Commands: + + + Use "{0} [command] --help" for more information about a command. + + + [args] + + + [[--] <additional arguments>...]] + + + Additional Arguments: + + + Invalid template pattern '{0}' + + + Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. + + \ No newline at end of file diff --git a/src/dotnet/CommonLocalizableStrings.cs b/src/dotnet/CommonLocalizableStrings.cs deleted file mode 100644 index 666ed56f4..000000000 --- a/src/dotnet/CommonLocalizableStrings.cs +++ /dev/null @@ -1,199 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools -{ - internal class CommonLocalizableStrings - { - public const string UnsupportedProjectType = "Unsupported project type. Please check with your sdk provider."; - public const string ProjectAlreadyHasAreference = "Project already has a reference to `{0}`."; - public const string ProjectReferenceCouldNotBeFound = "Project reference `{0}` could not be found."; - public const string ProjectReferenceRemoved = "Project reference `{0}` removed."; - - // Project related - public const string Project = "Project"; - public const string ProjectFile = "Project file"; - public const string Reference = "Reference"; - public const string ProjectReference = "Project reference"; - public const string ProjectReferenceOneOrMore = "Project reference(s)"; - public const string PackageReference = "Package reference"; - public const string P2P = "Project to Project"; - public const string P2PReference = "Project to Project reference"; - public const string Package = "Package"; - public const string Solution = "Solution"; - public const string SolutionFile = "Solution file"; - public const string Executable = "Executable"; - public const string Library = "Library"; - public const string Program = "Program"; - public const string Application = "Application"; - public const string ReferenceAddedToTheProject = "Reference `{0}` added to the project."; - - // Verbs - public const string Add = "Add"; - public const string Remove = "Remove"; - public const string Delete = "Delete"; - public const string Update = "Update"; - public const string New = "New"; - public const string List = "List"; - public const string Load = "Load"; - public const string Save = "Save"; - public const string Find = "Find"; - - // Other - public const string Error = "Error"; - public const string Warning = "Warning"; - - public const string File = "File"; - public const string Directory = "Directory"; - - public const string Type = "Type"; - public const string Value = "Value"; - public const string Group = "Group"; - - // General sentences"; - public const string XAddedToY = "{0} added to {1}."; - public const string XRemovedFromY = "{0} removed from {1}."; - public const string XDeletedFromY = "{0} deleted from {1}."; - public const string XSuccessfullyUpdated = "{0} successfully updated."; - - // General errors - /// Invalid - public const string XIsInvalid = "{0} is invalid."; - public const string XYFoundButInvalid = "{0} `{1}` found but is invalid."; - public const string XFoundButInvalid = "`{0}` found but is invalid."; - public const string OperationInvalid = "Operation is invalid."; - public const string OperationXInvalid = "Operation {0} is invalid."; - - /// Not Found - public const string XNotFound = "{0} not found."; - public const string XOrYNotFound = "{0} or {1} not found."; - public const string XOrYNotFoundInZ = "{0} or {1} not found in `{2}`."; - public const string FileNotFound = "File `{0}` not found."; - - /// Does not exist - public const string XDoesNotExist = "{0} does not exist."; - public const string XYDoesNotExist = "{0} `{1}` does not exist."; - - /// Duplicate - public const string MoreThanOneXFound = "More than one {0} found."; - public const string XAlreadyContainsY = "{0} already contains {1}."; - public const string XAlreadyContainsYZ = "{0} already contains {1} `{2}`."; - public const string XAlreadyHasY = "{0} already has {1}."; - public const string XAlreadyHasYZ = "{0} already has {1} `{2}`."; - - /// Other - public const string XWasNotExpected = "{0} was not expected."; - public const string XNotProvided = "{0} not provided."; - public const string SpecifyAtLeastOne = "Please specify at least one {0}."; - public const string CouldNotConnectWithTheServer = "Could not connect with the server."; - - // Command Line Parsing - public const string RequiredArgumentIsInvalid = "Required argument {0} is invalid."; - public const string OptionIsInvalid = "Option {0} is invalid."; - public const string ArgumentIsInvalid = "Argument {0} is invalid."; - public const string RequiredArgumentNotPassed = "Required argument {0} was not provided."; - public const string RequiredCommandNotPassed = "Required command was not provided."; - - // dotnet - /// Project - public const string CouldNotFindAnyProjectInDirectory = "Could not find any project in `{0}`."; - public const string CouldNotFindProjectOrDirectory = "Could not find project or directory `{0}`."; - public const string MoreThanOneProjectInDirectory = "Found more than one project in `{0}`. Please specify which one to use."; - public const string FoundInvalidProject = "Found a project `{0}` but it is invalid."; - public const string InvalidProject = "Invalid project `{0}`."; - public const string InvalidProjectWithExceptionMessage = "Invalid project `{0}`. {1}."; - - /// Solution - public const string CouldNotFindSolutionIn = "Specified solution file {0} does not exist, or there is no solution file in the directory."; - public const string CouldNotFindSolutionOrDirectory = "Could not find solution or directory `{0}`."; - public const string MoreThanOneSolutionInDirectory = "Found more than one solution file in {0}. Please specify which one to use."; - public const string InvalidSolutionFormatString = "Invalid solution `{0}`. {1}."; // {0} is the solution path, {1} is already localized details on the failure - public const string SolutionDoesNotExist = "Specified solution file {0} does not exist, or there is no solution file in the directory."; - - /// add p2p - public const string ReferenceDoesNotExist = "Reference {0} does not exist."; - public const string ReferenceIsInvalid = "Reference `{0}` is invalid."; - public const string SpecifyAtLeastOneReferenceToAdd = "You must specify at least one reference to add."; - public const string ProjectAlreadyHasAReference = "Project {0} already has a reference `{1}`."; - - /// add package - public const string PackageReferenceDoesNotExist = "Package reference `{0}` does not exist."; - public const string PackageReferenceIsInvalid = "Package reference `{0}` is invalid."; - public const string SpecifyAtLeastOnePackageReferenceToAdd = "You must specify at least one package to add."; - public const string PackageReferenceAddedToTheProject = "Package reference `{0}` added to the project."; - public const string ProjectAlreadyHasAPackageReference = "Project {0} already has a reference `{1}`."; - public const string PleaseSpecifyVersion = "Please specify a version of the package."; - - /// add sln - public const string ProjectDoesNotExist = "Project `{0}` does not exist."; - public const string ProjectIsInvalid = "Project `{0}` is invalid."; - public const string SpecifyAtLeastOneProjectToAdd = "You must specify at least one project to add."; - public const string ProjectAddedToTheSolution = "Project `{0}` added to the solution."; - public const string SolutionAlreadyContainsProject = "Solution {0} already contains project {1}."; - - /// del p2p - public const string ReferenceNotFoundInTheProject = "Specified reference {0} does not exist in project {1}."; - public const string ReferenceRemoved = "Reference `{0}` deleted from the project."; - public const string SpecifyAtLeastOneReferenceToRemove = "You must specify at least one reference to remove."; - public const string ReferenceDeleted = "Reference `{0}` deleted."; - - /// del pkg - public const string PackageReferenceNotFoundInTheProject = "Package reference `{0}` could not be found in the project."; - public const string PackageReferenceRemoved = "Reference `{0}` deleted from the project."; - public const string SpecifyAtLeastOnePackageReferenceToRemove = "You must specify at least one package reference to remove."; - public const string PackageReferenceDeleted = "Package reference `{0}` deleted."; - - /// del sln - public const string ProjectNotFoundInTheSolution = "Project `{0}` could not be found in the solution."; - public const string ProjectRemoved = "Project `{0}` removed from solution."; - public const string SpecifyAtLeastOneProjectToRemove = "You must specify at least one project to remove."; - public const string ProjectDeleted = "Project `{0}` deleted from solution."; - - /// list - public const string NoReferencesFound = "There are no {0} references in project {1}. ;; {0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). "; - public const string NoProjectsFound = "No projects found in the solution."; - - /// arguments - public const string ArgumentsProjectOrSolutionDescription = "The project or solution to operation on. If a file is not specified, the current directory is searched."; - - /// sln - public const string ArgumentsProjectDescription = "The project file to operate on. If a file is not specified, the command will search the current directory for one."; - public const string ArgumentsSolutionDescription = "Solution file to operate on. If not specified, the command will search the current directory for one."; - public const string CmdSlnFile = "SLN_FILE"; - public const string CmdProjectFile = "PROJECT"; - - /// commands - public const string CmdFramework = "FRAMEWORK"; - - /// update pkg - public const string PleaseSpecifyNewVersion = "Please specify new version of the package."; - public const string PleaseSpecifyWhichPackageToUpdate = "Please specify which package to update."; - public const string NothingToUpdate = "Nothing to update."; - public const string EverythingUpToDate = "Everything is already up-to-date."; - public const string PackageVersionUpdatedTo = "Version of package `{0}` updated to `{1}`."; - public const string PackageVersionUpdated = "Version of package `{0}` updated."; - public const string CouldNotUpdateTheVersion = "Could not update the version of the package `{0}`."; - - /// new - public const string TemplateCreatedSuccessfully = "The template {0} created successfully. Please run \"dotnet restore\" to get started!"; - public const string TemplateInstalledSuccesfully = "The template {0} installed successfully. You can use \"dotnet new {0}\" to get started with the new template."; - public const string TemplateCreateError = "Template {0} could not be created. Error returned was: {1}."; - public const string TemplateInstallError = "Template {0} could not be installed. Error returned was: {1}."; - public const string SpecifiedNameExists = "Specified name {0} already exists. Please specify a different name."; - public const string SpecifiedAliasExists = "Specified alias {0} already exists. Please specify a different alias."; - public const string MandatoryParameterMissing = "Mandatory parameter {0} missing for template {1}. "; - - public const string ProjectNotCompatibleWithFrameworks = "Project `{0}` cannot be added due to incompatible targeted frameworks between the two projects. Please review the project you are trying to add and verify that is compatible with the following targets:"; - public const string ProjectDoesNotTargetFramework = "Project `{0}` does not target framework `{1}`."; - public const string ProjectCouldNotBeEvaluated = "Project `{0}` could not be evaluated. Evaluation failed with following error:\n{1}."; - - /// common options - public const string VerbosityOptionDescription = "Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]."; - public const string FrameworkOptionDescription = "Target framework to publish for. The target framework has to be specified in the project file."; - public const string RuntimeOptionDescription = "Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app."; - public const string ConfigurationOptionDescription = "Configuration to use for building the project. Default for most projects is \"Debug\"."; - public const string CmdVersionSuffixDescription = "Defines the value for the $(VersionSuffix) property in the project."; - - public const string ShowHelpDescription = "Show help information."; - } -} diff --git a/src/dotnet/CommonLocalizableStrings.resx b/src/dotnet/CommonLocalizableStrings.resx new file mode 100644 index 000000000..a2f5c3270 --- /dev/null +++ b/src/dotnet/CommonLocalizableStrings.resx @@ -0,0 +1,526 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Unsupported project type. Please check with your sdk provider. + + + Project already has a reference to `{0}`. + + + Project reference `{0}` could not be found. + + + Project reference `{0}` removed. + + + Project + + + Project file + + + Reference + + + Project reference + + + Project reference(s) + + + Package reference + + + Project to Project + + + Project to Project reference + + + Package + + + Solution + + + Solution file + + + Executable + + + Library + + + Program + + + Application + + + Reference `{0}` added to the project. + + + Add + + + Remove + + + Delete + + + Update + + + New + + + List + + + Load + + + Save + + + Find + + + Error + + + Warning + + + File + + + Directory + + + Type + + + Value + + + Group + + + {0} added to {1}. + + + {0} removed from {1}. + + + {0} deleted from {1}. + + + {0} successfully updated. + + + {0} is invalid. + + + {0} `{1}` found but is invalid. + + + `{0}` found but is invalid. + + + Operation is invalid. + + + Operation {0} is invalid. + + + {0} not found. + + + {0} or {1} not found. + + + {0} or {1} not found in `{2}`. + + + File `{0}` not found. + + + {0} does not exist. + + + {0} `{1}` does not exist. + + + More than one {0} found. + + + {0} already contains {1}. + + + {0} already contains {1} `{2}`. + + + {0} already has {1}. + + + {0} already has {1} `{2}`. + + + {0} was not expected. + + + {0} not provided. + + + Please specify at least one {0}. + + + Could not connect with the server. + + + Required argument {0} is invalid. + + + Option {0} is invalid. + + + Argument {0} is invalid. + + + Required argument {0} was not provided. + + + Required command was not provided. + + + Could not find any project in `{0}`. + + + Could not find project or directory `{0}`. + + + Found more than one project in `{0}`. Please specify which one to use. + + + Found a project `{0}` but it is invalid. + + + Invalid project `{0}`. + + + Invalid project `{0}`. {1}. + + + Specified solution file {0} does not exist, or there is no solution file in the directory. + + + Could not find solution or directory `{0}`. + + + Found more than one solution file in {0}. Please specify which one to use. + + + Invalid solution `{0}`. {1}. + + + Specified solution file {0} does not exist, or there is no solution file in the directory. + + + Reference {0} does not exist. + + + Reference `{0}` is invalid. + + + You must specify at least one reference to add. + + + Project {0} already has a reference `{1}`. + + + Package reference `{0}` does not exist. + + + Package reference `{0}` is invalid. + + + You must specify at least one package to add. + + + Package reference `{0}` added to the project. + + + Project {0} already has a reference `{1}`. + + + Please specify a version of the package. + + + Project `{0}` does not exist. + + + Project `{0}` is invalid. + + + You must specify at least one project to add. + + + Project `{0}` added to the solution. + + + Solution {0} already contains project {1}. + + + Specified reference {0} does not exist in project {1}. + + + Reference `{0}` deleted from the project. + + + You must specify at least one reference to remove. + + + Reference `{0}` deleted. + + + Package reference `{0}` could not be found in the project. + + + Reference `{0}` deleted from the project. + + + You must specify at least one package reference to remove. + + + Package reference `{0}` deleted. + + + Project `{0}` could not be found in the solution. + + + Project `{0}` removed from solution. + + + You must specify at least one project to remove. + + + Project `{0}` deleted from solution. + + + There are no {0} references in project {1}. ;; {0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). + + + No projects found in the solution. + + + The project or solution to operation on. If a file is not specified, the current directory is searched. + + + The project file to operate on. If a file is not specified, the command will search the current directory for one. + + + Solution file to operate on. If not specified, the command will search the current directory for one. + + + SLN_FILE + + + PROJECT + + + FRAMEWORK + + + Please specify new version of the package. + + + Please specify which package to update. + + + Nothing to update. + + + Everything is already up-to-date. + + + Version of package `{0}` updated to `{1}`. + + + Version of package `{0}` updated. + + + Could not update the version of the package `{0}`. + + + The template {0} created successfully. Please run "dotnet restore" to get started! + + + The template {0} installed successfully. You can use "dotnet new {0}" to get started with the new template. + + + Template {0} could not be created. Error returned was: {1}. + + + Template {0} could not be installed. Error returned was: {1}. + + + Specified name {0} already exists. Please specify a different name. + + + Specified alias {0} already exists. Please specify a different alias. + + + Mandatory parameter {0} missing for template {1}. + + + Project `{0}` cannot be added due to incompatible targeted frameworks between the two projects. Please review the project you are trying to add and verify that is compatible with the following targets: + + + Project `{0}` does not target framework `{1}`. + + + Project `{0}` could not be evaluated. Evaluation failed with following error: +{1}. + + + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + + + Target framework to publish for. The target framework has to be specified in the project file. + + + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + + + Configuration to use for building the project. Default for most projects is "Debug". + + + Defines the value for the $(VersionSuffix) property in the project. + + + Show help information. + + + Does not do an implicit restore when executing the command. + + \ No newline at end of file diff --git a/src/dotnet/CommonOptions.cs b/src/dotnet/CommonOptions.cs index 06047fcd3..e3103b64c 100644 --- a/src/dotnet/CommonOptions.cs +++ b/src/dotnet/CommonOptions.cs @@ -65,5 +65,11 @@ namespace Microsoft.DotNet.Cli public static ArgumentsRule DefaultToCurrentDirectory(this ArgumentsRule rule) => rule.With(defaultValue: () => PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory())); + + public static Option NoRestoreOption() => + Create.Option( + "--no-restore", + CommonLocalizableStrings.NoRestoreDescription, + Accept.NoArguments()); } } \ No newline at end of file diff --git a/src/dotnet/commands/CommandWithRestoreOptions.cs b/src/dotnet/commands/CommandWithRestoreOptions.cs new file mode 100644 index 000000000..aaf9748d5 --- /dev/null +++ b/src/dotnet/commands/CommandWithRestoreOptions.cs @@ -0,0 +1,39 @@ +// 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 System.Collections.Generic; +using System.Linq; +using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.CommandLine; +using Microsoft.DotNet.Tools.MSBuild; +using Microsoft.DotNet.Tools.Restore; + +namespace Microsoft.DotNet.Tools +{ + public static class CreateWithRestoreOptions + { + public static Command Command( + string name, + string help, + ArgumentsRule arguments, + params Option[] options) + { + return Create.Command(name, help, arguments, RestoreCommandParser.AddImplicitRestoreOptions(options)); + } + + public static Command Command( + string name, + string help, + ArgumentsRule arguments, + bool treatUnmatchedTokensAsErrors, + params Option[] options) + { + return Create.Command( + name, + help, + arguments, + treatUnmatchedTokensAsErrors, + RestoreCommandParser.AddImplicitRestoreOptions(options)); + } + } +} \ No newline at end of file diff --git a/src/dotnet/commands/RestoringCommand.cs b/src/dotnet/commands/RestoringCommand.cs new file mode 100644 index 000000000..67c114577 --- /dev/null +++ b/src/dotnet/commands/RestoringCommand.cs @@ -0,0 +1,56 @@ +// 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 System.Collections.Generic; +using System.Linq; +using Microsoft.DotNet.Tools.MSBuild; +using Microsoft.DotNet.Tools.Restore; + +namespace Microsoft.DotNet.Tools +{ + public class RestoringCommand : MSBuildForwardingApp + { + private bool NoRestore { get; } + + private IEnumerable ArgsToForward { get; } + + private IEnumerable ArgsToForwardToRestore() + { + var restoreArguments = ArgsToForward.Where(a => + !a.StartsWith("/t:") && + !a.StartsWith("/target:") && + !a.StartsWith("/ConsoleLoggerParameters:") && + !a.StartsWith("/clp:")); + + if (!restoreArguments.Any(a => a.StartsWith("/v:") || a.StartsWith("/verbosity:"))) + { + restoreArguments = restoreArguments.Concat(new string[] { "/v:q" }); + } + + return restoreArguments; + } + + private bool ShouldRunImplicitRestore => !NoRestore; + + public RestoringCommand(IEnumerable msbuildArgs, bool noRestore, string msbuildPath = null) + : base(msbuildArgs, msbuildPath) + { + NoRestore = noRestore; + ArgsToForward = msbuildArgs; + } + + public override int Execute() + { + if (ShouldRunImplicitRestore) + { + int exitCode = RestoreCommand.Run(ArgsToForwardToRestore().ToArray()); + if (exitCode != 0) + { + return exitCode; + } + } + + return base.Execute(); + } + } +} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/LocalizableStrings.cs b/src/dotnet/commands/dotnet-add/LocalizableStrings.cs deleted file mode 100644 index cca914239..000000000 --- a/src/dotnet/commands/dotnet-add/LocalizableStrings.cs +++ /dev/null @@ -1,10 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.Add -{ - internal class LocalizableStrings - { - public const string NetAddCommand = ".NET Add Command"; - } -} diff --git a/src/dotnet/commands/dotnet-add/LocalizableStrings.resx b/src/dotnet/commands/dotnet-add/LocalizableStrings.resx new file mode 100644 index 000000000..0e0a56115 --- /dev/null +++ b/src/dotnet/commands/dotnet-add/LocalizableStrings.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + .NET Add Command + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/LocalizableStrings.cs b/src/dotnet/commands/dotnet-add/dotnet-add-package/LocalizableStrings.cs deleted file mode 100644 index a4514f2e0..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/LocalizableStrings.cs +++ /dev/null @@ -1,38 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.Add.PackageReference -{ - internal class LocalizableStrings - { - public const string AppFullName = ".NET Add Package reference Command"; - - public const string AppDescription = "Command to add package reference"; - - public const string CmdPackageDescription = "The package reference to add."; - - public const string SpecifyExactlyOnePackageReference = "Please specify one package reference to add."; - - public const string CmdFrameworkDescription = "Adds reference only when targeting a specific framework."; - - public const string CmdNoRestoreDescription = "Adds reference without performing restore preview and compatibility check."; - - public const string CmdSourceDescription = "Specifies NuGet package sources to use during the restore."; - - public const string CmdPackageDirectoryDescription = "Restores the packages to the specified directory."; - - public const string CmdVersionDescription = "Version for the package to be added."; - - public const string CmdDGFileException = "Unable to create dependency graph file for project '{0}'. Cannot add package reference."; - - public const string CmdPackage = "PACKAGE_NAME"; - - public const string CmdVersion = "VERSION"; - - public const string CmdFramework = "FRAMEWORK"; - - public const string CmdSource = "SOURCE"; - - public const string CmdPackageDirectory = "PACKAGE_DIRECTORY"; - } -} diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/LocalizableStrings.resx b/src/dotnet/commands/dotnet-add/dotnet-add-package/LocalizableStrings.resx new file mode 100644 index 000000000..c18e94039 --- /dev/null +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/LocalizableStrings.resx @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + .NET Add Package reference Command + + + Command to add package reference + + + The package reference to add. + + + Please specify one package reference to add. + + + Adds reference only when targeting a specific framework. + + + Adds reference without performing restore preview and compatibility check. + + + Specifies NuGet package sources to use during the restore. + + + Restores the packages to the specified directory. + + + Version for the package to be added. + + + Unable to create dependency graph file for project '{0}'. Cannot add package reference. + + + PACKAGE_NAME + + + VERSION + + + FRAMEWORK + + + SOURCE + + + PACKAGE_DIRECTORY + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/LocalizableStrings.cs b/src/dotnet/commands/dotnet-add/dotnet-add-proj/LocalizableStrings.cs deleted file mode 100644 index a3cc25377..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/LocalizableStrings.cs +++ /dev/null @@ -1,14 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.Add.ProjectToSolution -{ - internal class LocalizableStrings - { - public const string AppFullName = ".NET Add Project to Solution Command"; - - public const string AppDescription = "Command to add project to solution"; - - public const string AppHelpText = "Projects to add to solution"; - } -} diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/LocalizableStrings.resx b/src/dotnet/commands/dotnet-add/dotnet-add-proj/LocalizableStrings.resx new file mode 100644 index 000000000..a5810e897 --- /dev/null +++ b/src/dotnet/commands/dotnet-add/dotnet-add-proj/LocalizableStrings.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + .NET Add Project to Solution Command + + + Command to add project to solution + + + Projects to add to solution + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/LocalizableStrings.cs b/src/dotnet/commands/dotnet-add/dotnet-add-reference/LocalizableStrings.cs deleted file mode 100644 index 0e87d24bd..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/LocalizableStrings.cs +++ /dev/null @@ -1,16 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.Add.ProjectToProjectReference -{ - internal class LocalizableStrings - { - public const string AppFullName = ".NET Add Project to Project reference Command"; - - public const string AppDescription = "Command to add project to project reference"; - - public const string AppHelpText = "Project to project references to add"; - - public const string CmdFrameworkDescription = "Add reference only when targeting a specific framework"; - } -} diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/LocalizableStrings.resx b/src/dotnet/commands/dotnet-add/dotnet-add-reference/LocalizableStrings.resx new file mode 100644 index 000000000..3dc5538e3 --- /dev/null +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/LocalizableStrings.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + .NET Add Project to Project reference Command + + + Command to add project to project reference + + + Project to project references to add + + + Add reference only when targeting a specific framework + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/BuildCommand.cs b/src/dotnet/commands/dotnet-build/BuildCommand.cs index 691d5ef21..95539c662 100644 --- a/src/dotnet/commands/dotnet-build/BuildCommand.cs +++ b/src/dotnet/commands/dotnet-build/BuildCommand.cs @@ -2,18 +2,21 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Collections.Generic; +using System.Linq; using Microsoft.DotNet.Cli.CommandLine; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.MSBuild; +using Microsoft.DotNet.Tools; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Tools.Restore; using Parser = Microsoft.DotNet.Cli.Parser; namespace Microsoft.DotNet.Tools.Build { - public class BuildCommand : MSBuildForwardingApp + public class BuildCommand : RestoringCommand { - public BuildCommand(IEnumerable msbuildArgs, string msbuildPath = null) - : base(msbuildArgs, msbuildPath) + public BuildCommand(IEnumerable msbuildArgs, bool noRestore, string msbuildPath = null) + : base(msbuildArgs, noRestore, msbuildPath) { } @@ -44,7 +47,9 @@ namespace Microsoft.DotNet.Tools.Build msbuildArgs.Add($"/clp:Summary"); - return new BuildCommand(msbuildArgs, msbuildPath); + bool noRestore = appliedBuildOptions.HasOption("--no-restore"); + + return new BuildCommand(msbuildArgs, noRestore, msbuildPath); } public static int Run(string[] args) diff --git a/src/dotnet/commands/dotnet-build/BuildCommandParser.cs b/src/dotnet/commands/dotnet-build/BuildCommandParser.cs index eaa00740f..76da0258e 100644 --- a/src/dotnet/commands/dotnet-build/BuildCommandParser.cs +++ b/src/dotnet/commands/dotnet-build/BuildCommandParser.cs @@ -1,6 +1,7 @@ // 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 System.Collections.Generic; using System.Linq; using Microsoft.DotNet.Cli.CommandLine; using Microsoft.DotNet.Tools; @@ -11,7 +12,7 @@ namespace Microsoft.DotNet.Cli internal static class BuildCommandParser { public static Command Build() => - Create.Command( + CreateWithRestoreOptions.Command( "build", LocalizableStrings.AppFullName, Accept.ZeroOrMoreArguments() @@ -37,6 +38,7 @@ namespace Microsoft.DotNet.Cli LocalizableStrings.NoDependenciesOptionDescription, Accept.NoArguments() .ForwardAs("/p:BuildProjectReferences=false")), + CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption()); } } \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/LocalizableStrings.cs b/src/dotnet/commands/dotnet-build/LocalizableStrings.cs deleted file mode 100644 index 61fe7574c..000000000 --- a/src/dotnet/commands/dotnet-build/LocalizableStrings.cs +++ /dev/null @@ -1,20 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.Build -{ - internal class LocalizableStrings - { - public const string AppDescription = "Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file."; - - public const string AppFullName = ".NET Builder"; - - public const string NoDependenciesOptionDescription = "Set this flag to ignore project-to-project references and only build the root project"; - - public const string NoIncrementialOptionDescription = "Disables incremental build."; - - public const string OutputOptionDescription = "Output directory in which to place built artifacts."; - - public const string OutputOptionName = "OUTPUT_DIR"; - } -} diff --git a/src/dotnet/commands/dotnet-build/LocalizableStrings.resx b/src/dotnet/commands/dotnet-build/LocalizableStrings.resx new file mode 100644 index 000000000..418c52506 --- /dev/null +++ b/src/dotnet/commands/dotnet-build/LocalizableStrings.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file. + + + .NET Builder + + + Set this flag to ignore project-to-project references and only build the root project + + + Disables incremental build. + + + Output directory in which to place built artifacts. + + + OUTPUT_DIR + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/LocalizableStrings.cs b/src/dotnet/commands/dotnet-clean/LocalizableStrings.cs deleted file mode 100644 index 8cd76c8a9..000000000 --- a/src/dotnet/commands/dotnet-clean/LocalizableStrings.cs +++ /dev/null @@ -1,16 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.Clean -{ - internal class LocalizableStrings - { - public const string AppFullName = ".NET Clean Command"; - - public const string AppDescription = "Command to clean previously generated build outputs."; - - public const string CmdOutputDir = "OUTPUT_DIR"; - - public const string CmdOutputDirDescription = "Directory in which the build outputs have been placed."; - } -} diff --git a/src/dotnet/commands/dotnet-clean/LocalizableStrings.resx b/src/dotnet/commands/dotnet-clean/LocalizableStrings.resx new file mode 100644 index 000000000..96c19f35b --- /dev/null +++ b/src/dotnet/commands/dotnet-clean/LocalizableStrings.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + .NET Clean Command + + + Command to clean previously generated build outputs. + + + OUTPUT_DIR + + + Directory in which the build outputs have been placed. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/LocalizableStrings.cs b/src/dotnet/commands/dotnet-help/LocalizableStrings.cs deleted file mode 100644 index 375676f1c..000000000 --- a/src/dotnet/commands/dotnet-help/LocalizableStrings.cs +++ /dev/null @@ -1,102 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.Help -{ - internal class LocalizableStrings - { - public const string Usage = "Usage"; - - public const string Arguments = "Arguments"; - - public const string CommandDefinition = "The command to execute"; - - public const string ArgumentsDefinition = "Arguments to pass to the command"; - - public const string HostOptionsDefinition = "Options specific to dotnet (host)"; - - public const string OptionsDescription = "Options common to all commands"; - - public const string CommonOptions = "Common options"; - - public const string DiagnosticsDefinition = "Enable diagnostic output"; - - public const string HelpDefinition = "Show help."; - - public const string HostOptions = "Host options (passed before the command)"; - - public const string VersionDescription = "Display .NET CLI Version Number"; - - public const string InfoDescription = "Display .NET CLI Info"; - - public const string Commands = "SDK commands"; - - public const string NewDefinition = "Initialize .NET projects."; - - public const string RestoreDefinition = "Restore dependencies specified in the .NET project."; - - public const string BuildDefinition = "Builds a .NET project."; - - public const string PublishDefinition = "Publishes a .NET project for deployment (including the runtime)."; - - public const string RunDefinition = "Compiles and immediately executes a .NET project."; - - public const string TestDefinition = "Runs unit tests using the test runner specified in the project."; - - public const string PackDefinition = "Creates a NuGet package."; - - public const string MigrateDefinition = "Migrates a project.json based project to a msbuild based project."; - - public const string ProjectModificationCommands = "Project modification commands"; - - public const string AddDefinition = "Add reference to the project."; - - public const string RemoveDefinition = "Remove reference from the project."; - - public const string ListDefinition = "List reference in the project."; - - public const string AdvancedCommands = "Advanced Commands"; - - public const string NugetDefinition = "Provides additional NuGet commands."; - - public const string MsBuildDefinition = "Runs Microsoft Build Engine (MSBuild)."; - - public const string VsTestDefinition = "Runs Microsoft Test Execution Command Line Tool."; - - public const string CleanDefinition = "Clean build output(s)."; - - public const string SlnDefinition = "Modify solution (SLN) files."; - - public const string CommandDoesNotExist = "Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help."; - - public const string AppFullName = ".NET CLI help utility"; - - public const string AppDescription = "Utility to get more detailed help about each of the CLI commands."; - - public const string CommandArgumentName = "COMMAND_NAME"; - - public const string CommandArgumentDescription = "CLI command for which to view more detailed help."; - - public const string PathToApplicationDefinition = "The path to an application .dll file to execute."; - - public const string SDKVersionCommandDefinition = "Display .NET Core SDK version."; - - public const string SDKInfoCommandDefinition = "Display .NET Core information."; - - public const string SDKDiagnosticsCommandDefinition = "Enable diagnostic output."; - - public const string RunDotnetCommandHelpForMore = "Run 'dotnet COMMAND --help' for more information on a command."; - - public const string AdditionalprobingpathDefinition = "Path containing probing policy and assemblies to probe for."; - - public const string DepsfilDefinition = "Path to .deps.json file."; - - public const string RuntimeconfigDefinition = "Path to .runtimeconfig.json file."; - - public const string FxVersionDefinition = "Version of the installed Shared Framework to use to run the application."; - - public const string RollForwardOnNoCandidateFxDefinition = "Roll forward on no candidate shared framework is enabled."; - - public const string AdditionalDeps = "Path to additonal deps.json file."; - } -} diff --git a/src/dotnet/commands/dotnet-help/LocalizableStrings.resx b/src/dotnet/commands/dotnet-help/LocalizableStrings.resx new file mode 100644 index 000000000..5552d40c5 --- /dev/null +++ b/src/dotnet/commands/dotnet-help/LocalizableStrings.resx @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Usage + + + Arguments + + + The command to execute + + + Arguments to pass to the command + + + Options specific to dotnet (host) + + + Options common to all commands + + + Common options + + + Enable diagnostic output + + + Show help. + + + Host options (passed before the command) + + + Display .NET CLI Version Number + + + Display .NET CLI Info + + + SDK commands + + + Initialize .NET projects. + + + Restore dependencies specified in the .NET project. + + + Builds a .NET project. + + + Publishes a .NET project for deployment (including the runtime). + + + Compiles and immediately executes a .NET project. + + + Runs unit tests using the test runner specified in the project. + + + Creates a NuGet package. + + + Migrates a project.json based project to a msbuild based project. + + + Project modification commands + + + Add reference to the project. + + + Remove reference from the project. + + + List reference in the project. + + + Advanced Commands + + + Provides additional NuGet commands. + + + Runs Microsoft Build Engine (MSBuild). + + + Runs Microsoft Test Execution Command Line Tool. + + + Clean build output(s). + + + Modify solution (SLN) files. + + + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + + + .NET CLI help utility + + + Utility to get more detailed help about each of the CLI commands. + + + COMMAND_NAME + + + CLI command for which to view more detailed help. + + + The path to an application .dll file to execute. + + + Display .NET Core SDK version. + + + Display .NET Core information. + + + Enable diagnostic output. + + + Run 'dotnet COMMAND --help' for more information on a command. + + + Path containing probing policy and assemblies to probe for. + + + Path to <application>.deps.json file. + + + Path to <application>.runtimeconfig.json file. + + + Version of the installed Shared Framework to use to run the application. + + + Roll forward on no candidate shared framework is enabled. + + + Path to additonal deps.json file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/LocalizableStrings.resx b/src/dotnet/commands/dotnet-list/LocalizableStrings.resx new file mode 100644 index 000000000..41c12481c --- /dev/null +++ b/src/dotnet/commands/dotnet-list/LocalizableStrings.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + .NET List Command + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/LocalizableStrings.cs b/src/dotnet/commands/dotnet-list/dotnet-list-proj/LocalizableStrings.cs deleted file mode 100644 index e18cea956..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/LocalizableStrings.cs +++ /dev/null @@ -1,12 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.List.ProjectsInSolution -{ - internal class LocalizableStrings - { - public const string AppFullName = ".NET Projects in Solution viewer"; - - public const string AppDescription = "Command to list projects in a solution"; - } -} diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/LocalizableStrings.resx b/src/dotnet/commands/dotnet-list/dotnet-list-proj/LocalizableStrings.resx new file mode 100644 index 000000000..a7913dc1d --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-proj/LocalizableStrings.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + .NET Projects in Solution viewer + + + Command to list projects in a solution + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/LocalizableStrings.cs b/src/dotnet/commands/dotnet-list/dotnet-list-reference/LocalizableStrings.cs deleted file mode 100644 index 4bf2d2a83..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/LocalizableStrings.cs +++ /dev/null @@ -1,14 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.List.ProjectToProjectReferences -{ - internal class LocalizableStrings - { - public const string AppFullName = ".NET Core Project-to-Project dependency viewer"; - - public const string AppDescription = "Command to list project to project references"; - - public const string NoReferencesFound = "There are no {0} references in project {1}.\n{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). "; - } -} diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/LocalizableStrings.resx b/src/dotnet/commands/dotnet-list/dotnet-list-reference/LocalizableStrings.resx new file mode 100644 index 000000000..5536ff5ef --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-reference/LocalizableStrings.resx @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + .NET Core Project-to-Project dependency viewer + + + Command to list project to project references + + + There are no {0} references in project {1}. +{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/LocalizableStrings.cs b/src/dotnet/commands/dotnet-migrate/LocalizableStrings.cs deleted file mode 100644 index 08ad32f28..000000000 --- a/src/dotnet/commands/dotnet-migrate/LocalizableStrings.cs +++ /dev/null @@ -1,67 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.Migrate -{ - internal class LocalizableStrings - { - public const string AppFullName = ".NET Migrate Command"; - - public const string AppDescription = "Command used to migrate project.json projects to msbuild"; - - public const string CmdProjectArgument = "PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR"; - public const string CmdProjectArgumentDescription = -@"The path to one of the following: - - a project.json file to migrate. - - a global.json file, it will migrate the folders specified in global.json. - - a solution.sln file, it will migrate the projects referenced in the solution. - - a directory to migrate, it will recursively search for project.json files to migrate. -Defaults to current directory if nothing is specified."; - - public const string CmdTemplateDescription = "Base MSBuild template to use for migrated app. The default is the project included in dotnet new."; - - public const string CmdVersionDescription = "The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new."; - - public const string CmdXprojFileDescription = "The path to the xproj file to use. Required when there is more than one xproj in a project directory."; - - public const string CmdSkipProjectReferencesDescription = "Skip migrating project references. By default, project references are migrated recursively."; - - public const string CmdReportFileDescription = "Output migration report to the given file in addition to the console."; - - public const string CmdReportOutputDescription = "Output migration report file as json rather than user messages."; - - public const string CmdSkipBackupDescription = "Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration."; - - public const string MigrationFailedError = "Migration failed."; - - public const string MigrationAdditionalHelp = "The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help."; - - public const string MigrationReportSummary = "Summary"; - - public const string MigrationReportTotalProjects = "Total Projects: {0}"; - - public const string MigrationReportSucceededProjects = "Succeeded Projects: {0}"; - - public const string MigrationReportFailedProjects = "Failed Projects: {0}"; - - public const string ProjectMigrationSucceeded = "Project {0} migration succeeded ({1})."; - - public const string ProjectMigrationFailed = "Project {0} migration failed ({1})."; - - public const string MigrationFailedToFindProjectInGlobalJson = "Unable to find any projects in global.json."; - - public const string MigrationUnableToFindProjects = "Unable to find any projects in {0}."; - - public const string MigrationProjectJsonNotFound = "No project.json file found in '{0}'."; - - public const string MigrationInvalidProjectArgument = "Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist."; - - public const string MigratonUnableToFindProjectJson = "Unable to find project.json file at {0}."; - - public const string MigrationUnableToFindGlobalJson = "Unable to find global settings file at {0}."; - - public const string MigrationUnableToFindSolutionFile = "Unable to find the solution file at {0}."; - - public const string MigrateFilesBackupLocation = "Files backed up to {0}"; - } -} diff --git a/src/dotnet/commands/dotnet-migrate/LocalizableStrings.resx b/src/dotnet/commands/dotnet-migrate/LocalizableStrings.resx new file mode 100644 index 000000000..b86e0da0d --- /dev/null +++ b/src/dotnet/commands/dotnet-migrate/LocalizableStrings.resx @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + .NET Migrate Command + + + Command used to migrate project.json projects to msbuild + + + PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR + + + The path to one of the following: + - a project.json file to migrate. + - a global.json file, it will migrate the folders specified in global.json. + - a solution.sln file, it will migrate the projects referenced in the solution. + - a directory to migrate, it will recursively search for project.json files to migrate. +Defaults to current directory if nothing is specified. + + + Base MSBuild template to use for migrated app. The default is the project included in dotnet new. + + + The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. + + + The path to the xproj file to use. Required when there is more than one xproj in a project directory. + + + Skip migrating project references. By default, project references are migrated recursively. + + + Output migration report to the given file in addition to the console. + + + Output migration report file as json rather than user messages. + + + Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration. + + + Migration failed. + + + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + + + Summary + + + Total Projects: {0} + + + Succeeded Projects: {0} + + + Failed Projects: {0} + + + Project {0} migration succeeded ({1}). + + + Project {0} migration failed ({1}). + + + Unable to find any projects in global.json. + + + Unable to find any projects in {0}. + + + No project.json file found in '{0}'. + + + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + + + Unable to find project.json file at {0}. + + + Unable to find global settings file at {0}. + + + Unable to find the solution file at {0}. + + + Files backed up to {0} + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/LocalizableStrings.cs b/src/dotnet/commands/dotnet-msbuild/LocalizableStrings.cs deleted file mode 100644 index dae4177ba..000000000 --- a/src/dotnet/commands/dotnet-msbuild/LocalizableStrings.cs +++ /dev/null @@ -1,10 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.MSBuild -{ - internal class LocalizableStrings - { - public const string VerbosityOptionDescription = "Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]"; - } -} diff --git a/src/dotnet/commands/dotnet-msbuild/LocalizableStrings.resx b/src/dotnet/commands/dotnet-msbuild/LocalizableStrings.resx new file mode 100644 index 000000000..e1c8a7c9f --- /dev/null +++ b/src/dotnet/commands/dotnet-msbuild/LocalizableStrings.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs b/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs index b3edf4abe..dbf81dd6e 100644 --- a/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs +++ b/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs @@ -58,7 +58,7 @@ namespace Microsoft.DotNet.Tools.MSBuild return ret; } - public int Execute() + public virtual int Execute() { return GetProcessStartInfo().Execute(); } diff --git a/src/dotnet/commands/dotnet-pack/LocalizableStrings.cs b/src/dotnet/commands/dotnet-pack/LocalizableStrings.cs deleted file mode 100644 index 28d37315d..000000000 --- a/src/dotnet/commands/dotnet-pack/LocalizableStrings.cs +++ /dev/null @@ -1,28 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.Pack -{ - internal class LocalizableStrings - { - public const string AppFullName = ".NET Core NuGet Package Packer"; - - public const string AppDescription = "pack for msbuild"; - - public const string CmdOutputDir = "OUTPUT_DIR"; - - public const string CmdOutputDirDescription = "Directory in which to place built packages."; - - public const string CmdNoBuildOptionDescription = "Skip building the project prior to packing. By default, the project will be built."; - - public const string CmdIncludeSymbolsDescription = "Include packages with symbols in addition to regular packages in output directory."; - - public const string CmdIncludeSourceDescription = "Include PDBs and source files. Source files go into the src folder in the resulting nuget package"; - - public const string CmdServiceableDescription = "Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing."; - - public const string CmdArgumentProject = "PROJECT"; - - public const string CmdArgumentDescription = "The project to pack, defaults to the project file in the current directory. Can be a path to any project file"; - } -} diff --git a/src/dotnet/commands/dotnet-pack/LocalizableStrings.resx b/src/dotnet/commands/dotnet-pack/LocalizableStrings.resx new file mode 100644 index 000000000..d297d15e2 --- /dev/null +++ b/src/dotnet/commands/dotnet-pack/LocalizableStrings.resx @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + .NET Core NuGet Package Packer + + + pack for msbuild + + + OUTPUT_DIR + + + Directory in which to place built packages. + + + Skip building the project prior to packing. By default, the project will be built. + + + Include packages with symbols in addition to regular packages in output directory. + + + Include PDBs and source files. Source files go into the src folder in the resulting nuget package + + + Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. + + + PROJECT + + + The project to pack, defaults to the project file in the current directory. Can be a path to any project file + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/PackCommand.cs b/src/dotnet/commands/dotnet-pack/PackCommand.cs index 2821c23d8..0c7146356 100644 --- a/src/dotnet/commands/dotnet-pack/PackCommand.cs +++ b/src/dotnet/commands/dotnet-pack/PackCommand.cs @@ -5,16 +5,17 @@ using System.Collections.Generic; using Microsoft.DotNet.Cli.CommandLine; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.MSBuild; +using Microsoft.DotNet.Tools; using Microsoft.DotNet.Cli; using System.Diagnostics; using Parser = Microsoft.DotNet.Cli.Parser; namespace Microsoft.DotNet.Tools.Pack { - public class PackCommand : MSBuildForwardingApp + public class PackCommand : RestoringCommand { - public PackCommand(IEnumerable msbuildArgs, string msbuildPath = null) - : base(msbuildArgs, msbuildPath) + public PackCommand(IEnumerable msbuildArgs, bool noRestore, string msbuildPath = null) + : base(msbuildArgs, noRestore, msbuildPath) { } @@ -30,14 +31,16 @@ namespace Microsoft.DotNet.Tools.Pack var msbuildArgs = new List() { - "/t:pack" + "/t:pack" }; msbuildArgs.AddRange(parsedPack.OptionValuesToBeForwarded()); msbuildArgs.AddRange(parsedPack.Arguments); - return new PackCommand(msbuildArgs, msbuildPath); + bool noRestore = parsedPack.HasOption("--no-restore"); + + return new PackCommand(msbuildArgs, noRestore, msbuildPath); } public static int Run(string[] args) diff --git a/src/dotnet/commands/dotnet-pack/PackCommandParser.cs b/src/dotnet/commands/dotnet-pack/PackCommandParser.cs index 56be1ee3d..036e12072 100644 --- a/src/dotnet/commands/dotnet-pack/PackCommandParser.cs +++ b/src/dotnet/commands/dotnet-pack/PackCommandParser.cs @@ -1,8 +1,10 @@ // 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 System.Collections.Generic; using System.Linq; using Microsoft.DotNet.Cli.CommandLine; +using Microsoft.DotNet.Tools; using LocalizableStrings = Microsoft.DotNet.Tools.Pack.LocalizableStrings; namespace Microsoft.DotNet.Cli @@ -10,7 +12,7 @@ namespace Microsoft.DotNet.Cli internal static class PackCommandParser { public static Command Pack() => - Create.Command( + CreateWithRestoreOptions.Command( "pack", LocalizableStrings.AppFullName, Accept.ZeroOrMoreArguments(), @@ -39,6 +41,7 @@ namespace Microsoft.DotNet.Cli "-s|--serviceable", LocalizableStrings.CmdServiceableDescription, Accept.NoArguments().ForwardAs("/p:Serviceable=true")), + CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption()); } } \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/LocalizableStrings.cs b/src/dotnet/commands/dotnet-publish/LocalizableStrings.cs deleted file mode 100644 index a1ebc0a2b..000000000 --- a/src/dotnet/commands/dotnet-publish/LocalizableStrings.cs +++ /dev/null @@ -1,24 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.Publish -{ - internal class LocalizableStrings - { - public const string AppDescription = "Publisher for the .NET Platform"; - - public const string FrameworkOption = "FRAMEWORK"; - - public const string FrameworkOptionDescription = "Target framework to publish for. The target framework has to be specified in the project file."; - - public const string OutputOption = "OUTPUT_DIR"; - - public const string OutputOptionDescription = "Output directory in which to place the published artifacts."; - - public const string ManifestOption = "manifest.xml"; - - public const string ManifestOptionDescription = "The path to a target manifest file that contains the list of packages to be excluded from the publish step."; - - public const string SelfContainedOptionDescription = "Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified."; - } -} diff --git a/src/dotnet/commands/dotnet-publish/LocalizableStrings.resx b/src/dotnet/commands/dotnet-publish/LocalizableStrings.resx new file mode 100644 index 000000000..e11675be8 --- /dev/null +++ b/src/dotnet/commands/dotnet-publish/LocalizableStrings.resx @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Publisher for the .NET Platform + + + FRAMEWORK + + + Target framework to publish for. The target framework has to be specified in the project file. + + + OUTPUT_DIR + + + Output directory in which to place the published artifacts. + + + manifest.xml + + + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/Program.cs b/src/dotnet/commands/dotnet-publish/Program.cs index 8c8fbc9cf..d4337e107 100644 --- a/src/dotnet/commands/dotnet-publish/Program.cs +++ b/src/dotnet/commands/dotnet-publish/Program.cs @@ -5,15 +5,16 @@ using System.Collections.Generic; using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.CommandLine; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.MSBuild; using Parser = Microsoft.DotNet.Cli.Parser; namespace Microsoft.DotNet.Tools.Publish { - public class PublishCommand : MSBuildForwardingApp + public class PublishCommand : RestoringCommand { - private PublishCommand(IEnumerable msbuildArgs, string msbuildPath = null) - : base(msbuildArgs, msbuildPath) + private PublishCommand(IEnumerable msbuildArgs, bool noRestore, string msbuildPath = null) + : base(msbuildArgs, noRestore, msbuildPath) { } @@ -37,7 +38,9 @@ namespace Microsoft.DotNet.Tools.Publish msbuildArgs.AddRange(appliedPublishOption.Arguments); - return new PublishCommand(msbuildArgs, msbuildPath); + bool noRestore = appliedPublishOption.HasOption("--no-restore"); + + return new PublishCommand(msbuildArgs, noRestore, msbuildPath); } public static int Run(string[] args) diff --git a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs index 600d4c459..9149c1dfd 100644 --- a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs +++ b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs @@ -1,8 +1,10 @@ // 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 System.Collections.Generic; using System.Linq; using Microsoft.DotNet.Cli.CommandLine; +using Microsoft.DotNet.Tools; using LocalizableStrings = Microsoft.DotNet.Tools.Publish.LocalizableStrings; namespace Microsoft.DotNet.Cli @@ -10,7 +12,7 @@ namespace Microsoft.DotNet.Cli internal static class PublishCommandParser { public static Command Publish() => - Create.Command( + CreateWithRestoreOptions.Command( "publish", LocalizableStrings.AppDescription, Accept.ZeroOrMoreArguments(), @@ -41,6 +43,7 @@ namespace Microsoft.DotNet.Cli string value = o.Arguments.Any() ? o.Arguments.Single() : "true"; return $"/p:SelfContained={value}"; })), + CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption()); } } \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/LocalizableStrings.cs b/src/dotnet/commands/dotnet-remove/LocalizableStrings.cs deleted file mode 100644 index 5f88aa844..000000000 --- a/src/dotnet/commands/dotnet-remove/LocalizableStrings.cs +++ /dev/null @@ -1,10 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.Remove -{ - internal class LocalizableStrings - { - public const string NetRemoveCommand = ".NET Remove Command"; - } -} diff --git a/src/dotnet/commands/dotnet-remove/LocalizableStrings.resx b/src/dotnet/commands/dotnet-remove/LocalizableStrings.resx new file mode 100644 index 000000000..1f2a8221a --- /dev/null +++ b/src/dotnet/commands/dotnet-remove/LocalizableStrings.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + .NET Remove Command + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/LocalizableStrings.cs b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/LocalizableStrings.cs deleted file mode 100644 index 55186bf11..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/LocalizableStrings.cs +++ /dev/null @@ -1,17 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.Remove.PackageReference -{ - internal class LocalizableStrings - { - public const string AppFullName = ".NET Remove Package reference Command."; - - public const string AppDescription = "Command to remove package reference."; - - public const string AppHelpText = "Package reference to remove."; - - public const string SpecifyExactlyOnePackageReference = "Please specify only one package reference to remove."; - - } -} diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/LocalizableStrings.resx b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/LocalizableStrings.resx new file mode 100644 index 000000000..969e55a2d --- /dev/null +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/LocalizableStrings.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + .NET Remove Package reference Command. + + + Command to remove package reference. + + + Package reference to remove. + + + Please specify only one package reference to remove. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/LocalizableStrings.cs b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/LocalizableStrings.cs deleted file mode 100644 index 50d12b8c0..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/LocalizableStrings.cs +++ /dev/null @@ -1,14 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.Remove.ProjectFromSolution -{ - internal class LocalizableStrings - { - public const string AppFullName = ".NET Remove Project from Solution Command"; - - public const string AppDescription = "Command to remove projects from a solution"; - - public const string AppHelpText = "Projects to remove from a solution"; - } -} diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/LocalizableStrings.resx b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/LocalizableStrings.resx new file mode 100644 index 000000000..8b30c41cf --- /dev/null +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/LocalizableStrings.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + .NET Remove Project from Solution Command + + + Command to remove projects from a solution + + + Projects to remove from a solution + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/LocalizableStrings.cs b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/LocalizableStrings.cs deleted file mode 100644 index de954c2d8..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/LocalizableStrings.cs +++ /dev/null @@ -1,16 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.Remove.ProjectToProjectReference -{ - internal class LocalizableStrings - { - public const string AppFullName = ".NET Remove Project to Project reference Command"; - - public const string AppDescription = "Command to remove project to project reference"; - - public const string AppHelpText = "Project to project references to remove"; - - public const string CmdFrameworkDescription = "Remove reference only when targeting a specific framework"; - } -} diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/LocalizableStrings.resx b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/LocalizableStrings.resx new file mode 100644 index 000000000..7952e0f6b --- /dev/null +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/LocalizableStrings.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + .NET Remove Project to Project reference Command + + + Command to remove project to project reference + + + Project to project references to remove + + + Remove reference only when targeting a specific framework + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/LocalizableStrings.cs b/src/dotnet/commands/dotnet-restore/LocalizableStrings.cs deleted file mode 100644 index e502c8fc8..000000000 --- a/src/dotnet/commands/dotnet-restore/LocalizableStrings.cs +++ /dev/null @@ -1,40 +0,0 @@ -// 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. - -namespace Microsoft.DotNet.Tools.Restore -{ - internal class LocalizableStrings - { - public const string AppFullName = ".NET dependency restorer"; - - public const string AppDescription = "restore for msbuild"; - - public const string CmdArgument = "PROJECT"; - - public const string CmdArgumentDescription = "Optional path to a project file or MSBuild arguments."; - - public const string CmdSourceOption = "SOURCE"; - - public const string CmdSourceOptionDescription = "Specifies a NuGet package source to use during the restore."; - - public const string CmdRuntimeOption = "RUNTIME_IDENTIFIER"; - - public const string CmdRuntimeOptionDescription = "Target runtime to restore packages for."; - - public const string CmdPackagesOption = "PACKAGES_DIRECTORY"; - - public const string CmdPackagesOptionDescription = "Directory to install packages in."; - - public const string CmdDisableParallelOptionDescription = "Disables restoring multiple projects in parallel."; - - public const string CmdConfigFileOption = "FILE"; - - public const string CmdConfigFileOptionDescription = "The NuGet configuration file to use."; - - public const string CmdNoCacheOptionDescription = "Do not cache packages and http requests."; - - public const string CmdIgnoreFailedSourcesOptionDescription = "Treat package source failures as warnings."; - - public const string CmdNoDependenciesOptionDescription = "Set this flag to ignore project to project references and only restore the root project."; - } -} diff --git a/src/dotnet/commands/dotnet-restore/LocalizableStrings.resx b/src/dotnet/commands/dotnet-restore/LocalizableStrings.resx new file mode 100644 index 000000000..877cfa218 --- /dev/null +++ b/src/dotnet/commands/dotnet-restore/LocalizableStrings.resx @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + .NET dependency restorer + + + restore for msbuild + + + PROJECT + + + Optional path to a project file or MSBuild arguments. + + + SOURCE + + + Specifies a NuGet package source to use during the restore. + + + RUNTIME_IDENTIFIER + + + Target runtime to restore packages for. + + + PACKAGES_DIRECTORY + + + Directory to install packages in. + + + Disables restoring multiple projects in parallel. + + + FILE + + + The NuGet configuration file to use. + + + Do not cache packages and http requests. + + + Treat package source failures as warnings. + + + Set this flag to ignore project to project references and only restore the root project. + + + Set this flag to force all dependencies to be resolved even if the last restore was successful. This is equivalent to deleting project.assets.json. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/Program.cs b/src/dotnet/commands/dotnet-restore/Program.cs index 65a18e975..b0269370f 100644 --- a/src/dotnet/commands/dotnet-restore/Program.cs +++ b/src/dotnet/commands/dotnet-restore/Program.cs @@ -37,7 +37,7 @@ namespace Microsoft.DotNet.Tools.Restore "/t:Restore" }; - if (!parsedRestore.HasOption("verbosity")) + if (!HasVerbosityOption(parsedRestore)) { msbuildArgs.Add("/ConsoleLoggerParameters:Verbosity=Minimal"); } @@ -45,7 +45,7 @@ namespace Microsoft.DotNet.Tools.Restore msbuildArgs.AddRange(parsedRestore.OptionValuesToBeForwarded()); msbuildArgs.AddRange(parsedRestore.Arguments); - + return new RestoreCommand(msbuildArgs, msbuildPath); } @@ -65,5 +65,12 @@ namespace Microsoft.DotNet.Tools.Restore return cmd.Execute(); } + + private static bool HasVerbosityOption(AppliedOption parsedRestore) + { + return parsedRestore.HasOption("verbosity") || + parsedRestore.Arguments.Any(a => a.Contains("/v:")) || + parsedRestore.Arguments.Any(a => a.Contains("/verbosity:")); + } } } \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/RestoreCommandParser.cs b/src/dotnet/commands/dotnet-restore/RestoreCommandParser.cs index f42acad6b..46b17d0f3 100644 --- a/src/dotnet/commands/dotnet-restore/RestoreCommandParser.cs +++ b/src/dotnet/commands/dotnet-restore/RestoreCommandParser.cs @@ -1,6 +1,7 @@ // 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 System.Collections.Generic; using System.Linq; using Microsoft.DotNet.Cli.CommandLine; using LocalizableStrings = Microsoft.DotNet.Tools.Restore.LocalizableStrings; @@ -14,15 +15,41 @@ namespace Microsoft.DotNet.Cli "restore", LocalizableStrings.AppFullName, Accept.ZeroOrMoreArguments(), - CommonOptions.HelpOption(), + FullRestoreOptions()); + + private static Option[] FullRestoreOptions() + { + var fullRestoreOptions = AddImplicitRestoreOptions(new Option[] { CommonOptions.HelpOption() }, true, true); + + return fullRestoreOptions.Concat(new Option[] { CommonOptions.VerbosityOption() }).ToArray(); + } + + public static Option[] AddImplicitRestoreOptions( + IEnumerable diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj index 8a97849ce..faac7c346 100644 --- a/src/redist/redist.csproj +++ b/src/redist/redist.csproj @@ -112,9 +112,14 @@ DependsOnTargets="GenerateMSBuildExtensions" AfterTargets="Publish" BeforeTargets="GenerateCliRuntimeConfigurationFiles"> + + + $(PublishDir)/%(MSBuildExtensionsContent.DeploymentSubpath)%(RecursiveDir)%(Filename)%(Extension) + + + DestinationFiles="%(MSBuildExtensionsContent.DestinationPath)" /> $(PublishDir)/runtimes/any/native @@ -148,13 +153,13 @@ - + CLIBuildDll=$(CLIBuildDll); NuGetPackagesDir=$(NuGetPackagesDir); SdkLayoutDirectory=$(SdkOutputDirectory)/Sdks/%(BundledSdk.Identity); - SdkPackageName=%(BundledSdk.Identity); - SdkPackageVersion=%(BundledSdk.Version); + DependencyPackageName=%(BundledSdk.Identity); + DependencyPackageVersion=%(BundledSdk.Version); Stage0Directory=$(Stage0Directory) @@ -197,6 +202,12 @@ + + + + + + @@ -234,6 +245,7 @@ + + + + + $(PublishDir)/vstest.console.runtimeconfig.json + "version": ".*" + "version": "$(CLI_SharedFrameworkVersion)" + + + diff --git a/src/tool_fsharp/tool_fsc.csproj b/src/tool_fsharp/tool_fsc.csproj index ba8924741..d4ab96210 100644 --- a/src/tool_fsharp/tool_fsc.csproj +++ b/src/tool_fsharp/tool_fsc.csproj @@ -12,12 +12,12 @@ - - + + PreserveNewest PreserveNewest @@ -35,25 +35,9 @@ SectionName="%(AssetsToRemoveFromDeps.SectionName)" AssetPath="%(AssetsToRemoveFromDeps.Identity)" /> - diff --git a/test/EndToEnd/GivenNetFrameworkSupportsNetStandard2.cs b/test/EndToEnd/GivenNetFrameworkSupportsNetStandard2.cs new file mode 100644 index 000000000..97398a685 --- /dev/null +++ b/test/EndToEnd/GivenNetFrameworkSupportsNetStandard2.cs @@ -0,0 +1,40 @@ +using FluentAssertions; +using Microsoft.DotNet.TestFramework; +using Microsoft.DotNet.Tools.Test.Utilities; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace EndToEnd +{ + public class GivenNetFrameworkSupportsNetStandard2 : TestBase + { + [WindowsOnlyFact] + public void ANET461ProjectCanReferenceANETStandardProject() + { + var _testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "NETFrameworkReferenceNETStandard20") + .CreateInstance() + .WithSourceFiles(); + + string projectDirectory = Path.Combine(_testInstance.Root.FullName, "TestApp"); + + new RestoreCommand() + .WithWorkingDirectory(projectDirectory) + .Execute() + .Should().Pass(); + + new BuildCommand() + .WithWorkingDirectory(projectDirectory) + .Execute() + .Should().Pass(); + + new RunCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput() + .Should().Pass() + .And.HaveStdOutContaining("This string came from the test library!"); + + } + } +} diff --git a/test/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs b/test/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs index 53b01648f..29049f238 100644 --- a/test/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs +++ b/test/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs @@ -38,6 +38,35 @@ namespace Microsoft.DotNet.Cli.Build.Tests .And.HaveStdOutContaining("Hello World"); } + [Fact] + public void ItImplicitlyRestoresAProjectWhenBuilding() + { + var testAppName = "MSBuildTestApp"; + var testInstance = TestAssets.Get(testAppName) + .CreateInstance(testAppName) + .WithSourceFiles(); + + new BuildCommand() + .WithWorkingDirectory(testInstance.Root) + .Execute() + .Should().Pass(); + } + + [Fact] + public void ItDoesNotImplicitlyRestoreAProjectWhenBuildingWithTheNoRestoreOption() + { + var testAppName = "MSBuildTestApp"; + var testInstance = TestAssets.Get(testAppName) + .CreateInstance(testAppName) + .WithSourceFiles(); + + new BuildCommand() + .WithWorkingDirectory(testInstance.Root) + .ExecuteWithCapturedOutput("--no-restore") + .Should().Fail() + .And.HaveStdOutContaining("project.assets.json' not found.");; + } + [Fact] public void ItRunsWhenRestoringToSpecificPackageDir() { @@ -62,7 +91,7 @@ namespace Microsoft.DotNet.Cli.Build.Tests new BuildCommand() .WithWorkingDirectory(rootPath) - .Execute() + .Execute("--no-restore") .Should().Pass(); var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; diff --git a/test/dotnet-migrate.Tests/NuGet.tempaspnetpatch.config b/test/dotnet-migrate.Tests/NuGet.tempaspnetpatch.config index f38551286..33b9693d5 100644 --- a/test/dotnet-migrate.Tests/NuGet.tempaspnetpatch.config +++ b/test/dotnet-migrate.Tests/NuGet.tempaspnetpatch.config @@ -6,6 +6,6 @@ - + \ No newline at end of file diff --git a/test/dotnet-msbuild.Tests/GivenDotnetMSBuildBuildsProjects.cs b/test/dotnet-msbuild.Tests/GivenDotnetMSBuildBuildsProjects.cs index 51e7017b1..4c5cf322e 100644 --- a/test/dotnet-msbuild.Tests/GivenDotnetMSBuildBuildsProjects.cs +++ b/test/dotnet-msbuild.Tests/GivenDotnetMSBuildBuildsProjects.cs @@ -105,11 +105,7 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests result.Should().Fail(); - result.StdOut.Should() - .ContainVisuallySameFragment( -@"Feeds used: - /usr/local/bin - https://api.nuget.org/v3/index.json"); + result.StdOut.Should().ContainVisuallySameFragment(@"source(s): /usr/local/bin, nuget.org"); } [Fact] diff --git a/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs b/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs index ce6d8aff0..5e12f441c 100644 --- a/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs +++ b/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs @@ -16,31 +16,27 @@ namespace Microsoft.DotNet.New.Tests public class GivenThatIWantANewAppWithSpecifiedType : TestBase { [Theory] - [InlineData("C#", "console", false)] - [InlineData("C#", "classlib", false)] - [InlineData("C#", "mstest", false)] - [InlineData("C#", "xunit", false)] - [InlineData("C#", "web", false)] - [InlineData("C#", "mvc", false)] - [InlineData("C#", "webapi", false)] - // Uncomment the test below once https://github.com/dotnet/netcorecli-fsc/issues/92 is fixed. - //[InlineData("F#", "console", false)] - //[InlineData("F#", "classlib", false)] - //[InlineData("F#", "mstest", false)] - //[InlineData("F#", "xunit", false)] - //[InlineData("F#", "mvc", true)] + [InlineData("C#", "console", false, false)] + [InlineData("C#", "classlib", false, false)] + [InlineData("C#", "mstest", false, false)] + [InlineData("C#", "xunit", false, false)] + [InlineData("C#", "web", false, false)] + [InlineData("C#", "mvc", false, false)] + [InlineData("C#", "webapi", false, false)] + [InlineData("C#", "angular", false, true)] + [InlineData("C#", "react", false, true)] + [InlineData("C#", "reactredux", false, true)] + [InlineData("F#", "console", false, false)] + [InlineData("F#", "classlib", false, false)] + [InlineData("F#", "mstest", false, false)] + [InlineData("F#", "xunit", false, false)] + [InlineData("F#", "mvc", true, false)] public void TemplateRestoresAndBuildsWithoutWarnings( string language, string projectType, - bool useNuGetConfigForAspNet) + bool useNuGetConfigForAspNet, + bool skipSpaWebpackSteps) { - if (language == "F#" && !EnvironmentInfo.HasSharedFramework("netcoreapp1.0")) - { - // F# requires netcoreapp1.0 to be present in order to build - // https://github.com/dotnet/netcorecli-fsc/issues/76 - return; - } - string rootPath = TestAssets.CreateTestDirectory(identifier: $"{language}_{projectType}").FullName; new TestCommand("dotnet") { WorkingDirectory = rootPath } @@ -53,6 +49,13 @@ namespace Microsoft.DotNet.New.Tests File.Copy(configFile.FullName, Path.Combine(rootPath, "NuGet.Config")); } + if (skipSpaWebpackSteps) + { + // Not all CI machines have Node installed, so the build would fail if we tried + // to run Webpack. Bypass this by making it appear that Webpack already ran. + Directory.CreateDirectory(Path.Combine(rootPath, "wwwroot", "dist")); + } + new TestCommand("dotnet") .WithWorkingDirectory(rootPath) .Execute($"restore") diff --git a/test/dotnet-new.Tests/NuGet.tempaspnetpatch.config b/test/dotnet-new.Tests/NuGet.tempaspnetpatch.config index f38551286..33b9693d5 100644 --- a/test/dotnet-new.Tests/NuGet.tempaspnetpatch.config +++ b/test/dotnet-new.Tests/NuGet.tempaspnetpatch.config @@ -6,6 +6,6 @@ - + \ No newline at end of file diff --git a/test/dotnet-pack.Tests/PackTests.cs b/test/dotnet-pack.Tests/PackTests.cs index fb4bb42c5..cceb09ec1 100644 --- a/test/dotnet-pack.Tests/PackTests.cs +++ b/test/dotnet-pack.Tests/PackTests.cs @@ -157,10 +157,12 @@ namespace Microsoft.DotNet.Tools.Pack.Tests .And.Contain(e => e.FullName == "lib/netstandard1.5/MyLibrary.pdb"); } - [Fact] - public void PackWorksWithLocalProjectJson() + [Theory] + [InlineData("C#", "TestAppSimple")] + [InlineData("F#", "FSharpTestAppSimple")] + public void PackWorksWithLocalProject(string language, string projectName) { - var testInstance = TestAssets.Get("TestAppSimple") + var testInstance = TestAssets.Get(projectName) .CreateInstance() .WithSourceFiles() .WithRestoreFiles(); @@ -171,6 +173,33 @@ namespace Microsoft.DotNet.Tools.Pack.Tests .Should().Pass(); } + [Fact] + public void ItImplicitlyRestoresAProjectWhenPackaging() + { + var testInstance = TestAssets.Get("TestAppSimple") + .CreateInstance() + .WithSourceFiles(); + + new PackCommand() + .WithWorkingDirectory(testInstance.Root) + .Execute() + .Should().Pass(); + } + + [Fact] + public void ItDoesNotImplicitlyRestoreAProjectWhenPackagingWithTheNoRestoreOption() + { + var testInstance = TestAssets.Get("TestAppSimple") + .CreateInstance() + .WithSourceFiles(); + + new PackCommand() + .WithWorkingDirectory(testInstance.Root) + .ExecuteWithCapturedOutput("--no-restore") + .Should().Fail() + .And.HaveStdOutContaining("project.assets.json' not found.");; + } + [Fact] public void HasServiceableFlagWhenArgumentPassed() { @@ -231,7 +260,7 @@ namespace Microsoft.DotNet.Tools.Pack.Tests new PackCommand() .WithWorkingDirectory(rootPath) - .ExecuteWithCapturedOutput() + .ExecuteWithCapturedOutput("--no-restore") .Should() .Pass(); diff --git a/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs b/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs index f28ded611..80985a5a4 100644 --- a/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs +++ b/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs @@ -44,6 +44,39 @@ namespace Microsoft.DotNet.Cli.Publish.Tests .And.HaveStdOutContaining("Hello World"); } + [Fact] + public void ItImplicitlyRestoresAProjectWhenPublishing() + { + var testAppName = "MSBuildTestApp"; + var testInstance = TestAssets.Get(testAppName) + .CreateInstance() + .WithSourceFiles(); + + var testProjectDirectory = testInstance.Root.FullName; + + new PublishCommand() + .WithWorkingDirectory(testProjectDirectory) + .Execute("--framework netcoreapp2.0") + .Should().Pass(); + } + + [Fact] + public void ItDoesNotImplicitlyRestoreAProjectWhenPublishingWithTheNoRestoreOption() + { + var testAppName = "MSBuildTestApp"; + var testInstance = TestAssets.Get(testAppName) + .CreateInstance() + .WithSourceFiles(); + + var testProjectDirectory = testInstance.Root.FullName; + + new PublishCommand() + .WithWorkingDirectory(testProjectDirectory) + .ExecuteWithCapturedOutput("--framework netcoreapp2.0 --no-restore") + .Should().Fail() + .And.HaveStdOutContaining("project.assets.json' not found.");; + } + [Fact] public void ItPublishesARunnableSelfContainedApp() { @@ -170,7 +203,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests new PublishCommand() .WithWorkingDirectory(rootPath) - .ExecuteWithCapturedOutput() + .ExecuteWithCapturedOutput("--no-restore") .Should().Pass(); var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; diff --git a/test/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs b/test/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs index 234f890e9..21d1dee1a 100644 --- a/test/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs +++ b/test/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs @@ -37,6 +37,40 @@ namespace Microsoft.DotNet.Cli.Run.Tests .And.HaveStdOutContaining("Hello World!"); } + [Fact] + public void ItImplicitlyRestoresAProjectWhenRunning() + { + var testAppName = "MSBuildTestApp"; + var testInstance = TestAssets.Get(testAppName) + .CreateInstance() + .WithSourceFiles(); + + var testProjectDirectory = testInstance.Root.FullName; + + new RunCommand() + .WithWorkingDirectory(testProjectDirectory) + .ExecuteWithCapturedOutput() + .Should().Pass() + .And.HaveStdOutContaining("Hello World!"); + } + + [Fact] + public void ItDoesNotImplicitlyRestoreAProjectWhenRunningWithTheNoRestoreOption() + { + var testAppName = "MSBuildTestApp"; + var testInstance = TestAssets.Get(testAppName) + .CreateInstance() + .WithSourceFiles(); + + var testProjectDirectory = testInstance.Root.FullName; + + new RunCommand() + .WithWorkingDirectory(testProjectDirectory) + .ExecuteWithCapturedOutput("--no-restore") + .Should().Fail() + .And.HaveStdOutContaining("project.assets.json' not found.");; + } + [Fact] public void ItBuildsTheProjectBeforeRunning() { @@ -160,7 +194,7 @@ namespace Microsoft.DotNet.Cli.Run.Tests new RunCommand() .WithWorkingDirectory(rootPath) - .ExecuteWithCapturedOutput() + .ExecuteWithCapturedOutput("--no-restore") .Should().Pass() .And.HaveStdOutContaining("Hello World"); } diff --git a/test/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs b/test/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs index f9cb595d5..79d19c5e7 100644 --- a/test/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs +++ b/test/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs @@ -102,7 +102,10 @@ namespace Microsoft.DotNet.Cli.Publish.Tests new DotnetCommand() .ExecuteWithCapturedOutput(outputDll) .Should().Fail() - .And.HaveStdErrContaining($"Error: assembly specified in the dependencies manifest was not found probably due to missing runtime store associated with {targetManifestFileName} -- package: 'NuGet.Configuration',"); + .And.HaveStdErrContaining($"Error:{Environment.NewLine}" + + $" An assembly specified in the application dependencies manifest (NuGetConfigDependentProject.deps.json) was not found:{Environment.NewLine}" + + $" package: 'NuGet.Configuration', version: '4.3.0-beta1-2418'{Environment.NewLine}" + + " path: 'lib/netstandard1.3/NuGet.Configuration.dll'"); } [Fact] diff --git a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs index b20fb70ef..1512b9778 100644 --- a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs +++ b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs @@ -31,6 +31,43 @@ namespace Microsoft.DotNet.Cli.Test.Tests result.ExitCode.Should().Be(1); } + [Fact] + public void ItImplicitlyRestoresAProjectWhenTesting() + { + string testAppName = "VSTestCore"; + var testInstance = TestAssets.Get(testAppName) + .CreateInstance() + .WithSourceFiles(); + + var testProjectDirectory = testInstance.Root.FullName; + + CommandResult result = new DotnetTestCommand() + .WithWorkingDirectory(testProjectDirectory) + .ExecuteWithCapturedOutput(TestBase.ConsoleLoggerOutputNormal); + + result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0."); + result.StdOut.Should().Contain("Passed TestNamespace.VSTestTests.VSTestPassTest"); + result.StdOut.Should().Contain("Failed TestNamespace.VSTestTests.VSTestFailTest"); + result.ExitCode.Should().Be(1); + } + + [Fact] + public void ItDoesNotImplicitlyRestoreAProjectWhenTestingWithTheNoRestoreOption() + { + string testAppName = "VSTestCore"; + var testInstance = TestAssets.Get(testAppName) + .CreateInstance() + .WithSourceFiles(); + + var testProjectDirectory = testInstance.Root.FullName; + + new DotnetTestCommand() + .WithWorkingDirectory(testProjectDirectory) + .ExecuteWithCapturedOutput($"{TestBase.ConsoleLoggerOutputNormal} --no-restore") + .Should().Fail() + .And.HaveStdOutContaining("project.assets.json' not found.");; + } + [Fact] public void XunitSingleTFM() { @@ -161,14 +198,14 @@ namespace Microsoft.DotNet.Cli.Test.Tests new BuildCommand() .WithWorkingDirectory(rootPath) - .ExecuteWithCapturedOutput() + .ExecuteWithCapturedOutput("--no-restore") .Should() .Pass() .And.NotHaveStdErr(); CommandResult result = new DotnetTestCommand() .WithWorkingDirectory(rootPath) - .ExecuteWithCapturedOutput(TestBase.ConsoleLoggerOutputNormal); + .ExecuteWithCapturedOutput($"{TestBase.ConsoleLoggerOutputNormal} --no-restore"); result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0."); result.StdOut.Should().Contain("Passed TestNamespace.VSTestTests.VSTestPassTest"); @@ -209,6 +246,7 @@ namespace Microsoft.DotNet.Cli.Test.Tests .Execute() .Should() .Pass(); + return testProjectDirectory; } }