Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit d363b0b

Browse files
committed
Error out if dlls can't be found, and reorder locations where we go look for them
1 parent c975074 commit d363b0b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

common/unitylocation.props

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<UnityDir Condition="$(UnityDir) == '' and Exists('C:\Program Files (x86)\Unity\Editor\Data\Managed\UnityEditor.dll')">C:\Program Files (x86)\Unity\Editor\Data\Managed\</UnityDir>
5-
<UnityDir Condition="$(UnityDir) == '' and Exists('\Applications\Unity\Unity.app\Contents\Managed\UnityEditor.dll')">\Applications\Unity\Unity.app\Contents\Managed\</UnityDir>
64
<UnityDir Condition="$(UnityDir) == '' and Exists('$(SolutionDir)\script\lib\UnityEditor.dll')">$(SolutionDir)\script\lib\</UnityDir>
75
<UnityDir Condition="$(UnityDir) == '' and Exists('$(SolutionDir)\lib\UnityEditor.dll')">$(SolutionDir)\lib\</UnityDir>
6+
<UnityDir Condition="$(UnityDir) == '' and Exists('C:\Program Files (x86)\Unity\Editor\Data\Managed\UnityEditor.dll')">C:\Program Files (x86)\Unity\Editor\Data\Managed\</UnityDir>
7+
<UnityDir Condition="$(UnityDir) == '' and Exists('\Applications\Unity\Unity.app\Contents\Managed\UnityEditor.dll')">\Applications\Unity\Unity.app\Contents\Managed\</UnityDir>
88
</PropertyGroup>
9+
<Target Name="BeforeBuild">
10+
<PropertyGroup>
11+
<ErrorText>Location of Unity dlls is not set. You'll need to install Unity in a known location (the default installation directory for your system), or copy UnityEngine.dll and UnityEditor.dll to the {0}lib folder</ErrorText>
12+
</PropertyGroup>
13+
<Error Condition="'$(UnityDir)' == ''" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)'))" />
14+
</Target>
915
</Project>

0 commit comments

Comments
 (0)