You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
5.3 KiB

  1. <Project Sdk="Microsoft.NET.Sdk">
  2. <Import Project="..\Common.props" />
  3. <PropertyGroup>
  4. <TargetFramework>net472</TargetFramework>
  5. <RootNamespace>IPA.Injector</RootNamespace>
  6. <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  7. <GenerateDocumentationFile>false</GenerateDocumentationFile>
  8. <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
  9. <BuildForBeatSaber Condition=" '$(BuildForBeatSaber)' == '' And '$(TargetFramework)' == 'net472' ">true</BuildForBeatSaber>
  10. </PropertyGroup>
  11. <PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
  12. <DefineConstants>$(DefineConstants);NET4</DefineConstants>
  13. </PropertyGroup>
  14. <PropertyGroup Condition="'$(TargetFramework)' == 'net35'">
  15. <DefineConstants>$(DefineConstants);NET3</DefineConstants>
  16. </PropertyGroup>
  17. <PropertyGroup Condition="'$(BuildForBeatSaber)' == 'true'">
  18. <DefineConstants>$(DefineConstants);BeatSaber</DefineConstants>
  19. </PropertyGroup>
  20. <ItemGroup>
  21. <ProjectReference Include="..\IPA.Loader\IPA.Loader.csproj" />
  22. <ProjectReference Include="..\Net3-Proxy\Net3-Proxy.csproj" Condition=" '$(TargetFramework)' == 'net35' " />
  23. </ItemGroup>
  24. <ItemGroup>
  25. <Reference Include="UnityEngine.CoreModule" Condition=" '$(TargetFramework)' == 'net472' ">
  26. <HintPath>..\Refs\UnityEngine.CoreModule.Net4.dll</HintPath>
  27. <Private>False</Private>
  28. </Reference>
  29. <Reference Include="UnityEngine.CoreModule" Condition=" '$(TargetFramework)' == 'net35' ">
  30. <HintPath>..\Refs\UnityEngine.CoreModule.Net3.dll</HintPath>
  31. <Private>False</Private>
  32. </Reference>
  33. </ItemGroup>
  34. <ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
  35. <Content Include="..\Libs\I18N.Net4.dll">
  36. <Link>Libraries\Mono\I18N.dll</Link>
  37. <CopyToOutputDirectory>Always</CopyToOutputDirectory>
  38. </Content>
  39. <Content Include="..\Libs\I18N.West.Net4.dll">
  40. <Link>Libraries\Mono\I18N.West.dll</Link>
  41. <CopyToOutputDirectory>Always</CopyToOutputDirectory>
  42. </Content>
  43. <Content Include="..\Libs\Microsoft.CSharp.dll">
  44. <Link>Libraries\Mono\Microsoft.CSharp.dll</Link>
  45. <CopyToOutputDirectory>Always</CopyToOutputDirectory>
  46. </Content>
  47. <Content Include="..\Libs\System.Runtime.Serialization.Net4.dll">
  48. <Link>Libraries\Mono\System.Runtime.Serialization.dll</Link>
  49. <CopyToOutputDirectory>Always</CopyToOutputDirectory>
  50. </Content>
  51. <Content Include="..\Libs\netstandard.dll">
  52. <Link>Libraries\Mono\netstandard.dll</Link>
  53. <CopyToOutputDirectory>Always</CopyToOutputDirectory>
  54. </Content>
  55. </ItemGroup>
  56. <ItemGroup>
  57. <Content Include="..\Libs\thirdparty\*">
  58. <Link>Libraries\Thirdparty\%(Filename)%(Extension)</Link>
  59. <CopyToOutputDirectory>Always</CopyToOutputDirectory>
  60. </Content>
  61. </ItemGroup>
  62. <ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
  63. <Content Include="..\Libs\I18N.Net3.dll">
  64. <Link>Libraries\Mono\I18N.dll</Link>
  65. <CopyToOutputDirectory>Always</CopyToOutputDirectory>
  66. </Content>
  67. <Content Include="..\Libs\I18N.West.Net3.dll">
  68. <Link>Libraries\Mono\I18N.West.dll</Link>
  69. <CopyToOutputDirectory>Always</CopyToOutputDirectory>
  70. </Content>
  71. <Content Include="..\Libs\System.Runtime.Serialization.Net3.dll">
  72. <Link>Libraries\Mono\System.Runtime.Serialization.dll</Link>
  73. <CopyToOutputDirectory>Always</CopyToOutputDirectory>
  74. </Content>
  75. </ItemGroup>
  76. <ItemGroup>
  77. <PackageReference Include="Mono.Cecil" Version="0.11.5" />
  78. <PackageReference Include="AsyncBridge" Version="0.3.1" />
  79. <ProjectReference Include="..\SemVer\SemVer.csproj" />
  80. </ItemGroup>
  81. <Target Name="CopyDocumentation" BeforeTargets="Build">
  82. <ItemGroup>
  83. <ReferenceFiles Include="%(Reference.RelativeDir)%(Reference.Filename).xml" />
  84. </ItemGroup>
  85. <Message Text="Copying documentation" />
  86. <Copy SourceFiles="@(ReferenceFiles)" DestinationFolder="$(OutputPath)Libs" Condition="Exists('%(RootDir)%(Directory)%(Filename)%(Extension)')" />
  87. </Target>
  88. <Target Name="PostBuild" AfterTargets="PostBuildEvent">
  89. <Message Text="Relocating" Importance="normal" />
  90. <ItemGroup>
  91. <SystemFiles Include="$(OutputPath)IPA.Injector.*" />
  92. <SystemFiles Include="$(OutputPath)IPA.Loader.*" />
  93. <SystemFiles Include="$(OutputPath)AsyncBridge.*" />
  94. <SystemFiles Include="$(OutputPath)System.*" />
  95. <SystemFiles Include="$(OutputPath)Portable.System.*" />
  96. <SystemFiles Include="$(OutputPath)Net3-Proxy.*" />
  97. <SystemFiles Include="$(OutputPath)Libraries\Mono\**\*" />
  98. <OldLibFiles Include="$(OutputPath)Libs\**\*" />
  99. </ItemGroup>
  100. <Move SourceFiles="@(SystemFiles)" DestinationFolder="$(OutputPath)Data\Managed" />
  101. <RemoveDir Directories="$(OutputPath)Libraries\Mono" />
  102. <Delete Files="@(OldLibFiles)" />
  103. <RemoveDir Directories="$(OutputPath)Libs" />
  104. <ItemGroup>
  105. <LibFiles Include="$(OutputPath)**\*" Exclude="$(OutputPath)Data\**\*;$(OutputPath)Libs\**\*" />
  106. </ItemGroup>
  107. <Move SourceFiles="@(LibFiles)" DestinationFolder="$(OutputPath)Libs\" />
  108. <RemoveDir Directories="$(OutputPath)Libraries\Included" />
  109. <RemoveDir Directories="$(OutputPath)Libraries" />
  110. </Target>
  111. <Import Project="..\Common.targets" />
  112. </Project>