Merge upstream changes
This commit is contained in:
commit
6b44f8938b
39 changed files with 482 additions and 112 deletions
|
@ -20,7 +20,7 @@
|
|||
DependsOnTargets="MSBuildWorkaroundTarget;
|
||||
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)"/>
|
||||
</Target>
|
||||
|
||||
|
|
|
@ -5,16 +5,16 @@
|
|||
<BackwardsCompatibility110SharedHostVersion>1.1.0</BackwardsCompatibility110SharedHostVersion>
|
||||
<BackwardsCompatibility110HostFxrVersion>1.1.0</BackwardsCompatibility110HostFxrVersion>
|
||||
|
||||
<BackwardsCompatibility110DownloadedSharedHostInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-host-$(ProductMonikerRid).$(BackwardsCompatibility110SharedHostVersion)$(InstallerExtension)</BackwardsCompatibility110DownloadedSharedHostInstallerFileName>
|
||||
<BackwardsCompatibility110DownloadedSharedHostInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(BackwardsCompatibility110DownloadedSharedHostInstallerFileName)</BackwardsCompatibility110DownloadedSharedHostInstallerFile>
|
||||
<BackwardsCompatibility110DownloadedSharedHostInstallerFileName Condition=" '$(OSName)' != 'linux' ">dotnet-host-$(HostMonikerRid).$(BackwardsCompatibility110SharedHostVersion)$(InstallerExtension)</BackwardsCompatibility110DownloadedSharedHostInstallerFileName>
|
||||
<BackwardsCompatibility110DownloadedSharedHostInstallerFile Condition=" '$(OSName)' != 'linux' ">$(PackagesDirectory)/$(BackwardsCompatibility110DownloadedSharedHostInstallerFileName)</BackwardsCompatibility110DownloadedSharedHostInstallerFile>
|
||||
|
||||
<BackwardsCompatibility110DownloadedHostFxrInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-hostfxr-$(ProductMonikerRid).$(BackwardsCompatibility110HostFxrVersion)$(InstallerExtension)</BackwardsCompatibility110DownloadedHostFxrInstallerFileName>
|
||||
<BackwardsCompatibility110DownloadedHostFxrInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(BackwardsCompatibility110DownloadedHostFxrInstallerFileName)</BackwardsCompatibility110DownloadedHostFxrInstallerFile>
|
||||
<BackwardsCompatibility110DownloadedHostFxrInstallerFileName Condition=" '$(OSName)' != 'linux' ">dotnet-hostfxr-$(HostMonikerRid).$(BackwardsCompatibility110HostFxrVersion)$(InstallerExtension)</BackwardsCompatibility110DownloadedHostFxrInstallerFileName>
|
||||
<BackwardsCompatibility110DownloadedHostFxrInstallerFile Condition=" '$(OSName)' != 'linux' ">$(PackagesDirectory)/$(BackwardsCompatibility110DownloadedHostFxrInstallerFileName)</BackwardsCompatibility110DownloadedHostFxrInstallerFile>
|
||||
|
||||
<BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-sharedframework-$(ProductMonikerRid).$(BackwardsCompatibility110SharedFrameworkVersion)$(InstallerExtension)</BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName>
|
||||
<BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName)</BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile>
|
||||
<BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName Condition=" '$(OSName)' != 'linux' ">dotnet-sharedframework-$(HostMonikerRid).$(BackwardsCompatibility110SharedFrameworkVersion)$(InstallerExtension)</BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName>
|
||||
<BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile Condition=" '$(OSName)' != 'linux' ">$(PackagesDirectory)/$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName)</BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile>
|
||||
|
||||
<BackwardsCompatibility110CombinedFrameworkHostCompressedFileName>dotnet-$(ProductMonikerRid).$(BackwardsCompatibility110SharedFrameworkVersion)$(ArchiveExtension)</BackwardsCompatibility110CombinedFrameworkHostCompressedFileName>
|
||||
<BackwardsCompatibility110CombinedFrameworkHostCompressedFileName>dotnet-$(HostMonikerRid).$(BackwardsCompatibility110SharedFrameworkVersion)$(ArchiveExtension)</BackwardsCompatibility110CombinedFrameworkHostCompressedFileName>
|
||||
|
||||
<BackwardsCompatibility110CoreSetupBlobRootUrlWithChannel>$(CoreSetupBlobRootUrl)$(BackwardsCompatibility110CoreSetupChannel)</BackwardsCompatibility110CoreSetupBlobRootUrlWithChannel>
|
||||
<BackwardsCompatibility110SharedFrameworkArchiveBlobRootUrl>$(BackwardsCompatibility110CoreSetupBlobRootUrlWithChannel)/Binaries/$(BackwardsCompatibility110SharedFrameworkVersion)</BackwardsCompatibility110SharedFrameworkArchiveBlobRootUrl>
|
||||
|
@ -34,24 +34,24 @@
|
|||
</_DownloadAndExtractItem>
|
||||
|
||||
<_DownloadAndExtractItem Include="BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile"
|
||||
Condition="!Exists('$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile)') And '$(InstallerExtension)' != ''">
|
||||
Condition="!Exists('$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile)') And '$(OSName)' != 'linux'">
|
||||
<Url>$(BackwardsCompatibility110CoreSetupInstallerBlobRootUrl)/$(BackwardsCompatibility110SharedFrameworkVersion)/$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName)</Url>
|
||||
<DownloadFileName>$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile)</DownloadFileName>
|
||||
<ExtractDestination></ExtractDestination>
|
||||
</_DownloadAndExtractItem>
|
||||
|
||||
<_DownloadAndExtractItem Include="BackwardsCompatibility110DownloadedSharedHostInstallerFile"
|
||||
Condition="!Exists('$(BackwardsCompatibility110DownloadedSharedHostInstallerFile)') And '$(InstallerExtension)' != ''">
|
||||
Condition="!Exists('$(BackwardsCompatibility110DownloadedSharedHostInstallerFile)') And '$(OSName)' != 'linux'">
|
||||
<Url>$(BackwardsCompatibility110CoreSetupInstallerBlobRootUrl)/$(BackwardsCompatibility110SharedHostVersion)/$(BackwardsCompatibility110DownloadedSharedHostInstallerFileName)</Url>
|
||||
<DownloadFileName>$(BackwardsCompatibility110DownloadedSharedHostInstallerFile)</DownloadFileName>
|
||||
<ExtractDestintation></ExtractDestintation>
|
||||
</_DownloadAndExtractItem>
|
||||
|
||||
<_DownloadAndExtractItem Include="BackwardsCompatibility110DownloadedHostFxrInstallerFile"
|
||||
Condition="!Exists('$(BackwardsCompatibility110DownloadedHostFxrInstallerFile)') And '$(InstallerExtension)' != ''">
|
||||
Condition="!Exists('$(BackwardsCompatibility110DownloadedHostFxrInstallerFile)') And '$(OSName)' != 'linux'">
|
||||
<Url>$(BackwardsCompatibility110CoreSetupInstallerBlobRootUrl)/$(BackwardsCompatibility110HostFxrVersion)/$(BackwardsCompatibility110DownloadedHostFxrInstallerFileName)</Url>
|
||||
<DownloadFileName>$(BackwardsCompatibility110DownloadedHostFxrInstallerFile)</DownloadFileName>
|
||||
<ExtractDestintation></ExtractDestintation>
|
||||
</_DownloadAndExtractItem>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -13,14 +13,21 @@
|
|||
'$(Rid)' == 'fedora.24-x64' OR
|
||||
'$(Rid)' == 'opensuse.42.1-x64' ">$(Rid)</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>
|
||||
<ArtifactNameSdkDebug>dotnet-sdk-debug</ArtifactNameSdkDebug>
|
||||
<ArtifactNameCombinedHostHostFxrFrameworkSdk>dotnet-sdk</ArtifactNameCombinedHostHostFxrFrameworkSdk>
|
||||
|
||||
<ArtifactNameWithVersionSdk>$(ArtifactNameSdk)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionSdk>
|
||||
|
||||
|
||||
<ArtifactNameWithVersionSdkDebug>$(ArtifactNameSdkDebug)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionSdkDebug>
|
||||
<ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
|
||||
|
||||
<DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)-$(HostMonikerRid)</DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
@ -9,10 +9,16 @@
|
|||
</GetCurrentRuntimeInformation>
|
||||
|
||||
<PropertyGroup>
|
||||
<Rid Condition=" '$(Rid)' == '' ">$(HostRid)</Rid>
|
||||
<Architecture Condition=" '$(Architecture)' == '' ">x64</Architecture>
|
||||
<OSName Condition=" '$(OSName)' == '' ">$(HostOSName)</OSName>
|
||||
<OSPlatform Condition=" '$(OSPlatform)' == '' ">$(HostOSPlatform)</OSPlatform>
|
||||
<IsLinux Condition = " '$(HostOSName)' != 'win' AND '$(HostOSName)' != 'osx' ">True</IsLinux>
|
||||
<Rid Condition=" '$(Rid)' == '' AND '$(IsLinux)' != 'True' ">$(HostRid)</Rid>
|
||||
<Architecture Condition=" '$(Architecture)' == '' AND '$(IsLinux)' != 'True' ">x64</Architecture>
|
||||
<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>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<CoreSetupRid>$(Rid)</CoreSetupRid>
|
||||
<CoreSetupRid Condition=" '$(OSName)' == 'win' or '$(OSName)' == 'osx' ">$(ProductMonikerRid)</CoreSetupRid>
|
||||
<CoreSetupRid>$(HostRid)</CoreSetupRid>
|
||||
<CoreSetupRid Condition=" '$(HostOSName)' == 'win' or '$(HostOSName)' == 'osx' ">$(HostMonikerRid)</CoreSetupRid>
|
||||
|
||||
<!-- only the runtime OSX .pkgs have a `-internal` suffix -->
|
||||
<InstallerStartSuffix Condition="'$(OSName)' == 'osx'">-internal</InstallerStartSuffix>
|
||||
<InstallerStartSuffix Condition="'$(HostOSName)' == 'osx'">-internal</InstallerStartSuffix>
|
||||
|
||||
<!-- Downloaded Installers + Archives -->
|
||||
<DownloadedSharedHostInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-host$(InstallerStartSuffix)-$(SharedHostVersion)-$(CoreSetupRid)$(InstallerExtension)</DownloadedSharedHostInstallerFileName>
|
||||
|
@ -34,8 +34,8 @@
|
|||
<AspNetCoreRuntimeInstallerBlobRootUrl>$(CoreSetupBlobRootUrl)aspnetcore/store/$(AspNetCoreRuntimeVersion)</AspNetCoreRuntimeInstallerBlobRootUrl>
|
||||
|
||||
<!-- Examples: Build.RS.linux.zip Build.RS.winx86.zip AspNetCorePackageStoreLibx64.wixlib -->
|
||||
<AspNetCoreRuntimeInstallerArchiveFileNameOSToken Condition=" '$(OSName)' == 'win' ">$(OSName)$(Architecture)</AspNetCoreRuntimeInstallerArchiveFileNameOSToken>
|
||||
<AspNetCoreRuntimeInstallerArchiveFileNameOSToken Condition=" '$(OSName)' == 'osx' ">$(OSName)</AspNetCoreRuntimeInstallerArchiveFileNameOSToken>
|
||||
<AspNetCoreRuntimeInstallerArchiveFileNameOSToken Condition=" '$(HostOSName)' == 'win' ">$(HostOSName)$(Architecture)</AspNetCoreRuntimeInstallerArchiveFileNameOSToken>
|
||||
<AspNetCoreRuntimeInstallerArchiveFileNameOSToken Condition=" '$(HostOSName)' == 'osx' ">$(HostOSName)</AspNetCoreRuntimeInstallerArchiveFileNameOSToken>
|
||||
<AspNetCoreRuntimeInstallerArchiveFileNameOSToken Condition=" '$(AspNetCoreRuntimeInstallerArchiveFileNameOSToken)' == '' ">linux</AspNetCoreRuntimeInstallerArchiveFileNameOSToken>
|
||||
|
||||
<AspNetCoreRuntimeStoreSuffix Condition="'$(AspNetCoreRuntimePackageFlavor)' != 'notimestamp'">-$(AspNetCoreCoherenceTimestamp)</AspNetCoreRuntimeStoreSuffix>
|
||||
|
@ -43,7 +43,7 @@
|
|||
<AspNetCoreRuntimeInstallerArchiveFileName>Build.RS.$(AspNetCoreRuntimeInstallerArchiveFileNameOSToken)$(AspNetCoreRuntimeInstallerArchiveSuffix)$(ArchiveExtension)</AspNetCoreRuntimeInstallerArchiveFileName>
|
||||
<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>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<CLI_SharedFrameworkVersion>2.0.0-preview2-25407-01</CLI_SharedFrameworkVersion>
|
||||
<CLI_MSBuild_Version>15.3.0-preview-000246-05</CLI_MSBuild_Version>
|
||||
<CLI_MSBuild_Version>15.3.0-preview-000378-01</CLI_MSBuild_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_FSharp_Version>4.2.0-rc-170602-0</CLI_FSharp_Version>
|
||||
|
@ -11,25 +11,25 @@
|
|||
<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_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>
|
||||
<SharedHostVersion>$(CLI_SharedFrameworkVersion)</SharedHostVersion>
|
||||
<HostFxrVersion>$(CLI_SharedFrameworkVersion)</HostFxrVersion>
|
||||
<TemplateEngineVersion>1.0.0-beta2-20170606-253</TemplateEngineVersion>
|
||||
<TemplateEngineTemplateVersion>1.0.0-beta2-20170606-253</TemplateEngineTemplateVersion>
|
||||
<TemplateEngineTemplate2_0Version>1.0.0-beta2-20170606-253</TemplateEngineTemplate2_0Version>
|
||||
<TemplateEngineVersion>1.0.0-beta2-20170608-254</TemplateEngineVersion>
|
||||
<TemplateEngineTemplateVersion>1.0.0-beta2-20170608-256</TemplateEngineTemplateVersion>
|
||||
<TemplateEngineTemplate2_0Version>1.0.0-beta2-20170608-256</TemplateEngineTemplate2_0Version>
|
||||
<PlatformAbstractionsVersion>2.0.0-preview2-25407-01</PlatformAbstractionsVersion>
|
||||
<DependencyModelVersion>2.0.0-preview2-25407-01</DependencyModelVersion>
|
||||
<CliCommandLineParserVersion>0.1.0-alpha-142</CliCommandLineParserVersion>
|
||||
<CliMigrateVersion>1.2.1-alpha-002130</CliMigrateVersion>
|
||||
<CliMigrateVersion>1.2.1-alpha-002133</CliMigrateVersion>
|
||||
<MicroBuildVersion>0.2.0</MicroBuildVersion>
|
||||
<SpaTemplateVersion>1.0.0-preview-000249</SpaTemplateVersion>
|
||||
<SpaTemplateVersion>1.0.0-preview-000286</SpaTemplateVersion>
|
||||
|
||||
<!-- This should either be timestamped or notimestamp as appropriate -->
|
||||
<AspNetCoreRuntimePackageFlavor>timestamped</AspNetCoreRuntimePackageFlavor>
|
||||
<AspNetCoreRuntimeVersion>2.0.0-preview2-158</AspNetCoreRuntimeVersion>
|
||||
<AspNetCoreRuntimeVersion>2.0.0-preview2-168</AspNetCoreRuntimeVersion>
|
||||
<AspNetCoherenceLabel>preview2</AspNetCoherenceLabel>
|
||||
<AspNetCoreCoherenceTimestamp>25487</AspNetCoreCoherenceTimestamp>
|
||||
<AspNetCoreCoherenceTimestamp>25571</AspNetCoreCoherenceTimestamp>
|
||||
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
|
||||
<ArchiveExtension Condition=" '$(OSName)' == 'win' ">.zip</ArchiveExtension>
|
||||
<ArchiveExtension Condition=" '$(OSName)' != 'win' ">.tar.gz</ArchiveExtension>
|
||||
<ArchiveExtension Condition=" '$(HostOSName)' == 'win' ">.zip</ArchiveExtension>
|
||||
<ArchiveExtension Condition=" '$(HostOSName)' != 'win' ">.tar.gz</ArchiveExtension>
|
||||
|
||||
<InstallerExtension Condition=" '$(OSName)' == 'win' ">.msi</InstallerExtension>
|
||||
<InstallerExtension Condition=" '$(OSName)' == 'osx' ">.pkg</InstallerExtension>
|
||||
<InstallerExtension Condition=" '$(OSName)' == 'ubuntu' OR '$(OSName)' == 'debian' ">.deb</InstallerExtension>
|
||||
<InstallerExtension Condition=" '$(HostOSName)' == 'win' ">.msi</InstallerExtension>
|
||||
<InstallerExtension Condition=" '$(HostOSName)' == 'osx' ">.pkg</InstallerExtension>
|
||||
<InstallerExtension Condition=" '$(HostOSName)' == 'ubuntu' OR '$(OSName)' == 'debian' ">.deb</InstallerExtension>
|
||||
|
||||
<BundleExtension Condition=" '$(OSName)' == 'win' ">.exe</BundleExtension>
|
||||
<BundleExtension Condition=" '$(OSName)' == 'osx' ">$(InstallerExtension)</BundleExtension>
|
||||
<BundleExtension Condition=" '$(OSName)' == 'ubuntu' OR '$(OSName)' == 'debian' ">$(InstallerExtension)</BundleExtension>
|
||||
<BundleExtension Condition=" '$(HostOSName)' == 'win' ">.exe</BundleExtension>
|
||||
<BundleExtension Condition=" '$(HostOSName)' == 'osx' ">$(InstallerExtension)</BundleExtension>
|
||||
<BundleExtension Condition=" '$(HostOSName)' == 'ubuntu' OR '$(OSName)' == 'debian' ">$(InstallerExtension)</BundleExtension>
|
||||
|
||||
<DynamicLibPrefix>lib</DynamicLibPrefix>
|
||||
<DynamicLibPrefix Condition=" '$(OSName)' == 'win' "></DynamicLibPrefix>
|
||||
<DynamicLibPrefix Condition=" '$(HostOSName)' == 'win' "></DynamicLibPrefix>
|
||||
|
||||
<DynamicLibExtension>.so</DynamicLibExtension>
|
||||
<DynamicLibExtension Condition=" '$(OSName)' == 'win' ">.dll</DynamicLibExtension>
|
||||
<DynamicLibExtension Condition=" '$(OSName)' == 'osx' ">.dylib</DynamicLibExtension>
|
||||
<DynamicLibExtension Condition=" '$(HostOSName)' == 'win' ">.dll</DynamicLibExtension>
|
||||
<DynamicLibExtension Condition=" '$(HostOSName)' == 'osx' ">.dylib</DynamicLibExtension>
|
||||
|
||||
<ExeExtension>.exe</ExeExtension>
|
||||
<ExeExtension Condition=" '$(OS)' != 'Windows_NT' "></ExeExtension>
|
||||
|
|
|
@ -10,11 +10,11 @@
|
|||
TestDebuild;
|
||||
BuildSdkDeb;
|
||||
TestSdkDeb;"
|
||||
Condition=" '$(OSName)' == 'ubuntu' OR '$(OSName)' == 'debian' "
|
||||
Condition=" '$(HostOSName)' == 'ubuntu' OR '$(HostOSName)' == 'debian' "
|
||||
Outputs="@(GeneratedInstallers)"/>
|
||||
|
||||
<Target Name="BuildSdkDeb"
|
||||
Condition=" ('$(OSName)' == 'ubuntu' OR '$(OSName)' == 'debian') AND '$(DebuildPresent)' == 'true' "
|
||||
Condition=" ('$(HostOSName)' == 'ubuntu' OR '$(HostOSName)' == 'debian') AND '$(DebuildPresent)' == 'true' "
|
||||
DependsOnTargets="PrepareDotnetDebDirectories;
|
||||
PrepareDotnetDebTool;"
|
||||
Inputs="@(CLISdkFiles)"
|
||||
|
@ -98,7 +98,7 @@
|
|||
</Target>
|
||||
|
||||
<Target Name="TestSdkDeb"
|
||||
Condition=" ('$(OSName)' == 'ubuntu' OR '$(OSName)' == 'debian') and '$(DebuildPresent)' == 'true' "
|
||||
Condition=" ('$(HostOSName)' == 'ubuntu' OR '$(HostOSName)' == 'debian') and '$(DebuildPresent)' == 'true' "
|
||||
Inputs="$(DownloadedSharedHostInstallerFile);
|
||||
$(DownloadedHostFxrInstallerFile);
|
||||
$(DownloadedSharedFrameworkInstallerFile);
|
||||
|
|
|
@ -52,8 +52,7 @@
|
|||
<!-- Output Directories -->
|
||||
<PropertyGroup>
|
||||
<InstallerOutputDirectory>$(PackagesDirectory)</InstallerOutputDirectory>
|
||||
<SdkInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension)</SdkInstallerFile>
|
||||
|
||||
<SdkInstallerFile>$(InstallerOutputDirectory)/$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension)</SdkInstallerFile>
|
||||
<SdkDebianIntermediateDirectory>$(IntermediateDirectory)/debian/sdk</SdkDebianIntermediateDirectory>
|
||||
<DotNetDebToolOutputDirectory>$(SdkDebianIntermediateDirectory)/deb-tool-output</DotNetDebToolOutputDirectory>
|
||||
<DebianTestResultsXmlFile>$(SdkDebianIntermediateDirectory)/debian-testResults.xml</DebianTestResultsXmlFile>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SdkDebianUploadUrl>$(DotnetBlobRootUrl)/$(Product)/$(FullNugetVersion)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension)</SdkDebianUploadUrl>
|
||||
<SdkDebianUploadUrl>$(DotnetBlobRootUrl)/$(Product)/$(FullNugetVersion)/$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension)</SdkDebianUploadUrl>
|
||||
<DebianUploadJsonFile>$(SdkDebianIntermediateDirectory)/package_upload.json</DebianUploadJsonFile>
|
||||
<DebianRevisionNumber>1</DebianRevisionNumber>
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
|||
</DebianUploadJsonContent>
|
||||
</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_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." />
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using Microsoft.Build.Utilities;
|
||||
using Microsoft.Build.Framework;
|
||||
|
||||
|
@ -84,7 +85,8 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
var replacementPattern = ReplacementPatterns[i].ItemSpec;
|
||||
var replacementString = ReplacementStrings[i].ItemSpec;
|
||||
|
||||
outText = outText.Replace(replacementPattern, replacementString);
|
||||
var regex = new Regex(replacementPattern);
|
||||
outText = regex.Replace(outText, replacementString);
|
||||
}
|
||||
|
||||
return outText;
|
||||
|
|
|
@ -80,8 +80,8 @@ $env:VSTEST_TRACE_BUILD=1
|
|||
# install a stage0
|
||||
$dotnetInstallPath = Join-Path $RepoRoot "scripts\obtain\dotnet-install.ps1"
|
||||
|
||||
Write-Output "$dotnetInstallPath -Channel ""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"" -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"""
|
||||
if ($LastExitCode -ne 0)
|
||||
{
|
||||
Write-Output "The .NET CLI installation failed with exit code $LastExitCode"
|
||||
|
|
|
@ -155,7 +155,7 @@ export VSTEST_TRACE_BUILD=1
|
|||
DOTNET_MULTILEVEL_LOOKUP=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=$?
|
||||
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"
|
||||
}
|
||||
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"
|
||||
|
|
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
|
||||
download_link="$azure_feed/Runtime/$specific_version/dotnet-runtime-$specific_version-$osname-$normalized_architecture.tar.gz"
|
||||
else
|
||||
download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$specific_version-$osname-$normalized_architecture.tar.gz"
|
||||
download_link="$azure_feed/Sdk/$specific_version/dotnet-sdk-$specific_version-$osname-$normalized_architecture.tar.gz"
|
||||
fi
|
||||
|
||||
echo "$download_link"
|
||||
|
|
|
@ -520,4 +520,7 @@
|
|||
<data name="ShowHelpDescription" xml:space="preserve">
|
||||
<value>Show help information.</value>
|
||||
</data>
|
||||
<data name="NoRestoreDescription" xml:space="preserve">
|
||||
<value>Does not do an implicit restore when executing the command.</value>
|
||||
</data>
|
||||
</root>
|
|
@ -65,5 +65,11 @@ namespace Microsoft.DotNet.Cli
|
|||
|
||||
public static ArgumentsRule DefaultToCurrentDirectory(this ArgumentsRule rule) =>
|
||||
rule.With(defaultValue: () => PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory()));
|
||||
|
||||
public static Option NoRestoreOption() =>
|
||||
Create.Option(
|
||||
"--no-restore",
|
||||
CommonLocalizableStrings.NoRestoreDescription,
|
||||
Accept.NoArguments());
|
||||
}
|
||||
}
|
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.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.DotNet.Cli.CommandLine;
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.DotNet.Tools.MSBuild;
|
||||
using Microsoft.DotNet.Tools;
|
||||
using Microsoft.DotNet.Cli;
|
||||
using Microsoft.DotNet.Tools.Restore;
|
||||
using Parser = Microsoft.DotNet.Cli.Parser;
|
||||
|
||||
namespace Microsoft.DotNet.Tools.Build
|
||||
{
|
||||
public class BuildCommand : MSBuildForwardingApp
|
||||
public class BuildCommand : RestoringCommand
|
||||
{
|
||||
public BuildCommand(IEnumerable<string> msbuildArgs, string msbuildPath = null)
|
||||
: base(msbuildArgs, msbuildPath)
|
||||
public BuildCommand(IEnumerable<string> msbuildArgs, bool noRestore, string msbuildPath = null)
|
||||
: base(msbuildArgs, noRestore, msbuildPath)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -44,7 +47,9 @@ namespace Microsoft.DotNet.Tools.Build
|
|||
|
||||
msbuildArgs.Add($"/clp:Summary");
|
||||
|
||||
return new BuildCommand(msbuildArgs, msbuildPath);
|
||||
bool noRestore = appliedBuildOptions.HasOption("--no-restore");
|
||||
|
||||
return new BuildCommand(msbuildArgs, noRestore, msbuildPath);
|
||||
}
|
||||
|
||||
public static int Run(string[] args)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.DotNet.Cli.CommandLine;
|
||||
using Microsoft.DotNet.Tools;
|
||||
|
@ -11,7 +12,7 @@ namespace Microsoft.DotNet.Cli
|
|||
internal static class BuildCommandParser
|
||||
{
|
||||
public static Command Build() =>
|
||||
Create.Command(
|
||||
CreateWithRestoreOptions.Command(
|
||||
"build",
|
||||
LocalizableStrings.AppFullName,
|
||||
Accept.ZeroOrMoreArguments()
|
||||
|
@ -37,6 +38,7 @@ namespace Microsoft.DotNet.Cli
|
|||
LocalizableStrings.NoDependenciesOptionDescription,
|
||||
Accept.NoArguments()
|
||||
.ForwardAs("/p:BuildProjectReferences=false")),
|
||||
CommonOptions.NoRestoreOption(),
|
||||
CommonOptions.VerbosityOption());
|
||||
}
|
||||
}
|
|
@ -58,7 +58,7 @@ namespace Microsoft.DotNet.Tools.MSBuild
|
|||
return ret;
|
||||
}
|
||||
|
||||
public int Execute()
|
||||
public virtual int Execute()
|
||||
{
|
||||
return GetProcessStartInfo().Execute();
|
||||
}
|
||||
|
|
|
@ -5,16 +5,17 @@ using System.Collections.Generic;
|
|||
using Microsoft.DotNet.Cli.CommandLine;
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.DotNet.Tools.MSBuild;
|
||||
using Microsoft.DotNet.Tools;
|
||||
using Microsoft.DotNet.Cli;
|
||||
using System.Diagnostics;
|
||||
using Parser = Microsoft.DotNet.Cli.Parser;
|
||||
|
||||
namespace Microsoft.DotNet.Tools.Pack
|
||||
{
|
||||
public class PackCommand : MSBuildForwardingApp
|
||||
public class PackCommand : RestoringCommand
|
||||
{
|
||||
public PackCommand(IEnumerable<string> msbuildArgs, string msbuildPath = null)
|
||||
: base(msbuildArgs, msbuildPath)
|
||||
public PackCommand(IEnumerable<string> msbuildArgs, bool noRestore, string msbuildPath = null)
|
||||
: base(msbuildArgs, noRestore, msbuildPath)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -30,14 +31,16 @@ namespace Microsoft.DotNet.Tools.Pack
|
|||
|
||||
var msbuildArgs = new List<string>()
|
||||
{
|
||||
"/t:pack"
|
||||
"/t:pack"
|
||||
};
|
||||
|
||||
msbuildArgs.AddRange(parsedPack.OptionValuesToBeForwarded());
|
||||
|
||||
msbuildArgs.AddRange(parsedPack.Arguments);
|
||||
|
||||
return new PackCommand(msbuildArgs, msbuildPath);
|
||||
bool noRestore = parsedPack.HasOption("--no-restore");
|
||||
|
||||
return new PackCommand(msbuildArgs, noRestore, msbuildPath);
|
||||
}
|
||||
|
||||
public static int Run(string[] args)
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.DotNet.Cli.CommandLine;
|
||||
using Microsoft.DotNet.Tools;
|
||||
using LocalizableStrings = Microsoft.DotNet.Tools.Pack.LocalizableStrings;
|
||||
|
||||
namespace Microsoft.DotNet.Cli
|
||||
|
@ -10,7 +12,7 @@ namespace Microsoft.DotNet.Cli
|
|||
internal static class PackCommandParser
|
||||
{
|
||||
public static Command Pack() =>
|
||||
Create.Command(
|
||||
CreateWithRestoreOptions.Command(
|
||||
"pack",
|
||||
LocalizableStrings.AppFullName,
|
||||
Accept.ZeroOrMoreArguments(),
|
||||
|
@ -39,6 +41,7 @@ namespace Microsoft.DotNet.Cli
|
|||
"-s|--serviceable",
|
||||
LocalizableStrings.CmdServiceableDescription,
|
||||
Accept.NoArguments().ForwardAs("/p:Serviceable=true")),
|
||||
CommonOptions.NoRestoreOption(),
|
||||
CommonOptions.VerbosityOption());
|
||||
}
|
||||
}
|
|
@ -5,15 +5,16 @@ using System.Collections.Generic;
|
|||
using Microsoft.DotNet.Cli;
|
||||
using Microsoft.DotNet.Cli.CommandLine;
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.DotNet.Tools;
|
||||
using Microsoft.DotNet.Tools.MSBuild;
|
||||
using Parser = Microsoft.DotNet.Cli.Parser;
|
||||
|
||||
namespace Microsoft.DotNet.Tools.Publish
|
||||
{
|
||||
public class PublishCommand : MSBuildForwardingApp
|
||||
public class PublishCommand : RestoringCommand
|
||||
{
|
||||
private PublishCommand(IEnumerable<string> msbuildArgs, string msbuildPath = null)
|
||||
: base(msbuildArgs, msbuildPath)
|
||||
private PublishCommand(IEnumerable<string> msbuildArgs, bool noRestore, string msbuildPath = null)
|
||||
: base(msbuildArgs, noRestore, msbuildPath)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -37,7 +38,9 @@ namespace Microsoft.DotNet.Tools.Publish
|
|||
|
||||
msbuildArgs.AddRange(appliedPublishOption.Arguments);
|
||||
|
||||
return new PublishCommand(msbuildArgs, msbuildPath);
|
||||
bool noRestore = appliedPublishOption.HasOption("--no-restore");
|
||||
|
||||
return new PublishCommand(msbuildArgs, noRestore, msbuildPath);
|
||||
}
|
||||
|
||||
public static int Run(string[] args)
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.DotNet.Cli.CommandLine;
|
||||
using Microsoft.DotNet.Tools;
|
||||
using LocalizableStrings = Microsoft.DotNet.Tools.Publish.LocalizableStrings;
|
||||
|
||||
namespace Microsoft.DotNet.Cli
|
||||
|
@ -10,7 +12,7 @@ namespace Microsoft.DotNet.Cli
|
|||
internal static class PublishCommandParser
|
||||
{
|
||||
public static Command Publish() =>
|
||||
Create.Command(
|
||||
CreateWithRestoreOptions.Command(
|
||||
"publish",
|
||||
LocalizableStrings.AppDescription,
|
||||
Accept.ZeroOrMoreArguments(),
|
||||
|
@ -41,6 +43,7 @@ namespace Microsoft.DotNet.Cli
|
|||
string value = o.Arguments.Any() ? o.Arguments.Single() : "true";
|
||||
return $"/p:SelfContained={value}";
|
||||
})),
|
||||
CommonOptions.NoRestoreOption(),
|
||||
CommonOptions.VerbosityOption());
|
||||
}
|
||||
}
|
|
@ -165,4 +165,7 @@
|
|||
<data name="CmdNoDependenciesOptionDescription" xml:space="preserve">
|
||||
<value>Set this flag to ignore project to project references and only restore the root project.</value>
|
||||
</data>
|
||||
<data name="CmdForceRestoreOptionDescription" xml:space="preserve">
|
||||
<value>Set this flag to force all dependencies to be resolved even if the last restore was successful. This is equivalent to deleting project.assets.json.</value>
|
||||
</data>
|
||||
</root>
|
|
@ -37,7 +37,7 @@ namespace Microsoft.DotNet.Tools.Restore
|
|||
"/t:Restore"
|
||||
};
|
||||
|
||||
if (!parsedRestore.HasOption("verbosity"))
|
||||
if (!HasVerbosityOption(parsedRestore))
|
||||
{
|
||||
msbuildArgs.Add("/ConsoleLoggerParameters:Verbosity=Minimal");
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ namespace Microsoft.DotNet.Tools.Restore
|
|||
msbuildArgs.AddRange(parsedRestore.OptionValuesToBeForwarded());
|
||||
|
||||
msbuildArgs.AddRange(parsedRestore.Arguments);
|
||||
|
||||
|
||||
return new RestoreCommand(msbuildArgs, msbuildPath);
|
||||
}
|
||||
|
||||
|
@ -65,5 +65,12 @@ namespace Microsoft.DotNet.Tools.Restore
|
|||
|
||||
return cmd.Execute();
|
||||
}
|
||||
|
||||
private static bool HasVerbosityOption(AppliedOption parsedRestore)
|
||||
{
|
||||
return parsedRestore.HasOption("verbosity") ||
|
||||
parsedRestore.Arguments.Any(a => a.Contains("/v:")) ||
|
||||
parsedRestore.Arguments.Any(a => a.Contains("/verbosity:"));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.DotNet.Cli.CommandLine;
|
||||
using LocalizableStrings = Microsoft.DotNet.Tools.Restore.LocalizableStrings;
|
||||
|
@ -14,15 +15,41 @@ namespace Microsoft.DotNet.Cli
|
|||
"restore",
|
||||
LocalizableStrings.AppFullName,
|
||||
Accept.ZeroOrMoreArguments(),
|
||||
CommonOptions.HelpOption(),
|
||||
FullRestoreOptions());
|
||||
|
||||
private static Option[] FullRestoreOptions()
|
||||
{
|
||||
var fullRestoreOptions = AddImplicitRestoreOptions(new Option[] { CommonOptions.HelpOption() }, true, true);
|
||||
|
||||
return fullRestoreOptions.Concat(new Option[] { CommonOptions.VerbosityOption() }).ToArray();
|
||||
}
|
||||
|
||||
public static Option[] AddImplicitRestoreOptions(
|
||||
IEnumerable<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(
|
||||
"-s|--source",
|
||||
LocalizableStrings.CmdSourceOptionDescription,
|
||||
useShortOptions ? "-s|--source" : "--source",
|
||||
showHelp ? LocalizableStrings.CmdSourceOptionDescription : string.Empty,
|
||||
Accept.OneOrMoreArguments()
|
||||
.With(name: LocalizableStrings.CmdSourceOption)
|
||||
.ForwardAsSingle(o => $"/p:RestoreSources={string.Join("%3B", o.Arguments)}")),
|
||||
Create.Option(
|
||||
"-r|--runtime",
|
||||
useShortOptions ? "-r|--runtime" : "--runtime" ,
|
||||
LocalizableStrings.CmdRuntimeOptionDescription,
|
||||
Accept.OneOrMoreArguments()
|
||||
.WithSuggestionsFrom(_ => Suggest.RunTimesFromProjectFile())
|
||||
|
@ -30,29 +57,29 @@ namespace Microsoft.DotNet.Cli
|
|||
.ForwardAsSingle(o => $"/p:RuntimeIdentifiers={string.Join("%3B", o.Arguments)}")),
|
||||
Create.Option(
|
||||
"--packages",
|
||||
LocalizableStrings.CmdPackagesOptionDescription,
|
||||
showHelp ? LocalizableStrings.CmdPackagesOptionDescription : string.Empty,
|
||||
Accept.ExactlyOneArgument()
|
||||
.With(name: LocalizableStrings.CmdPackagesOption)
|
||||
.ForwardAsSingle(o => $"/p:RestorePackagesPath={o.Arguments.Single()}")),
|
||||
Create.Option(
|
||||
"--disable-parallel",
|
||||
LocalizableStrings.CmdDisableParallelOptionDescription,
|
||||
showHelp ? LocalizableStrings.CmdDisableParallelOptionDescription : string.Empty,
|
||||
Accept.NoArguments()
|
||||
.ForwardAs("/p:RestoreDisableParallel=true")),
|
||||
Create.Option(
|
||||
"--configfile",
|
||||
LocalizableStrings.CmdConfigFileOptionDescription,
|
||||
showHelp ? LocalizableStrings.CmdConfigFileOptionDescription : string.Empty,
|
||||
Accept.ExactlyOneArgument()
|
||||
.With(name: LocalizableStrings.CmdConfigFileOption)
|
||||
.ForwardAsSingle(o => $"/p:RestoreConfigFile={o.Arguments.Single()}")),
|
||||
Create.Option(
|
||||
"--no-cache",
|
||||
LocalizableStrings.CmdNoCacheOptionDescription,
|
||||
showHelp ? LocalizableStrings.CmdNoCacheOptionDescription : string.Empty,
|
||||
Accept.NoArguments()
|
||||
.ForwardAs("/p:RestoreNoCache=true")),
|
||||
Create.Option(
|
||||
"--ignore-failed-sources",
|
||||
LocalizableStrings.CmdIgnoreFailedSourcesOptionDescription,
|
||||
showHelp ? LocalizableStrings.CmdIgnoreFailedSourcesOptionDescription : string.Empty,
|
||||
Accept.NoArguments()
|
||||
.ForwardAs("/p:RestoreIgnoreFailedSources=true")),
|
||||
Create.Option(
|
||||
|
@ -60,6 +87,12 @@ namespace Microsoft.DotNet.Cli
|
|||
LocalizableStrings.CmdNoDependenciesOptionDescription,
|
||||
Accept.NoArguments()
|
||||
.ForwardAs("/p:RestoreRecursive=false")),
|
||||
CommonOptions.VerbosityOption());
|
||||
Create.Option(
|
||||
useShortOptions ? "-f|--force" : "--force",
|
||||
LocalizableStrings.CmdForceRestoreOptionDescription,
|
||||
Accept.NoArguments()
|
||||
.ForwardAs("/p:RestoreForce=true"))
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using Microsoft.Build.Evaluation;
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.DotNet.Tools;
|
||||
using Microsoft.DotNet.Tools.MSBuild;
|
||||
using Microsoft.DotNet.Tools.Run.LaunchSettings;
|
||||
|
||||
|
@ -19,6 +20,8 @@ namespace Microsoft.DotNet.Tools.Run
|
|||
public bool NoBuild { get; private set; }
|
||||
public string Project { 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 bool ShouldBuild => !NoBuild;
|
||||
|
@ -55,6 +58,8 @@ namespace Microsoft.DotNet.Tools.Run
|
|||
string project,
|
||||
string launchProfile,
|
||||
bool noLaunchProfile,
|
||||
bool noRestore,
|
||||
IEnumerable<string> restoreArgs,
|
||||
IReadOnlyCollection<string> args)
|
||||
{
|
||||
Configuration = configuration;
|
||||
|
@ -64,6 +69,8 @@ namespace Microsoft.DotNet.Tools.Run
|
|||
LaunchProfile = launchProfile;
|
||||
NoLaunchProfile = noLaunchProfile;
|
||||
Args = args;
|
||||
RestoreArgs = restoreArgs;
|
||||
NoRestore = noRestore;
|
||||
}
|
||||
|
||||
public RunCommand MakeNewWithReplaced(string configuration = null,
|
||||
|
@ -72,6 +79,8 @@ namespace Microsoft.DotNet.Tools.Run
|
|||
string project = null,
|
||||
string launchProfile = null,
|
||||
bool? noLaunchProfile = null,
|
||||
bool? noRestore = null,
|
||||
IEnumerable<string> restoreArgs = null,
|
||||
IReadOnlyCollection<string> args = null)
|
||||
{
|
||||
return new RunCommand(
|
||||
|
@ -81,6 +90,8 @@ namespace Microsoft.DotNet.Tools.Run
|
|||
project ?? this.Project,
|
||||
launchProfile ?? this.LaunchProfile,
|
||||
noLaunchProfile ?? this.NoLaunchProfile,
|
||||
noRestore ?? this.NoRestore,
|
||||
restoreArgs ?? this.RestoreArgs,
|
||||
args ?? this.Args
|
||||
);
|
||||
}
|
||||
|
@ -132,18 +143,9 @@ namespace Microsoft.DotNet.Tools.Run
|
|||
buildArgs.Add("/nologo");
|
||||
buildArgs.Add("/verbosity:quiet");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(Configuration))
|
||||
{
|
||||
buildArgs.Add($"/p:Configuration={Configuration}");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(Framework))
|
||||
{
|
||||
buildArgs.Add($"/p:TargetFramework={Framework}");
|
||||
}
|
||||
|
||||
var buildResult = new MSBuildForwardingApp(buildArgs).Execute();
|
||||
buildArgs.AddRange(RestoreArgs);
|
||||
|
||||
var buildResult = new RestoringCommand(buildArgs, NoRestore).Execute();
|
||||
if (buildResult != 0)
|
||||
{
|
||||
Reporter.Error.WriteLine();
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.DotNet.Cli.CommandLine;
|
||||
using Microsoft.DotNet.Tools;
|
||||
using Microsoft.DotNet.Tools.Run;
|
||||
using LocalizableStrings = Microsoft.DotNet.Tools.Run.LocalizableStrings;
|
||||
|
||||
|
@ -10,7 +13,7 @@ namespace Microsoft.DotNet.Cli
|
|||
internal static class RunCommandParser
|
||||
{
|
||||
public static Command Run() =>
|
||||
Create.Command(
|
||||
CreateWithRestoreOptions.Command(
|
||||
"run",
|
||||
LocalizableStrings.AppFullName,
|
||||
treatUnmatchedTokensAsErrors: false,
|
||||
|
@ -23,6 +26,8 @@ namespace Microsoft.DotNet.Cli
|
|||
project: o.SingleArgumentOrDefault("--project"),
|
||||
launchProfile: o.SingleArgumentOrDefault("--launch-profile"),
|
||||
noLaunchProfile: o.HasOption("--no-launch-profile"),
|
||||
noRestore: o.HasOption("--no-restore"),
|
||||
restoreArgs: o.OptionValuesToBeForwarded(),
|
||||
args: o.Arguments
|
||||
)),
|
||||
options: new[]
|
||||
|
@ -45,7 +50,8 @@ namespace Microsoft.DotNet.Cli
|
|||
Create.Option(
|
||||
"--no-build",
|
||||
LocalizableStrings.CommandOptionNoBuildDescription,
|
||||
Accept.NoArguments())
|
||||
Accept.NoArguments()),
|
||||
CommonOptions.NoRestoreOption()
|
||||
});
|
||||
}
|
||||
}
|
|
@ -14,10 +14,10 @@ using Parser = Microsoft.DotNet.Cli.Parser;
|
|||
|
||||
namespace Microsoft.DotNet.Tools.Test
|
||||
{
|
||||
public class TestCommand : MSBuildForwardingApp
|
||||
public class TestCommand : RestoringCommand
|
||||
{
|
||||
public TestCommand(IEnumerable<string> msbuildArgs, string msbuildPath = null)
|
||||
: base(msbuildArgs, msbuildPath)
|
||||
public TestCommand(IEnumerable<string> msbuildArgs, bool noRestore, string msbuildPath = null)
|
||||
: 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)
|
||||
|
|
|
@ -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.Linq;
|
||||
using Microsoft.DotNet.Cli.CommandLine;
|
||||
using Microsoft.DotNet.Tools;
|
||||
using LocalizableStrings = Microsoft.DotNet.Tools.Test.LocalizableStrings;
|
||||
|
||||
namespace Microsoft.DotNet.Cli
|
||||
|
@ -44,10 +48,10 @@ namespace Microsoft.DotNet.Cli
|
|||
LocalizableStrings.CmdLoggerDescription,
|
||||
Accept.ExactlyOneArgument()
|
||||
.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}";
|
||||
})),
|
||||
CommonOptions.ConfigurationOption(),
|
||||
|
@ -81,6 +85,7 @@ namespace Microsoft.DotNet.Cli
|
|||
Accept.OneOrMoreArguments()
|
||||
.With(name: LocalizableStrings.cmdCollectFriendlyName)
|
||||
.ForwardAsSingle(o => $"/p:VSTestCollect=\"{string.Join(";", o.Arguments)}\"")),
|
||||
CommonOptions.NoRestoreOption(),
|
||||
CommonOptions.VerbosityOption());
|
||||
|
||||
private static string GetSemiColonEsacpedstring(string arg)
|
||||
|
|
|
@ -275,4 +275,18 @@
|
|||
<Copy SourceFiles="@(Stage2Cli)"
|
||||
DestinationFiles="@(Stage2Cli->'$(Stage2WithBackwardsCompatibleRuntimesOutputDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
</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>
|
||||
|
|
|
@ -38,6 +38,35 @@ namespace Microsoft.DotNet.Cli.Build.Tests
|
|||
.And.HaveStdOutContaining("Hello World");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItImplicitlyRestoresAProjectWhenBuilding()
|
||||
{
|
||||
var testAppName = "MSBuildTestApp";
|
||||
var testInstance = TestAssets.Get(testAppName)
|
||||
.CreateInstance(testAppName)
|
||||
.WithSourceFiles();
|
||||
|
||||
new BuildCommand()
|
||||
.WithWorkingDirectory(testInstance.Root)
|
||||
.Execute()
|
||||
.Should().Pass();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItDoesNotImplicitlyRestoreAProjectWhenBuildingWithTheNoRestoreOption()
|
||||
{
|
||||
var testAppName = "MSBuildTestApp";
|
||||
var testInstance = TestAssets.Get(testAppName)
|
||||
.CreateInstance(testAppName)
|
||||
.WithSourceFiles();
|
||||
|
||||
new BuildCommand()
|
||||
.WithWorkingDirectory(testInstance.Root)
|
||||
.ExecuteWithCapturedOutput("--no-restore")
|
||||
.Should().Fail()
|
||||
.And.HaveStdOutContaining("project.assets.json' not found.");;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItRunsWhenRestoringToSpecificPackageDir()
|
||||
{
|
||||
|
@ -62,7 +91,7 @@ namespace Microsoft.DotNet.Cli.Build.Tests
|
|||
|
||||
new BuildCommand()
|
||||
.WithWorkingDirectory(rootPath)
|
||||
.Execute()
|
||||
.Execute("--no-restore")
|
||||
.Should().Pass();
|
||||
|
||||
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
|
||||
|
|
|
@ -158,7 +158,7 @@ namespace Microsoft.DotNet.Tools.Pack.Tests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void PackWorksWithLocalProjectJson()
|
||||
public void PackWorksWithLocalProject()
|
||||
{
|
||||
var testInstance = TestAssets.Get("TestAppSimple")
|
||||
.CreateInstance()
|
||||
|
@ -171,6 +171,33 @@ namespace Microsoft.DotNet.Tools.Pack.Tests
|
|||
.Should().Pass();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItImplicitlyRestoresAProjectWhenPackaging()
|
||||
{
|
||||
var testInstance = TestAssets.Get("TestAppSimple")
|
||||
.CreateInstance()
|
||||
.WithSourceFiles();
|
||||
|
||||
new PackCommand()
|
||||
.WithWorkingDirectory(testInstance.Root)
|
||||
.Execute()
|
||||
.Should().Pass();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItDoesNotImplicitlyRestoreAProjectWhenPackagingWithTheNoRestoreOption()
|
||||
{
|
||||
var testInstance = TestAssets.Get("TestAppSimple")
|
||||
.CreateInstance()
|
||||
.WithSourceFiles();
|
||||
|
||||
new PackCommand()
|
||||
.WithWorkingDirectory(testInstance.Root)
|
||||
.ExecuteWithCapturedOutput("--no-restore")
|
||||
.Should().Fail()
|
||||
.And.HaveStdOutContaining("project.assets.json' not found.");;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HasServiceableFlagWhenArgumentPassed()
|
||||
{
|
||||
|
@ -231,7 +258,7 @@ namespace Microsoft.DotNet.Tools.Pack.Tests
|
|||
|
||||
new PackCommand()
|
||||
.WithWorkingDirectory(rootPath)
|
||||
.ExecuteWithCapturedOutput()
|
||||
.ExecuteWithCapturedOutput("--no-restore")
|
||||
.Should()
|
||||
.Pass();
|
||||
|
||||
|
|
|
@ -44,6 +44,39 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
|
|||
.And.HaveStdOutContaining("Hello World");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItImplicitlyRestoresAProjectWhenPublishing()
|
||||
{
|
||||
var testAppName = "MSBuildTestApp";
|
||||
var testInstance = TestAssets.Get(testAppName)
|
||||
.CreateInstance()
|
||||
.WithSourceFiles();
|
||||
|
||||
var testProjectDirectory = testInstance.Root.FullName;
|
||||
|
||||
new PublishCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.Execute("--framework netcoreapp2.0")
|
||||
.Should().Pass();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItDoesNotImplicitlyRestoreAProjectWhenPublishingWithTheNoRestoreOption()
|
||||
{
|
||||
var testAppName = "MSBuildTestApp";
|
||||
var testInstance = TestAssets.Get(testAppName)
|
||||
.CreateInstance()
|
||||
.WithSourceFiles();
|
||||
|
||||
var testProjectDirectory = testInstance.Root.FullName;
|
||||
|
||||
new PublishCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput("--framework netcoreapp2.0 --no-restore")
|
||||
.Should().Fail()
|
||||
.And.HaveStdOutContaining("project.assets.json' not found.");;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItPublishesARunnableSelfContainedApp()
|
||||
{
|
||||
|
@ -170,7 +203,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
|
|||
|
||||
new PublishCommand()
|
||||
.WithWorkingDirectory(rootPath)
|
||||
.ExecuteWithCapturedOutput()
|
||||
.ExecuteWithCapturedOutput("--no-restore")
|
||||
.Should().Pass();
|
||||
|
||||
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
|
||||
|
|
|
@ -37,6 +37,40 @@ namespace Microsoft.DotNet.Cli.Run.Tests
|
|||
.And.HaveStdOutContaining("Hello World!");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItImplicitlyRestoresAProjectWhenRunning()
|
||||
{
|
||||
var testAppName = "MSBuildTestApp";
|
||||
var testInstance = TestAssets.Get(testAppName)
|
||||
.CreateInstance()
|
||||
.WithSourceFiles();
|
||||
|
||||
var testProjectDirectory = testInstance.Root.FullName;
|
||||
|
||||
new RunCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput()
|
||||
.Should().Pass()
|
||||
.And.HaveStdOutContaining("Hello World!");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItDoesNotImplicitlyRestoreAProjectWhenRunningWithTheNoRestoreOption()
|
||||
{
|
||||
var testAppName = "MSBuildTestApp";
|
||||
var testInstance = TestAssets.Get(testAppName)
|
||||
.CreateInstance()
|
||||
.WithSourceFiles();
|
||||
|
||||
var testProjectDirectory = testInstance.Root.FullName;
|
||||
|
||||
new RunCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput("--no-restore")
|
||||
.Should().Fail()
|
||||
.And.HaveStdOutContaining("project.assets.json' not found.");;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItBuildsTheProjectBeforeRunning()
|
||||
{
|
||||
|
@ -160,7 +194,7 @@ namespace Microsoft.DotNet.Cli.Run.Tests
|
|||
|
||||
new RunCommand()
|
||||
.WithWorkingDirectory(rootPath)
|
||||
.ExecuteWithCapturedOutput()
|
||||
.ExecuteWithCapturedOutput("--no-restore")
|
||||
.Should().Pass()
|
||||
.And.HaveStdOutContaining("Hello World");
|
||||
}
|
||||
|
|
|
@ -31,6 +31,43 @@ namespace Microsoft.DotNet.Cli.Test.Tests
|
|||
result.ExitCode.Should().Be(1);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItImplicitlyRestoresAProjectWhenTesting()
|
||||
{
|
||||
string testAppName = "VSTestCore";
|
||||
var testInstance = TestAssets.Get(testAppName)
|
||||
.CreateInstance()
|
||||
.WithSourceFiles();
|
||||
|
||||
var testProjectDirectory = testInstance.Root.FullName;
|
||||
|
||||
CommandResult result = new DotnetTestCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput(TestBase.ConsoleLoggerOutputNormal);
|
||||
|
||||
result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0.");
|
||||
result.StdOut.Should().Contain("Passed TestNamespace.VSTestTests.VSTestPassTest");
|
||||
result.StdOut.Should().Contain("Failed TestNamespace.VSTestTests.VSTestFailTest");
|
||||
result.ExitCode.Should().Be(1);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItDoesNotImplicitlyRestoreAProjectWhenTestingWithTheNoRestoreOption()
|
||||
{
|
||||
string testAppName = "VSTestCore";
|
||||
var testInstance = TestAssets.Get(testAppName)
|
||||
.CreateInstance()
|
||||
.WithSourceFiles();
|
||||
|
||||
var testProjectDirectory = testInstance.Root.FullName;
|
||||
|
||||
new DotnetTestCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput($"{TestBase.ConsoleLoggerOutputNormal} --no-restore")
|
||||
.Should().Fail()
|
||||
.And.HaveStdOutContaining("project.assets.json' not found.");;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void XunitSingleTFM()
|
||||
{
|
||||
|
@ -161,14 +198,14 @@ namespace Microsoft.DotNet.Cli.Test.Tests
|
|||
|
||||
new BuildCommand()
|
||||
.WithWorkingDirectory(rootPath)
|
||||
.ExecuteWithCapturedOutput()
|
||||
.ExecuteWithCapturedOutput("--no-restore")
|
||||
.Should()
|
||||
.Pass()
|
||||
.And.NotHaveStdErr();
|
||||
|
||||
CommandResult result = new DotnetTestCommand()
|
||||
.WithWorkingDirectory(rootPath)
|
||||
.ExecuteWithCapturedOutput(TestBase.ConsoleLoggerOutputNormal);
|
||||
.ExecuteWithCapturedOutput($"{TestBase.ConsoleLoggerOutputNormal} --no-restore");
|
||||
|
||||
result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0.");
|
||||
result.StdOut.Should().Contain("Passed TestNamespace.VSTestTests.VSTestPassTest");
|
||||
|
@ -209,6 +246,7 @@ namespace Microsoft.DotNet.Cli.Test.Tests
|
|||
.Execute()
|
||||
.Should()
|
||||
.Pass();
|
||||
|
||||
return testProjectDirectory;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue