1fd99f1588
* 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
249 lines
No EOL
11 KiB
XML
249 lines
No EOL
11 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<Project ToolsVersion="14.0" DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
<PropertyGroup>
|
|
<PathSeparator>/</PathSeparator>
|
|
<PathSeparator Condition=" '$(OSName)' == 'win' ">\</PathSeparator>
|
|
</PropertyGroup>
|
|
|
|
<Import Project="test/TestPackageProjects.targets" />
|
|
<Import Project="test/TestAssetProjects.targets" />
|
|
<Import Project="test/TestProjects.targets" />
|
|
|
|
<Target Name="Test"
|
|
Condition=" '$(CLIBUILD_SKIP_TESTS)' != 'true' "
|
|
DependsOnTargets="PrepareTests;
|
|
BuildTestAssets;
|
|
BuildTests;">
|
|
|
|
<PropertyGroup>
|
|
<PathListSeparator>:</PathListSeparator>
|
|
<PathListSeparator Condition=" '$(OSName)' == 'win' ">%3b</PathListSeparator>
|
|
<ExecPath>$(Stage2Directory)$(PathListSeparator)$(PATH)</ExecPath>
|
|
<ExecPath Condition=" '$(OSName)' == 'win' ">$(Stage2Directory)</ExecPath>
|
|
<TestArtifactsEnv>$(TestArtifactsDir)</TestArtifactsEnv>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<TestTaskEnvironmentVariables Include="PATH=$(ExecPath)" />
|
|
<TestTaskEnvironmentVariables Include="TEST_ARTIFACTS=$(TestArtifactsEnv)" />
|
|
</ItemGroup>
|
|
|
|
<PropertyGroup>
|
|
<RunTestEnvironmentVariables>@(TestTaskEnvironmentVariables)</RunTestEnvironmentVariables>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<ProjectsToTest Include="build/test/RunTest.proj">
|
|
<Properties>
|
|
CLIBuildDll=$(CLIBuildDll);
|
|
Configuration=$(Configuration);
|
|
EnvironmentVariables=$(RunTestEnvironmentVariables);
|
|
TestProject=%(TestProjects.ProjectPath);
|
|
TestProjectName=%(TestProjects.OutputName);
|
|
TestResultXmlDir=$(TestResultXmlDir);
|
|
ToolPath=$(Stage0Directory);
|
|
WorkingDirectory=%(TestProjects.ProjectDir)
|
|
</Properties>
|
|
</ProjectsToTest>
|
|
</ItemGroup>
|
|
|
|
<MSBuild
|
|
BuildInParallel="True"
|
|
Projects="@(ProjectsToTest)">
|
|
</MSBuild>
|
|
</Target>
|
|
|
|
<Target Name="PrepareTests"
|
|
DependsOnTargets="Init">
|
|
<PropertyGroup>
|
|
<TestPackageBuildVersionSuffix>$(CommitCount)</TestPackageBuildVersionSuffix>
|
|
<TestOutputDir>$(RepoRoot)/artifacts/testpackages/</TestOutputDir>
|
|
<TestPackagesBuildDir>$(TestOutputDir)/packagesBuild/</TestPackagesBuildDir>
|
|
<TestPackagesDir>$(TestOutputDir)/packages/</TestPackagesDir>
|
|
<TestArtifactsDir>$(TestOutputDir)/artifacts/</TestArtifactsDir>
|
|
<TestResultXmlDir>$(TestOutputDir)/results/</TestResultXmlDir>
|
|
<TestDirectory>$(RepoRoot)/test/</TestDirectory>
|
|
<DotnetUnderTest>$(Stage2Directory)</DotnetUnderTest>
|
|
</PropertyGroup>
|
|
</Target>
|
|
|
|
<Target Name="BuildTests"
|
|
DependsOnTargets="RestoreTests;
|
|
SetupTestProjectData;"
|
|
Inputs="%(TestProjects.BuildInputs)"
|
|
Outputs="%(TestProjects.BuildOutput)">
|
|
<DotNetBuild Configuration="$(Configuration)"
|
|
Framework="%(TestProjects.Framework)"
|
|
ToolPath="$(Stage0Directory)"
|
|
ProjectPath="%(TestProjects.ProjectPath)" />
|
|
</Target>
|
|
|
|
<Target Name="RestoreTests"
|
|
DependsOnTargets="CreateTestAssetPackageNuPkgs;
|
|
CleanTestProjectsBinObj;
|
|
SetupRestoreTestsInputs;"
|
|
Inputs="@(RestoreTestsInputs)"
|
|
Outputs="@(RestoreTestsInputs->'%(RelativeDir)/obj/project.assets.json');@(RestoreTestsInputs->'%(RelativeDir)/obj/%(Filename).csproj.nuget.g.props');@(RestoreTestsInputs->'%(RelativeDir)/obj/%(Filename).csproj.nuget.g.targets')">
|
|
<CallTarget Targets="CleanTestProjectsLockFiles"/>
|
|
|
|
<DotNetRestore ToolPath="$(Stage0Directory)"
|
|
ProjectPath=""%(RestoreTestsInputs.FullPath)"" />
|
|
</Target>
|
|
|
|
<Target Name="CleanTestProjectsBinObj"
|
|
DependsOnTargets="SetupRestoreTestsInputs;">
|
|
<ItemGroup>
|
|
<FilesToDelete Include="$(TestDirectory)**/bin/**/project.assets.json;$(TestDirectory)**/bin/**/*.csproj.nuget.g.props;$(TestDirectory)**/bin/**/*.csproj.nuget.g.targets" />
|
|
<FilesToDelete Include="$(TestDirectory)**/obj/**/project.assets.json;$(TestDirectory)**/obj/**/*.csproj.nuget.g.props;$(TestDirectory)**/obj/**/*.csproj.nuget.g.targets" />
|
|
</ItemGroup>
|
|
|
|
<Delete Files="@(FilesToDelete)" />
|
|
|
|
<ItemGroup>
|
|
<FilesToDelete Remove="*" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Target Name="SetupRestoreTestsInputs"
|
|
DependsOnTargets="PrepareTests;" >
|
|
<ItemGroup>
|
|
<RestoreTestsInputs Include="$(TestDirectory)/**/*.csproj"
|
|
Exclude="$(TestDirectory)/**/bin/**/*.csproj" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Target Name="BuildTestAssets"
|
|
DependsOnTargets="BuildTestAssetProjects;
|
|
BuildDesktopTestAssetProjects;">
|
|
</Target>
|
|
|
|
<Target Name="BuildTestAssetProjects"
|
|
DependsOnTargets="RestoreTestAssetProjects;
|
|
SetupTestAssetProjectData;"
|
|
Inputs="%(TestAssetProjects.BuildInputs)"
|
|
Outputs="%(TestAssetProjects.BuildOutput)">
|
|
|
|
<DotNetBuildPj Framework="netcoreapp1.0"
|
|
ProjectPath="$(RepoRoot)%(TestAssetProjects.ProjectPath)"
|
|
ToolPath="$(Stage0PjDirectory)" />
|
|
</Target>
|
|
|
|
<Target Name="RestoreTestAssetProjects"
|
|
DependsOnTargets="CreateTestAssetPackageNuPkgs;
|
|
SetupRestoreTestAssetProjectsInputs;"
|
|
Inputs="@(RestoreTestAssetProjectsInputs)"
|
|
Outputs="@(RestoreTestAssetProjectsInputs->'%(RelativeDir)/project.lock.json')">
|
|
|
|
<DotNetRestorePj FallbackSource="$(TestPackagesDir)"
|
|
ToolPath="$(Stage0PjDirectory)"
|
|
WorkingDirectory="$(RepoRoot)TestAssets/TestProjects/" />
|
|
</Target>
|
|
|
|
<Target Name="SetupRestoreTestAssetProjectsInputs" >
|
|
<ItemGroup>
|
|
<RestoreTestAssetProjectsInputs Include="$(RepoRoot)/TestAssets/TestProjects/**/project.json" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Target Name="CleanTestAssetProjectsLockFiles" >
|
|
<ItemGroup>
|
|
<TestAssetProjectsLockFiles Include="$(RepoRoot)/TestAssets/TestProjects/**/project.lock.json" />
|
|
</ItemGroup>
|
|
<Delete Files="@(TestAssetProjectsLockFiles)" />
|
|
</Target>
|
|
|
|
<Target Name="CleanTestProjectsLockFiles" >
|
|
<ItemGroup>
|
|
<TestProjectsLockFiles Include="$(RepoRoot)/test/**/project.assets.json;$(RepoRoot)/test/**/*.csproj.nuget.g.props;$(RepoRoot)/test/**/*.csproj.nuget.g.targets" />
|
|
</ItemGroup>
|
|
<Delete Files="@(TestProjectsLockFiles)" />
|
|
</Target>
|
|
|
|
<Target Name="BuildDesktopTestAssetProjects"
|
|
Condition=" '$(IsDesktopAvailable)' == 'True' "
|
|
DependsOnTargets="RestoreDesktopTestAssetProjects">
|
|
<ItemGroup>
|
|
<NoAutoBuildDesktopTestAssets Include="$(RepoRoot)TestAssets\DesktopTestProjects\**\.noautobuild" />
|
|
<NoAutoBuildDesktopTestAssetProjects Include="%(NoAutoBuildDesktopTestAssets.RelativeDir)project.json" />
|
|
<BuildableDesktopTestAssetProjects Include="$(RepoRoot)TestAssets\DesktopTestProjects\**\project.json"
|
|
Exclude="@(NoAutoBuildDesktopTestAssetProjects)" />
|
|
</ItemGroup>
|
|
|
|
<Message Text="Skipping projects with .noautobuild files:" />
|
|
<Message Text="%(NoAutoBuildDesktopTestAssetProjects.FullPath)" />
|
|
|
|
<DotNetBuild Condition="'@(BuildableDesktopTestAssetProjects)' != ''"
|
|
Configuration="$(Configuration)"
|
|
Framework="net46"
|
|
ProjectPath="%(BuildableDesktopTestAssetProjects.FullPath)"
|
|
ToolPath="$(Stage0PjDirectory)" />
|
|
</Target>
|
|
|
|
<Target Name="RestoreDesktopTestAssetProjects"
|
|
Condition=" '$(IsDesktopAvailable)' == 'True' "
|
|
DependsOnTargets="CreateTestAssetPackageNuPkgs;
|
|
SetupRestoreDesktopTestAssetProjectsInputs;"
|
|
Inputs="@(RestoreDesktopTestAssetProjectsInputs)"
|
|
Outputs="@(RestoreDesktopTestAssetProjectsInputs->'%(RelativeDir)/project.lock.json')">
|
|
|
|
<DotNetRestorePj FallbackSource="$(TestPackagesDir)"
|
|
ToolPath="$(Stage0PjDirectory)"
|
|
WorkingDirectory="$(RepoRoot)TestAssets\DesktopTestProjects\" />
|
|
</Target>
|
|
|
|
<Target Name="SetupRestoreDesktopTestAssetProjectsInputs">
|
|
<ItemGroup>
|
|
<RestoreDesktopTestAssetProjectsInputs Include="$(RepoRoot)TestAssets\DesktopTestProjects\**\project.json" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Target Name="CreateTestAssetPackageNuPkgs"
|
|
DependsOnTargets="BuildTestAssetPackageProjects;
|
|
SetupTestPackageProjectData;"
|
|
Inputs="%(TestPackageProject.PackInputs)"
|
|
Outputs="%(TestPackageProject.PackOutputs)">
|
|
|
|
<PropertyGroup>
|
|
<DotNetPackMsbuildArgs>/p:TargetFramework=%(TestPackageProject.Framework)</DotNetPackMsbuildArgs>
|
|
<DotNetPackMsbuildArgs Condition=" '$(IsDesktopAvailable)' == 'True' And '%(TestPackageProject.PackRuntime)' != '' ">/p:RuntimeIdentifier=%(TestPackageProject.PackRuntime)</DotNetPackMsbuildArgs>
|
|
</PropertyGroup>
|
|
|
|
<!-- https://github.com/NuGet/Home/issues/4063 -->
|
|
<DotNetPack NoBuild="True"
|
|
Output="$(TestPackagesDir)"
|
|
ProjectPath="%(TestPackageProject.ProjectPath)"
|
|
ToolPath="$(Stage0Directory)"
|
|
VersionSuffix="%(TestPackageProject.VersionSuffix)"
|
|
MsbuildArgs="$(DotNetPackMsbuildArgs) /p:SdkNuGetVersion=$(SdkNugetVersion)" />
|
|
</Target>
|
|
|
|
<Target Name="BuildTestAssetPackageProjects"
|
|
DependsOnTargets="RestoreTestAssetPackageProjects;
|
|
SetupTestPackageProjectData;"
|
|
Inputs="%(TestPackageProject.BuildInputs)"
|
|
Outputs="%(TestPackageProject.BuildOutputs)">
|
|
|
|
<DotNetBuild Framework="%(TestPackageProject.Framework)"
|
|
Runtime="%(TestPackageProject.Runtime)"
|
|
ProjectPath="%(TestPackageProject.ProjectPath)"
|
|
ToolPath="$(Stage0Directory)" />
|
|
</Target>
|
|
|
|
<Target Name="RestoreTestAssetPackageProjects"
|
|
DependsOnTargets="PrepareTests;
|
|
SetupRestoreTestAssetPackageProjectsInputs;"
|
|
Inputs="@(RestoreTestAssetPackageProjectsInputs)"
|
|
Outputs="@(RestoreTestAssetPackageProjectsInputs->'%(RelativeDir)/obj/project.assets.json');@(RestoreTestAssetPackageProjectsInputs->'%(RelativeDir)/obj/%(Filename).csproj.nuget.g.props');@(RestoreTestAssetPackageProjectsInputs->'%(RelativeDir)/obj/%(Filename).csproj.nuget.g.targets')">
|
|
|
|
<DotNetRestore ToolPath="$(Stage0Directory)"
|
|
ProjectPath=""%(RestoreTestAssetPackageProjectsInputs.FullPath)"" />
|
|
</Target>
|
|
|
|
<Target Name="SetupRestoreTestAssetPackageProjectsInputs"
|
|
DependsOnTargets="Init;">
|
|
<ItemGroup>
|
|
<RestoreTestAssetPackageProjectsInputs Include="$(RepoRoot)/TestAssets/TestPackages/**/*.csproj" />
|
|
</ItemGroup>
|
|
</Target>
|
|
</Project> |