forked from sepluginloader/PluginTemplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
135 lines (109 loc) · 8.75 KB
/
Copy pathDirectory.Build.props
File metadata and controls
135 lines (109 loc) · 8.75 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<Project>
<!-- Folders overridable by Directory.Build.props.user -->
<PropertyGroup>
<!-- Folder containing SpaceEngineers.exe (empty = auto-detect from Steam) -->
<Bin64></Bin64>
<!-- Folder containing SpaceEngineersDedicated.exe (empty = auto-detect from Steam) -->
<Dedicated64></Dedicated64>
<!-- Pulsar plugin loader folder the client plugin is deployed into (empty = auto-detect) -->
<Pulsar></Pulsar>
<!-- Magnetar plugin loader installation folder, the one holding the launcher
executables and their Libraries (empty = auto-detect) -->
<Magnetar></Magnetar>
<!-- Magnetar config folder the server plugin is deployed into, the one holding
Local, Sources and Profiles (empty = the Magnetar subfolder of the folder above) -->
<MagnetarData></MagnetarData>
</PropertyGroup>
<!-- Plugin version (committed, shared by all contributors) -->
<Import Project="$(MSBuildThisFileDirectory)Version.Build.props" />
<!-- Local developer overrides for the folders above; ignored by Git (*.user).
Copy the first PropertyGroup of this file into Directory.Build.props.user,
wrapped into a top-level Project element, and fill in your local paths there.
Running setup.py writes that file for you. -->
<Import Project="$(MSBuildThisFileDirectory)Directory.Build.props.user"
Condition="Exists('$(MSBuildThisFileDirectory)Directory.Build.props.user')" />
<!-- Repository root (this file lives in it). Used instead of $(SolutionDir), so it
resolves whether the build is driven from the solution or a single project.
$(MSBuildThisFileDirectory) ends with a directory separator. -->
<PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<PathSeparator Condition="$([MSBuild]::IsOSPlatform('Windows'))">\</PathSeparator>
<PathSeparator Condition="!$([MSBuild]::IsOSPlatform('Windows'))">/</PathSeparator>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
<SteamPath Condition="'$(SteamPath)' == ''">$(registry:HKEY_CURRENT_USER\SOFTWARE\Valve\Steam@SteamPath)</SteamPath>
<!-- Steam fills in InstallLocation for game apps (244850) only, it is left empty
for tool apps like the Dedicated Server (298740). -->
<SteamGameDir Condition="'$(SteamGameDir)' == ''">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 244850@InstallLocation)</SteamGameDir>
<SteamServerDir Condition="'$(SteamServerDir)' == ''">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 298740@InstallLocation)</SteamServerDir>
<Pulsar Condition="'$(Pulsar)' == '' and '$(APPDATA)' != ''">$(APPDATA)\Pulsar</Pulsar>
</PropertyGroup>
<PropertyGroup Condition="!$([MSBuild]::IsOSPlatform('Windows')) and '$(HOME)' != ''">
<SteamPath Condition="'$(SteamPath)' == '' and Exists('$(HOME)/.steam/steam/steamapps')">$(HOME)/.steam/steam</SteamPath>
<SteamPath Condition="'$(SteamPath)' == '' and Exists('$(HOME)/.local/share/Steam/steamapps')">$(HOME)/.local/share/Steam</SteamPath>
<SteamPath Condition="'$(SteamPath)' == '' and Exists('$(HOME)/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps')">$(HOME)/.var/app/com.valvesoftware.Steam/.local/share/Steam</SteamPath>
<Pulsar Condition="'$(Pulsar)' == '' and '$(XDG_CONFIG_HOME)' != ''">$(XDG_CONFIG_HOME)/Pulsar</Pulsar>
<Pulsar Condition="'$(Pulsar)' == ''">$(HOME)/.config/Pulsar</Pulsar>
<!-- Magnetar is portable and lives in one folder, $XDG_CONFIG_HOME/Magnetar by
default; its config folder is the Magnetar subfolder of it, see below. -->
<Magnetar Condition="'$(Magnetar)' == '' and '$(XDG_CONFIG_HOME)' != ''">$(XDG_CONFIG_HOME)/Magnetar</Magnetar>
<Magnetar Condition="'$(Magnetar)' == ''">$(HOME)/.config/Magnetar</Magnetar>
</PropertyGroup>
<!-- Locate the Steam library folder holding each app, so non-default libraries work too -->
<PropertyGroup>
<SteamLibVdf Condition="'$(SteamPath)' != ''">$(SteamPath)/steamapps/libraryfolders.vdf</SteamLibVdf>
<SteamLibVdfText Condition="'$(SteamLibVdf)' != '' and Exists('$(SteamLibVdf)')">$([System.IO.File]::ReadAllText('$(SteamLibVdf)'))</SteamLibVdfText>
<!-- Captures the "path" of the library block which lists the given app ID -->
<SteamLibRx>(?s)^.*?"path"\s+"([^"]*)"(?:(?!"path").)*?"</SteamLibRx>
<SteamGameLibRx>$(SteamLibRx)244850".*$</SteamGameLibRx>
<SteamServerLibRx>$(SteamLibRx)298740".*$</SteamServerLibRx>
<SteamGameDir Condition="'$(SteamGameDir)' == '' and $([System.Text.RegularExpressions.Regex]::IsMatch('$(SteamLibVdfText)', '$(SteamGameLibRx)'))">$([System.Text.RegularExpressions.Regex]::Replace('$(SteamLibVdfText)', '$(SteamGameLibRx)', '$1'))/steamapps/common/SpaceEngineers</SteamGameDir>
<SteamServerDir Condition="'$(SteamServerDir)' == '' and $([System.Text.RegularExpressions.Regex]::IsMatch('$(SteamLibVdfText)', '$(SteamServerLibRx)'))">$([System.Text.RegularExpressions.Regex]::Replace('$(SteamLibVdfText)', '$(SteamServerLibRx)', '$1'))/steamapps/common/SpaceEngineersDedicatedServer</SteamServerDir>
<Bin64 Condition="'$(Bin64)' == '' and '$(SteamGameDir)' != ''">$([System.IO.Path]::GetFullPath('$(SteamGameDir)/Bin64'))</Bin64>
<Dedicated64 Condition="'$(Dedicated64)' == '' and '$(SteamServerDir)' != ''">$([System.IO.Path]::GetFullPath('$(SteamServerDir)/DedicatedServer64'))</Dedicated64>
</PropertyGroup>
<!-- Last resort: default Steam library layout (also covers SteamCMD installs) -->
<PropertyGroup Condition="!$([MSBuild]::IsOSPlatform('Windows')) and '$(HOME)' != ''">
<Bin64 Condition="'$(Bin64)' == ''">$(HOME)/.steam/steam/steamapps/common/SpaceEngineers/Bin64</Bin64>
<Dedicated64 Condition="'$(Dedicated64)' == ''">$(HOME)/.steam/steam/steamapps/common/SpaceEngineersDedicatedServer/DedicatedServer64</Dedicated64>
</PropertyGroup>
<!-- On Windows Magnetar is extracted next to the dedicated server installation,
so it sits beside the DedicatedServer64 folder the plugin builds against. -->
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
<Magnetar Condition="'$(Magnetar)' == '' and '$(Dedicated64)' != ''">$([System.IO.Path]::GetFullPath('$(Dedicated64)\..\Magnetar'))</Magnetar>
</PropertyGroup>
<!-- Magnetar launcher the current build targets. It names both the Libraries
subfolder holding PluginSdk.dll and (on Windows) the config folder holding
the Local plugins. $(TargetFrameworkIdentifier) is only derived after this
file is imported, but the raw $(TargetFramework) is available: in a
multi-targeting inner build MSBuild passes it as a global property. -->
<PropertyGroup Condition="'$(TargetFramework)' != ''">
<MagnetarLauncher Condition="$(TargetFramework.StartsWith('net4'))">MagnetarLegacy</MagnetarLauncher>
<MagnetarLauncher Condition="'$(MagnetarLauncher)' == ''">MagnetarInterim</MagnetarLauncher>
</PropertyGroup>
<!-- A single-target project sets its TargetFramework only after this file is
imported; Linux builds are always single-target and always MagnetarInterim. -->
<PropertyGroup Condition="'$(MagnetarLauncher)' == '' and !$([MSBuild]::IsOSPlatform('Windows'))">
<MagnetarLauncher>MagnetarInterim</MagnetarLauncher>
</PropertyGroup>
<!-- Folder holding PluginSdk.dll, referenced by the ServerPlugin project: each
launcher has its own Libraries subfolder, Linux ships only MagnetarInterim. -->
<PropertyGroup Condition="'$(MagnetarBin)' == '' and '$(Magnetar)' != '' and '$(MagnetarLauncher)' != ''">
<MagnetarBin>$(Magnetar)$(PathSeparator)Libraries$(PathSeparator)$(MagnetarLauncher)</MagnetarBin>
</PropertyGroup>
<!-- Magnetar's config folder, the counterpart of Pulsar's Legacy folder: it holds
Local, Sources, Profiles and the DevFolder, is shared by both launchers and sits
next to them unless the launcher runs with -useHome or -config. -->
<PropertyGroup Condition="'$(MagnetarData)' == '' and '$(Magnetar)' != ''">
<MagnetarData>$(Magnetar)$(PathSeparator)Magnetar</MagnetarData>
</PropertyGroup>
<!-- Reference folders with a trailing directory separator, for use in HintPath -->
<PropertyGroup>
<Bin64Dir>$(Bin64)</Bin64Dir>
<Bin64Dir Condition="'$(Bin64Dir)' != '' and !HasTrailingSlash('$(Bin64Dir)')">$(Bin64Dir)$(PathSeparator)</Bin64Dir>
<Dedicated64Dir>$(Dedicated64)</Dedicated64Dir>
<Dedicated64Dir Condition="'$(Dedicated64Dir)' != '' and !HasTrailingSlash('$(Dedicated64Dir)')">$(Dedicated64Dir)$(PathSeparator)</Dedicated64Dir>
<MagnetarBinDir>$(MagnetarBin)</MagnetarBinDir>
<MagnetarBinDir Condition="'$(MagnetarBinDir)' != '' and !HasTrailingSlash('$(MagnetarBinDir)')">$(MagnetarBinDir)$(PathSeparator)</MagnetarBinDir>
</PropertyGroup>
</Project>