forked from SubnauticaNitrox/Nitrox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SharedConfig.targets
40 lines (32 loc) · 2.02 KB
/
SharedConfig.targets
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
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="TestSubnauticaFolder">
<PropertyGroup>
<DevVars>DevVars.targets</DevVars>
<DevVarsLoc>$(SolutionDir)\$(DevVars)</DevVarsLoc>
<SubnauticaDir Condition="!Exists($(DevVarsLoc))">C:\Program Files (x86)\Steam\steamapps\common\Subnautica</SubnauticaDir>
<LangVersion>6</LangVersion>
</PropertyGroup>
<PropertyGroup>
<IsGameLibrary>false</IsGameLibrary>
<IsGameLibrary Condition="'$(OutputType)' == 'Library' and '$(MSBuildProjectName)' != 'NitroxTest'">true</IsGameLibrary>
</PropertyGroup>
<Import Project="$(DevVarsLoc)" Condition="Exists($(DevVarsLoc))" />
<Target Name="MaybeCopyDevVars" Condition="!Exists($(SubnauticaDir)) and !Exists($(DevVarsLoc))">
<Copy SourceFiles="$(DevVarsLoc).example" DestinationFiles="$(DevVarsLoc)" />
<Error Text="It appears your Subnautica installation is not in the default Steam directory. Please set the path correctly in $(DevVars) (it has been copied there for you)." />
</Target>
<Target Name="DevVarsInvalid" Condition="!Exists($(SubnauticaDir)) and Exists($(DevVarsLoc))">
<!-- If the default path is overriden in DevVars, and it doesn't exist -->
<Error Text="Your Subnautica installation folder has not been found at the path defined in $(DevVars). Please set it correctly." Condition="Exists($(DevVarsLoc))" />
</Target>
<PropertyGroup>
<SubnauticaManaged>$(SubnauticaDir)\Subnautica_Data\Managed</SubnauticaManaged>
</PropertyGroup>
<!-- Using DependsOnTarget with Conditional targets as an if else structure... -->
<!-- Note that this is the first target, called by InitialTargets -->
<Target Name="TestSubnauticaFolder" DependsOnTargets="MaybeCopyDevVars;DevVarsInvalid" Condition="!Exists($(SubnauticaDir))" />
<PropertyGroup >
<OutputPath Condition="$(IsGameLibrary)">$(SolutionDir)\bin\$(Configuration)\</OutputPath>
</PropertyGroup>
<Import Project="$(SolutionDir)tasks\DeployTask.targets" />
</Project>