Merge branch 'release/2.0.0' into loc
This commit is contained in:
commit
31c5294ef5
48 changed files with 693 additions and 166 deletions
|
@ -1,6 +1,6 @@
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 15
|
# Visual Studio 15
|
||||||
VisualStudioVersion = 15.0.26419.0
|
VisualStudioVersion = 15.0.26510.0
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ED2FE3E2-F7E7-4389-8231-B65123F2076F}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ED2FE3E2-F7E7-4389-8231-B65123F2076F}"
|
||||||
EndProject
|
EndProject
|
||||||
|
@ -30,7 +30,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4
|
||||||
build\BuildDefaults.props = build\BuildDefaults.props
|
build\BuildDefaults.props = build\BuildDefaults.props
|
||||||
build\BuildInfo.targets = build\BuildInfo.targets
|
build\BuildInfo.targets = build\BuildInfo.targets
|
||||||
build\BundledRuntimes.props = build\BundledRuntimes.props
|
build\BundledRuntimes.props = build\BundledRuntimes.props
|
||||||
build\BundledSdks.proj = build\BundledSdks.proj
|
|
||||||
build\BundledSdks.props = build\BundledSdks.props
|
build\BundledSdks.props = build\BundledSdks.props
|
||||||
build\BundledTemplates.proj = build\BundledTemplates.proj
|
build\BundledTemplates.proj = build\BundledTemplates.proj
|
||||||
build\BundledTemplates.props = build\BundledTemplates.props
|
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\InstallerInfo.props = build\InstallerInfo.props
|
||||||
build\Microsoft.DotNet.Cli.tasks = build\Microsoft.DotNet.Cli.tasks
|
build\Microsoft.DotNet.Cli.tasks = build\Microsoft.DotNet.Cli.tasks
|
||||||
build\MSBuildExtensions.props = build\MSBuildExtensions.props
|
build\MSBuildExtensions.props = build\MSBuildExtensions.props
|
||||||
|
build\MSBuildExtensions.targets = build\MSBuildExtensions.targets
|
||||||
build\OutputDirectories.props = build\OutputDirectories.props
|
build\OutputDirectories.props = build\OutputDirectories.props
|
||||||
build\Package.targets = build\Package.targets
|
build\Package.targets = build\Package.targets
|
||||||
build\Prepare.targets = build\Prepare.targets
|
build\Prepare.targets = build\Prepare.targets
|
||||||
build\Publish.targets = build\Publish.targets
|
build\Publish.targets = build\Publish.targets
|
||||||
|
build\RestoreDependency.proj = build\RestoreDependency.proj
|
||||||
build\sdks\sdks.csproj = build\sdks\sdks.csproj
|
build\sdks\sdks.csproj = build\sdks\sdks.csproj
|
||||||
build\Signing.proj = build\Signing.proj
|
build\Signing.proj = build\Signing.proj
|
||||||
build\Stage0.props = build\Stage0.props
|
build\Stage0.props = build\Stage0.props
|
||||||
|
|
|
@ -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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net461</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\TestLibrary\TestLibrary.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
|
@ -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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the message from the helper. This comment is here to help test XML documentation file generation, please do not remove it.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A message</returns>
|
||||||
|
public static string GetMessage()
|
||||||
|
{
|
||||||
|
return "This string came from the test library!";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SayHi()
|
||||||
|
{
|
||||||
|
Console.WriteLine("Hello there!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
|
@ -20,7 +20,7 @@
|
||||||
DependsOnTargets="MSBuildWorkaroundTarget;
|
DependsOnTargets="MSBuildWorkaroundTarget;
|
||||||
RestoreDotnetCliBuildFramework">
|
RestoreDotnetCliBuildFramework">
|
||||||
|
|
||||||
<Exec Command="$(DotnetStage0) publish -o $(DotnetCliBuildDirectory)/bin --framework netcoreapp2.0 /p:GeneratePropsFile=$(GeneratePropsFile)"
|
<Exec Command="$(DotnetStage0) publish --no-restore -o $(DotnetCliBuildDirectory)/bin --framework netcoreapp2.0 /p:GeneratePropsFile=$(GeneratePropsFile)"
|
||||||
WorkingDirectory="$(DotnetCliBuildDirectory)"/>
|
WorkingDirectory="$(DotnetCliBuildDirectory)"/>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
|
|
@ -5,16 +5,16 @@
|
||||||
<BackwardsCompatibility110SharedHostVersion>1.1.0</BackwardsCompatibility110SharedHostVersion>
|
<BackwardsCompatibility110SharedHostVersion>1.1.0</BackwardsCompatibility110SharedHostVersion>
|
||||||
<BackwardsCompatibility110HostFxrVersion>1.1.0</BackwardsCompatibility110HostFxrVersion>
|
<BackwardsCompatibility110HostFxrVersion>1.1.0</BackwardsCompatibility110HostFxrVersion>
|
||||||
|
|
||||||
<BackwardsCompatibility110DownloadedSharedHostInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-host-$(ProductMonikerRid).$(BackwardsCompatibility110SharedHostVersion)$(InstallerExtension)</BackwardsCompatibility110DownloadedSharedHostInstallerFileName>
|
<BackwardsCompatibility110DownloadedSharedHostInstallerFileName Condition=" '$(OSName)' != 'linux' ">dotnet-host-$(HostMonikerRid).$(BackwardsCompatibility110SharedHostVersion)$(InstallerExtension)</BackwardsCompatibility110DownloadedSharedHostInstallerFileName>
|
||||||
<BackwardsCompatibility110DownloadedSharedHostInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(BackwardsCompatibility110DownloadedSharedHostInstallerFileName)</BackwardsCompatibility110DownloadedSharedHostInstallerFile>
|
<BackwardsCompatibility110DownloadedSharedHostInstallerFile Condition=" '$(OSName)' != 'linux' ">$(PackagesDirectory)/$(BackwardsCompatibility110DownloadedSharedHostInstallerFileName)</BackwardsCompatibility110DownloadedSharedHostInstallerFile>
|
||||||
|
|
||||||
<BackwardsCompatibility110DownloadedHostFxrInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-hostfxr-$(ProductMonikerRid).$(BackwardsCompatibility110HostFxrVersion)$(InstallerExtension)</BackwardsCompatibility110DownloadedHostFxrInstallerFileName>
|
<BackwardsCompatibility110DownloadedHostFxrInstallerFileName Condition=" '$(OSName)' != 'linux' ">dotnet-hostfxr-$(HostMonikerRid).$(BackwardsCompatibility110HostFxrVersion)$(InstallerExtension)</BackwardsCompatibility110DownloadedHostFxrInstallerFileName>
|
||||||
<BackwardsCompatibility110DownloadedHostFxrInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(BackwardsCompatibility110DownloadedHostFxrInstallerFileName)</BackwardsCompatibility110DownloadedHostFxrInstallerFile>
|
<BackwardsCompatibility110DownloadedHostFxrInstallerFile Condition=" '$(OSName)' != 'linux' ">$(PackagesDirectory)/$(BackwardsCompatibility110DownloadedHostFxrInstallerFileName)</BackwardsCompatibility110DownloadedHostFxrInstallerFile>
|
||||||
|
|
||||||
<BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-sharedframework-$(ProductMonikerRid).$(BackwardsCompatibility110SharedFrameworkVersion)$(InstallerExtension)</BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName>
|
<BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName Condition=" '$(OSName)' != 'linux' ">dotnet-sharedframework-$(HostMonikerRid).$(BackwardsCompatibility110SharedFrameworkVersion)$(InstallerExtension)</BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName>
|
||||||
<BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName)</BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile>
|
<BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile Condition=" '$(OSName)' != 'linux' ">$(PackagesDirectory)/$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName)</BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile>
|
||||||
|
|
||||||
<BackwardsCompatibility110CombinedFrameworkHostCompressedFileName>dotnet-$(ProductMonikerRid).$(BackwardsCompatibility110SharedFrameworkVersion)$(ArchiveExtension)</BackwardsCompatibility110CombinedFrameworkHostCompressedFileName>
|
<BackwardsCompatibility110CombinedFrameworkHostCompressedFileName>dotnet-$(HostMonikerRid).$(BackwardsCompatibility110SharedFrameworkVersion)$(ArchiveExtension)</BackwardsCompatibility110CombinedFrameworkHostCompressedFileName>
|
||||||
|
|
||||||
<BackwardsCompatibility110CoreSetupBlobRootUrlWithChannel>$(CoreSetupBlobRootUrl)$(BackwardsCompatibility110CoreSetupChannel)</BackwardsCompatibility110CoreSetupBlobRootUrlWithChannel>
|
<BackwardsCompatibility110CoreSetupBlobRootUrlWithChannel>$(CoreSetupBlobRootUrl)$(BackwardsCompatibility110CoreSetupChannel)</BackwardsCompatibility110CoreSetupBlobRootUrlWithChannel>
|
||||||
<BackwardsCompatibility110SharedFrameworkArchiveBlobRootUrl>$(BackwardsCompatibility110CoreSetupBlobRootUrlWithChannel)/Binaries/$(BackwardsCompatibility110SharedFrameworkVersion)</BackwardsCompatibility110SharedFrameworkArchiveBlobRootUrl>
|
<BackwardsCompatibility110SharedFrameworkArchiveBlobRootUrl>$(BackwardsCompatibility110CoreSetupBlobRootUrlWithChannel)/Binaries/$(BackwardsCompatibility110SharedFrameworkVersion)</BackwardsCompatibility110SharedFrameworkArchiveBlobRootUrl>
|
||||||
|
@ -34,24 +34,24 @@
|
||||||
</_DownloadAndExtractItem>
|
</_DownloadAndExtractItem>
|
||||||
|
|
||||||
<_DownloadAndExtractItem Include="BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile"
|
<_DownloadAndExtractItem Include="BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile"
|
||||||
Condition="!Exists('$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile)') And '$(InstallerExtension)' != ''">
|
Condition="!Exists('$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile)') And '$(OSName)' != 'linux'">
|
||||||
<Url>$(BackwardsCompatibility110CoreSetupInstallerBlobRootUrl)/$(BackwardsCompatibility110SharedFrameworkVersion)/$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName)</Url>
|
<Url>$(BackwardsCompatibility110CoreSetupInstallerBlobRootUrl)/$(BackwardsCompatibility110SharedFrameworkVersion)/$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName)</Url>
|
||||||
<DownloadFileName>$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile)</DownloadFileName>
|
<DownloadFileName>$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile)</DownloadFileName>
|
||||||
<ExtractDestination></ExtractDestination>
|
<ExtractDestination></ExtractDestination>
|
||||||
</_DownloadAndExtractItem>
|
</_DownloadAndExtractItem>
|
||||||
|
|
||||||
<_DownloadAndExtractItem Include="BackwardsCompatibility110DownloadedSharedHostInstallerFile"
|
<_DownloadAndExtractItem Include="BackwardsCompatibility110DownloadedSharedHostInstallerFile"
|
||||||
Condition="!Exists('$(BackwardsCompatibility110DownloadedSharedHostInstallerFile)') And '$(InstallerExtension)' != ''">
|
Condition="!Exists('$(BackwardsCompatibility110DownloadedSharedHostInstallerFile)') And '$(OSName)' != 'linux'">
|
||||||
<Url>$(BackwardsCompatibility110CoreSetupInstallerBlobRootUrl)/$(BackwardsCompatibility110SharedHostVersion)/$(BackwardsCompatibility110DownloadedSharedHostInstallerFileName)</Url>
|
<Url>$(BackwardsCompatibility110CoreSetupInstallerBlobRootUrl)/$(BackwardsCompatibility110SharedHostVersion)/$(BackwardsCompatibility110DownloadedSharedHostInstallerFileName)</Url>
|
||||||
<DownloadFileName>$(BackwardsCompatibility110DownloadedSharedHostInstallerFile)</DownloadFileName>
|
<DownloadFileName>$(BackwardsCompatibility110DownloadedSharedHostInstallerFile)</DownloadFileName>
|
||||||
<ExtractDestintation></ExtractDestintation>
|
<ExtractDestintation></ExtractDestintation>
|
||||||
</_DownloadAndExtractItem>
|
</_DownloadAndExtractItem>
|
||||||
|
|
||||||
<_DownloadAndExtractItem Include="BackwardsCompatibility110DownloadedHostFxrInstallerFile"
|
<_DownloadAndExtractItem Include="BackwardsCompatibility110DownloadedHostFxrInstallerFile"
|
||||||
Condition="!Exists('$(BackwardsCompatibility110DownloadedHostFxrInstallerFile)') And '$(InstallerExtension)' != ''">
|
Condition="!Exists('$(BackwardsCompatibility110DownloadedHostFxrInstallerFile)') And '$(OSName)' != 'linux'">
|
||||||
<Url>$(BackwardsCompatibility110CoreSetupInstallerBlobRootUrl)/$(BackwardsCompatibility110HostFxrVersion)/$(BackwardsCompatibility110DownloadedHostFxrInstallerFileName)</Url>
|
<Url>$(BackwardsCompatibility110CoreSetupInstallerBlobRootUrl)/$(BackwardsCompatibility110HostFxrVersion)/$(BackwardsCompatibility110DownloadedHostFxrInstallerFileName)</Url>
|
||||||
<DownloadFileName>$(BackwardsCompatibility110DownloadedHostFxrInstallerFile)</DownloadFileName>
|
<DownloadFileName>$(BackwardsCompatibility110DownloadedHostFxrInstallerFile)</DownloadFileName>
|
||||||
<ExtractDestintation></ExtractDestintation>
|
<ExtractDestintation></ExtractDestintation>
|
||||||
</_DownloadAndExtractItem>
|
</_DownloadAndExtractItem>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -13,14 +13,21 @@
|
||||||
'$(Rid)' == 'fedora.24-x64' OR
|
'$(Rid)' == 'fedora.24-x64' OR
|
||||||
'$(Rid)' == 'opensuse.42.1-x64' ">$(Rid)</ProductMonikerRid>
|
'$(Rid)' == 'opensuse.42.1-x64' ">$(Rid)</ProductMonikerRid>
|
||||||
<ProductMonikerRid Condition=" '$(ProductMonikerRid)' == '' ">$(OSName)-$(Architecture)</ProductMonikerRid>
|
<ProductMonikerRid Condition=" '$(ProductMonikerRid)' == '' ">$(OSName)-$(Architecture)</ProductMonikerRid>
|
||||||
|
<HostMonikerRid Condition=" '$(HostRid)' == 'ubuntu.16.04-x64' OR
|
||||||
|
'$(HostRid)' == 'ubuntu.16.10-x64' OR
|
||||||
|
'$(HostRid)' == 'fedora.24-x64' OR
|
||||||
|
'$(HostRid)' == 'opensuse.42.1-x64' ">$(HostRid)</HostMonikerRid>
|
||||||
|
<HostMonikerRid Condition=" '$(HostMonikerRid)' == '' ">$(HostOSName)-$(Architecture)</HostMonikerRid>
|
||||||
|
|
||||||
<ArtifactNameSdk>dotnet-sdk-internal</ArtifactNameSdk>
|
<ArtifactNameSdk>dotnet-sdk-internal</ArtifactNameSdk>
|
||||||
<ArtifactNameSdkDebug>dotnet-sdk-debug</ArtifactNameSdkDebug>
|
<ArtifactNameSdkDebug>dotnet-sdk-debug</ArtifactNameSdkDebug>
|
||||||
<ArtifactNameCombinedHostHostFxrFrameworkSdk>dotnet-sdk</ArtifactNameCombinedHostHostFxrFrameworkSdk>
|
<ArtifactNameCombinedHostHostFxrFrameworkSdk>dotnet-sdk</ArtifactNameCombinedHostHostFxrFrameworkSdk>
|
||||||
|
|
||||||
<ArtifactNameWithVersionSdk>$(ArtifactNameSdk)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionSdk>
|
<ArtifactNameWithVersionSdk>$(ArtifactNameSdk)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionSdk>
|
||||||
|
|
||||||
|
|
||||||
<ArtifactNameWithVersionSdkDebug>$(ArtifactNameSdkDebug)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionSdkDebug>
|
<ArtifactNameWithVersionSdkDebug>$(ArtifactNameSdkDebug)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionSdkDebug>
|
||||||
<ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
|
<ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
|
||||||
|
<DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)-$(HostMonikerRid)</DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -9,10 +9,16 @@
|
||||||
</GetCurrentRuntimeInformation>
|
</GetCurrentRuntimeInformation>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Rid Condition=" '$(Rid)' == '' ">$(HostRid)</Rid>
|
<IsLinux Condition = " '$(HostOSName)' != 'win' AND '$(HostOSName)' != 'osx' ">True</IsLinux>
|
||||||
<Architecture Condition=" '$(Architecture)' == '' ">x64</Architecture>
|
<Rid Condition=" '$(Rid)' == '' AND '$(IsLinux)' != 'True' ">$(HostRid)</Rid>
|
||||||
<OSName Condition=" '$(OSName)' == '' ">$(HostOSName)</OSName>
|
<Architecture Condition=" '$(Architecture)' == '' AND '$(IsLinux)' != 'True' ">x64</Architecture>
|
||||||
<OSPlatform Condition=" '$(OSPlatform)' == '' ">$(HostOSPlatform)</OSPlatform>
|
<OSName Condition=" '$(OSName)' == '' AND '$(IsLinux)' != 'True' ">$(HostOSName)</OSName>
|
||||||
|
<OSPlatform Condition=" '$(OSPlatform)' == '' AND '$(IsLinux)' != 'True' ">$(HostOSPlatform)</OSPlatform>
|
||||||
|
|
||||||
|
<Rid Condition=" '$(Rid)' == '' AND '$(IsLinux)' == 'True' ">linux-x64</Rid>
|
||||||
|
<Architecture Condition=" '$(Architecture)' == '' AND '$(IsLinux)' == 'True' ">x64</Architecture>
|
||||||
|
<OSName Condition=" '$(OSName)' == '' AND '$(IsLinux)' == 'True' ">linux</OSName>
|
||||||
|
<OSPlatform Condition=" '$(OSPlatform)' == '' AND '$(IsLinux)' == 'True' ">linux</OSPlatform>
|
||||||
|
|
||||||
<BuildInfoPropsContent>
|
<BuildInfoPropsContent>
|
||||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<CoreSetupRid>$(Rid)</CoreSetupRid>
|
<CoreSetupRid>$(HostRid)</CoreSetupRid>
|
||||||
<CoreSetupRid Condition=" '$(OSName)' == 'win' or '$(OSName)' == 'osx' ">$(ProductMonikerRid)</CoreSetupRid>
|
<CoreSetupRid Condition=" '$(HostOSName)' == 'win' or '$(HostOSName)' == 'osx' ">$(HostMonikerRid)</CoreSetupRid>
|
||||||
|
|
||||||
<!-- only the runtime OSX .pkgs have a `-internal` suffix -->
|
<!-- only the runtime OSX .pkgs have a `-internal` suffix -->
|
||||||
<InstallerStartSuffix Condition="'$(OSName)' == 'osx'">-internal</InstallerStartSuffix>
|
<InstallerStartSuffix Condition="'$(HostOSName)' == 'osx'">-internal</InstallerStartSuffix>
|
||||||
|
|
||||||
<!-- Downloaded Installers + Archives -->
|
<!-- Downloaded Installers + Archives -->
|
||||||
<DownloadedSharedHostInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-host$(InstallerStartSuffix)-$(SharedHostVersion)-$(CoreSetupRid)$(InstallerExtension)</DownloadedSharedHostInstallerFileName>
|
<DownloadedSharedHostInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-host$(InstallerStartSuffix)-$(SharedHostVersion)-$(CoreSetupRid)$(InstallerExtension)</DownloadedSharedHostInstallerFileName>
|
||||||
|
@ -34,8 +34,8 @@
|
||||||
<AspNetCoreRuntimeInstallerBlobRootUrl>$(CoreSetupBlobRootUrl)aspnetcore/store/$(AspNetCoreRuntimeVersion)</AspNetCoreRuntimeInstallerBlobRootUrl>
|
<AspNetCoreRuntimeInstallerBlobRootUrl>$(CoreSetupBlobRootUrl)aspnetcore/store/$(AspNetCoreRuntimeVersion)</AspNetCoreRuntimeInstallerBlobRootUrl>
|
||||||
|
|
||||||
<!-- Examples: Build.RS.linux.zip Build.RS.winx86.zip AspNetCorePackageStoreLibx64.wixlib -->
|
<!-- Examples: Build.RS.linux.zip Build.RS.winx86.zip AspNetCorePackageStoreLibx64.wixlib -->
|
||||||
<AspNetCoreRuntimeInstallerArchiveFileNameOSToken Condition=" '$(OSName)' == 'win' ">$(OSName)$(Architecture)</AspNetCoreRuntimeInstallerArchiveFileNameOSToken>
|
<AspNetCoreRuntimeInstallerArchiveFileNameOSToken Condition=" '$(HostOSName)' == 'win' ">$(HostOSName)$(Architecture)</AspNetCoreRuntimeInstallerArchiveFileNameOSToken>
|
||||||
<AspNetCoreRuntimeInstallerArchiveFileNameOSToken Condition=" '$(OSName)' == 'osx' ">$(OSName)</AspNetCoreRuntimeInstallerArchiveFileNameOSToken>
|
<AspNetCoreRuntimeInstallerArchiveFileNameOSToken Condition=" '$(HostOSName)' == 'osx' ">$(HostOSName)</AspNetCoreRuntimeInstallerArchiveFileNameOSToken>
|
||||||
<AspNetCoreRuntimeInstallerArchiveFileNameOSToken Condition=" '$(AspNetCoreRuntimeInstallerArchiveFileNameOSToken)' == '' ">linux</AspNetCoreRuntimeInstallerArchiveFileNameOSToken>
|
<AspNetCoreRuntimeInstallerArchiveFileNameOSToken Condition=" '$(AspNetCoreRuntimeInstallerArchiveFileNameOSToken)' == '' ">linux</AspNetCoreRuntimeInstallerArchiveFileNameOSToken>
|
||||||
|
|
||||||
<AspNetCoreRuntimeStoreSuffix Condition="'$(AspNetCoreRuntimePackageFlavor)' != 'notimestamp'">-$(AspNetCoreCoherenceTimestamp)</AspNetCoreRuntimeStoreSuffix>
|
<AspNetCoreRuntimeStoreSuffix Condition="'$(AspNetCoreRuntimePackageFlavor)' != 'notimestamp'">-$(AspNetCoreCoherenceTimestamp)</AspNetCoreRuntimeStoreSuffix>
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
<AspNetCoreRuntimeInstallerArchiveFileName>Build.RS.$(AspNetCoreRuntimeInstallerArchiveFileNameOSToken)$(AspNetCoreRuntimeInstallerArchiveSuffix)$(ArchiveExtension)</AspNetCoreRuntimeInstallerArchiveFileName>
|
<AspNetCoreRuntimeInstallerArchiveFileName>Build.RS.$(AspNetCoreRuntimeInstallerArchiveFileNameOSToken)$(AspNetCoreRuntimeInstallerArchiveSuffix)$(ArchiveExtension)</AspNetCoreRuntimeInstallerArchiveFileName>
|
||||||
<AspNetCoreRuntimeInstallerArchiveFile>$(PackagesDirectory)/$(AspNetCoreRuntimeInstallerArchiveFileName)</AspNetCoreRuntimeInstallerArchiveFile>
|
<AspNetCoreRuntimeInstallerArchiveFile>$(PackagesDirectory)/$(AspNetCoreRuntimeInstallerArchiveFileName)</AspNetCoreRuntimeInstallerArchiveFile>
|
||||||
|
|
||||||
<AspNetCoreRuntimeInstallerWixLibFileName Condition=" '$(OSName)' == 'win' ">AspNetCorePackageStoreLib$(Architecture)$(AspNetCoreRuntimeStoreSuffix).wixlib</AspNetCoreRuntimeInstallerWixLibFileName>
|
<AspNetCoreRuntimeInstallerWixLibFileName Condition=" '$(HostOSName)' == 'win' ">AspNetCorePackageStoreLib$(Architecture)$(AspNetCoreRuntimeStoreSuffix).wixlib</AspNetCoreRuntimeInstallerWixLibFileName>
|
||||||
<AspNetCoreRuntimeInstallerWixLibFile Condition=" '$(AspNetCoreRuntimeInstallerWixLibFileName)' != '' ">$(PackagesDirectory)/$(AspNetCoreRuntimeInstallerWixLibFileName)</AspNetCoreRuntimeInstallerWixLibFile>
|
<AspNetCoreRuntimeInstallerWixLibFile Condition=" '$(AspNetCoreRuntimeInstallerWixLibFileName)' != '' ">$(PackagesDirectory)/$(AspNetCoreRuntimeInstallerWixLibFileName)</AspNetCoreRuntimeInstallerWixLibFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
<Project ToolsVersion="15.0" DefaultTargets="CopySdkToOutput">
|
|
||||||
<!-- workaround for https://github.com/Microsoft/msbuild/issues/885 -->
|
|
||||||
<!-- renaming the property because the original property is a global property and therefore
|
|
||||||
cannot be redefined at runtime. -->
|
|
||||||
<PropertyGroup>
|
|
||||||
<CLIBuildDllPath>$([MSBuild]::Unescape($(CLIBuildDll)))</CLIBuildDllPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<UsingTask TaskName="DotNetRestore" AssemblyFile="$(CLIBuildDllPath)" />
|
|
||||||
|
|
||||||
<Target Name="CopySdkToOutput"
|
|
||||||
DependsOnTargets="PrepareBundledSdksProps;
|
|
||||||
EnsureSdkRestored;
|
|
||||||
GetSdkItemsToCopy"
|
|
||||||
Inputs="@(SdkContent)"
|
|
||||||
Outputs="@(SdkContent->'$(SdkLayoutDirectory)/%(RecursiveDir)%(FileName)%(Extension)')">
|
|
||||||
<Copy SourceFiles="@(SdkContent)"
|
|
||||||
DestinationFiles="@(SdkContent->'$(SdkLayoutDirectory)/%(RecursiveDir)%(FileName)%(Extension)')" />
|
|
||||||
|
|
||||||
<Message Text="Copied Sdk $(SdkPackageName) from $(SdkNuPkgPath) to $(SdkLayoutDirectory)."
|
|
||||||
Importance="High" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="GetSdkItemsToCopy">
|
|
||||||
<ItemGroup>
|
|
||||||
<SdkContent Include="$(SdkNuPkgPath)/**/*"
|
|
||||||
Exclude="$(SdkNuPkgPath)/$(SdkPackageName).nuspec;
|
|
||||||
$(SdkNuPkgPath)/$(SdkPackageName).$(SdkPackageVersion).nupkg;
|
|
||||||
$(SdkNuPkgPath)/$(SdkPackageName).$(SdkPackageVersion).nupkg.sha512" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="EnsureSdkRestored"
|
|
||||||
Condition="!Exists('$(SdkNuPkgPath)/$(SdkPackageName.ToLower()).nuspec')">
|
|
||||||
<DotNetRestore ToolPath="$(Stage0Directory)"
|
|
||||||
ProjectPath="$(MSBuildThisFileDirectory)/sdks/sdks.csproj"
|
|
||||||
AdditionalParameters="/p:SdkPackageName=$(SdkPackageName) /p:SdkPackageVersion=$(SdkPackageVersion)" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="PrepareBundledSdksProps">
|
|
||||||
<PropertyGroup>
|
|
||||||
<SdkNuPkgPath>$(NuGetPackagesDir)/$(SdkPackageName.ToLower())/$(SdkPackageVersion.ToLower())</SdkNuPkgPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Target>
|
|
||||||
</Project>
|
|
|
@ -6,29 +6,31 @@
|
||||||
<CLI_Roslyn_Version>2.3.0-beta2-61716-09</CLI_Roslyn_Version>
|
<CLI_Roslyn_Version>2.3.0-beta2-61716-09</CLI_Roslyn_Version>
|
||||||
<CLI_DiaSymNative_Version>1.6.0-beta2-25304</CLI_DiaSymNative_Version>
|
<CLI_DiaSymNative_Version>1.6.0-beta2-25304</CLI_DiaSymNative_Version>
|
||||||
<CLI_FSharp_Version>4.2.0-rc-170602-0</CLI_FSharp_Version>
|
<CLI_FSharp_Version>4.2.0-rc-170602-0</CLI_FSharp_Version>
|
||||||
<CLI_NETSDK_Version>2.0.0-preview2-20170602-1</CLI_NETSDK_Version>
|
<CLI_NETSDK_Version>2.0.0-preview2-20170608-2</CLI_NETSDK_Version>
|
||||||
<CLI_NuGet_Version>4.3.0-preview3-4146</CLI_NuGet_Version>
|
<CLI_NuGet_Version>4.3.0-preview3-4146</CLI_NuGet_Version>
|
||||||
|
<CLI_MSBuildExtensions_Version>2.0.0-preview2-20170608-2</CLI_MSBuildExtensions_Version>
|
||||||
|
<CLI_NETStandardLibraryNETFrameworkVersion>2.0.0-preview2-25331-02</CLI_NETStandardLibraryNETFrameworkVersion>
|
||||||
<CLI_WEBSDK_Version>2.0.0-rel-20170518-512</CLI_WEBSDK_Version>
|
<CLI_WEBSDK_Version>2.0.0-rel-20170518-512</CLI_WEBSDK_Version>
|
||||||
<CLI_TestPlatform_Version>15.3.0-preview-20170601-03</CLI_TestPlatform_Version>
|
<CLI_TestPlatform_Version>15.3.0-preview-20170609-02</CLI_TestPlatform_Version>
|
||||||
<SharedFrameworkVersion>$(CLI_SharedFrameworkVersion)</SharedFrameworkVersion>
|
<SharedFrameworkVersion>$(CLI_SharedFrameworkVersion)</SharedFrameworkVersion>
|
||||||
<SharedHostVersion>$(CLI_SharedFrameworkVersion)</SharedHostVersion>
|
<SharedHostVersion>$(CLI_SharedFrameworkVersion)</SharedHostVersion>
|
||||||
<HostFxrVersion>$(CLI_SharedFrameworkVersion)</HostFxrVersion>
|
<HostFxrVersion>$(CLI_SharedFrameworkVersion)</HostFxrVersion>
|
||||||
<TemplateEngineVersion>1.0.0-beta2-20170606-253</TemplateEngineVersion>
|
<TemplateEngineVersion>1.0.0-beta2-20170608-254</TemplateEngineVersion>
|
||||||
<TemplateEngineTemplateVersion>1.0.0-beta2-20170606-253</TemplateEngineTemplateVersion>
|
<TemplateEngineTemplateVersion>1.0.0-beta2-20170608-256</TemplateEngineTemplateVersion>
|
||||||
<TemplateEngineTemplate2_0Version>1.0.0-beta2-20170606-253</TemplateEngineTemplate2_0Version>
|
<TemplateEngineTemplate2_0Version>1.0.0-beta2-20170608-256</TemplateEngineTemplate2_0Version>
|
||||||
<PlatformAbstractionsVersion>2.0.0-preview2-25407-01</PlatformAbstractionsVersion>
|
<PlatformAbstractionsVersion>2.0.0-preview2-25407-01</PlatformAbstractionsVersion>
|
||||||
<DependencyModelVersion>2.0.0-preview2-25407-01</DependencyModelVersion>
|
<DependencyModelVersion>2.0.0-preview2-25407-01</DependencyModelVersion>
|
||||||
<CliCommandLineParserVersion>0.1.0-alpha-142</CliCommandLineParserVersion>
|
<CliCommandLineParserVersion>0.1.0-alpha-142</CliCommandLineParserVersion>
|
||||||
<CliMigrateVersion>1.2.1-alpha-002133</CliMigrateVersion>
|
<CliMigrateVersion>1.2.1-alpha-002133</CliMigrateVersion>
|
||||||
<MicroBuildVersion>0.2.0</MicroBuildVersion>
|
<MicroBuildVersion>0.2.0</MicroBuildVersion>
|
||||||
<SpaTemplateVersion>1.0.0-preview-000249</SpaTemplateVersion>
|
<SpaTemplateVersion>1.0.0-preview-000286</SpaTemplateVersion>
|
||||||
<XliffTasksVersion>0.2.0-beta-000042</XliffTasksVersion>
|
<XliffTasksVersion>0.2.0-beta-000042</XliffTasksVersion>
|
||||||
|
|
||||||
<!-- This should either be timestamped or notimestamp as appropriate -->
|
<!-- This should either be timestamped or notimestamp as appropriate -->
|
||||||
<AspNetCoreRuntimePackageFlavor>timestamped</AspNetCoreRuntimePackageFlavor>
|
<AspNetCoreRuntimePackageFlavor>timestamped</AspNetCoreRuntimePackageFlavor>
|
||||||
<AspNetCoreRuntimeVersion>2.0.0-preview2-158</AspNetCoreRuntimeVersion>
|
<AspNetCoreRuntimeVersion>2.0.0-preview2-168</AspNetCoreRuntimeVersion>
|
||||||
<AspNetCoherenceLabel>preview2</AspNetCoherenceLabel>
|
<AspNetCoherenceLabel>preview2</AspNetCoherenceLabel>
|
||||||
<AspNetCoreCoherenceTimestamp>25487</AspNetCoreCoherenceTimestamp>
|
<AspNetCoreCoherenceTimestamp>25571</AspNetCoreCoherenceTimestamp>
|
||||||
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|
||||||
<ArchiveExtension Condition=" '$(OSName)' == 'win' ">.zip</ArchiveExtension>
|
<ArchiveExtension Condition=" '$(HostOSName)' == 'win' ">.zip</ArchiveExtension>
|
||||||
<ArchiveExtension Condition=" '$(OSName)' != 'win' ">.tar.gz</ArchiveExtension>
|
<ArchiveExtension Condition=" '$(HostOSName)' != 'win' ">.tar.gz</ArchiveExtension>
|
||||||
|
|
||||||
<InstallerExtension Condition=" '$(OSName)' == 'win' ">.msi</InstallerExtension>
|
<InstallerExtension Condition=" '$(HostOSName)' == 'win' ">.msi</InstallerExtension>
|
||||||
<InstallerExtension Condition=" '$(OSName)' == 'osx' ">.pkg</InstallerExtension>
|
<InstallerExtension Condition=" '$(HostOSName)' == 'osx' ">.pkg</InstallerExtension>
|
||||||
<InstallerExtension Condition=" '$(OSName)' == 'ubuntu' OR '$(OSName)' == 'debian' ">.deb</InstallerExtension>
|
<InstallerExtension Condition=" '$(HostOSName)' == 'ubuntu' OR '$(OSName)' == 'debian' ">.deb</InstallerExtension>
|
||||||
|
|
||||||
<BundleExtension Condition=" '$(OSName)' == 'win' ">.exe</BundleExtension>
|
<BundleExtension Condition=" '$(HostOSName)' == 'win' ">.exe</BundleExtension>
|
||||||
<BundleExtension Condition=" '$(OSName)' == 'osx' ">$(InstallerExtension)</BundleExtension>
|
<BundleExtension Condition=" '$(HostOSName)' == 'osx' ">$(InstallerExtension)</BundleExtension>
|
||||||
<BundleExtension Condition=" '$(OSName)' == 'ubuntu' OR '$(OSName)' == 'debian' ">$(InstallerExtension)</BundleExtension>
|
<BundleExtension Condition=" '$(HostOSName)' == 'ubuntu' OR '$(OSName)' == 'debian' ">$(InstallerExtension)</BundleExtension>
|
||||||
|
|
||||||
<DynamicLibPrefix>lib</DynamicLibPrefix>
|
<DynamicLibPrefix>lib</DynamicLibPrefix>
|
||||||
<DynamicLibPrefix Condition=" '$(OSName)' == 'win' "></DynamicLibPrefix>
|
<DynamicLibPrefix Condition=" '$(HostOSName)' == 'win' "></DynamicLibPrefix>
|
||||||
|
|
||||||
<DynamicLibExtension>.so</DynamicLibExtension>
|
<DynamicLibExtension>.so</DynamicLibExtension>
|
||||||
<DynamicLibExtension Condition=" '$(OSName)' == 'win' ">.dll</DynamicLibExtension>
|
<DynamicLibExtension Condition=" '$(HostOSName)' == 'win' ">.dll</DynamicLibExtension>
|
||||||
<DynamicLibExtension Condition=" '$(OSName)' == 'osx' ">.dylib</DynamicLibExtension>
|
<DynamicLibExtension Condition=" '$(HostOSName)' == 'osx' ">.dylib</DynamicLibExtension>
|
||||||
|
|
||||||
<ExeExtension>.exe</ExeExtension>
|
<ExeExtension>.exe</ExeExtension>
|
||||||
<ExeExtension Condition=" '$(OS)' != 'Windows_NT' "></ExeExtension>
|
<ExeExtension Condition=" '$(OS)' != 'Windows_NT' "></ExeExtension>
|
||||||
|
|
|
@ -1,12 +1,64 @@
|
||||||
<Project>
|
<Project>
|
||||||
<Target Name="GenerateMSBuildExtensions"
|
<Target Name="GenerateMSBuildExtensions"
|
||||||
DependsOnTargets="GenerateBundledVersionsProps">
|
DependsOnTargets="GenerateBundledVersionsProps;RestoreMSBuildExtensionsPackages">
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<MSBuildExtensionsContent Include="$(GeneratedMSBuildExtensionsDirectory)/**/*" />
|
<MSBuildExtensionsContent Include="$(GeneratedMSBuildExtensionsDirectory)/**/*" />
|
||||||
|
|
||||||
|
<!-- We want to include the tasks and targets from the Microsoft.NET.Build.Extensions package, but we don't want to include the DLLs
|
||||||
|
from that package under the net461, net462, etc folders. That is because they come from the NETStandard.Library.NETFramework
|
||||||
|
package, and we want to insert them directly into the CLI from CoreFx instead of having to do a two-hop insertion (CoreFX -> SDK -> CLI)
|
||||||
|
if we need to update them.
|
||||||
|
|
||||||
|
https://github.com/dotnet/sdk/issues/1324 has been filed to exclude these from the Microsoft.NET.Build.Extensions package when
|
||||||
|
we generate it.
|
||||||
|
-->
|
||||||
|
<MSBuildExtensionsContent Include="$(MSBuildExtensionsNuPkgPath)\msbuildExtensions\**\*.*"
|
||||||
|
Exclude="$(MSBuildExtensionsNuPkgPath)\msbuildExtensions\Microsoft.NET.Build.Extensions\net*\**" />
|
||||||
|
|
||||||
|
<MSBuildExtensionsContent Include="$(MSBuildExtensionsNuPkgPath)\msbuildExtensions-ver\**\*.*"
|
||||||
|
DeploymentSubpath="$(MSBuildExtensionsVersionSubfolder)/" />
|
||||||
|
|
||||||
|
<MSBuildExtensionsContent Include="$(NETStandardLibraryNETFrameworkNuPkgPath)\build\**\*.*"
|
||||||
|
Exclude="$(NETStandardLibraryNETFrameworkNuPkgPath)\build\**\*.props;$(NETStandardLibraryNETFrameworkNuPkgPath)\build\**\*.targets"
|
||||||
|
DeploymentSubpath="Microsoft.NET.Build.Extensions/" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="PrepareMSBuildExtensionsProps">
|
||||||
|
<PropertyGroup>
|
||||||
|
<MSBuildExtensionsPackageName>Microsoft.NET.Build.Extensions</MSBuildExtensionsPackageName>
|
||||||
|
<MSBuildExtensionsVersionSubfolder>15.0</MSBuildExtensionsVersionSubfolder>
|
||||||
|
<MSBuildExtensionsNuPkgPath>$(NuGetPackagesDir)/$(MSBuildExtensionsPackageName.ToLower())/$(CLI_MSBuildExtensions_Version.ToLower())</MSBuildExtensionsNuPkgPath>
|
||||||
|
|
||||||
|
<NETStandardLibraryNETFrameworkPackageName>NETStandard.Library.NETFramework</NETStandardLibraryNETFrameworkPackageName>
|
||||||
|
<NETStandardLibraryNETFrameworkNuPkgPath>$(NuGetPackagesDir)/$(NETStandardLibraryNETFrameworkPackageName.ToLower())/$(CLI_NETStandardLibraryNETFrameworkVersion.ToLower())</NETStandardLibraryNETFrameworkNuPkgPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="RestoreMSBuildExtensionsPackages"
|
||||||
|
DependsOnTargets="PrepareMSBuildExtensionsProps">
|
||||||
|
<ItemGroup>
|
||||||
|
<ExtensionPackageToRestore Include="$(MSBuildExtensionsPackageName)" Version="$(CLI_MSBuildExtensions_Version)"/>
|
||||||
|
<ExtensionPackageToRestore Include="$(NETStandardLibraryNETFrameworkPackageName)" Version="$(CLI_NETStandardLibraryNETFrameworkVersion)"/>
|
||||||
|
|
||||||
|
<ExtensionRestore Include="$(RepoRoot)/build/RestoreDependency.proj">
|
||||||
|
<Properties>
|
||||||
|
CLIBuildDll=$(CLIBuildDll);
|
||||||
|
NuGetPackagesDir=$(NuGetPackagesDir);
|
||||||
|
DependencyPackageName=%(ExtensionPackageToRestore.Identity);
|
||||||
|
DependencyPackageVersion=%(ExtensionPackageToRestore.Version);
|
||||||
|
Stage0Directory=$(Stage0Directory)
|
||||||
|
</Properties>
|
||||||
|
</ExtensionRestore>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<MSBuild
|
||||||
|
BuildInParallel="False"
|
||||||
|
Projects="@(ExtensionRestore)">
|
||||||
|
</MSBuild>
|
||||||
|
</Target>
|
||||||
|
|
||||||
<Target Name="GenerateBundledVersionsProps">
|
<Target Name="GenerateBundledVersionsProps">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<BundledVersionsPropsFileName>Microsoft.NETCoreSdk.BundledVersions.props</BundledVersionsPropsFileName>
|
<BundledVersionsPropsFileName>Microsoft.NETCoreSdk.BundledVersions.props</BundledVersionsPropsFileName>
|
||||||
|
|
46
build/RestoreDependency.proj
Normal file
46
build/RestoreDependency.proj
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
<Project ToolsVersion="15.0" DefaultTargets="EnsureDependencyRestored;CopySdkToOutput">
|
||||||
|
<!-- workaround for https://github.com/Microsoft/msbuild/issues/885 -->
|
||||||
|
<!-- renaming the property because the original property is a global property and therefore
|
||||||
|
cannot be redefined at runtime. -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<CLIBuildDllPath>$([MSBuild]::Unescape($(CLIBuildDll)))</CLIBuildDllPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<UsingTask TaskName="DotNetRestore" AssemblyFile="$(CLIBuildDllPath)" />
|
||||||
|
|
||||||
|
<Target Name="CopySdkToOutput"
|
||||||
|
DependsOnTargets="PrepareBundledDependencyProps;
|
||||||
|
EnsureDependencyRestored;
|
||||||
|
GetSdkItemsToCopy"
|
||||||
|
Condition="'$(SdkLayoutDirectory)' != ''"
|
||||||
|
Inputs="@(SdkContent)"
|
||||||
|
Outputs="@(SdkContent->'$(SdkLayoutDirectory)/%(RecursiveDir)%(FileName)%(Extension)')">
|
||||||
|
<Copy SourceFiles="@(SdkContent)"
|
||||||
|
DestinationFiles="@(SdkContent->'$(SdkLayoutDirectory)/%(RecursiveDir)%(FileName)%(Extension)')" />
|
||||||
|
|
||||||
|
<Message Text="Copied Sdk $(DependencyPackageName) from $(DependencyNuPkgPath) to $(SdkLayoutDirectory)."
|
||||||
|
Importance="High" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="GetSdkItemsToCopy">
|
||||||
|
<ItemGroup>
|
||||||
|
<SdkContent Include="$(DependencyNuPkgPath)/**/*"
|
||||||
|
Exclude="$(DependencyNuPkgPath)/$(DependencyPackageName).nuspec;
|
||||||
|
$(DependencyNuPkgPath)/$(DependencyPackageName).$(DependencyPackageVersion).nupkg;
|
||||||
|
$(DependencyNuPkgPath)/$(DependencyPackageName).$(DependencyPackageVersion).nupkg.sha512" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="EnsureDependencyRestored"
|
||||||
|
Condition="!Exists('$(DependencyNuPkgPath)/$(DependencyPackageName.ToLower()).nuspec')">
|
||||||
|
<DotNetRestore ToolPath="$(Stage0Directory)"
|
||||||
|
ProjectPath="$(MSBuildThisFileDirectory)/sdks/sdks.csproj"
|
||||||
|
AdditionalParameters="/p:DependencyPackageName=$(DependencyPackageName) /p:DependencyPackageVersion=$(DependencyPackageVersion)" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="PrepareBundledDependencyProps">
|
||||||
|
<PropertyGroup>
|
||||||
|
<DependencyNuPkgPath>$(NuGetPackagesDir)/$(DependencyPackageName.ToLower())/$(DependencyPackageVersion.ToLower())</DependencyNuPkgPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Target>
|
||||||
|
</Project>
|
|
@ -10,11 +10,11 @@
|
||||||
TestDebuild;
|
TestDebuild;
|
||||||
BuildSdkDeb;
|
BuildSdkDeb;
|
||||||
TestSdkDeb;"
|
TestSdkDeb;"
|
||||||
Condition=" '$(OSName)' == 'ubuntu' OR '$(OSName)' == 'debian' "
|
Condition=" '$(HostOSName)' == 'ubuntu' OR '$(HostOSName)' == 'debian' "
|
||||||
Outputs="@(GeneratedInstallers)"/>
|
Outputs="@(GeneratedInstallers)"/>
|
||||||
|
|
||||||
<Target Name="BuildSdkDeb"
|
<Target Name="BuildSdkDeb"
|
||||||
Condition=" ('$(OSName)' == 'ubuntu' OR '$(OSName)' == 'debian') AND '$(DebuildPresent)' == 'true' "
|
Condition=" ('$(HostOSName)' == 'ubuntu' OR '$(HostOSName)' == 'debian') AND '$(DebuildPresent)' == 'true' "
|
||||||
DependsOnTargets="PrepareDotnetDebDirectories;
|
DependsOnTargets="PrepareDotnetDebDirectories;
|
||||||
PrepareDotnetDebTool;"
|
PrepareDotnetDebTool;"
|
||||||
Inputs="@(CLISdkFiles)"
|
Inputs="@(CLISdkFiles)"
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="TestSdkDeb"
|
<Target Name="TestSdkDeb"
|
||||||
Condition=" ('$(OSName)' == 'ubuntu' OR '$(OSName)' == 'debian') and '$(DebuildPresent)' == 'true' "
|
Condition=" ('$(HostOSName)' == 'ubuntu' OR '$(HostOSName)' == 'debian') and '$(DebuildPresent)' == 'true' "
|
||||||
Inputs="$(DownloadedSharedHostInstallerFile);
|
Inputs="$(DownloadedSharedHostInstallerFile);
|
||||||
$(DownloadedHostFxrInstallerFile);
|
$(DownloadedHostFxrInstallerFile);
|
||||||
$(DownloadedSharedFrameworkInstallerFile);
|
$(DownloadedSharedFrameworkInstallerFile);
|
||||||
|
|
|
@ -52,8 +52,7 @@
|
||||||
<!-- Output Directories -->
|
<!-- Output Directories -->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<InstallerOutputDirectory>$(PackagesDirectory)</InstallerOutputDirectory>
|
<InstallerOutputDirectory>$(PackagesDirectory)</InstallerOutputDirectory>
|
||||||
<SdkInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension)</SdkInstallerFile>
|
<SdkInstallerFile>$(InstallerOutputDirectory)/$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension)</SdkInstallerFile>
|
||||||
|
|
||||||
<SdkDebianIntermediateDirectory>$(IntermediateDirectory)/debian/sdk</SdkDebianIntermediateDirectory>
|
<SdkDebianIntermediateDirectory>$(IntermediateDirectory)/debian/sdk</SdkDebianIntermediateDirectory>
|
||||||
<DotNetDebToolOutputDirectory>$(SdkDebianIntermediateDirectory)/deb-tool-output</DotNetDebToolOutputDirectory>
|
<DotNetDebToolOutputDirectory>$(SdkDebianIntermediateDirectory)/deb-tool-output</DotNetDebToolOutputDirectory>
|
||||||
<DebianTestResultsXmlFile>$(SdkDebianIntermediateDirectory)/debian-testResults.xml</DebianTestResultsXmlFile>
|
<DebianTestResultsXmlFile>$(SdkDebianIntermediateDirectory)/debian-testResults.xml</DebianTestResultsXmlFile>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<SdkDebianUploadUrl>$(DotnetBlobRootUrl)/$(Product)/$(FullNugetVersion)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension)</SdkDebianUploadUrl>
|
<SdkDebianUploadUrl>$(DotnetBlobRootUrl)/$(Product)/$(FullNugetVersion)/$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension)</SdkDebianUploadUrl>
|
||||||
<DebianUploadJsonFile>$(SdkDebianIntermediateDirectory)/package_upload.json</DebianUploadJsonFile>
|
<DebianUploadJsonFile>$(SdkDebianIntermediateDirectory)/package_upload.json</DebianUploadJsonFile>
|
||||||
<DebianRevisionNumber>1</DebianRevisionNumber>
|
<DebianRevisionNumber>1</DebianRevisionNumber>
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
</DebianUploadJsonContent>
|
</DebianUploadJsonContent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<Target Name="PublishDebFilesToDebianRepo" Condition=" ('$(OSName)' == 'ubuntu' OR '$(OSName)' == 'debian') AND '$(SkipPublishToDebianRepo)' != 'true' ">
|
<Target Name="PublishDebFilesToDebianRepo" Condition=" ('$(HostOSName)' == 'ubuntu' OR '$(HostOSName)' == 'debian') AND '$(SkipPublishToDebianRepo)' != 'true' ">
|
||||||
<Error Condition="'$(REPO_ID)' == ''" Text="REPO_ID must be set as an environment variable for debian publishing." />
|
<Error Condition="'$(REPO_ID)' == ''" Text="REPO_ID must be set as an environment variable for debian publishing." />
|
||||||
<Error Condition="'$(REPO_USER)' == ''" Text="REPO_USER must be set as an environment variable for debian publishing." />
|
<Error Condition="'$(REPO_USER)' == ''" Text="REPO_USER must be set as an environment variable for debian publishing." />
|
||||||
<Error Condition="'$(REPO_PASS)' == ''" Text="REPO_PASS must be set as an environment variable for debian publishing." />
|
<Error Condition="'$(REPO_PASS)' == ''" Text="REPO_PASS must be set as an environment variable for debian publishing." />
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="$(SdkPackageName)" Version="$(SdkPackageVersion)" />
|
<PackageReference Include="$(DependencyPackageName)" Version="$(DependencyPackageVersion)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using Microsoft.Build.Utilities;
|
using Microsoft.Build.Utilities;
|
||||||
using Microsoft.Build.Framework;
|
using Microsoft.Build.Framework;
|
||||||
|
|
||||||
|
@ -84,7 +85,8 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
var replacementPattern = ReplacementPatterns[i].ItemSpec;
|
var replacementPattern = ReplacementPatterns[i].ItemSpec;
|
||||||
var replacementString = ReplacementStrings[i].ItemSpec;
|
var replacementString = ReplacementStrings[i].ItemSpec;
|
||||||
|
|
||||||
outText = outText.Replace(replacementPattern, replacementString);
|
var regex = new Regex(replacementPattern);
|
||||||
|
outText = regex.Replace(outText, replacementString);
|
||||||
}
|
}
|
||||||
|
|
||||||
return outText;
|
return outText;
|
||||||
|
|
|
@ -80,8 +80,8 @@ $env:VSTEST_TRACE_BUILD=1
|
||||||
# install a stage0
|
# install a stage0
|
||||||
$dotnetInstallPath = Join-Path $RepoRoot "scripts\obtain\dotnet-install.ps1"
|
$dotnetInstallPath = Join-Path $RepoRoot "scripts\obtain\dotnet-install.ps1"
|
||||||
|
|
||||||
Write-Output "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"" -Version 2.0.0-preview2-006349"
|
Write-Output "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"""
|
||||||
Invoke-Expression "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"" -Version 2.0.0-preview2-006349"
|
Invoke-Expression "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"""
|
||||||
if ($LastExitCode -ne 0)
|
if ($LastExitCode -ne 0)
|
||||||
{
|
{
|
||||||
Write-Output "The .NET CLI installation failed with exit code $LastExitCode"
|
Write-Output "The .NET CLI installation failed with exit code $LastExitCode"
|
||||||
|
|
|
@ -155,7 +155,7 @@ export VSTEST_TRACE_BUILD=1
|
||||||
DOTNET_MULTILEVEL_LOOKUP=0
|
DOTNET_MULTILEVEL_LOOKUP=0
|
||||||
|
|
||||||
# Install a stage 0
|
# Install a stage 0
|
||||||
(set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "release/2.0.0" --version "2.0.0-preview2-006349" --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)
|
||||||
|
|
||||||
EXIT_CODE=$?
|
EXIT_CODE=$?
|
||||||
if [ $EXIT_CODE != 0 ]; then
|
if [ $EXIT_CODE != 0 ]; then
|
||||||
|
|
2
scripts/obtain/dotnet-install.ps1
vendored
2
scripts/obtain/dotnet-install.ps1
vendored
|
@ -253,7 +253,7 @@ function Get-Download-Link([string]$AzureFeed, [string]$Channel, [string]$Specif
|
||||||
$PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-runtime-$SpecificVersion-win-$CLIArchitecture.zip"
|
$PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-runtime-$SpecificVersion-win-$CLIArchitecture.zip"
|
||||||
}
|
}
|
||||||
else {
|
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"
|
Say-Verbose "Constructed primary payload URL: $PayloadURL"
|
||||||
|
|
2
scripts/obtain/dotnet-install.sh
vendored
2
scripts/obtain/dotnet-install.sh
vendored
|
@ -400,7 +400,7 @@ construct_download_link() {
|
||||||
if [ "$shared_runtime" = true ]; then
|
if [ "$shared_runtime" = true ]; then
|
||||||
download_link="$azure_feed/Runtime/$specific_version/dotnet-runtime-$specific_version-$osname-$normalized_architecture.tar.gz"
|
download_link="$azure_feed/Runtime/$specific_version/dotnet-runtime-$specific_version-$osname-$normalized_architecture.tar.gz"
|
||||||
else
|
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
|
fi
|
||||||
|
|
||||||
echo "$download_link"
|
echo "$download_link"
|
||||||
|
|
|
@ -520,4 +520,7 @@
|
||||||
<data name="ShowHelpDescription" xml:space="preserve">
|
<data name="ShowHelpDescription" xml:space="preserve">
|
||||||
<value>Show help information.</value>
|
<value>Show help information.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="NoRestoreDescription" xml:space="preserve">
|
||||||
|
<value>Does not do an implicit restore when executing the command.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -65,5 +65,11 @@ namespace Microsoft.DotNet.Cli
|
||||||
|
|
||||||
public static ArgumentsRule DefaultToCurrentDirectory(this ArgumentsRule rule) =>
|
public static ArgumentsRule DefaultToCurrentDirectory(this ArgumentsRule rule) =>
|
||||||
rule.With(defaultValue: () => PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory()));
|
rule.With(defaultValue: () => PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory()));
|
||||||
|
|
||||||
|
public static Option NoRestoreOption() =>
|
||||||
|
Create.Option(
|
||||||
|
"--no-restore",
|
||||||
|
CommonLocalizableStrings.NoRestoreDescription,
|
||||||
|
Accept.NoArguments());
|
||||||
}
|
}
|
||||||
}
|
}
|
39
src/dotnet/commands/CommandWithRestoreOptions.cs
Normal file
39
src/dotnet/commands/CommandWithRestoreOptions.cs
Normal file
|
@ -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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
56
src/dotnet/commands/RestoringCommand.cs
Normal file
56
src/dotnet/commands/RestoringCommand.cs
Normal file
|
@ -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<string> ArgsToForward { get; }
|
||||||
|
|
||||||
|
private IEnumerable<string> 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<string> 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,18 +2,21 @@
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using Microsoft.DotNet.Cli.CommandLine;
|
using Microsoft.DotNet.Cli.CommandLine;
|
||||||
using Microsoft.DotNet.Cli.Utils;
|
using Microsoft.DotNet.Cli.Utils;
|
||||||
using Microsoft.DotNet.Tools.MSBuild;
|
using Microsoft.DotNet.Tools.MSBuild;
|
||||||
|
using Microsoft.DotNet.Tools;
|
||||||
using Microsoft.DotNet.Cli;
|
using Microsoft.DotNet.Cli;
|
||||||
|
using Microsoft.DotNet.Tools.Restore;
|
||||||
using Parser = Microsoft.DotNet.Cli.Parser;
|
using Parser = Microsoft.DotNet.Cli.Parser;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Tools.Build
|
namespace Microsoft.DotNet.Tools.Build
|
||||||
{
|
{
|
||||||
public class BuildCommand : MSBuildForwardingApp
|
public class BuildCommand : RestoringCommand
|
||||||
{
|
{
|
||||||
public BuildCommand(IEnumerable<string> msbuildArgs, string msbuildPath = null)
|
public BuildCommand(IEnumerable<string> msbuildArgs, bool noRestore, string msbuildPath = null)
|
||||||
: base(msbuildArgs, msbuildPath)
|
: base(msbuildArgs, noRestore, msbuildPath)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +47,9 @@ namespace Microsoft.DotNet.Tools.Build
|
||||||
|
|
||||||
msbuildArgs.Add($"/clp:Summary");
|
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)
|
public static int Run(string[] args)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
// 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.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.DotNet.Cli.CommandLine;
|
using Microsoft.DotNet.Cli.CommandLine;
|
||||||
using Microsoft.DotNet.Tools;
|
using Microsoft.DotNet.Tools;
|
||||||
|
@ -11,7 +12,7 @@ namespace Microsoft.DotNet.Cli
|
||||||
internal static class BuildCommandParser
|
internal static class BuildCommandParser
|
||||||
{
|
{
|
||||||
public static Command Build() =>
|
public static Command Build() =>
|
||||||
Create.Command(
|
CreateWithRestoreOptions.Command(
|
||||||
"build",
|
"build",
|
||||||
LocalizableStrings.AppFullName,
|
LocalizableStrings.AppFullName,
|
||||||
Accept.ZeroOrMoreArguments()
|
Accept.ZeroOrMoreArguments()
|
||||||
|
@ -37,6 +38,7 @@ namespace Microsoft.DotNet.Cli
|
||||||
LocalizableStrings.NoDependenciesOptionDescription,
|
LocalizableStrings.NoDependenciesOptionDescription,
|
||||||
Accept.NoArguments()
|
Accept.NoArguments()
|
||||||
.ForwardAs("/p:BuildProjectReferences=false")),
|
.ForwardAs("/p:BuildProjectReferences=false")),
|
||||||
|
CommonOptions.NoRestoreOption(),
|
||||||
CommonOptions.VerbosityOption());
|
CommonOptions.VerbosityOption());
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -58,7 +58,7 @@ namespace Microsoft.DotNet.Tools.MSBuild
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Execute()
|
public virtual int Execute()
|
||||||
{
|
{
|
||||||
return GetProcessStartInfo().Execute();
|
return GetProcessStartInfo().Execute();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,16 +5,17 @@ using System.Collections.Generic;
|
||||||
using Microsoft.DotNet.Cli.CommandLine;
|
using Microsoft.DotNet.Cli.CommandLine;
|
||||||
using Microsoft.DotNet.Cli.Utils;
|
using Microsoft.DotNet.Cli.Utils;
|
||||||
using Microsoft.DotNet.Tools.MSBuild;
|
using Microsoft.DotNet.Tools.MSBuild;
|
||||||
|
using Microsoft.DotNet.Tools;
|
||||||
using Microsoft.DotNet.Cli;
|
using Microsoft.DotNet.Cli;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using Parser = Microsoft.DotNet.Cli.Parser;
|
using Parser = Microsoft.DotNet.Cli.Parser;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Tools.Pack
|
namespace Microsoft.DotNet.Tools.Pack
|
||||||
{
|
{
|
||||||
public class PackCommand : MSBuildForwardingApp
|
public class PackCommand : RestoringCommand
|
||||||
{
|
{
|
||||||
public PackCommand(IEnumerable<string> msbuildArgs, string msbuildPath = null)
|
public PackCommand(IEnumerable<string> msbuildArgs, bool noRestore, string msbuildPath = null)
|
||||||
: base(msbuildArgs, msbuildPath)
|
: base(msbuildArgs, noRestore, msbuildPath)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,14 +31,16 @@ namespace Microsoft.DotNet.Tools.Pack
|
||||||
|
|
||||||
var msbuildArgs = new List<string>()
|
var msbuildArgs = new List<string>()
|
||||||
{
|
{
|
||||||
"/t:pack"
|
"/t:pack"
|
||||||
};
|
};
|
||||||
|
|
||||||
msbuildArgs.AddRange(parsedPack.OptionValuesToBeForwarded());
|
msbuildArgs.AddRange(parsedPack.OptionValuesToBeForwarded());
|
||||||
|
|
||||||
msbuildArgs.AddRange(parsedPack.Arguments);
|
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)
|
public static int Run(string[] args)
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
// 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.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.DotNet.Cli.CommandLine;
|
using Microsoft.DotNet.Cli.CommandLine;
|
||||||
|
using Microsoft.DotNet.Tools;
|
||||||
using LocalizableStrings = Microsoft.DotNet.Tools.Pack.LocalizableStrings;
|
using LocalizableStrings = Microsoft.DotNet.Tools.Pack.LocalizableStrings;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Cli
|
namespace Microsoft.DotNet.Cli
|
||||||
|
@ -10,7 +12,7 @@ namespace Microsoft.DotNet.Cli
|
||||||
internal static class PackCommandParser
|
internal static class PackCommandParser
|
||||||
{
|
{
|
||||||
public static Command Pack() =>
|
public static Command Pack() =>
|
||||||
Create.Command(
|
CreateWithRestoreOptions.Command(
|
||||||
"pack",
|
"pack",
|
||||||
LocalizableStrings.AppFullName,
|
LocalizableStrings.AppFullName,
|
||||||
Accept.ZeroOrMoreArguments(),
|
Accept.ZeroOrMoreArguments(),
|
||||||
|
@ -39,6 +41,7 @@ namespace Microsoft.DotNet.Cli
|
||||||
"-s|--serviceable",
|
"-s|--serviceable",
|
||||||
LocalizableStrings.CmdServiceableDescription,
|
LocalizableStrings.CmdServiceableDescription,
|
||||||
Accept.NoArguments().ForwardAs("/p:Serviceable=true")),
|
Accept.NoArguments().ForwardAs("/p:Serviceable=true")),
|
||||||
|
CommonOptions.NoRestoreOption(),
|
||||||
CommonOptions.VerbosityOption());
|
CommonOptions.VerbosityOption());
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,15 +5,16 @@ using System.Collections.Generic;
|
||||||
using Microsoft.DotNet.Cli;
|
using Microsoft.DotNet.Cli;
|
||||||
using Microsoft.DotNet.Cli.CommandLine;
|
using Microsoft.DotNet.Cli.CommandLine;
|
||||||
using Microsoft.DotNet.Cli.Utils;
|
using Microsoft.DotNet.Cli.Utils;
|
||||||
|
using Microsoft.DotNet.Tools;
|
||||||
using Microsoft.DotNet.Tools.MSBuild;
|
using Microsoft.DotNet.Tools.MSBuild;
|
||||||
using Parser = Microsoft.DotNet.Cli.Parser;
|
using Parser = Microsoft.DotNet.Cli.Parser;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Tools.Publish
|
namespace Microsoft.DotNet.Tools.Publish
|
||||||
{
|
{
|
||||||
public class PublishCommand : MSBuildForwardingApp
|
public class PublishCommand : RestoringCommand
|
||||||
{
|
{
|
||||||
private PublishCommand(IEnumerable<string> msbuildArgs, string msbuildPath = null)
|
private PublishCommand(IEnumerable<string> msbuildArgs, bool noRestore, string msbuildPath = null)
|
||||||
: base(msbuildArgs, msbuildPath)
|
: base(msbuildArgs, noRestore, msbuildPath)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +38,9 @@ namespace Microsoft.DotNet.Tools.Publish
|
||||||
|
|
||||||
msbuildArgs.AddRange(appliedPublishOption.Arguments);
|
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)
|
public static int Run(string[] args)
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
// 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.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.DotNet.Cli.CommandLine;
|
using Microsoft.DotNet.Cli.CommandLine;
|
||||||
|
using Microsoft.DotNet.Tools;
|
||||||
using LocalizableStrings = Microsoft.DotNet.Tools.Publish.LocalizableStrings;
|
using LocalizableStrings = Microsoft.DotNet.Tools.Publish.LocalizableStrings;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Cli
|
namespace Microsoft.DotNet.Cli
|
||||||
|
@ -10,7 +12,7 @@ namespace Microsoft.DotNet.Cli
|
||||||
internal static class PublishCommandParser
|
internal static class PublishCommandParser
|
||||||
{
|
{
|
||||||
public static Command Publish() =>
|
public static Command Publish() =>
|
||||||
Create.Command(
|
CreateWithRestoreOptions.Command(
|
||||||
"publish",
|
"publish",
|
||||||
LocalizableStrings.AppDescription,
|
LocalizableStrings.AppDescription,
|
||||||
Accept.ZeroOrMoreArguments(),
|
Accept.ZeroOrMoreArguments(),
|
||||||
|
@ -41,6 +43,7 @@ namespace Microsoft.DotNet.Cli
|
||||||
string value = o.Arguments.Any() ? o.Arguments.Single() : "true";
|
string value = o.Arguments.Any() ? o.Arguments.Single() : "true";
|
||||||
return $"/p:SelfContained={value}";
|
return $"/p:SelfContained={value}";
|
||||||
})),
|
})),
|
||||||
|
CommonOptions.NoRestoreOption(),
|
||||||
CommonOptions.VerbosityOption());
|
CommonOptions.VerbosityOption());
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -37,7 +37,7 @@ namespace Microsoft.DotNet.Tools.Restore
|
||||||
"/t:Restore"
|
"/t:Restore"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!parsedRestore.HasOption("verbosity"))
|
if (!HasVerbosityOption(parsedRestore))
|
||||||
{
|
{
|
||||||
msbuildArgs.Add("/ConsoleLoggerParameters:Verbosity=Minimal");
|
msbuildArgs.Add("/ConsoleLoggerParameters:Verbosity=Minimal");
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ namespace Microsoft.DotNet.Tools.Restore
|
||||||
msbuildArgs.AddRange(parsedRestore.OptionValuesToBeForwarded());
|
msbuildArgs.AddRange(parsedRestore.OptionValuesToBeForwarded());
|
||||||
|
|
||||||
msbuildArgs.AddRange(parsedRestore.Arguments);
|
msbuildArgs.AddRange(parsedRestore.Arguments);
|
||||||
|
|
||||||
return new RestoreCommand(msbuildArgs, msbuildPath);
|
return new RestoreCommand(msbuildArgs, msbuildPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,5 +65,12 @@ namespace Microsoft.DotNet.Tools.Restore
|
||||||
|
|
||||||
return cmd.Execute();
|
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:"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
// 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.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.DotNet.Cli.CommandLine;
|
using Microsoft.DotNet.Cli.CommandLine;
|
||||||
using LocalizableStrings = Microsoft.DotNet.Tools.Restore.LocalizableStrings;
|
using LocalizableStrings = Microsoft.DotNet.Tools.Restore.LocalizableStrings;
|
||||||
|
@ -14,15 +15,41 @@ namespace Microsoft.DotNet.Cli
|
||||||
"restore",
|
"restore",
|
||||||
LocalizableStrings.AppFullName,
|
LocalizableStrings.AppFullName,
|
||||||
Accept.ZeroOrMoreArguments(),
|
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<Option> commandOptions)
|
||||||
|
{
|
||||||
|
return AddImplicitRestoreOptions(commandOptions, false, false).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static IEnumerable<Option> AddImplicitRestoreOptions(
|
||||||
|
IEnumerable<Option> commandOptions,
|
||||||
|
bool showHelp,
|
||||||
|
bool useShortOptions)
|
||||||
|
{
|
||||||
|
return commandOptions.Concat(ImplicitRestoreOptions(showHelp, useShortOptions)
|
||||||
|
.Where(o => !commandOptions.Any(c => c.Name == o.Name)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Option[] ImplicitRestoreOptions(bool showHelp = false, bool useShortOptions = false)
|
||||||
|
{
|
||||||
|
return new Option[] {
|
||||||
Create.Option(
|
Create.Option(
|
||||||
"-s|--source",
|
useShortOptions ? "-s|--source" : "--source",
|
||||||
LocalizableStrings.CmdSourceOptionDescription,
|
showHelp ? LocalizableStrings.CmdSourceOptionDescription : string.Empty,
|
||||||
Accept.OneOrMoreArguments()
|
Accept.OneOrMoreArguments()
|
||||||
.With(name: LocalizableStrings.CmdSourceOption)
|
.With(name: LocalizableStrings.CmdSourceOption)
|
||||||
.ForwardAsSingle(o => $"/p:RestoreSources={string.Join("%3B", o.Arguments)}")),
|
.ForwardAsSingle(o => $"/p:RestoreSources={string.Join("%3B", o.Arguments)}")),
|
||||||
Create.Option(
|
Create.Option(
|
||||||
"-r|--runtime",
|
useShortOptions ? "-r|--runtime" : "--runtime" ,
|
||||||
LocalizableStrings.CmdRuntimeOptionDescription,
|
LocalizableStrings.CmdRuntimeOptionDescription,
|
||||||
Accept.OneOrMoreArguments()
|
Accept.OneOrMoreArguments()
|
||||||
.WithSuggestionsFrom(_ => Suggest.RunTimesFromProjectFile())
|
.WithSuggestionsFrom(_ => Suggest.RunTimesFromProjectFile())
|
||||||
|
@ -30,29 +57,29 @@ namespace Microsoft.DotNet.Cli
|
||||||
.ForwardAsSingle(o => $"/p:RuntimeIdentifiers={string.Join("%3B", o.Arguments)}")),
|
.ForwardAsSingle(o => $"/p:RuntimeIdentifiers={string.Join("%3B", o.Arguments)}")),
|
||||||
Create.Option(
|
Create.Option(
|
||||||
"--packages",
|
"--packages",
|
||||||
LocalizableStrings.CmdPackagesOptionDescription,
|
showHelp ? LocalizableStrings.CmdPackagesOptionDescription : string.Empty,
|
||||||
Accept.ExactlyOneArgument()
|
Accept.ExactlyOneArgument()
|
||||||
.With(name: LocalizableStrings.CmdPackagesOption)
|
.With(name: LocalizableStrings.CmdPackagesOption)
|
||||||
.ForwardAsSingle(o => $"/p:RestorePackagesPath={o.Arguments.Single()}")),
|
.ForwardAsSingle(o => $"/p:RestorePackagesPath={o.Arguments.Single()}")),
|
||||||
Create.Option(
|
Create.Option(
|
||||||
"--disable-parallel",
|
"--disable-parallel",
|
||||||
LocalizableStrings.CmdDisableParallelOptionDescription,
|
showHelp ? LocalizableStrings.CmdDisableParallelOptionDescription : string.Empty,
|
||||||
Accept.NoArguments()
|
Accept.NoArguments()
|
||||||
.ForwardAs("/p:RestoreDisableParallel=true")),
|
.ForwardAs("/p:RestoreDisableParallel=true")),
|
||||||
Create.Option(
|
Create.Option(
|
||||||
"--configfile",
|
"--configfile",
|
||||||
LocalizableStrings.CmdConfigFileOptionDescription,
|
showHelp ? LocalizableStrings.CmdConfigFileOptionDescription : string.Empty,
|
||||||
Accept.ExactlyOneArgument()
|
Accept.ExactlyOneArgument()
|
||||||
.With(name: LocalizableStrings.CmdConfigFileOption)
|
.With(name: LocalizableStrings.CmdConfigFileOption)
|
||||||
.ForwardAsSingle(o => $"/p:RestoreConfigFile={o.Arguments.Single()}")),
|
.ForwardAsSingle(o => $"/p:RestoreConfigFile={o.Arguments.Single()}")),
|
||||||
Create.Option(
|
Create.Option(
|
||||||
"--no-cache",
|
"--no-cache",
|
||||||
LocalizableStrings.CmdNoCacheOptionDescription,
|
showHelp ? LocalizableStrings.CmdNoCacheOptionDescription : string.Empty,
|
||||||
Accept.NoArguments()
|
Accept.NoArguments()
|
||||||
.ForwardAs("/p:RestoreNoCache=true")),
|
.ForwardAs("/p:RestoreNoCache=true")),
|
||||||
Create.Option(
|
Create.Option(
|
||||||
"--ignore-failed-sources",
|
"--ignore-failed-sources",
|
||||||
LocalizableStrings.CmdIgnoreFailedSourcesOptionDescription,
|
showHelp ? LocalizableStrings.CmdIgnoreFailedSourcesOptionDescription : string.Empty,
|
||||||
Accept.NoArguments()
|
Accept.NoArguments()
|
||||||
.ForwardAs("/p:RestoreIgnoreFailedSources=true")),
|
.ForwardAs("/p:RestoreIgnoreFailedSources=true")),
|
||||||
Create.Option(
|
Create.Option(
|
||||||
|
@ -61,10 +88,11 @@ namespace Microsoft.DotNet.Cli
|
||||||
Accept.NoArguments()
|
Accept.NoArguments()
|
||||||
.ForwardAs("/p:RestoreRecursive=false")),
|
.ForwardAs("/p:RestoreRecursive=false")),
|
||||||
Create.Option(
|
Create.Option(
|
||||||
"-f|--force",
|
useShortOptions ? "-f|--force" : "--force",
|
||||||
LocalizableStrings.CmdForceRestoreOptionDescription,
|
LocalizableStrings.CmdForceRestoreOptionDescription,
|
||||||
Accept.NoArguments()
|
Accept.NoArguments()
|
||||||
.ForwardAs("/p:RestoreForce=true")),
|
.ForwardAs("/p:RestoreForce=true"))
|
||||||
CommonOptions.VerbosityOption());
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,6 +7,7 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.Build.Evaluation;
|
using Microsoft.Build.Evaluation;
|
||||||
using Microsoft.DotNet.Cli.Utils;
|
using Microsoft.DotNet.Cli.Utils;
|
||||||
|
using Microsoft.DotNet.Tools;
|
||||||
using Microsoft.DotNet.Tools.MSBuild;
|
using Microsoft.DotNet.Tools.MSBuild;
|
||||||
using Microsoft.DotNet.Tools.Run.LaunchSettings;
|
using Microsoft.DotNet.Tools.Run.LaunchSettings;
|
||||||
|
|
||||||
|
@ -19,6 +20,8 @@ namespace Microsoft.DotNet.Tools.Run
|
||||||
public bool NoBuild { get; private set; }
|
public bool NoBuild { get; private set; }
|
||||||
public string Project { get; private set; }
|
public string Project { get; private set; }
|
||||||
public IReadOnlyCollection<string> Args { get; private set; }
|
public IReadOnlyCollection<string> Args { get; private set; }
|
||||||
|
public bool NoRestore { get; private set; }
|
||||||
|
public IEnumerable<string> RestoreArgs { get; private set; }
|
||||||
|
|
||||||
private List<string> _args;
|
private List<string> _args;
|
||||||
private bool ShouldBuild => !NoBuild;
|
private bool ShouldBuild => !NoBuild;
|
||||||
|
@ -55,6 +58,8 @@ namespace Microsoft.DotNet.Tools.Run
|
||||||
string project,
|
string project,
|
||||||
string launchProfile,
|
string launchProfile,
|
||||||
bool noLaunchProfile,
|
bool noLaunchProfile,
|
||||||
|
bool noRestore,
|
||||||
|
IEnumerable<string> restoreArgs,
|
||||||
IReadOnlyCollection<string> args)
|
IReadOnlyCollection<string> args)
|
||||||
{
|
{
|
||||||
Configuration = configuration;
|
Configuration = configuration;
|
||||||
|
@ -64,6 +69,8 @@ namespace Microsoft.DotNet.Tools.Run
|
||||||
LaunchProfile = launchProfile;
|
LaunchProfile = launchProfile;
|
||||||
NoLaunchProfile = noLaunchProfile;
|
NoLaunchProfile = noLaunchProfile;
|
||||||
Args = args;
|
Args = args;
|
||||||
|
RestoreArgs = restoreArgs;
|
||||||
|
NoRestore = noRestore;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RunCommand MakeNewWithReplaced(string configuration = null,
|
public RunCommand MakeNewWithReplaced(string configuration = null,
|
||||||
|
@ -72,6 +79,8 @@ namespace Microsoft.DotNet.Tools.Run
|
||||||
string project = null,
|
string project = null,
|
||||||
string launchProfile = null,
|
string launchProfile = null,
|
||||||
bool? noLaunchProfile = null,
|
bool? noLaunchProfile = null,
|
||||||
|
bool? noRestore = null,
|
||||||
|
IEnumerable<string> restoreArgs = null,
|
||||||
IReadOnlyCollection<string> args = null)
|
IReadOnlyCollection<string> args = null)
|
||||||
{
|
{
|
||||||
return new RunCommand(
|
return new RunCommand(
|
||||||
|
@ -81,6 +90,8 @@ namespace Microsoft.DotNet.Tools.Run
|
||||||
project ?? this.Project,
|
project ?? this.Project,
|
||||||
launchProfile ?? this.LaunchProfile,
|
launchProfile ?? this.LaunchProfile,
|
||||||
noLaunchProfile ?? this.NoLaunchProfile,
|
noLaunchProfile ?? this.NoLaunchProfile,
|
||||||
|
noRestore ?? this.NoRestore,
|
||||||
|
restoreArgs ?? this.RestoreArgs,
|
||||||
args ?? this.Args
|
args ?? this.Args
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -132,18 +143,9 @@ namespace Microsoft.DotNet.Tools.Run
|
||||||
buildArgs.Add("/nologo");
|
buildArgs.Add("/nologo");
|
||||||
buildArgs.Add("/verbosity:quiet");
|
buildArgs.Add("/verbosity:quiet");
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(Configuration))
|
buildArgs.AddRange(RestoreArgs);
|
||||||
{
|
|
||||||
buildArgs.Add($"/p:Configuration={Configuration}");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(Framework))
|
|
||||||
{
|
|
||||||
buildArgs.Add($"/p:TargetFramework={Framework}");
|
|
||||||
}
|
|
||||||
|
|
||||||
var buildResult = new MSBuildForwardingApp(buildArgs).Execute();
|
|
||||||
|
|
||||||
|
var buildResult = new RestoringCommand(buildArgs, NoRestore).Execute();
|
||||||
if (buildResult != 0)
|
if (buildResult != 0)
|
||||||
{
|
{
|
||||||
Reporter.Error.WriteLine();
|
Reporter.Error.WriteLine();
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
// 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.
|
// 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.CommandLine;
|
||||||
|
using Microsoft.DotNet.Tools;
|
||||||
using Microsoft.DotNet.Tools.Run;
|
using Microsoft.DotNet.Tools.Run;
|
||||||
using LocalizableStrings = Microsoft.DotNet.Tools.Run.LocalizableStrings;
|
using LocalizableStrings = Microsoft.DotNet.Tools.Run.LocalizableStrings;
|
||||||
|
|
||||||
|
@ -10,7 +13,7 @@ namespace Microsoft.DotNet.Cli
|
||||||
internal static class RunCommandParser
|
internal static class RunCommandParser
|
||||||
{
|
{
|
||||||
public static Command Run() =>
|
public static Command Run() =>
|
||||||
Create.Command(
|
CreateWithRestoreOptions.Command(
|
||||||
"run",
|
"run",
|
||||||
LocalizableStrings.AppFullName,
|
LocalizableStrings.AppFullName,
|
||||||
treatUnmatchedTokensAsErrors: false,
|
treatUnmatchedTokensAsErrors: false,
|
||||||
|
@ -23,6 +26,8 @@ namespace Microsoft.DotNet.Cli
|
||||||
project: o.SingleArgumentOrDefault("--project"),
|
project: o.SingleArgumentOrDefault("--project"),
|
||||||
launchProfile: o.SingleArgumentOrDefault("--launch-profile"),
|
launchProfile: o.SingleArgumentOrDefault("--launch-profile"),
|
||||||
noLaunchProfile: o.HasOption("--no-launch-profile"),
|
noLaunchProfile: o.HasOption("--no-launch-profile"),
|
||||||
|
noRestore: o.HasOption("--no-restore"),
|
||||||
|
restoreArgs: o.OptionValuesToBeForwarded(),
|
||||||
args: o.Arguments
|
args: o.Arguments
|
||||||
)),
|
)),
|
||||||
options: new[]
|
options: new[]
|
||||||
|
@ -45,7 +50,8 @@ namespace Microsoft.DotNet.Cli
|
||||||
Create.Option(
|
Create.Option(
|
||||||
"--no-build",
|
"--no-build",
|
||||||
LocalizableStrings.CommandOptionNoBuildDescription,
|
LocalizableStrings.CommandOptionNoBuildDescription,
|
||||||
Accept.NoArguments())
|
Accept.NoArguments()),
|
||||||
|
CommonOptions.NoRestoreOption()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -14,10 +14,10 @@ using Parser = Microsoft.DotNet.Cli.Parser;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Tools.Test
|
namespace Microsoft.DotNet.Tools.Test
|
||||||
{
|
{
|
||||||
public class TestCommand : MSBuildForwardingApp
|
public class TestCommand : RestoringCommand
|
||||||
{
|
{
|
||||||
public TestCommand(IEnumerable<string> msbuildArgs, string msbuildPath = null)
|
public TestCommand(IEnumerable<string> msbuildArgs, bool noRestore, string msbuildPath = null)
|
||||||
: base(msbuildArgs, msbuildPath)
|
: base(msbuildArgs, noRestore, msbuildPath)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,9 @@ namespace Microsoft.DotNet.Tools.Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new TestCommand(msbuildArgs, msbuildPath);
|
bool noRestore = parsedTest.HasOption("--no-restore");
|
||||||
|
|
||||||
|
return new TestCommand(msbuildArgs, noRestore, msbuildPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int Run(string[] args)
|
public static int Run(string[] args)
|
||||||
|
|
|
@ -1,6 +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.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.DotNet.Cli.CommandLine;
|
using Microsoft.DotNet.Cli.CommandLine;
|
||||||
|
using Microsoft.DotNet.Tools;
|
||||||
using LocalizableStrings = Microsoft.DotNet.Tools.Test.LocalizableStrings;
|
using LocalizableStrings = Microsoft.DotNet.Tools.Test.LocalizableStrings;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Cli
|
namespace Microsoft.DotNet.Cli
|
||||||
|
@ -44,10 +48,10 @@ namespace Microsoft.DotNet.Cli
|
||||||
LocalizableStrings.CmdLoggerDescription,
|
LocalizableStrings.CmdLoggerDescription,
|
||||||
Accept.ExactlyOneArgument()
|
Accept.ExactlyOneArgument()
|
||||||
.With(name: LocalizableStrings.CmdLoggerOption)
|
.With(name: LocalizableStrings.CmdLoggerOption)
|
||||||
.ForwardAsSingle(o =>
|
.ForwardAsSingle(o =>
|
||||||
{
|
{
|
||||||
var loggersString = string.Join(";", GetSemiColonEscapedArgs(o.Arguments));
|
var loggersString = string.Join(";", GetSemiColonEscapedArgs(o.Arguments));
|
||||||
|
|
||||||
return $"/p:VSTestLogger={loggersString}";
|
return $"/p:VSTestLogger={loggersString}";
|
||||||
})),
|
})),
|
||||||
CommonOptions.ConfigurationOption(),
|
CommonOptions.ConfigurationOption(),
|
||||||
|
@ -81,6 +85,7 @@ namespace Microsoft.DotNet.Cli
|
||||||
Accept.OneOrMoreArguments()
|
Accept.OneOrMoreArguments()
|
||||||
.With(name: LocalizableStrings.cmdCollectFriendlyName)
|
.With(name: LocalizableStrings.cmdCollectFriendlyName)
|
||||||
.ForwardAsSingle(o => $"/p:VSTestCollect=\"{string.Join(";", o.Arguments)}\"")),
|
.ForwardAsSingle(o => $"/p:VSTestCollect=\"{string.Join(";", o.Arguments)}\"")),
|
||||||
|
CommonOptions.NoRestoreOption(),
|
||||||
CommonOptions.VerbosityOption());
|
CommonOptions.VerbosityOption());
|
||||||
|
|
||||||
private static string GetSemiColonEsacpedstring(string arg)
|
private static string GetSemiColonEsacpedstring(string arg)
|
||||||
|
|
|
@ -112,9 +112,14 @@
|
||||||
DependsOnTargets="GenerateMSBuildExtensions"
|
DependsOnTargets="GenerateMSBuildExtensions"
|
||||||
AfterTargets="Publish"
|
AfterTargets="Publish"
|
||||||
BeforeTargets="GenerateCliRuntimeConfigurationFiles">
|
BeforeTargets="GenerateCliRuntimeConfigurationFiles">
|
||||||
|
<ItemGroup>
|
||||||
|
<MSBuildExtensionsContent Update="@(MSBuildExtensionsContent)">
|
||||||
|
<DestinationPath Condition="'%(MSBuildExtensionsContent.DestinationPath)' == ''">$(PublishDir)/%(MSBuildExtensionsContent.DeploymentSubpath)%(RecursiveDir)%(Filename)%(Extension)</DestinationPath>
|
||||||
|
</MSBuildExtensionsContent>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<Copy SourceFiles="@(MSBuildExtensionsContent)"
|
<Copy SourceFiles="@(MSBuildExtensionsContent)"
|
||||||
DestinationFolder="$(PublishDir)/%(RecursiveDir)" />
|
DestinationFiles="%(MSBuildExtensionsContent.DestinationPath)" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<MSBuildTargetsDirectory>$(PublishDir)/runtimes/any/native</MSBuildTargetsDirectory>
|
<MSBuildTargetsDirectory>$(PublishDir)/runtimes/any/native</MSBuildTargetsDirectory>
|
||||||
|
@ -140,13 +145,13 @@
|
||||||
<Target Name="PublishSdks"
|
<Target Name="PublishSdks"
|
||||||
AfterTargets="Publish">
|
AfterTargets="Publish">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<SdksToBundle Include="$(RepoRoot)/build/BundledSdks.proj">
|
<SdksToBundle Include="$(RepoRoot)/build/RestoreDependency.proj">
|
||||||
<Properties>
|
<Properties>
|
||||||
CLIBuildDll=$(CLIBuildDll);
|
CLIBuildDll=$(CLIBuildDll);
|
||||||
NuGetPackagesDir=$(NuGetPackagesDir);
|
NuGetPackagesDir=$(NuGetPackagesDir);
|
||||||
SdkLayoutDirectory=$(SdkOutputDirectory)/Sdks/%(BundledSdk.Identity);
|
SdkLayoutDirectory=$(SdkOutputDirectory)/Sdks/%(BundledSdk.Identity);
|
||||||
SdkPackageName=%(BundledSdk.Identity);
|
DependencyPackageName=%(BundledSdk.Identity);
|
||||||
SdkPackageVersion=%(BundledSdk.Version);
|
DependencyPackageVersion=%(BundledSdk.Version);
|
||||||
Stage0Directory=$(Stage0Directory)
|
Stage0Directory=$(Stage0Directory)
|
||||||
</Properties>
|
</Properties>
|
||||||
</SdksToBundle>
|
</SdksToBundle>
|
||||||
|
@ -189,6 +194,12 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!-- Removing Full CLR built TestHost assemblies from getting Crossgen as it is throwing error -->
|
<!-- Removing Full CLR built TestHost assemblies from getting Crossgen as it is throwing error -->
|
||||||
<SdkFiles Include="$(PublishDir)/**/*" Exclude="$(PublishDir)/TestHost*/**/*;$(PublishDir)/Sdks/**/*" />
|
<SdkFiles Include="$(PublishDir)/**/*" Exclude="$(PublishDir)/TestHost*/**/*;$(PublishDir)/Sdks/**/*" />
|
||||||
|
|
||||||
|
<!-- Don't try to CrossGen .NET Framework support assemblies for .NET Standard -->
|
||||||
|
<SdkFiles Remove="$(PublishDir)/Microsoft.NET.Build.Extensions\net*\**\*" />
|
||||||
|
|
||||||
|
<!-- Don't try to CrossGen tasks and supporting DLLs compiled for .NET Framework -->
|
||||||
|
<SdkFiles Remove="$(PublishDir)/Microsoft.NET.Build.Extensions\tools\net*\**\*" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<AddMetadataIsPE Items="@(SdkFiles)">
|
<AddMetadataIsPE Items="@(SdkFiles)">
|
||||||
|
@ -264,4 +275,18 @@
|
||||||
<Copy SourceFiles="@(Stage2Cli)"
|
<Copy SourceFiles="@(Stage2Cli)"
|
||||||
DestinationFiles="@(Stage2Cli->'$(Stage2WithBackwardsCompatibleRuntimesOutputDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" />
|
DestinationFiles="@(Stage2Cli->'$(Stage2WithBackwardsCompatibleRuntimesOutputDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="RetargetVSTestConsole"
|
||||||
|
AfterTargets="Publish">
|
||||||
|
<PropertyGroup>
|
||||||
|
<VSTestRuntimeConfigPath>$(PublishDir)/vstest.console.runtimeconfig.json</VSTestRuntimeConfigPath>
|
||||||
|
<ReplacementPattern>"version": ".*"</ReplacementPattern>
|
||||||
|
<ReplacementString>"version": "$(CLI_SharedFrameworkVersion)"</ReplacementString>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ReplaceFileContents
|
||||||
|
InputFile="$(VSTestRuntimeConfigPath)"
|
||||||
|
DestinationFile="$(VSTestRuntimeConfigPath)"
|
||||||
|
ReplacementPatterns="$(ReplacementPattern)"
|
||||||
|
ReplacementStrings="$(ReplacementString)" />
|
||||||
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
40
test/EndToEnd/GivenNetFrameworkSupportsNetStandard2.cs
Normal file
40
test/EndToEnd/GivenNetFrameworkSupportsNetStandard2.cs
Normal file
|
@ -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!");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -38,6 +38,35 @@ namespace Microsoft.DotNet.Cli.Build.Tests
|
||||||
.And.HaveStdOutContaining("Hello World");
|
.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]
|
[Fact]
|
||||||
public void ItRunsWhenRestoringToSpecificPackageDir()
|
public void ItRunsWhenRestoringToSpecificPackageDir()
|
||||||
{
|
{
|
||||||
|
@ -62,7 +91,7 @@ namespace Microsoft.DotNet.Cli.Build.Tests
|
||||||
|
|
||||||
new BuildCommand()
|
new BuildCommand()
|
||||||
.WithWorkingDirectory(rootPath)
|
.WithWorkingDirectory(rootPath)
|
||||||
.Execute()
|
.Execute("--no-restore")
|
||||||
.Should().Pass();
|
.Should().Pass();
|
||||||
|
|
||||||
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
|
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
|
||||||
|
|
|
@ -158,7 +158,7 @@ namespace Microsoft.DotNet.Tools.Pack.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void PackWorksWithLocalProjectJson()
|
public void PackWorksWithLocalProject()
|
||||||
{
|
{
|
||||||
var testInstance = TestAssets.Get("TestAppSimple")
|
var testInstance = TestAssets.Get("TestAppSimple")
|
||||||
.CreateInstance()
|
.CreateInstance()
|
||||||
|
@ -171,6 +171,33 @@ namespace Microsoft.DotNet.Tools.Pack.Tests
|
||||||
.Should().Pass();
|
.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]
|
[Fact]
|
||||||
public void HasServiceableFlagWhenArgumentPassed()
|
public void HasServiceableFlagWhenArgumentPassed()
|
||||||
{
|
{
|
||||||
|
@ -231,7 +258,7 @@ namespace Microsoft.DotNet.Tools.Pack.Tests
|
||||||
|
|
||||||
new PackCommand()
|
new PackCommand()
|
||||||
.WithWorkingDirectory(rootPath)
|
.WithWorkingDirectory(rootPath)
|
||||||
.ExecuteWithCapturedOutput()
|
.ExecuteWithCapturedOutput("--no-restore")
|
||||||
.Should()
|
.Should()
|
||||||
.Pass();
|
.Pass();
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,39 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
|
||||||
.And.HaveStdOutContaining("Hello World");
|
.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]
|
[Fact]
|
||||||
public void ItPublishesARunnableSelfContainedApp()
|
public void ItPublishesARunnableSelfContainedApp()
|
||||||
{
|
{
|
||||||
|
@ -170,7 +203,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
|
||||||
|
|
||||||
new PublishCommand()
|
new PublishCommand()
|
||||||
.WithWorkingDirectory(rootPath)
|
.WithWorkingDirectory(rootPath)
|
||||||
.ExecuteWithCapturedOutput()
|
.ExecuteWithCapturedOutput("--no-restore")
|
||||||
.Should().Pass();
|
.Should().Pass();
|
||||||
|
|
||||||
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
|
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
|
||||||
|
|
|
@ -37,6 +37,40 @@ namespace Microsoft.DotNet.Cli.Run.Tests
|
||||||
.And.HaveStdOutContaining("Hello World!");
|
.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]
|
[Fact]
|
||||||
public void ItBuildsTheProjectBeforeRunning()
|
public void ItBuildsTheProjectBeforeRunning()
|
||||||
{
|
{
|
||||||
|
@ -160,7 +194,7 @@ namespace Microsoft.DotNet.Cli.Run.Tests
|
||||||
|
|
||||||
new RunCommand()
|
new RunCommand()
|
||||||
.WithWorkingDirectory(rootPath)
|
.WithWorkingDirectory(rootPath)
|
||||||
.ExecuteWithCapturedOutput()
|
.ExecuteWithCapturedOutput("--no-restore")
|
||||||
.Should().Pass()
|
.Should().Pass()
|
||||||
.And.HaveStdOutContaining("Hello World");
|
.And.HaveStdOutContaining("Hello World");
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,43 @@ namespace Microsoft.DotNet.Cli.Test.Tests
|
||||||
result.ExitCode.Should().Be(1);
|
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]
|
[Fact]
|
||||||
public void XunitSingleTFM()
|
public void XunitSingleTFM()
|
||||||
{
|
{
|
||||||
|
@ -161,14 +198,14 @@ namespace Microsoft.DotNet.Cli.Test.Tests
|
||||||
|
|
||||||
new BuildCommand()
|
new BuildCommand()
|
||||||
.WithWorkingDirectory(rootPath)
|
.WithWorkingDirectory(rootPath)
|
||||||
.ExecuteWithCapturedOutput()
|
.ExecuteWithCapturedOutput("--no-restore")
|
||||||
.Should()
|
.Should()
|
||||||
.Pass()
|
.Pass()
|
||||||
.And.NotHaveStdErr();
|
.And.NotHaveStdErr();
|
||||||
|
|
||||||
CommandResult result = new DotnetTestCommand()
|
CommandResult result = new DotnetTestCommand()
|
||||||
.WithWorkingDirectory(rootPath)
|
.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("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0.");
|
||||||
result.StdOut.Should().Contain("Passed TestNamespace.VSTestTests.VSTestPassTest");
|
result.StdOut.Should().Contain("Passed TestNamespace.VSTestTests.VSTestPassTest");
|
||||||
|
@ -209,6 +246,7 @@ namespace Microsoft.DotNet.Cli.Test.Tests
|
||||||
.Execute()
|
.Execute()
|
||||||
.Should()
|
.Should()
|
||||||
.Pass();
|
.Pass();
|
||||||
|
|
||||||
return testProjectDirectory;
|
return testProjectDirectory;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue