diff --git a/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.csproj b/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.csproj index c1ec38777..d82622599 100644 --- a/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.csproj +++ b/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.csproj @@ -1,18 +1,16 @@  + + - netcoreapp1.1 + $(CliTargetFramework) + $(CLI_SharedFrameworkVersion) dotnet-hello Exe win7-x64;win7-x86;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64 - - 1.1.0 - + - - $(DefineConstants);RELEASE - diff --git a/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.csproj b/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.csproj index 510f6a431..8c11115c9 100644 --- a/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.csproj +++ b/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.csproj @@ -1,19 +1,17 @@  + + 2.0.0 - netcoreapp1.1 + $(CliTargetFramework) + $(CLI_SharedFrameworkVersion) dotnet-hello Exe win7-x64;win7-x86;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64 - - 1.1.0 - + - - $(DefineConstants);RELEASE - diff --git a/TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj b/TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj index 5c2bcc31d..837602aad 100644 --- a/TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj +++ b/TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj @@ -15,13 +15,10 @@ - + - 1.1.0 + 1.0.0 - - $(DefineConstants);RELEASE - diff --git a/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj b/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj index 9c9243987..7935c117c 100755 --- a/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj +++ b/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj @@ -1,13 +1,10 @@  - netcoreapp1.1 + netcoreapp2.0 Exe - - 1.1.0 - 1.0.0 @@ -17,7 +14,4 @@ 1.0.0 - - $(DefineConstants);RELEASE - \ No newline at end of file diff --git a/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj b/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj index 1f2bc2278..e7faa8005 100755 --- a/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj +++ b/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj @@ -1,22 +1,16 @@  1.0.0 - netcoreapp1.1 + netcoreapp2.0 AppWithDirectDep Exe false + - - 1.1.0 - 1.0.0 - - $(DefineConstants);RELEASE;TRACE - true - \ No newline at end of file diff --git a/build/compile/Microsoft.DotNet.Cli.LzmaArchive.targets b/build/compile/Microsoft.DotNet.Cli.LzmaArchive.targets index cde2d7385..276c39d70 100644 --- a/build/compile/Microsoft.DotNet.Cli.LzmaArchive.targets +++ b/build/compile/Microsoft.DotNet.Cli.LzmaArchive.targets @@ -81,7 +81,7 @@ - diff --git a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj index e1ed4996a..5ad281a48 100644 --- a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj +++ b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj @@ -3,10 +3,10 @@ Build scripts for dotnet-cli 1.0.0 - netcoreapp1.1 + netcoreapp1.0 true bin\$(Configuration) - $(PackageTargetFallback);portable-net45+win8+wp8+wpa81 + $(PackageTargetFallback);portable-net45+win8+wp8+wpa81 @@ -17,7 +17,7 @@ 1.6.0 - 1.1.0 + 1.0.4 $(CLI_MSBuild_Version) diff --git a/src/Microsoft.DotNet.Cli.Utils/Properties/AssemblyInfo.cs b/src/Microsoft.DotNet.Cli.Utils/Properties/AssemblyInfo.cs index e5ed6ddf4..f2b870535 100644 --- a/src/Microsoft.DotNet.Cli.Utils/Properties/AssemblyInfo.cs +++ b/src/Microsoft.DotNet.Cli.Utils/Properties/AssemblyInfo.cs @@ -5,5 +5,6 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("dotnet, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.DotNet.Tools.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.DotNet.Cli.Utils.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("Microsoft.DotNet.TestFramework, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.DotNet.Tools.Tests.Utilities, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.DotNet.ProjectJsonMigration, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs b/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs index 3fc98f0a4..0f7101b94 100644 --- a/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs +++ b/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs @@ -9,6 +9,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; +using System.Xml.Linq; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.Common; @@ -113,6 +114,48 @@ namespace Microsoft.DotNet.TestFramework return this; } + public TestAssetInstance WithProjectChanges(Action xmlAction) + { + return WithProjectChanges((path, project) => xmlAction(project)); + } + + public TestAssetInstance WithProjectChanges(Action xmlAction) + { + var projectFileInfos = Root.GetFiles("*.*proj", SearchOption.AllDirectories); + + foreach (var projectFileInfo in projectFileInfos) + { + var projectFile = projectFileInfo.FullName; + var project = XDocument.Load(projectFile); + + xmlAction(projectFile, project); + + using (var file = File.CreateText(projectFile)) + { + project.Save(file); + } + } + + return this; + } + + public TestAssetInstance UseCurrentRuntimeFrameworkVersion() + { + return WithProjectChanges(project => + { + var ns = project.Root.Name.Namespace; + + var propertyGroup = project.Root.Elements(ns + "PropertyGroup").LastOrDefault(); + if (propertyGroup == null) + { + propertyGroup = new XElement(ns + "PropertyGroup"); + project.Root.Add(propertyGroup); + } + + propertyGroup.Add(new XElement(ns + "RuntimeFrameworkVersion", new Muxer().SharedFxVersion)); + }); + } + private void CopyFiles(IEnumerable filesToCopy) { foreach (var file in filesToCopy) @@ -127,7 +170,6 @@ namespace Microsoft.DotNet.TestFramework file.CopyTo(newPath); } - } } } diff --git a/src/dotnet-archive/dotnet-archive.csproj b/src/dotnet-archive/dotnet-archive.csproj index 3bf1aba42..baf11b332 100644 --- a/src/dotnet-archive/dotnet-archive.csproj +++ b/src/dotnet-archive/dotnet-archive.csproj @@ -2,7 +2,7 @@ - netcoreapp1.1 + $(CliTargetFramework) Exe @@ -12,11 +12,6 @@ - - 1.1.0 - + - - $(DefineConstants);RELEASE - \ No newline at end of file diff --git a/src/tool_msbuild/tool_msbuild.csproj b/src/tool_msbuild/tool_msbuild.csproj index 006bbeec2..af6b13ecb 100644 --- a/src/tool_msbuild/tool_msbuild.csproj +++ b/src/tool_msbuild/tool_msbuild.csproj @@ -3,14 +3,10 @@ $(CliVersionPrefix) - netcoreapp1.1 + $(CliTargetFramework) - - 1.1.0 - - - $(CLI_MSBuild_Version) - + + \ No newline at end of file diff --git a/src/tool_nuget/tool_nuget.csproj b/src/tool_nuget/tool_nuget.csproj index 163953ae9..3f7a61c1e 100644 --- a/src/tool_nuget/tool_nuget.csproj +++ b/src/tool_nuget/tool_nuget.csproj @@ -3,17 +3,10 @@ $(CliVersionPrefix) - netcoreapp1.1 + $(CliTargetFramework) - - 1.1.0 - - - $(CLI_NuGet_Version) - + + - - $(DefineConstants);RELEASE - \ No newline at end of file diff --git a/test/dotnet.Tests/PackagedCommandTests.cs b/test/dotnet.Tests/PackagedCommandTests.cs index d1f8b0c93..e4a0a3cc1 100644 --- a/test/dotnet.Tests/PackagedCommandTests.cs +++ b/test/dotnet.Tests/PackagedCommandTests.cs @@ -59,15 +59,26 @@ namespace Microsoft.DotNet.Tests } [Theory] - [InlineData("AppWithDirectAndToolDep")] - [InlineData("AppWithToolDependency")] - public void TestProjectToolIsAvailableThroughDriver(string appName) + [InlineData("AppWithDirectAndToolDep", true)] + [InlineData("AppWithToolDependency", false)] + public void TestProjectToolIsAvailableThroughDriver(string appName, bool useCurrentFrameworkRuntimeVersion) { var testInstance = TestAssets.Get(appName) .CreateInstance() .WithSourceFiles() .WithRestoreFiles(); + if (useCurrentFrameworkRuntimeVersion) + { + testInstance = testInstance.UseCurrentRuntimeFrameworkVersion(); + + // restore again now that the project has changed + new RestoreCommand() + .WithWorkingDirectory(testInstance.Root) + .Execute() + .Should().Pass(); + } + new BuildCommand() .WithProjectDirectory(testInstance.Root) .Execute() @@ -263,7 +274,14 @@ namespace Microsoft.DotNet.Tests var testInstance = TestAssets.Get("AppWithDirectDep") .CreateInstance() .WithSourceFiles() - .WithRestoreFiles(); + .WithRestoreFiles() + .UseCurrentRuntimeFrameworkVersion(); + + // restore again now that the project has changed + new RestoreCommand() + .WithWorkingDirectory(testInstance.Root) + .Execute() + .Should().Pass(); new BuildCommand() .WithWorkingDirectory(testInstance.Root) diff --git a/tools/Archiver/Archiver.csproj b/tools/Archiver/Archiver.csproj index d4ece9545..c69dce6e4 100644 --- a/tools/Archiver/Archiver.csproj +++ b/tools/Archiver/Archiver.csproj @@ -12,6 +12,7 @@ +