MixedReality.Toolkit.targets 3.75 KB
Newer Older
BlackAngle233's avatar
BlackAngle233 committed
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
65
66
67
68
<Project>
  <!-- Check if MSBuildForUnity is being used to resolve, by checking if its version is present or not -->
  <PropertyGroup Condition="'$(MSBuildForUnityVersion)' == ''">
    <!-- If $(UnityPlayer) is not set, default to Standalone. -->
    <MRTKUnityPlayer Condition=" '$(MRTKUnityPlayer)' == '' ">Standalone</MRTKUnityPlayer>

    <!-- Player specific assemblies are in a directory name that starts with the player name and is suffixed with 'Player'. -->
    <_MRTKPlayerDirectory>$(MRTKUnityPlayer)Player</_MRTKPlayerDirectory>
  </PropertyGroup>

   <!-- MSBuild for Unity. -->
   <ItemGroup Condition="'$(MSBuildForUnityVersion)' != ''">
      <Content Include="$(MSBuildThisFileDirectory)..\MRTK\**">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        <!-- Don't show .meta files in Solution Explorer - it's not useful. -->
        <Visible Condition="'%(Extension)' == '.meta'">false</Visible>
        <Link>$(MSBuildThisFileName)\%(RecursiveDir)%(Filename)%(Extension)</Link>
      </Content>

      <Content Include="$(MSBuildThisFileDirectory)..\Plugins\**">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        <!-- Don't show .meta files in Solution Explorer - it's not useful. -->
        <Visible Condition="'%(Extension)' == '.meta'">false</Visible>
        <Link>$(MSBuildThisFileName)\Plugins\%(RecursiveDir)%(Filename)%(Extension)</Link>
      </Content>
  </ItemGroup>

   <!-- MRW -->
  <ItemGroup Condition="'$(MSBuildForUnityVersion)' == ''">
    <!-- Include content, but only if explicitly requested. This is useful if an MSBuild project references this
         nuget package, and the output of the MSBuild project is copied into a Unity project. -->
    <Content Include="$(MSBuildThisFileDirectory)..\MRTK\**" Condition=" '$(MRTKIncludeContent)' == 'true' ">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <!-- Don't show .meta files in Solution Explorer - it's not useful. -->
      <Visible Condition=" '%(Extension)' == '.meta' ">false</Visible>
      <Link>MRTK\%(RecursiveDir)%(Filename)%(Extension)</Link>
    </Content>

    <Content Include="$(MSBuildThisFileDirectory)..\link.xml" Condition=" '$(MRTKIncludeContent)' == 'true' ">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <Link>MRTK\link.xml</Link>
    </Content>

    <!-- Get all the dlls for the target player, and store the Identity in a custom OriginalPath metadata.
         If Identity is used directly as the HintPath in the Reference, Visual Studio generates a warning
         indicating the assemblies are not found, even though the build succeeds. -->
    <_MRTKPlayerAssemblies Include="$(MSBuildThisFileDirectory)..\Plugins\$(_MRTKPlayerDirectory)\*.dll">
      <OriginalPath>%(Identity)</OriginalPath>
    </_MRTKPlayerAssemblies>

    <!-- Add a Reference to each assembly, where the FileName is assumed to be the assembly name (true by default),
         and the HintPath is just the full path to the assembly.  -->
    <Reference Include="@(_MRTKPlayerAssemblies -> '%(FileName)')">
      <HintPath>%(OriginalPath)</HintPath>
    </Reference>

    <!-- Include assembly meta files, but only if explicitly requested. This is useful if an MSBuild project references this
         nuget package, and the output of the MSBuild project is copied into a Unity project. -->
    <Content Include="@(_MRTKPlayerAssemblies -> '%(OriginalPath).meta')" Condition=" '$(MRTKIncludeAssemblyMetaFiles)' == 'true' ">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <Visible>false</Visible>
    </Content>

    <!-- Clear the _MRTKPlayerAssemblies item list since it will be reused for each MRTK nuget package. -->
    <_MRTKPlayerAssemblies Remove="@(_MRTKPlayerAssemblies)" />
  </ItemGroup>

</Project>