Merge remote-tracking branch 'dotnet/release/2.0.0' into merges/release/2.0.0-to-master-20170627-070029
* dotnet/release/2.0.0: (27 commits) Updating the runtime to pick up the satellite assembly host fix. Fixing some merges from release/2.0.0-preview2. Create the Dotnet User Profile folder when running the first experience, if the folder does not exist, if will fail the first run because it will fail to create the first notice sentinel. Add F# and Roslyn satellites Fix tests expecting unlocalized messages from dotnet/sdk Generating a layout folder with the satellite assemblies only which we use to generate a language pack tarball/zip. Initially, I wanted a IncludeOnlyFilter, but couldn't quite get that to work on tar, just passing the filter in the command line didn't work because the shell does not do recursive globbing. So, I opted for the layout folder. Update SPA templates version to 1.0.0-preview-000321 Fix dotnet/sdk#1364 Add rhel and Debian download link Exclude satellite assemblies from archive. Remove failed workaround for Microsoft.Composition warning Update templates to add missing BrowserLink package Update to SetupCrossgen 215 - Coherence 25794 Update templates to suppress the warning for Microsoft.Composition and AssetTargetFallback Add explicit dependency for pakcage smoke test Update templates to remove the package NETStandard.Library.NETFramework Update F# compiler to latest Update to SetupCrossgen 213 - Coherence 25769 Pinning to the dotnet-install to version '2.0.0-preview2-006470' Updating branch/channel information. ...
This commit is contained in:
commit
a5aba4929a
16 changed files with 239 additions and 26 deletions
|
@ -4,6 +4,7 @@
|
|||
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
|
||||
<clear />
|
||||
<add key="templating" value="https://dotnet.myget.org/F/templating/api/v3/index.json" />
|
||||
<add key="preview2-verification-feed" value="https://dotnet.myget.org/F/dotnet-2-0-0-preview2-final/api/v3/index.json" />
|
||||
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
|
||||
<add key="aspnet-final" value="https://dotnet.myget.org/F/aspnetcore-2-0-0-preview1-no-timestamp/api/v3/index.json" />
|
||||
<add key="aspnet-release" value="https://dotnet.myget.org/F/aspnetcore-release/api/v3/index.json" />
|
||||
|
|
10
README.md
10
README.md
|
@ -14,7 +14,7 @@ If you are looking for the v1.0.1 release of the .NET Core tools (CLI, MSBuild a
|
|||
|
||||
Found an issue?
|
||||
---------------
|
||||
You can consult the [known issues page](https://github.com/dotnet/core/blob/master/cli/known-issues.md) to find out the current issues and to see the workarounds.
|
||||
You can consult the [Documents Index](Documentation/README.md) to find out the current issues and to see the workarounds.
|
||||
|
||||
If you don't find your issue, please file one! However, given that this is a very high-frequency repo, we've setup some [basic guidelines](Documentation/project-docs/issue-filing-guide.md) to help you. Please consult those first.
|
||||
|
||||
|
@ -115,11 +115,11 @@ In order to download just the .NET Core runtime without the SDK, please visit ht
|
|||
[ubuntu-16.10-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-ubuntu.16.10-x64.deb
|
||||
[ubuntu-16.10-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-ubuntu.16.10-x64.deb.sha
|
||||
|
||||
[debian-8-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-sdk-latest-debian-x64.deb
|
||||
[debian-8-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-sdk-latest-debian-x64.deb.sha
|
||||
[debian-8-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-debian-x64.deb
|
||||
[debian-8-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-debian-x64.deb.sha
|
||||
|
||||
[rhel-7-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-sdk-latest-rhel-x64.rpm
|
||||
[rhel-7-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-sdk-latest-rhel-x64.rpm.sha
|
||||
[rhel-7-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-rhel-x64.rpm
|
||||
[rhel-7-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-rhel-x64.rpm.sha
|
||||
|
||||
# Debian daily feed
|
||||
|
||||
|
|
|
@ -22,12 +22,14 @@
|
|||
<ArtifactNameSdk>dotnet-sdk-internal</ArtifactNameSdk>
|
||||
<ArtifactNameSdkDebug>dotnet-sdk-debug</ArtifactNameSdkDebug>
|
||||
<ArtifactNameCombinedHostHostFxrFrameworkSdk>dotnet-sdk</ArtifactNameCombinedHostHostFxrFrameworkSdk>
|
||||
<ArtifactNameSdkLanguagePack>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)-langpack</ArtifactNameSdkLanguagePack>
|
||||
|
||||
<ArtifactNameWithVersionSdk>$(ArtifactNameSdk)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionSdk>
|
||||
|
||||
|
||||
<ArtifactNameWithVersionSdkDebug>$(ArtifactNameSdkDebug)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionSdkDebug>
|
||||
<ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
|
||||
<ArtifactNameWithVersionSdkLanguagePack>$(ArtifactNameSdkLanguagePack)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionSdkLanguagePack>
|
||||
<DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)-$(HostMonikerRid)</DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<CLI_SharedFrameworkVersion>2.0.0-preview3-25419-01</CLI_SharedFrameworkVersion>
|
||||
<CLI_SharedFrameworkVersion>2.0.0-preview3-25426-01</CLI_SharedFrameworkVersion>
|
||||
<CLI_MSBuild_Version>15.3.0-preview-000400-01</CLI_MSBuild_Version>
|
||||
<CLI_Roslyn_Version>2.3.0-beta3-61816-04</CLI_Roslyn_Version>
|
||||
<CLI_Roslyn_Satellites_Version>2.3.0-pre-20170624-6</CLI_Roslyn_Satellites_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-170621-0</CLI_FSharp_Version>
|
||||
<CLI_FSharp_Satellites_Version>4.4.1-pre-20170624-6</CLI_FSharp_Satellites_Version>
|
||||
|
||||
<!-- We'll usually want to keep these versions in sync, but we may want to diverge in some
|
||||
cases, so use separate properties but derive one from the other unless we want to
|
||||
|
@ -20,22 +22,22 @@
|
|||
<SharedFrameworkVersion>$(CLI_SharedFrameworkVersion)</SharedFrameworkVersion>
|
||||
<SharedHostVersion>$(CLI_SharedFrameworkVersion)</SharedHostVersion>
|
||||
<HostFxrVersion>$(CLI_SharedFrameworkVersion)</HostFxrVersion>
|
||||
<TemplateEngineVersion>1.0.0-beta2-20170608-254</TemplateEngineVersion>
|
||||
<TemplateEngineTemplateVersion>1.0.0-beta2-20170612-258</TemplateEngineTemplateVersion>
|
||||
<TemplateEngineTemplate2_0Version>1.0.0-beta2-20170612-258</TemplateEngineTemplate2_0Version>
|
||||
<PlatformAbstractionsVersion>2.0.0-preview3-25419-01</PlatformAbstractionsVersion>
|
||||
<DependencyModelVersion>2.0.0-preview3-25419-01</DependencyModelVersion>
|
||||
<TemplateEngineVersion>1.0.0-beta2-20170614-260</TemplateEngineVersion>
|
||||
<TemplateEngineTemplateVersion>1.0.0-beta2-20170620-266</TemplateEngineTemplateVersion>
|
||||
<TemplateEngineTemplate2_0Version>1.0.0-beta2-20170620-266</TemplateEngineTemplate2_0Version>
|
||||
<PlatformAbstractionsVersion>2.0.0-preview3-25426-01</PlatformAbstractionsVersion>
|
||||
<DependencyModelVersion>2.0.0-preview3-25426-01</DependencyModelVersion>
|
||||
<CliCommandLineParserVersion>0.1.0-alpha-142</CliCommandLineParserVersion>
|
||||
<CliMigrateVersion>1.2.1-alpha-002133</CliMigrateVersion>
|
||||
<MicroBuildVersion>0.2.0</MicroBuildVersion>
|
||||
<SpaTemplateVersion>1.0.0-preview-000297</SpaTemplateVersion>
|
||||
<SpaTemplateVersion>1.0.0-preview-000321</SpaTemplateVersion>
|
||||
<XliffTasksVersion>0.2.0-beta-000042</XliffTasksVersion>
|
||||
|
||||
<!-- This should either be timestamped or notimestamp as appropriate -->
|
||||
<AspNetCoreRuntimePackageFlavor>timestamped</AspNetCoreRuntimePackageFlavor>
|
||||
<AspNetCoreRuntimeVersion>2.0.0-preview2-186</AspNetCoreRuntimeVersion>
|
||||
<AspNetCoreRuntimePackageFlavor>notimestamp</AspNetCoreRuntimePackageFlavor>
|
||||
<AspNetCoreRuntimeVersion>2.0.0-preview2-215</AspNetCoreRuntimeVersion>
|
||||
<AspNetCoherenceLabel>preview2</AspNetCoherenceLabel>
|
||||
<AspNetCoreCoherenceTimestamp>25661</AspNetCoreCoherenceTimestamp>
|
||||
<AspNetCoreCoherenceTimestamp>25794</AspNetCoreCoherenceTimestamp>
|
||||
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -20,13 +20,15 @@
|
|||
Condition=" '$(OSName)' == 'win' "
|
||||
SourceDirectory="%(GenerateArchivesInputsOutputs.InputDirectory)"
|
||||
DestinationArchive="$(GenerateArchivesDestinationArchive)"
|
||||
OverwriteDestination="true"/>
|
||||
OverwriteDestination="true"
|
||||
ExcludePatterns="%(GenerateArchivesInputsOutputs.ExcludePatterns)" />
|
||||
|
||||
<TarGzFileCreateFromDirectory
|
||||
Condition=" '$(OSName)' != 'win' "
|
||||
SourceDirectory="%(GenerateArchivesInputsOutputs.InputDirectory)"
|
||||
DestinationArchive="$(GenerateArchivesDestinationArchive)"
|
||||
OverwriteDestination="true"/>
|
||||
OverwriteDestination="true"
|
||||
ExcludePatterns="%(GenerateArchivesInputsOutputs.ExcludePatterns)" />
|
||||
|
||||
<ItemGroup>
|
||||
<Archives Include="$(GenerateArchivesDestinationArchive)" />
|
||||
|
@ -42,6 +44,7 @@
|
|||
<Outputs>$(ArchiveOutputDirectory)/%(LayoutDefinition.NameWithVersion)$(ArchiveExtension)</Outputs>
|
||||
<InputDirectory>$(LayoutDirectory)/%(LayoutDefinition.Name)</InputDirectory>
|
||||
<OutFileName>%(LayoutDefinition.NameWithVersion)</OutFileName>
|
||||
<ExcludePatterns>%(LayoutDefinition.ExcludePatterns)</ExcludePatterns>
|
||||
</GenerateArchivesInputsOutputs>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
<PropertyGroup>
|
||||
<SdkDebugLayoutOutputDirectory>$(LayoutDirectory)/$(ArtifactNameSdkDebug)</SdkDebugLayoutOutputDirectory>
|
||||
<CombinedHostHostFxrFrameworkSdkOutputDirectory>$(LayoutDirectory)/$(ArtifactNameCombinedHostHostFxrFrameworkSdk)</CombinedHostHostFxrFrameworkSdkOutputDirectory>
|
||||
<SdkLanguagePackOutputDirectory>$(LayoutDirectory)/$(ArtifactNameSdkLanguagePack)</SdkLanguagePackOutputDirectory>
|
||||
<SatelliteAssemblies>*.resources.dll</SatelliteAssemblies>
|
||||
<WindowsSatelliteAssembliesRegEx>.*.resources.dll</WindowsSatelliteAssembliesRegEx>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target DependsOnTargets="Init" Name="SetupLayoutInputsOutputs" >
|
||||
|
@ -11,6 +14,7 @@
|
|||
<SdkLayoutInput Include="$(OutputDirectory)/sdk/**/*" />
|
||||
<SdkDebugLayoutInput Include="$(SymbolsDirectory)/sdk/**/*" />
|
||||
<CombinedHostHostFxrFrameworkSdkInput Include="$(OutputDirectory)/**/*" />
|
||||
<SdkLanguagePackInput Include="$(OutputDirectory)/sdk/**/$(SatelliteAssemblies)" />
|
||||
|
||||
<AspNetRuntimeFilesInput Include="$(AspNetRuntimePackageStorePublishDirectory)/**/*" />
|
||||
</ItemGroup>
|
||||
|
@ -30,6 +34,11 @@
|
|||
Path2="%(CombinedHostHostFxrFrameworkSdkInput.Identity)" >
|
||||
<Output TaskParameter="RelativePath" ItemName="CombinedHostHostFxrFrameworkSdkRelativeOutputFiles" />
|
||||
</MakeRelative>
|
||||
<MakeRelative
|
||||
Path1="$(OutputDirectory)/"
|
||||
Path2="%(SdkLanguagePackInput.Identity)" >
|
||||
<Output TaskParameter="RelativePath" ItemName="SdkLanguagePackRelativeOutputFiles" />
|
||||
</MakeRelative>
|
||||
|
||||
<!-- Set up Items Defining Layouts for easy change -->
|
||||
<ItemGroup>
|
||||
|
@ -52,6 +61,15 @@
|
|||
<OutputFiles>@(CombinedHostHostFxrFrameworkSdkRelativeOutputFiles -> '$(CombinedHostHostFxrFrameworkSdkOutputDirectory)/%(Identity)')</OutputFiles>
|
||||
<NameWithVersion>$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)</NameWithVersion>
|
||||
<Name>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)</Name>
|
||||
<ExcludePatterns Condition=" '$(OSName)' == 'win' ">$(WindowsSatelliteAssembliesRegEx)</ExcludePatterns>
|
||||
<ExcludePatterns Condition=" '$(OSName)' != 'win' ">$(SatelliteAssemblies)</ExcludePatterns>
|
||||
</LayoutDefinition>
|
||||
|
||||
<LayoutDefinition Include="SdkLanguagePack">
|
||||
<InputFiles>@(SdkLanguagePackInput)</InputFiles>
|
||||
<OutputFiles>@(SdkLanguagePackRelativeOutputFiles -> '$(SdkLanguagePackOutputDirectory)/%(Identity)')</OutputFiles>
|
||||
<NameWithVersion>$(ArtifactNameWithVersionSdkLanguagePack)</NameWithVersion>
|
||||
<Name>$(ArtifactNameSdkLanguagePack)</Name>
|
||||
</LayoutDefinition>
|
||||
|
||||
</ItemGroup>
|
||||
|
|
2
scripts/obtain/dotnet-install.sh
vendored
2
scripts/obtain/dotnet-install.sh
vendored
|
@ -346,7 +346,7 @@ get_latest_version_info() {
|
|||
version_file_url="$uncached_feed/Runtime/$channel/latest.version"
|
||||
else
|
||||
if [ "$coherent" = true ]; then
|
||||
version_file_url="$uncached_feed/Runtime/$channel/latest.coherent.version"
|
||||
version_file_url="$uncached_feed/Sdk/$channel/latest.coherent.version"
|
||||
else
|
||||
version_file_url="$uncached_feed/Sdk/$channel/latest.version"
|
||||
fi
|
||||
|
|
|
@ -13,19 +13,24 @@ namespace Microsoft.DotNet.Configurer
|
|||
public static readonly string SENTINEL = $"{Product.Version}.dotnetFirstUseSentinel";
|
||||
|
||||
private readonly IFile _file;
|
||||
private readonly IDirectory _directory;
|
||||
|
||||
private string _dotnetUserProfileFolderPath;
|
||||
|
||||
private string SentinelPath => Path.Combine(_dotnetUserProfileFolderPath, SENTINEL);
|
||||
|
||||
public FirstTimeUseNoticeSentinel(CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator) :
|
||||
this(cliFallbackFolderPathCalculator.DotnetUserProfileFolderPath, FileSystemWrapper.Default.File)
|
||||
this(
|
||||
cliFallbackFolderPathCalculator.DotnetUserProfileFolderPath,
|
||||
FileSystemWrapper.Default.File,
|
||||
FileSystemWrapper.Default.Directory)
|
||||
{
|
||||
}
|
||||
|
||||
internal FirstTimeUseNoticeSentinel(string dotnetUserProfileFolderPath, IFile file)
|
||||
internal FirstTimeUseNoticeSentinel(string dotnetUserProfileFolderPath, IFile file, IDirectory directory)
|
||||
{
|
||||
_file = file;
|
||||
_directory = directory;
|
||||
_dotnetUserProfileFolderPath = dotnetUserProfileFolderPath;
|
||||
}
|
||||
|
||||
|
@ -38,6 +43,11 @@ namespace Microsoft.DotNet.Configurer
|
|||
{
|
||||
if (!Exists())
|
||||
{
|
||||
if (!_directory.Exists(_dotnetUserProfileFolderPath))
|
||||
{
|
||||
_directory.CreateDirectory(_dotnetUserProfileFolderPath);
|
||||
}
|
||||
|
||||
_file.CreateEmptyFile(SentinelPath);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NetCore.App" Version="$(CLI_SharedFrameworkVersion)" />
|
||||
<PackageReference Include="Microsoft.FSharp.Compiler" Version="$(CLI_FSharp_Version)" />
|
||||
<PackageReference Include="CliDeps.Satellites.FSharp" Version="$(CLI_FSharp_Satellites_Version)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
<PackageReference Include="Microsoft.CodeAnalysis.Build.Tasks" Version="$(CLI_Roslyn_Version)" />
|
||||
<PackageReference Include="Microsoft.Net.Compilers.netcore" Version="$(CLI_Roslyn_Version)" />
|
||||
<PackageReference Include="Microsoft.DiaSymReader.Native" Version="$(CLI_DiaSymNative_Version)" Condition="'$(OSName)' == 'win'" />
|
||||
<PackageReference Include="CliDeps.Satellites.Roslyn" Version="$(CLI_Roslyn_Satellites_Version)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -0,0 +1,175 @@
|
|||
// 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;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.DotNet.Configurer;
|
||||
using Microsoft.Extensions.DependencyModel.Tests;
|
||||
using Microsoft.Extensions.EnvironmentAbstractions;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.DotNet.Configurer.UnitTests
|
||||
{
|
||||
public class GivenAFirstTimeUseNoticeSentinel
|
||||
{
|
||||
private const string DOTNET_USER_PROFILE_FOLDER_PATH = "some path";
|
||||
|
||||
private FileSystemMockBuilder _fileSystemMockBuilder;
|
||||
|
||||
public GivenAFirstTimeUseNoticeSentinel()
|
||||
{
|
||||
_fileSystemMockBuilder = FileSystemMockBuilder.Create();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheSentinelHasTheCurrentVersionInItsName()
|
||||
{
|
||||
FirstTimeUseNoticeSentinel.SENTINEL.Should().Contain($"{Product.Version}");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItReturnsTrueIfTheSentinelExists()
|
||||
{
|
||||
_fileSystemMockBuilder.AddFiles(DOTNET_USER_PROFILE_FOLDER_PATH, FirstTimeUseNoticeSentinel.SENTINEL);
|
||||
|
||||
var fileSystemMock = _fileSystemMockBuilder.Build();
|
||||
|
||||
var firstTimeUseNoticeSentinel =
|
||||
new FirstTimeUseNoticeSentinel(
|
||||
DOTNET_USER_PROFILE_FOLDER_PATH,
|
||||
fileSystemMock.File,
|
||||
fileSystemMock.Directory);
|
||||
|
||||
firstTimeUseNoticeSentinel.Exists().Should().BeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItReturnsFalseIfTheSentinelDoesNotExist()
|
||||
{
|
||||
var fileSystemMock = _fileSystemMockBuilder.Build();
|
||||
|
||||
var firstTimeUseNoticeSentinel =
|
||||
new FirstTimeUseNoticeSentinel(
|
||||
DOTNET_USER_PROFILE_FOLDER_PATH,
|
||||
fileSystemMock.File,
|
||||
fileSystemMock.Directory);
|
||||
|
||||
firstTimeUseNoticeSentinel.Exists().Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItCreatesTheSentinelInTheDotnetUserProfileFolderPathIfItDoesNotExistAlready()
|
||||
{
|
||||
var fileSystemMock = _fileSystemMockBuilder.Build();
|
||||
var firstTimeUseNoticeSentinel =
|
||||
new FirstTimeUseNoticeSentinel(
|
||||
DOTNET_USER_PROFILE_FOLDER_PATH,
|
||||
fileSystemMock.File,
|
||||
fileSystemMock.Directory);
|
||||
|
||||
firstTimeUseNoticeSentinel.Exists().Should().BeFalse();
|
||||
|
||||
firstTimeUseNoticeSentinel.CreateIfNotExists();
|
||||
|
||||
firstTimeUseNoticeSentinel.Exists().Should().BeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItDoesNotCreateTheSentinelAgainIfItAlreadyExistsInTheDotnetUserProfileFolderPath()
|
||||
{
|
||||
const string contentToValidateSentinalWasNotReplaced = "some string";
|
||||
var sentinel = Path.Combine(DOTNET_USER_PROFILE_FOLDER_PATH, FirstTimeUseNoticeSentinel.SENTINEL);
|
||||
_fileSystemMockBuilder.AddFile(sentinel, contentToValidateSentinalWasNotReplaced);
|
||||
|
||||
var fileSystemMock = _fileSystemMockBuilder.Build();
|
||||
|
||||
var firstTimeUseNoticeSentinel =
|
||||
new FirstTimeUseNoticeSentinel(
|
||||
DOTNET_USER_PROFILE_FOLDER_PATH,
|
||||
fileSystemMock.File,
|
||||
fileSystemMock.Directory);
|
||||
|
||||
firstTimeUseNoticeSentinel.Exists().Should().BeTrue();
|
||||
|
||||
firstTimeUseNoticeSentinel.CreateIfNotExists();
|
||||
|
||||
fileSystemMock.File.ReadAllText(sentinel).Should().Be(contentToValidateSentinalWasNotReplaced);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItCreatesTheDotnetUserProfileFolderIfItDoesNotExistAlreadyWhenCreatingTheSentinel()
|
||||
{
|
||||
var fileSystemMock = _fileSystemMockBuilder.Build();
|
||||
var directoryMock = new DirectoryMock();
|
||||
var firstTimeUseNoticeSentinel =
|
||||
new FirstTimeUseNoticeSentinel(
|
||||
DOTNET_USER_PROFILE_FOLDER_PATH,
|
||||
fileSystemMock.File,
|
||||
directoryMock);
|
||||
|
||||
firstTimeUseNoticeSentinel.CreateIfNotExists();
|
||||
|
||||
directoryMock.Exists(DOTNET_USER_PROFILE_FOLDER_PATH).Should().BeTrue();
|
||||
directoryMock.CreateDirectoryInvoked.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItDoesNotAttemptToCreateTheDotnetUserProfileFolderIfItAlreadyExistsWhenCreatingTheSentinel()
|
||||
{
|
||||
var fileSystemMock = _fileSystemMockBuilder.Build();
|
||||
var directoryMock = new DirectoryMock(new List<string> { DOTNET_USER_PROFILE_FOLDER_PATH });
|
||||
var firstTimeUseNoticeSentinel =
|
||||
new FirstTimeUseNoticeSentinel(
|
||||
DOTNET_USER_PROFILE_FOLDER_PATH,
|
||||
fileSystemMock.File,
|
||||
directoryMock);
|
||||
|
||||
firstTimeUseNoticeSentinel.CreateIfNotExists();
|
||||
|
||||
directoryMock.CreateDirectoryInvoked.Should().BeFalse();
|
||||
}
|
||||
|
||||
private class DirectoryMock : IDirectory
|
||||
{
|
||||
private IList<string> _directories;
|
||||
|
||||
public bool CreateDirectoryInvoked { get; set; }
|
||||
|
||||
public DirectoryMock(IList<string> directories = null)
|
||||
{
|
||||
_directories = directories ?? new List<string>();
|
||||
}
|
||||
|
||||
public bool Exists(string path)
|
||||
{
|
||||
return _directories.Any(d => d == path);
|
||||
}
|
||||
|
||||
public ITemporaryDirectory CreateTemporaryDirectory()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetFiles(string path, string searchPattern)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public string GetDirectoryFullName(string path)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void CreateDirectory(string path)
|
||||
{
|
||||
_directories.Add(path);
|
||||
CreateDirectoryInvoked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -82,7 +82,7 @@ namespace Microsoft.DotNet.Cli.Build.Tests
|
|||
.WithWorkingDirectory(testInstance.Root)
|
||||
.ExecuteWithCapturedOutput("--no-restore")
|
||||
.Should().Fail()
|
||||
.And.HaveStdOutContaining("project.assets.json' not found.");;
|
||||
.And.HaveStdOutContaining("project.assets.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
@ -197,7 +197,7 @@ namespace Microsoft.DotNet.Tools.Pack.Tests
|
|||
.WithWorkingDirectory(testInstance.Root)
|
||||
.ExecuteWithCapturedOutput("--no-restore")
|
||||
.Should().Fail()
|
||||
.And.HaveStdOutContaining("project.assets.json' not found.");;
|
||||
.And.HaveStdOutContaining("project.assets.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
@ -92,7 +92,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
|
|||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput("--framework netcoreapp2.0 --no-restore")
|
||||
.Should().Fail()
|
||||
.And.HaveStdOutContaining("project.assets.json' not found.");;
|
||||
.And.HaveStdOutContaining("project.assets.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
@ -87,7 +87,7 @@ namespace Microsoft.DotNet.Cli.Run.Tests
|
|||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput("--no-restore")
|
||||
.Should().Fail()
|
||||
.And.HaveStdOutContaining("project.assets.json' not found.");;
|
||||
.And.HaveStdOutContaining("project.assets.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
@ -73,7 +73,7 @@ namespace Microsoft.DotNet.Cli.Test.Tests
|
|||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput($"{TestBase.ConsoleLoggerOutputNormal} --no-restore")
|
||||
.Should().Fail()
|
||||
.And.HaveStdOutContaining("project.assets.json' not found.");;
|
||||
.And.HaveStdOutContaining("project.assets.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue