XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 0
UTF-8
<Project>
  <Target Name="ResolveSpaceEngineersAssemblies"
          BeforeTargets="ResolveAssemblyReferences"
          Condition="'$(UseSpaceEngineersAssemblies)' == 'true'">
    <Exec Command="powershell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File &quot;$(MSBuildThisFileDirectory)build\Find-SpaceEngineers.ps1&quot; -BinPath &quot;$(SpaceEngineersBinPath)&quot; -RootPath &quot;$(SpaceEngineersRootPath)&quot;"
          ConsoleToMSBuild="true"
          StandardOutputImportance="Low">
      <Output TaskParameter="ConsoleOutput" PropertyName="_DetectedSpaceEngineersBinPath" />
    </Exec>

    <PropertyGroup>
      <SpaceEngineersBinPath>$(_DetectedSpaceEngineersBinPath)</SpaceEngineersBinPath>
    </PropertyGroup>

    <Error Condition="'$(SpaceEngineersBinPath)' == ''"
           Text="Space Engineers was not found. Install the game, set SPACE_ENGINEERS_BIN, or build with /p:SpaceEngineersBinPath=&quot;X:\...\SpaceEngineers\Bin64&quot;." />

    <ItemGroup>
      <_SpaceEngineersAssemblyName Include="EmptyKeys.UserInterface.dll;EmptyKeys.UserInterface.Core.dll;HavokWrapper.dll;ProtoBuf.Net.dll;ProtoBuf.Net.Core.dll;Sandbox.Common.dll;Sandbox.Game.dll;Sandbox.Game.XmlSerializers.dll;Sandbox.Graphics.dll;Sandbox.RenderDirect.dll;SpaceEngineers.Game.dll;SpaceEngineers.ObjectBuilders.dll;SpaceEngineers.ObjectBuilders.XmlSerializers.dll;Steamworks.NET.dll;VRage.dll;VRage.Ansel.dll;VRage.Audio.dll;VRage.Game.dll;VRage.Game.XmlSerializers.dll;VRage.Input.dll;VRage.Library.dll;VRage.Math.dll;VRage.Math.XmlSerializers.dll;VRage.NativeWrapper.dll;VRage.Network.dll;VRage.Render.dll;VRage.Render11.dll;VRage.Scripting.dll;VRage.Steam.dll;VRage.XmlSerializers.dll" />
      <_MissingSpaceEngineersAssembly Include="@(_SpaceEngineersAssemblyName)"
                                      Condition="!Exists('$(SpaceEngineersBinPath)\%(Identity)')" />
    </ItemGroup>

    <Error Condition="'@(_MissingSpaceEngineersAssembly)' != ''"
           Text="The detected Space Engineers installation is incomplete. Missing from $(SpaceEngineersBinPath): @(_MissingSpaceEngineersAssembly, ', ')" />

    <ItemGroup>
      <_SpaceEngineersAssemblyFile Include="@(_SpaceEngineersAssemblyName->'$(SpaceEngineersBinPath)\%(Identity)')" />
      <Reference Include="@(_SpaceEngineersAssemblyFile)">
        <Private>false</Private>
      </Reference>
    </ItemGroup>

    <Message Importance="High" Text="Using Space Engineers assemblies from $(SpaceEngineersBinPath)" />
  </Target>

</Project>