Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Microsoft.AspNetCore.Razor.Design.Test.csproj « IntegrationTests « test « Razor.Design « Razor « src - github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 86bcbf5a9f4610a3ab0bf3e7353115f96a9e94e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <!--
      There's not much value in multi-targeting here, this doesn't run much .NET code, it tests MSBuild.

      This is also a partial workaround for https://github.com/Microsoft/msbuild/issues/2661 - this project
      has netcoreapp2.0 dependencies that need to be built first.
    -->
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <PreserveCompilationContext>true</PreserveCompilationContext>
    <DefineConstants Condition="'$(PreserveWorkingDirectory)'=='true'">$(DefineConstants);PRESERVE_WORKING_DIRECTORY</DefineConstants>
    <!-- Copy references locally so that we can use them in the test. -->
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
    <BuildVariablesGeneratedFile>$(MSBuildProjectDirectory)\obj\BuildVariables.generated.cs</BuildVariablesGeneratedFile>
    <TestGroupName>RazorTests</TestGroupName>
  </PropertyGroup>

  <ItemGroup>
    <None Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
  </ItemGroup>

  <!-- The test projects rely on these binaries being available -->
  <ItemGroup>
    <Reference Include="System.Diagnostics.DiagnosticSource" />
    <Reference Include="Microsoft.AspNetCore.Html.Abstractions" />

  </ItemGroup>

  <ItemGroup>
    <!-- We don't need anything in this assembly, we just want to make sure it's built -->
    <Reference Include="Microsoft.AspNetCore.Razor.Design" />
    <Reference Include="rzc" />
    <Reference Include="Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib" />
  </ItemGroup>

  <Target Name="GenerateBuildVariablesFile" BeforeTargets="BeforeBuild">
    <Warning Text="Some SDK tests on Windows require the project to be built once using Desktop MSBuild, but the current build is executed using .NET Core MSBuild. This may result in test failures."
        Condition="!Exists('$(BuildVariablesGeneratedFile)') and '$(MSBuildRuntimeType)' != 'Full' and '$(OS)' == 'Windows_NT'" />

    <PropertyGroup>
      <GeneratedFileContents>
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
{
    internal static partial class BuildVariables
    {
        static partial void InitializeVariables()
        {
            _msBuildPath = @"$(MSBuildBinPath)\MSBuild.exe"%3B
        }
    }
}
      </GeneratedFileContents>
    </PropertyGroup>
    <WriteLinesToFile Lines="$(GeneratedFileContents)" File="$(BuildVariablesGeneratedFile)" Overwrite="true" WriteOnlyWhenDifferent="true" Condition="'$(MSBuildRuntimeType)' == 'Full'" />
    <ItemGroup>
      <Compile Include="$(BuildVariablesGeneratedFile)"  Condition="Exists('$(BuildVariablesGeneratedFile)')" />
    </ItemGroup>
  </Target>

</Project>