-
-
Notifications
You must be signed in to change notification settings - Fork 124
/
SharedConfig.targets
34 lines (29 loc) · 1.7 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
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="TestDSPGameFolder">
<PropertyGroup>
<DevEnv>DevEnv.targets</DevEnv>
<DevEnvLoc>$(SolutionDir)\$(DevEnv)</DevEnvLoc>
<DSPGameDir Condition="!Exists('$(DevEnvLoc)')">C:\Program Files (x86)\Steam\steamapps\common\Dyson Sphere Program\</DSPGameDir>
<PluginImports>$(MSBuildThisFileDirectory)PluginImports.targets</PluginImports>
</PropertyGroup>
<Import Project="$(DevEnvLoc)" Condition="Exists('$(DevEnvLoc)')" />
<Target Name="MaybeCopyDevEnv"
Inputs="$(MSBuildAllProjects)"
Outputs="$(DevEnvLoc)"
Condition="!Exists('$(DSPGameDir)') and !Exists('$(DevEnvLoc)')">
<Copy SourceFiles="$(DevEnvLoc).example"
DestinationFiles="$(DevEnvLoc)"
SkipUnchangedFiles="true" />
<Error Text="It appears your Dyson Sphere Program installation is not in the default Steam directory. Please set the path correctly in $(DevEnv) (it has been created for you)." />
</Target>
<Target Name="DevEnvInvalid"
Condition="!Exists('$(DSPGameDir)') and Exists('$(DevEnvLoc)')">
<!-- If the default path is overriden in DevEnv, and it doesn't exist -->
<Error Text="Your Dyson Sphere Program installation folder has not been found at the path defined in $(DevEnv). Please set it correctly." />
</Target>
<!-- Using DependsOnTarget with Conditional targets as an if else structure... -->
<!-- Note that this is the first target, called by InitialTargets -->
<Target Name="TestDSPGameFolder"
DependsOnTargets="MaybeCopyDevEnv;DevEnvInvalid;CreatePluginDirectory"
Condition="!Exists('$(DSPGameDir)')" />
</Project>