-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSharedConfig.targets
56 lines (47 loc) · 2.8 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
InitialTargets="TestDSPGameFolder;TestDumpedAssembly;PublicizeAssembly">
<PropertyGroup>
<DevEnvLoc>$(MSBuildThisFileDirectory)/DevEnv.targets</DevEnvLoc>
</PropertyGroup>
<PropertyGroup Label="Game Install Properties">
<DSPGameDir Condition="!Exists('$(DevEnvLoc)')">C:\Program Files (x86)\Steam\steamapps\common\Dyson Sphere Program\</DSPGameDir>
<DSPGameDir>$([MSBuild]::EnsureTrailingSlash('$(DSPGameDir)'))</DSPGameDir>
<DumpedAssembliesDir>$(DSPGameDir)BepInEx\DumpedAssemblies\DSPGAME\</DumpedAssembliesDir>
<ProjectDir>$(MSBuildThisFileDirectory)\</ProjectDir>
<UnityBundle>$([MSBuild]::EnsureTrailingSlash('$(UnityProject)'))Assets\StreamingAssets\AssetBundles\commonapi</UnityBundle>
<ReleaseMode>0</ReleaseMode>
</PropertyGroup>
<Target Name="MaybeCopyDevEnv"
Inputs="$(MSBuildAllProjects)"
Outputs="$(DevEnvLoc)"
Condition="!Exists('$(DevEnvLoc)') And '$(ReleaseMode)' == '0'">
<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 '$(DevEnvLoc)' (it has been created for you)." />
</Target>
<Target Name="DevEnvInvalid"
Condition="Exists('$(DevEnvLoc)') And '$(ReleaseMode)' == '0'">
<!-- 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 '$(DevEnvLoc)'. 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"
Condition="!Exists('$(DSPGameDir)')" />
<Target Name="TestDumpedAssembly"
Condition="!Exists('$(DumpedAssembliesDir)Assembly-CSharp.dll') And '$(ReleaseMode)' == '0'" >
<Error Text="Can't find dumped Assembly-CSharp.dll! Please run game with preloader patch installed." />
</Target>
<Target Name="PublicizeAssembly" Condition="Exists('$(DumpedAssembliesDir)Assembly-CSharp.dll') And !Exists('$(ProjectDir)Libs\Assembly-CSharp.dll')" >
<Exec WorkingDirectory="$(DumpedAssembliesDir)" Command="$(ProjectDir)AssemblyPublicizer.exe Assembly-CSharp.dll $(ProjectDir)Libs\Assembly-CSharp.dll"/>
</Target>
<Target Name="BeforeBuild">
<Copy
Condition="Exists('$(UnityBundle)')"
SourceFiles="$(UnityBundle)"
DestinationFolder="../Staging/plugins/" />
</Target>
</Project>