|
4 | 4 | <KSPCommonPropsImported>true</KSPCommonPropsImported>
|
5 | 5 | </PropertyGroup>
|
6 | 6 |
|
7 |
| - <!-- import the csproj.user file. This might not be a good idea --> |
| 7 | + <!-- default CKAN compatibility versions --> |
| 8 | + <PropertyGroup> |
| 9 | + <CKANCompatibleVersions Condition="('$(CKANCompatibleVersions)' == '')">1.12 1.11 1.10 1.9 1.8</CKANCompatibleVersions> |
| 10 | + </PropertyGroup> |
| 11 | + |
| 12 | + <!--Parse KSP platform-specific paths --> |
| 13 | + <!-- These can be overwritten by user and props files --> |
| 14 | + <PropertyGroup Condition=" '$(ManagedRelativePath)' == '' "> |
| 15 | + <ManagedRelativePath Condition="$([MSBuild]::IsOsPlatform('Windows'))">KSP_x64_Data\Managed</ManagedRelativePath> |
| 16 | + <ManagedRelativePath Condition="$([MSBuild]::IsOsPlatform('OSX'))">KSP.app\Contents\Resources\Data\Managed</ManagedRelativePath> |
| 17 | + <ManagedRelativePath Condition="$([MSBuild]::IsOsPlatform('Linux'))">KSP_Data\Managed</ManagedRelativePath> |
| 18 | + </PropertyGroup> |
| 19 | + <PropertyGroup> |
| 20 | + <KSPExecutable Condition="$([MSBuild]::IsOsPlatform('Windows'))">KSP_x64.exe</KSPExecutable> |
| 21 | + <KSPExecutable Condition="$([MSBuild]::IsOsPlatform('OSX'))">KSP.app/Contents/MacOS/KSP</KSPExecutable> |
| 22 | + <KSPExecutable Condition="$([MSBuild]::IsOsPlatform('Linux'))">KSP.x86_64</KSPExecutable> |
| 23 | + <SteamKSPRoot Condition="($([MSBuild]::IsOsPlatform('Windows')))">C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program</SteamKSPRoot> |
| 24 | + <SteamKSPRoot Condition="($([MSBuild]::IsOsPlatform('OSX')))">$(HOME)/Library/Application Support/Steam/steamapps/common/Kerbal Space Program</SteamKSPRoot> |
| 25 | + </PropertyGroup> |
| 26 | + |
| 27 | + <!-- Calculate mod paths --> |
| 28 | + <!-- These can be overwritten by user, csproj, and props files --> |
| 29 | + <PropertyGroup> |
| 30 | + <!-- The root directory of the mod repository --> |
| 31 | + <RepoRootPath Condition=" '$(RepoRootPath)' == '' ">$(SolutionDir.TrimEnd([System.IO.Path]::DirectorySeparatorChar))</RepoRootPath> |
| 32 | + <BinariesOutputRelativePath Condition=" '$(BinariesOutputRelativePath)' == '' ">GameData/$(SolutionName)</BinariesOutputRelativePath> |
| 33 | + </PropertyGroup> |
| 34 | + |
| 35 | + <!-- Import the csproj.user file. --> |
| 36 | + <!-- This can overwrite ManagedRelativePath and KSPExecutable, |
| 37 | + set KSPRoot and ReferencePath, and any other user-specific settings --> |
8 | 38 | <Import Project="$(MSBuildProjectFullPath).user" Condition="Exists('$(MSBuildProjectFullPath).user')"/>
|
9 | 39 |
|
10 |
| - <!--import solution-wide props if it exists --> |
| 40 | + <!-- Import a props.user file --> |
| 41 | + <!-- serves the same role as the csproj.user file --> |
| 42 | + <Import Condition=" Exists('$(SolutionDir)$(SolutionName).props.user') " Project="$(SolutionDir)$(SolutionName).props.user"/> |
| 43 | + |
| 44 | + <!-- Import solution-wide props if it exists --> |
11 | 45 | <Import Condition=" Exists('$(SolutionDir)$(SolutionName).props') " Project="$(SolutionDir)$(SolutionName).props"/>
|
12 | 46 |
|
13 |
| - <!-- The following properties can be customized per-mod in SolutionName.props--> |
14 | 47 | <PropertyGroup>
|
15 |
| - <!-- The root directory of the mod repository --> |
16 |
| - <RepoRootPath Condition = " '$(RepoRootPath)' == '' ">$(SolutionDir.TrimEnd([System.IO.Path]::DirectorySeparatorChar))</RepoRootPath> |
17 |
| - <BinariesOutputRelativePath Condition = " '$(BinariesOutputRelativePath)' == '' ">GameData\$(SolutionName)</BinariesOutputRelativePath> |
| 48 | + <!-- Relative path that must exist for a path to be a valid KSP Install--> |
| 49 | + <KSPRootIdentifier>$(ManagedRelativePath)/Assembly-CSharp.dll</KSPRootIdentifier> |
18 | 50 |
|
19 | 51 | <!-- Default KSPRoot to the "KSP_ROOT" environment variable if it exists -->
|
20 |
| - <KSPRoot Condition=" '$(KSPRoot)' == '' And '$(KSP_ROOT)' != ''">$(KSP_ROOT)</KSPRoot> |
| 52 | + <!-- Doing this skips any checks for a valid KSP install so be careful! --> |
| 53 | + <KSPRoot Condition=" '$(KSPRoot)' == '' And '$(KSP_ROOT)' != '' ">$(KSP_ROOT)</KSPRoot> |
21 | 54 |
|
22 |
| - <!-- look for a KSP installation in SolutionDir --> |
23 |
| - <KSPRoot Condition = " '$(KSPRoot)' == '' And Exists('$(SolutionDir)KSP/GameData')">$(SolutionDir)KSP</KSPRoot> |
| 55 | + <!-- Look for KSP install in Solution dir --> |
| 56 | + <KSPRoot Condition=" '$(KSPRoot)' == '' And Exists('$(SolutionDir)KSP/$(KSPRootIdentifier)') ">$(SolutionDir)KSP</KSPRoot> |
24 | 57 |
|
25 |
| - <!-- use ReferencePath if it exists and is a valid KSP install --> |
26 |
| - <KSPRoot Condition = " '$(KSPRoot)' == '' And Exists('$(ReferencePath)GameData')">$(ReferencePath.TrimEnd([System.IO.Path]::DirectorySeparatorChar))</KSPRoot> |
| 58 | + <!-- Look for KSP install in ReferencePath --> |
| 59 | + <KSPRoot Condition=" '$(KSPRoot)' == '' And Exists('$(ReferencePath)/$(KSPRootIdentifier)') ">$(ReferencePath)</KSPRoot> |
27 | 60 |
|
28 |
| - <!--If the reference path isn't set, use the default steam location, but this will be incorrect in lots of cases--> |
29 |
| - <SteamKSPRoot Condition = "($([MSBuild]::IsOsPlatform('Windows')))">C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program</SteamKSPRoot> |
30 |
| - <SteamKSPRoot Condition = "($([MSBuild]::IsOsPlatform('OSX')))">$(HOME)/Library/Application Support/Steam/steamapps/common/Kerbal Space Program</SteamKSPRoot> |
31 |
| - <KSPRoot Condition = "'$(KSPRoot)' == '' And Exists('$(SteamKSPRoot)/GameData')">$(SteamKSPRoot)</KSPRoot> |
| 61 | + <!-- Look for KSP steam install--> |
| 62 | + <KSPRoot Condition=" '$(KSPRoot)' == '' And Exists('$(SteamKSPRoot)/$(KSPRootIdentifier)') ">$(SteamKSPRoot)</KSPRoot> |
32 | 63 |
|
33 |
| - <!-- default CKAN compatibility versions --> |
34 |
| - <CKANCompatibleVersions Condition="('$(CKANCompatibleVersions)' == '')">1.12 1.11 1.10 1.9 1.8</CKANCompatibleVersions> |
| 64 | + <!-- Calculate ManagedPath --> |
| 65 | + <ManagedPath>$(KSPRoot)/$(ManagedRelativePath)</ManagedPath> |
35 | 66 | </PropertyGroup>
|
36 | 67 |
|
37 |
| - <!--Import a props.user file if it exists, so that KSPRoot can be set globally for the whole mod if desired--> |
38 |
| - <Import Condition=" Exists('$(SolutionDir)$(SolutionName).props.user') " Project="$(SolutionDir)$(SolutionName).props.user"/> |
39 |
| - |
40 |
| - <!--Parse KSP platform-specific paths --> |
41 |
| - <PropertyGroup Condition = " '$(ManagedRelativePath)' == '' "> |
42 |
| - <ManagedRelativePath Condition = "$([MSBuild]::IsOsPlatform('Windows'))">KSP_x64_Data\Managed</ManagedRelativePath> |
43 |
| - <ManagedRelativePath Condition = "$([MSBuild]::IsOsPlatform('OSX'))">KSP.app\Contents\Resources\Data\Managed</ManagedRelativePath> |
44 |
| - <ManagedRelativePath Condition = "$([MSBuild]::IsOsPlatform('Linux'))">KSP_Data\Managed</ManagedRelativePath> |
45 |
| - </PropertyGroup> |
46 |
| - <PropertyGroup> |
47 |
| - <KSPExecutable Condition = "$([MSBuild]::IsOsPlatform('Windows'))">KSP_x64.exe</KSPExecutable> |
48 |
| - <KSPExecutable Condition = "$([MSBuild]::IsOsPlatform('OSX'))">KSP.app/Contents/MacOS/KSP</KSPExecutable> |
49 |
| - <KSPExecutable Condition = "$([MSBuild]::IsOsPlatform('Linux'))">KSP.x86_64</KSPExecutable> |
50 |
| - <ManagedPath>$(KSPRoot)\$(ManagedRelativePath)</ManagedPath> |
51 |
| - </PropertyGroup> |
52 |
| - |
53 | 68 | <!-- set the start action so that you can launch directly from VS -->
|
54 | 69 | <PropertyGroup>
|
55 | 70 | <StartAction>Program</StartAction>
|
|
0 commit comments