Merge rel/1.0.0-preview4 back into rel/1.0.0 (#4974)
* Updating the preview4 channel to rel-1.0.0-preview4 * Add more xlf files for new strings * bundle fsharp sdk, only Sdk directory is required * align f# console proj * align f# lib template * align f# mstest template * align f# xunit template * align f# web template * fix mstest package version, aligned to c# * remove unused directories from bundled sdks * Adding a SdkNugetVersion property when invoking dotnet pack on test packages so that test packages can reference exact packages. We need that because of https://github.com/NuGet/Home/issues/4063. Without it, pack creates the nuspec with a version like 1.0.0-version-, instead of 1.0.0-version-<version_used_in_build>, which leads to problems when restoring the tool. Like, it ends up restoring to the closest version of the package (oldest), instead of the latest. * Update web template for Web SDK 154 (#4948) * Update WebSDK version * Update web template to get rid of globs https://github.com/aspnet/Templates/pull/735 * MSBuild to 15.1.458 (#4950) * Adding MigrateWebSdkRule to the DefaultMigrationRuleSet (#4963) * Adding MigrateWebSdkRule to the DefaultMigrationRuleSet and adding a E2E test to cover it. * Do not migrate compile and EmbeddedResources for web application, because those are included in the Web Sdk already. * Addressing code review comments
This commit is contained in:
parent
355b6233cb
commit
1fd99f1588
15 changed files with 160 additions and 90 deletions
TestAssets/TestPackages/dotnet-dependency-tool-invoker
build
Microsoft.DotNet.Cli.BundledSdks.projMicrosoft.DotNet.Cli.BundledSdks.propsMicrosoft.DotNet.Cli.DependencyVersions.propsMicrosoft.DotNet.Cli.Test.targets
src
Microsoft.DotNet.ProjectJsonMigration
dotnet/commands/dotnet-new
CSharp_Web
FSharp_Console
FSharp_Lib
FSharp_Mstest
FSharp_Web
FSharp_Xunittest
test
Microsoft.DotNet.ProjectJsonMigration.Tests/Rules
dotnet-migrate.Tests
|
@ -10,6 +10,10 @@
|
||||||
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);portable-net45+win8;dnxcore50</PackageTargetFallback>
|
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);portable-net45+win8;dnxcore50</PackageTargetFallback>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<SdkNugetVersion Condition=" '$(SdkNugetVersion)' == ''">1.0.0-preview5-*</SdkNugetVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="**\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
<Compile Include="**\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
||||||
<Compile Include="..\..\..\src\dotnet\CommandLine\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
<Compile Include="..\..\..\src\dotnet\CommandLine\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
||||||
|
@ -34,7 +38,7 @@
|
||||||
<Version>4.0.0-rc2</Version>
|
<Version>4.0.0-rc2</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.DotNet.Cli.Utils">
|
<PackageReference Include="Microsoft.DotNet.Cli.Utils">
|
||||||
<Version>1.0.0-preview5-*</Version>
|
<Version>$(SdkNugetVersion)</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
<Copy SourceFiles="@(SdkContent)"
|
<Copy SourceFiles="@(SdkContent)"
|
||||||
DestinationFiles="@(SdkContent->'$(SdkLayoutDirectory)/%(RecursiveDir)%(FileName)%(Extension)')" />
|
DestinationFiles="@(SdkContent->'$(SdkLayoutDirectory)/%(RecursiveDir)%(FileName)%(Extension)')" />
|
||||||
|
|
||||||
|
<!-- Remove unused directories for FSharp.NET.Sdk, just Sdk directory is needed -->
|
||||||
|
<RemoveDir Condition=" '$([System.IO.Path]::GetFileName($(SdkLayoutDirectory)))' == 'FSharp.NET.Sdk' " Directories="$(SdkLayoutDirectory)/build;$(SdkLayoutDirectory)/buildCrossTargeting" />
|
||||||
|
|
||||||
<Message Text="Copied Sdk $(SdkPackageName) from $(SdkNuPkgPath) to $(SdkLayoutDirectory)."
|
<Message Text="Copied Sdk $(SdkPackageName) from $(SdkNuPkgPath) to $(SdkLayoutDirectory)."
|
||||||
Importance="High" />
|
Importance="High" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
|
@ -8,5 +8,6 @@
|
||||||
<BundledSdk Include="Microsoft.NET.Sdk.Web" Version="$(CLI_WEBSDK_Version)" />
|
<BundledSdk Include="Microsoft.NET.Sdk.Web" Version="$(CLI_WEBSDK_Version)" />
|
||||||
<BundledSdk Include="Microsoft.NET.Sdk.Publish" Version="$(CLI_WEBSDK_Version)" />
|
<BundledSdk Include="Microsoft.NET.Sdk.Publish" Version="$(CLI_WEBSDK_Version)" />
|
||||||
<BundledSdk Include="Microsoft.NET.Sdk.Web.ProjectSystem" Version="$(CLI_WEBSDK_Version)" />
|
<BundledSdk Include="Microsoft.NET.Sdk.Web.ProjectSystem" Version="$(CLI_WEBSDK_Version)" />
|
||||||
|
<BundledSdk Include="FSharp.NET.Sdk" Version="1.0.0-beta-040011" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<CLI_MSBuild_Version>15.1.0-preview-000454-01</CLI_MSBuild_Version>
|
<CLI_MSBuild_Version>15.1.0-preview-000458-02</CLI_MSBuild_Version>
|
||||||
<CLI_NETSDK_Version>1.0.0-alpha-20161104-2</CLI_NETSDK_Version>
|
<CLI_NETSDK_Version>1.0.0-alpha-20161104-2</CLI_NETSDK_Version>
|
||||||
<CLI_WEBSDK_Version>1.0.0-alpha-20161203-1-150</CLI_WEBSDK_Version>
|
<CLI_WEBSDK_Version>1.0.0-alpha-20161205-1-154</CLI_WEBSDK_Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -209,12 +209,13 @@
|
||||||
<DotNetPackMsbuildArgs Condition=" '$(IsDesktopAvailable)' == 'True' And '%(TestPackageProject.PackRuntime)' != '' ">/p:RuntimeIdentifier=%(TestPackageProject.PackRuntime)</DotNetPackMsbuildArgs>
|
<DotNetPackMsbuildArgs Condition=" '$(IsDesktopAvailable)' == 'True' And '%(TestPackageProject.PackRuntime)' != '' ">/p:RuntimeIdentifier=%(TestPackageProject.PackRuntime)</DotNetPackMsbuildArgs>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- https://github.com/NuGet/Home/issues/4063 -->
|
||||||
<DotNetPack NoBuild="True"
|
<DotNetPack NoBuild="True"
|
||||||
Output="$(TestPackagesDir)"
|
Output="$(TestPackagesDir)"
|
||||||
ProjectPath="%(TestPackageProject.ProjectPath)"
|
ProjectPath="%(TestPackageProject.ProjectPath)"
|
||||||
ToolPath="$(Stage0Directory)"
|
ToolPath="$(Stage0Directory)"
|
||||||
VersionSuffix="%(TestPackageProject.VersionSuffix)"
|
VersionSuffix="%(TestPackageProject.VersionSuffix)"
|
||||||
MsbuildArgs="$(DotNetPackMsbuildArgs)" />
|
MsbuildArgs="$(DotNetPackMsbuildArgs) /p:SdkNuGetVersion=$(SdkNugetVersion)" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="BuildTestAssetPackageProjects"
|
<Target Name="BuildTestAssetPackageProjects"
|
||||||
|
|
|
@ -25,7 +25,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration
|
||||||
new MigrateAssemblyInfoRule(),
|
new MigrateAssemblyInfoRule(),
|
||||||
new RemoveDefaultsFromProjectRule(),
|
new RemoveDefaultsFromProjectRule(),
|
||||||
new CleanOutputProjectRule(),
|
new CleanOutputProjectRule(),
|
||||||
new SaveOutputProjectRule()
|
new SaveOutputProjectRule(),
|
||||||
|
new MigrateWebSdkRule()
|
||||||
};
|
};
|
||||||
|
|
||||||
public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs)
|
public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs)
|
||||||
|
|
|
@ -202,6 +202,9 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
|
|
||||||
var compilerOptions = projectContext.ProjectFile.GetCompilerOptions(null, null);
|
var compilerOptions = projectContext.ProjectFile.GetCompilerOptions(null, null);
|
||||||
|
|
||||||
|
var project = migrationRuleInputs.DefaultProjectContext.ProjectFile;
|
||||||
|
var projectType = project.GetProjectType();
|
||||||
|
|
||||||
// If we're in a configuration, we need to be careful not to overwrite values from BuildOptions
|
// If we're in a configuration, we need to be careful not to overwrite values from BuildOptions
|
||||||
// without a configuration
|
// without a configuration
|
||||||
if (_configurationBuildOptions == null)
|
if (_configurationBuildOptions == null)
|
||||||
|
@ -213,7 +216,9 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
propertyGroup,
|
propertyGroup,
|
||||||
itemGroup,
|
itemGroup,
|
||||||
_transformApplicator,
|
_transformApplicator,
|
||||||
migrationSettings.ProjectDirectory);
|
migrationSettings.ProjectDirectory,
|
||||||
|
projectType,
|
||||||
|
csproj);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -223,7 +228,9 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
propertyGroup,
|
propertyGroup,
|
||||||
itemGroup,
|
itemGroup,
|
||||||
_transformApplicator,
|
_transformApplicator,
|
||||||
migrationSettings.ProjectDirectory);
|
migrationSettings.ProjectDirectory,
|
||||||
|
projectType,
|
||||||
|
csproj);
|
||||||
}
|
}
|
||||||
|
|
||||||
var transformOutput = GenerateRuntimeConfigurationFilesTransform.Transform(
|
var transformOutput = GenerateRuntimeConfigurationFilesTransform.Transform(
|
||||||
|
@ -237,7 +244,9 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
ProjectPropertyGroupElement propertyGroup,
|
ProjectPropertyGroupElement propertyGroup,
|
||||||
ProjectItemGroupElement itemGroup,
|
ProjectItemGroupElement itemGroup,
|
||||||
ITransformApplicator transformApplicator,
|
ITransformApplicator transformApplicator,
|
||||||
string projectDirectory)
|
string projectDirectory,
|
||||||
|
ProjectType projectType,
|
||||||
|
ProjectRootElement csproj)
|
||||||
{
|
{
|
||||||
foreach (var transform in _propertyTransforms)
|
foreach (var transform in _propertyTransforms)
|
||||||
{
|
{
|
||||||
|
@ -253,7 +262,13 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
foreach (var includeContextTransformExecute in _includeContextTransformExecutes)
|
foreach (var includeContextTransformExecute in _includeContextTransformExecutes)
|
||||||
{
|
{
|
||||||
var nonConfigurationOutput = includeContextTransformExecute(compilerOptions, projectDirectory);
|
var nonConfigurationOutput = includeContextTransformExecute(compilerOptions, projectDirectory);
|
||||||
var configurationOutput = includeContextTransformExecute(configurationCompilerOptions, projectDirectory);
|
var configurationOutput =
|
||||||
|
includeContextTransformExecute(configurationCompilerOptions, projectDirectory);
|
||||||
|
|
||||||
|
configurationOutput = RemoveDefaultCompileAndEmbeddedResourceForWebProjects(
|
||||||
|
configurationOutput,
|
||||||
|
projectType,
|
||||||
|
csproj);
|
||||||
|
|
||||||
transformApplicator.Execute(configurationOutput, itemGroup, mergeExisting: true);
|
transformApplicator.Execute(configurationOutput, itemGroup, mergeExisting: true);
|
||||||
}
|
}
|
||||||
|
@ -293,7 +308,9 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
ProjectPropertyGroupElement propertyGroup,
|
ProjectPropertyGroupElement propertyGroup,
|
||||||
ProjectItemGroupElement itemGroup,
|
ProjectItemGroupElement itemGroup,
|
||||||
ITransformApplicator transformApplicator,
|
ITransformApplicator transformApplicator,
|
||||||
string projectDirectory)
|
string projectDirectory,
|
||||||
|
ProjectType projectType,
|
||||||
|
ProjectRootElement csproj)
|
||||||
{
|
{
|
||||||
foreach (var transform in _propertyTransforms)
|
foreach (var transform in _propertyTransforms)
|
||||||
{
|
{
|
||||||
|
@ -302,13 +319,40 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
|
|
||||||
foreach (var includeContextTransformExecute in _includeContextTransformExecutes)
|
foreach (var includeContextTransformExecute in _includeContextTransformExecutes)
|
||||||
{
|
{
|
||||||
|
var transform = includeContextTransformExecute(compilerOptions, projectDirectory);
|
||||||
|
|
||||||
|
transform = RemoveDefaultCompileAndEmbeddedResourceForWebProjects(
|
||||||
|
transform,
|
||||||
|
projectType,
|
||||||
|
csproj);
|
||||||
|
|
||||||
transformApplicator.Execute(
|
transformApplicator.Execute(
|
||||||
includeContextTransformExecute(compilerOptions, projectDirectory),
|
transform,
|
||||||
itemGroup,
|
itemGroup,
|
||||||
mergeExisting: true);
|
mergeExisting: true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private IEnumerable<ProjectItemElement> RemoveDefaultCompileAndEmbeddedResourceForWebProjects(
|
||||||
|
IEnumerable<ProjectItemElement> transform,
|
||||||
|
ProjectType projectType,
|
||||||
|
ProjectRootElement csproj)
|
||||||
|
{
|
||||||
|
if(projectType == ProjectType.Web)
|
||||||
|
{
|
||||||
|
var itemsToRemove = transform.Where(p =>
|
||||||
|
p != null &&
|
||||||
|
p.Include.Contains("**\\*") &&
|
||||||
|
(p.ItemType == "Compile" || p.ItemType == "EmbeddedResource"));
|
||||||
|
|
||||||
|
CleanExistingItems(csproj, new [] {"Compile", "EmbeddedResource"});
|
||||||
|
|
||||||
|
transform = transform.Where(p => !itemsToRemove.Contains(p));
|
||||||
|
}
|
||||||
|
|
||||||
|
return transform;
|
||||||
|
}
|
||||||
|
|
||||||
private void CleanExistingProperties(ProjectRootElement csproj)
|
private void CleanExistingProperties(ProjectRootElement csproj)
|
||||||
{
|
{
|
||||||
var existingPropertiesToRemove = new [] {"OutputType", "TargetExt"};
|
var existingPropertiesToRemove = new [] {"OutputType", "TargetExt"};
|
||||||
|
@ -324,6 +368,19 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CleanExistingItems(ProjectRootElement csproj, IEnumerable<string> itemsToRemove)
|
||||||
|
{
|
||||||
|
foreach (var itemName in itemsToRemove)
|
||||||
|
{
|
||||||
|
var items = csproj.Items.Where(i => i.ItemType == itemName);
|
||||||
|
|
||||||
|
foreach (var item in items)
|
||||||
|
{
|
||||||
|
item.Parent.RemoveChild(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private IncludeContext GetCompileIncludeContext(CommonCompilerOptions compilerOptions, string projectDirectory)
|
private IncludeContext GetCompileIncludeContext(CommonCompilerOptions compilerOptions, string projectDirectory)
|
||||||
{
|
{
|
||||||
// Defaults from src/Microsoft.DotNet.ProjectModel/ProjectReader.cs #L596
|
// Defaults from src/Microsoft.DotNet.ProjectModel/ProjectReader.cs #L596
|
||||||
|
|
|
@ -9,20 +9,6 @@
|
||||||
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
|
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<GlobalExclude>$(GlobalExclude);bin\**;obj\**;node_modules\**;jspm_packages\**;bower_components\**;**\*.user;**\*.*proj</GlobalExclude>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="**\*" />
|
|
||||||
<Compile Include="**\*.cs" />
|
|
||||||
<EmbeddedResource Include="**\*.resx" />
|
|
||||||
<Content Include="wwwroot\**" CopyToPublishDirectory="PreserveNewest" />
|
|
||||||
<Content Include="**\*.cshtml" Exclude="wwwroot\**\*.cshtml" CopyToPublishDirectory="PreserveNewest" />
|
|
||||||
<Content Include="**\*.config" Exclude="wwwroot\**\*.config" CopyToPublishDirectory="PreserveNewest" />
|
|
||||||
<Content Include="**\*.json" Exclude="wwwroot\**\*.json" CopyToPublishDirectory="PreserveNewest" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.0.1" />
|
<PackageReference Include="Microsoft.NETCore.App" Version="1.0.1" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.0.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.0.0" />
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<Project ToolsVersion="15.0">
|
<Project Sdk="FSharp.NET.Sdk;Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
|
@ -15,10 +14,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.0.1" />
|
<PackageReference Include="Microsoft.NETCore.App" Version="1.0.1" />
|
||||||
<PackageReference Include="Microsoft.FSharp.Core.netcore" Version="1.0.0-alpha-161023" />
|
<PackageReference Include="Microsoft.FSharp.Core.netcore" Version="1.0.0-alpha-161023" />
|
||||||
<PackageReference Include="Microsoft.NET.Sdk" Version="1.0.0-alpha-20161104-2">
|
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.0-beta-*">
|
||||||
<PrivateAssets>All</PrivateAssets>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.0-alpha-*">
|
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -29,6 +25,4 @@
|
||||||
</DotNetCliToolReference>
|
</DotNetCliToolReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<Project ToolsVersion="15.0">
|
<Project Sdk="FSharp.NET.Sdk;Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard1.6</TargetFramework>
|
<TargetFramework>netstandard1.6</TargetFramework>
|
||||||
|
@ -14,10 +13,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="NETStandard.Library" Version="1.6" />
|
<PackageReference Include="NETStandard.Library" Version="1.6" />
|
||||||
<PackageReference Include="Microsoft.FSharp.Core.netcore" Version="1.0.0-alpha-161023" />
|
<PackageReference Include="Microsoft.FSharp.Core.netcore" Version="1.0.0-alpha-161023" />
|
||||||
<PackageReference Include="Microsoft.NET.Sdk" Version="1.0.0-alpha-20161104-2">
|
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.0-beta-*">
|
||||||
<PrivateAssets>All</PrivateAssets>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.0-alpha-*">
|
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -28,6 +24,4 @@
|
||||||
</DotNetCliToolReference>
|
</DotNetCliToolReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<Project ToolsVersion="15.0">
|
<Project Sdk="FSharp.NET.Sdk;Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
|
@ -14,13 +13,10 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.0.1" />
|
<PackageReference Include="Microsoft.NETCore.App" Version="1.0.1" />
|
||||||
<PackageReference Include="Microsoft.FSharp.Core.netcore" Version="1.0.0-alpha-161023" />
|
<PackageReference Include="Microsoft.FSharp.Core.netcore" Version="1.0.0-alpha-161023" />
|
||||||
<PackageReference Include="Microsoft.NET.Sdk" Version="1.0.0-alpha-20161104-2">
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20161123-03" />
|
||||||
<PrivateAssets>All</PrivateAssets>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20161109-01" />
|
|
||||||
<PackageReference Include="MSTest.TestAdapter" Version="1.1.5-preview" />
|
<PackageReference Include="MSTest.TestAdapter" Version="1.1.5-preview" />
|
||||||
<PackageReference Include="MSTest.TestFramework" Version="1.0.6-preview" />
|
<PackageReference Include="MSTest.TestFramework" Version="1.0.6-preview" />
|
||||||
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.0-alpha-*">
|
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.0-beta-*">
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -31,5 +27,4 @@
|
||||||
</DotNetCliToolReference>
|
</DotNetCliToolReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
|
|
||||||
</Project>
|
</Project>
|
|
@ -1,5 +1,4 @@
|
||||||
<Project ToolsVersion="15.0">
|
<Project ToolsVersion="15.0" Sdk="FSharp.NET.Sdk;Microsoft.NET.Sdk.Web">
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
|
@ -11,20 +10,26 @@
|
||||||
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
|
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<GlobalExclude>$(GlobalExclude);bin\**;obj\**;node_modules\**;jspm_packages\**;bower_components\**;**\*.user;**\*.*proj</GlobalExclude>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<None Include="**\*" />
|
||||||
<Compile Include="Controllers\*.fs" />
|
<Compile Include="Controllers\*.fs" />
|
||||||
<Compile Include="Startup.fs" />
|
<Compile Include="Startup.fs" />
|
||||||
<Compile Include="Program.fs" />
|
<Compile Include="Program.fs" />
|
||||||
<EmbeddedResource Include="**\*.resx" />
|
<EmbeddedResource Include="**\*.resx" />
|
||||||
|
<Content Include="wwwroot\**" CopyToPublishDirectory="PreserveNewest" />
|
||||||
|
<Content Include="**\*.cshtml" Exclude="wwwroot\**\*.cshtml" CopyToPublishDirectory="PreserveNewest" />
|
||||||
|
<Content Include="**\*.config" Exclude="wwwroot\**\*.config" CopyToPublishDirectory="PreserveNewest" />
|
||||||
|
<Content Include="**\*.json" Exclude="wwwroot\**\*.json" CopyToPublishDirectory="PreserveNewest" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.0.1" />
|
<PackageReference Include="Microsoft.NETCore.App" Version="1.0.1" />
|
||||||
<PackageReference Include="Microsoft.NET.Sdk.Web" Version="1.0.0-alpha-20161117-1-119">
|
|
||||||
<PrivateAssets>All</PrivateAssets>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="Microsoft.FSharp.Core.netcore" Version="1.0.0-alpha-161023" />
|
<PackageReference Include="Microsoft.FSharp.Core.netcore" Version="1.0.0-alpha-161023" />
|
||||||
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.0-alpha-*">
|
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.0-beta-*">
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.0.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.0.0" />
|
||||||
|
@ -49,5 +54,4 @@
|
||||||
</DotNetCliToolReference>
|
</DotNetCliToolReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<Project ToolsVersion="15.0">
|
<Project Sdk="FSharp.NET.Sdk;Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
|
@ -13,14 +12,11 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.0.1" />
|
<PackageReference Include="Microsoft.NETCore.App" Version="1.0.1" />
|
||||||
<PackageReference Include="Microsoft.NET.Sdk" Version="1.0.0-alpha-20161104-2">
|
|
||||||
<PrivateAssets>All</PrivateAssets>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20161123-03" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20161123-03" />
|
||||||
<PackageReference Include="xunit" Version="2.2.0-beta4-build3444" />
|
<PackageReference Include="xunit" Version="2.2.0-beta4-build3444" />
|
||||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta4-build1194" />
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta4-build1194" />
|
||||||
<PackageReference Include="Microsoft.FSharp.Core.netcore" Version="1.0.0-alpha-161023" />
|
<PackageReference Include="Microsoft.FSharp.Core.netcore" Version="1.0.0-alpha-161023" />
|
||||||
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.0-alpha-*">
|
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.0-beta-*">
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -31,6 +27,4 @@
|
||||||
</DotNetCliToolReference>
|
</DotNetCliToolReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -63,6 +63,27 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
||||||
mockProj.Items.First(i => i.ItemType == "EmbeddedResource").Exclude.Should().BeEmpty();
|
mockProj.Items.First(i => i.ItemType == "EmbeddedResource").Exclude.Should().BeEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void MigratingWebProjectWithoutCustomSourcesOrResourcesDoesNotEmitCompileAndEmbeddedResource()
|
||||||
|
{
|
||||||
|
var mockProj = RunBuildOptionsRuleOnPj(@"
|
||||||
|
{
|
||||||
|
""buildOptions"": {
|
||||||
|
""emitEntryPoint"": true
|
||||||
|
},
|
||||||
|
""dependencies"": {
|
||||||
|
""Microsoft.AspNetCore.Mvc"" : {
|
||||||
|
""version"": ""1.0.0""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
""frameworks"": {
|
||||||
|
""netcoreapp1.0"": {}
|
||||||
|
}
|
||||||
|
}");
|
||||||
|
|
||||||
|
mockProj.Items.Count().Should().Be(0);
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void MigratingEmitEntryPointTruePopulatesOutputTypeField()
|
public void MigratingEmitEntryPointTruePopulatesOutputTypeField()
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
[InlineData("TestAppWithRuntimeOptions")]
|
[InlineData("TestAppWithRuntimeOptions")]
|
||||||
[InlineData("TestAppWithContents")]
|
[InlineData("TestAppWithContents")]
|
||||||
[InlineData("AppWithAssemblyInfo")]
|
[InlineData("AppWithAssemblyInfo")]
|
||||||
public void It_migrates_apps(string projectName)
|
public void ItMigratesApps(string projectName)
|
||||||
{
|
{
|
||||||
var projectDirectory = TestAssetsManager.CreateTestInstance(projectName, identifier: projectName)
|
var projectDirectory = TestAssetsManager.CreateTestInstance(projectName, identifier: projectName)
|
||||||
.WithLockFiles()
|
.WithLockFiles()
|
||||||
|
@ -50,7 +50,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void It_migrates_signed_apps()
|
public void ItMigratesSignedApps()
|
||||||
{
|
{
|
||||||
var projectDirectory = TestAssetsManager.CreateTestInstance("TestAppWithSigning").WithLockFiles().Path;
|
var projectDirectory = TestAssetsManager.CreateTestInstance("TestAppWithSigning").WithLockFiles().Path;
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void It_migrates_dotnet_new_console_with_identical_outputs()
|
public void ItMigratesDotnetNewConsoleWithIdenticalOutputs()
|
||||||
{
|
{
|
||||||
var testInstance = TestAssetsManager
|
var testInstance = TestAssetsManager
|
||||||
.CreateTestInstance("ProjectJsonConsoleTemplate");
|
.CreateTestInstance("ProjectJsonConsoleTemplate");
|
||||||
|
@ -96,8 +96,8 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
VerifyAllMSBuildOutputsRunnable(projectDirectory);
|
VerifyAllMSBuildOutputsRunnable(projectDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(Skip="Final tools version missing.")]
|
[Fact]
|
||||||
public void It_migrates_old_dotnet_new_web_without_tools_with_outputs_containing_project_json_outputs()
|
public void ItMigratesOldDotnetNewWebWithoutToolsWithOutputsContainingProjectJsonOutputs()
|
||||||
{
|
{
|
||||||
var testInstance = TestAssetsManager
|
var testInstance = TestAssetsManager
|
||||||
.CreateTestInstance("ProjectJsonWebTemplate")
|
.CreateTestInstance("ProjectJsonWebTemplate")
|
||||||
|
@ -109,9 +109,6 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
var projectJsonFile = Path.Combine(projectDirectory, "project.json");
|
var projectJsonFile = Path.Combine(projectDirectory, "project.json");
|
||||||
|
|
||||||
WriteGlobalJson(globalDirectory);
|
WriteGlobalJson(globalDirectory);
|
||||||
var projectJson = JObject.Parse(File.ReadAllText(projectJsonFile));
|
|
||||||
projectJson.Remove("tools");
|
|
||||||
File.WriteAllText(projectJsonFile, projectJson.ToString());
|
|
||||||
|
|
||||||
var outputComparisonData = GetComparisonData(projectDirectory);
|
var outputComparisonData = GetComparisonData(projectDirectory);
|
||||||
|
|
||||||
|
@ -126,9 +123,27 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
outputsIdentical.Should().BeTrue();
|
outputsIdentical.Should().BeTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ItAddsMicrosoftNetWebSdkToTheSdkAttributeOfAWebApp()
|
||||||
|
{
|
||||||
|
var testInstance = TestAssetsManager
|
||||||
|
.CreateTestInstance("ProjectJsonWebTemplate")
|
||||||
|
.WithLockFiles();
|
||||||
|
|
||||||
|
var projectDirectory = testInstance.Path;
|
||||||
|
|
||||||
|
var globalDirectory = Path.Combine(projectDirectory, "..");
|
||||||
|
var projectJsonFile = Path.Combine(projectDirectory, "project.json");
|
||||||
|
|
||||||
|
MigrateProject(new [] { projectDirectory });
|
||||||
|
|
||||||
|
var csProj = Path.Combine(projectDirectory, $"{new DirectoryInfo(projectDirectory).Name}.csproj");
|
||||||
|
|
||||||
|
File.ReadAllText(csProj).Should().Contain(@"Sdk=""Microsoft.NET.Sdk.Web""");
|
||||||
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData("TestLibraryWithTwoFrameworks")]
|
[InlineData("TestLibraryWithTwoFrameworks")]
|
||||||
public void It_migrates_projects_with_multiple_TFMs(string projectName)
|
public void ItMigratesProjectsWithMultipleTFMs(string projectName)
|
||||||
{
|
{
|
||||||
var projectDirectory =
|
var projectDirectory =
|
||||||
TestAssetsManager.CreateTestInstance(projectName, identifier: projectName).WithLockFiles().Path;
|
TestAssetsManager.CreateTestInstance(projectName, identifier: projectName).WithLockFiles().Path;
|
||||||
|
@ -150,7 +165,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
[InlineData("TestAppWithLibrary/TestLibrary")]
|
[InlineData("TestAppWithLibrary/TestLibrary")]
|
||||||
[InlineData("TestLibraryWithAnalyzer")]
|
[InlineData("TestLibraryWithAnalyzer")]
|
||||||
[InlineData("PJTestLibraryWithConfiguration")]
|
[InlineData("PJTestLibraryWithConfiguration")]
|
||||||
public void It_migrates_a_library(string projectName)
|
public void ItMigratesALibrary(string projectName)
|
||||||
{
|
{
|
||||||
var projectDirectory =
|
var projectDirectory =
|
||||||
TestAssetsManager.CreateTestInstance(projectName, identifier: projectName).WithLockFiles().Path;
|
TestAssetsManager.CreateTestInstance(projectName, identifier: projectName).WithLockFiles().Path;
|
||||||
|
@ -174,7 +189,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
[InlineData("ProjectC", "ProjectC,ProjectD,ProjectE")]
|
[InlineData("ProjectC", "ProjectC,ProjectD,ProjectE")]
|
||||||
[InlineData("ProjectD", "ProjectD")]
|
[InlineData("ProjectD", "ProjectD")]
|
||||||
[InlineData("ProjectE", "ProjectE")]
|
[InlineData("ProjectE", "ProjectE")]
|
||||||
public void It_migrates_root_project_and_references(string projectName, string expectedProjects)
|
public void ItMigratesRootProjectAndReferences(string projectName, string expectedProjects)
|
||||||
{
|
{
|
||||||
var projectDirectory =
|
var projectDirectory =
|
||||||
TestAssetsManager.CreateTestInstance("TestAppDependencyGraph", callingMethod: $"{projectName}.RefsTest").Path;
|
TestAssetsManager.CreateTestInstance("TestAppDependencyGraph", callingMethod: $"{projectName}.RefsTest").Path;
|
||||||
|
@ -192,7 +207,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
[InlineData("ProjectC")]
|
[InlineData("ProjectC")]
|
||||||
[InlineData("ProjectD")]
|
[InlineData("ProjectD")]
|
||||||
[InlineData("ProjectE")]
|
[InlineData("ProjectE")]
|
||||||
public void It_migrates_root_project_and_skips_references(string projectName)
|
public void ItMigratesRootProjectAndSkipsReferences(string projectName)
|
||||||
{
|
{
|
||||||
var projectDirectory =
|
var projectDirectory =
|
||||||
TestAssetsManager.CreateTestInstance("TestAppDependencyGraph", callingMethod: $"{projectName}.SkipRefsTest").Path;
|
TestAssetsManager.CreateTestInstance("TestAppDependencyGraph", callingMethod: $"{projectName}.SkipRefsTest").Path;
|
||||||
|
@ -205,7 +220,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData(true)]
|
[InlineData(true)]
|
||||||
[InlineData(false)]
|
[InlineData(false)]
|
||||||
public void It_migrates_all_projects_in_given_directory(bool skipRefs)
|
public void ItMigratesAllProjectsInGivenDirectory(bool skipRefs)
|
||||||
{
|
{
|
||||||
var projectDirectory = TestAssetsManager.CreateTestInstance("TestAppDependencyGraph", callingMethod: $"MigrateDirectory.SkipRefs.{skipRefs}").Path;
|
var projectDirectory = TestAssetsManager.CreateTestInstance("TestAppDependencyGraph", callingMethod: $"MigrateDirectory.SkipRefs.{skipRefs}").Path;
|
||||||
|
|
||||||
|
@ -224,7 +239,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void It_migrates_given_project_json()
|
public void ItMigratesGivenProjectJson()
|
||||||
{
|
{
|
||||||
var projectDirectory = TestAssetsManager.CreateTestInstance("TestAppDependencyGraph").Path;
|
var projectDirectory = TestAssetsManager.CreateTestInstance("TestAppDependencyGraph").Path;
|
||||||
|
|
||||||
|
@ -239,7 +254,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
// regression test for https://github.com/dotnet/cli/issues/4269
|
// regression test for https://github.com/dotnet/cli/issues/4269
|
||||||
public void It_migrates_and_builds_P2P_references()
|
public void ItMigratesAndBuildsP2PReferences()
|
||||||
{
|
{
|
||||||
var assetsDir = TestAssetsManager.CreateTestInstance("TestAppDependencyGraph").WithLockFiles().Path;
|
var assetsDir = TestAssetsManager.CreateTestInstance("TestAppDependencyGraph").WithLockFiles().Path;
|
||||||
|
|
||||||
|
@ -269,7 +284,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData("src", "ProjectH")]
|
[InlineData("src", "ProjectH")]
|
||||||
[InlineData("src with spaces", "ProjectJ")]
|
[InlineData("src with spaces", "ProjectJ")]
|
||||||
public void It_migrates_and_builds_projects_in_global_json(string path, string projectName)
|
public void ItMigratesAndBuildsProjectsInGlobalJson(string path, string projectName)
|
||||||
{
|
{
|
||||||
var assetsDir = TestAssetsManager.CreateTestInstance(Path.Combine("TestAppDependencyGraph", "ProjectsWithGlobalJson"),
|
var assetsDir = TestAssetsManager.CreateTestInstance(Path.Combine("TestAppDependencyGraph", "ProjectsWithGlobalJson"),
|
||||||
callingMethod: $"ProjectsWithGlobalJson.{projectName}")
|
callingMethod: $"ProjectsWithGlobalJson.{projectName}")
|
||||||
|
@ -306,7 +321,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData(true)]
|
[InlineData(true)]
|
||||||
[InlineData(false)]
|
[InlineData(false)]
|
||||||
public void Migration_outputs_error_when_no_projects_found(bool useGlobalJson)
|
public void MigrationOutputsErrorWhenNoProjectsFound(bool useGlobalJson)
|
||||||
{
|
{
|
||||||
var projectDirectory = TestAssetsManager.CreateTestDirectory("Migration_outputs_error_when_no_projects_found");
|
var projectDirectory = TestAssetsManager.CreateTestDirectory("Migration_outputs_error_when_no_projects_found");
|
||||||
|
|
||||||
|
@ -353,7 +368,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void It_migrates_and_publishes_projects_with_runtimes()
|
public void ItMigratesAndPublishesProjectsWithRuntimes()
|
||||||
{
|
{
|
||||||
var projectName = "PJTestAppSimple";
|
var projectName = "PJTestAppSimple";
|
||||||
var projectDirectory = TestAssetsManager
|
var projectDirectory = TestAssetsManager
|
||||||
|
@ -369,7 +384,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
[WindowsOnlyTheory]
|
[WindowsOnlyTheory]
|
||||||
[InlineData("DesktopTestProjects", "AutoAddDesktopReferencesDuringMigrate", true)]
|
[InlineData("DesktopTestProjects", "AutoAddDesktopReferencesDuringMigrate", true)]
|
||||||
[InlineData("TestProjects", "PJTestAppSimple", false)]
|
[InlineData("TestProjects", "PJTestAppSimple", false)]
|
||||||
public void It_auto_add_desktop_references_during_migrate(string testGroup, string projectName, bool isDesktopApp)
|
public void ItAutoAddDesktopReferencesDuringMigrate(string testGroup, string projectName, bool isDesktopApp)
|
||||||
{
|
{
|
||||||
var runtime = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier();
|
var runtime = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier();
|
||||||
var testAssetManager = GetTestGroupTestAssetsManager(testGroup);
|
var testAssetManager = GetTestGroupTestAssetsManager(testGroup);
|
||||||
|
@ -384,7 +399,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void It_builds_a_migrated_app_with_a_indirect_dependency()
|
public void ItBuildsAMigratedAppWithAnIndirectDependency()
|
||||||
{
|
{
|
||||||
const string projectName = "ProjectA";
|
const string projectName = "ProjectA";
|
||||||
var solutionDirectory =
|
var solutionDirectory =
|
||||||
|
@ -399,7 +414,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void It_migrates_project_with_output_name()
|
public void ItMigratesProjectWithOutputName()
|
||||||
{
|
{
|
||||||
string projectName = "AppWithOutputAssemblyName";
|
string projectName = "AppWithOutputAssemblyName";
|
||||||
string expectedOutputName = "MyApp";
|
string expectedOutputName = "MyApp";
|
||||||
|
@ -426,10 +441,10 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData("LibraryWithoutNetStandardLibRef")]
|
[InlineData("LibraryWithoutNetStandardLibRef")]
|
||||||
[InlineData("LibraryWithNetStandardLibRef")]
|
[InlineData("LibraryWithNetStandardLibRef")]
|
||||||
public void It_migrates_and_builds_library(string projectName)
|
public void ItMigratesAndBuildsLibrary(string projectName)
|
||||||
{
|
{
|
||||||
var projectDirectory = TestAssetsManager.CreateTestInstance(projectName,
|
var projectDirectory = TestAssetsManager.CreateTestInstance(projectName,
|
||||||
callingMethod: $"{nameof(It_migrates_and_builds_library)}-projectName").Path;
|
callingMethod: $"{nameof(ItMigratesAndBuildsLibrary)}-projectName").Path;
|
||||||
|
|
||||||
MigrateProject(projectDirectory);
|
MigrateProject(projectDirectory);
|
||||||
Restore(projectDirectory, projectName);
|
Restore(projectDirectory, projectName);
|
||||||
|
@ -437,7 +452,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void It_fails_gracefully_when_migrating_app_with_missing_dependency()
|
public void ItFailsGracefullyWhenMigratingAppWithMissingDependency()
|
||||||
{
|
{
|
||||||
string projectName = "MigrateAppWithMissingDep";
|
string projectName = "MigrateAppWithMissingDep";
|
||||||
var projectDirectory = Path.Combine(GetTestGroupTestAssetsManager("NonRestoredTestProjects").CreateTestInstance(projectName).Path, "MyApp");
|
var projectDirectory = Path.Combine(GetTestGroupTestAssetsManager("NonRestoredTestProjects").CreateTestInstance(projectName).Path, "MyApp");
|
||||||
|
|
Loading…
Reference in a new issue