|
4 | 4 | <KSPCommonPropsImported>true</KSPCommonPropsImported> |
5 | 5 | </PropertyGroup> |
6 | 6 |
|
7 | | - <!-- default settings for KSPBT targets and references --> |
| 7 | + <!-- default settings for KSPBT_ targets and references --> |
8 | 8 | <PropertyGroup> |
| 9 | + <!-- The root directory of the mod, the folder that gets placed in GameData --> |
| 10 | + <KSPBT_ModRoot Condition=" '$(KSPBT_ModRoot)' == '' ">$(MSBuildProjectDirectory)/../GameData/$(MSBuildProjectName)/</KSPBT_ModRoot> |
| 11 | + |
| 12 | + <!-- The folder to place resulting DLLs into, relative to KSPBT_ModRoot --> |
| 13 | + <KSPBT_ModPluginFolder Condition=" '$(KSPBT_ModPluginFolder)' == '' "/> |
| 14 | + |
| 15 | + <!-- default CKAN compatibility versions --> |
| 16 | + <KSPBT_CKANCompatibleVersions Condition=" '$(KSPBT_CKANCompatibleVersions)' == '' ">1.12 1.11 1.10 1.9 1.8</KSPBT_CKANCompatibleVersions> |
| 17 | + |
9 | 18 | <!-- reference unity and KSP assemblies unless explicitly disabled --> |
10 | | - <KSPBTReferenceSystemAssemblies Condition=" '$(KSPBTReferenceSystemAssemblies)' == '' ">true</KSPBTReferenceSystemAssemblies> |
11 | | - <KSPBTReferenceUnityAssemblies Condition=" '$(KSPBTReferenceUnityAssemblies)' == '' ">true</KSPBTReferenceUnityAssemblies> |
12 | | - <KSPBTReferenceGameAssemblies Condition=" '$(KSPBTReferenceGameAssemblies)' == '' ">true</KSPBTReferenceGameAssemblies> |
| 19 | + <KSPBT_ReferenceSystemAssemblies Condition=" '$(KSPBT_ReferenceSystemAssemblies)' == '' ">true</KSPBT_ReferenceSystemAssemblies> |
| 20 | + <KSPBT_ReferenceUnityAssemblies Condition=" '$(KSPBT_ReferenceUnityAssemblies)' == '' ">true</KSPBT_ReferenceUnityAssemblies> |
| 21 | + <KSPBT_ReferenceGameAssemblies Condition=" '$(KSPBT_ReferenceGameAssemblies)' == '' ">true</KSPBT_ReferenceGameAssemblies> |
| 22 | + <KSPBT_ReferenceModAssemblies Condition=" '$(KSPBT_ReferenceModAssemblies)' == '' ">true</KSPBT_ReferenceModAssemblies> |
13 | 23 |
|
14 | 24 | <!-- Copy DLLs to mod folder --> |
15 | | - <KSPBTCopyDLLsToPluginFolder Condition=" '$(KSPBTCopyDLLsToPluginFolder)' == '' ">true</KSPBTCopyDLLsToPluginFolder> |
| 25 | + <KSPBT_InstallCKANDependencies Condition=" '$(KSPBT_InstallCKANDependencies)' == '' ">true</KSPBT_InstallCKANDependencies> |
16 | 26 |
|
| 27 | + <KSPBT_CopyDLLsToPluginFolder Condition=" '$(KSPBT_CopyDLLsToPluginFolder)' == '' ">true</KSPBT_CopyDLLsToPluginFolder> |
17 | 28 |
|
18 | | - <KSPBTGenerateAssemblyAttribute Condition=" '$(KSPBTGenerateAssemblyAttribute)' == '' ">true</KSPBTGenerateAssemblyAttribute> |
| 29 | + <KSPBT_GenerateAssemblyAttribute Condition=" '$(KSPBT_GenerateAssemblyAttribute)' == '' ">true</KSPBT_GenerateAssemblyAttribute> |
19 | 30 |
|
20 | | - <KSPBTGenerateDependencyAttributes Condition=" '$(KSPBTGenerateDependencyAttributes)' == '' ">true</KSPBTGenerateDependencyAttributes> |
| 31 | + <KSPBT_GenerateDependencyAttributes Condition=" '$(KSPBT_GenerateDependencyAttributes)' == '' ">true</KSPBT_GenerateDependencyAttributes> |
21 | 32 |
|
22 | | - <KSPBTGenerateVersionFile Condition=" '$(KSPBTGenerateVersionFile)' == '' ">true</KSPBTGenerateVersionFile> |
23 | 33 |
|
24 | | - <!-- default CKAN compatibility versions --> |
25 | | - <CKANCompatibleVersions Condition=" '$(CKANCompatibleVersions)' == '' ">1.12 1.11 1.10 1.9 1.8</CKANCompatibleVersions> |
| 34 | + <KSPBT_GenerateVersionFile Condition=" '$(KSPBT_GenerateVersionFile)' == '' ">true</KSPBT_GenerateVersionFile> |
26 | 35 | </PropertyGroup> |
27 | 36 |
|
28 | | - <!--Parse KSP platform-specific paths --> |
29 | | - <!-- These can be overwritten by user and props files --> |
30 | | - <PropertyGroup Condition=" '$(KSPBTManagedRelativePath)' == '' "> |
31 | | - <KSPBTManagedRelativePath Condition=" $([MSBuild]::IsOsPlatform('Windows')) ">KSP_x64_Data/Managed</KSPBTManagedRelativePath> |
32 | | - <KSPBTManagedRelativePath Condition=" $([MSBuild]::IsOsPlatform('OSX')) ">KSP.app/Contents/Resources/Data/Managed</KSPBTManagedRelativePath> |
33 | | - <KSPBTManagedRelativePath Condition=" $([MSBuild]::IsOsPlatform('Linux')) ">KSP_Data/Managed</KSPBTManagedRelativePath> |
34 | | - </PropertyGroup> |
| 37 | + <!-- Define the ModReference item type and its defaults --> |
| 38 | + <ItemDefinitionGroup> |
| 39 | + <ModReference> |
| 40 | + <Private>false</Private> |
| 41 | + </ModReference> |
| 42 | + </ItemDefinitionGroup> |
35 | 43 |
|
36 | | - <PropertyGroup> |
37 | | - <KSPBTGameExecutable Condition=" $([MSBuild]::IsOsPlatform('Windows')) ">KSP_x64.exe</KSPBTGameExecutable> |
38 | | - <KSPBTGameExecutable Condition=" $([MSBuild]::IsOsPlatform('OSX')) ">KSP.app/Contents/MacOS/KSP</KSPBTGameExecutable> |
39 | | - <KSPBTGameExecutable Condition=" $([MSBuild]::IsOsPlatform('Linux')) ">KSP.x86_64</KSPBTGameExecutable> |
40 | | - <KSPBTSteamGameRoot Condition=" $([MSBuild]::IsOsPlatform('Windows')) ">C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program</KSPBTSteamGameRoot> |
41 | | - <KSPBTSteamGameRoot Condition=" $([MSBuild]::IsOsPlatform('OSX')) ">$(HOME)/Library/Application Support/Steam/steamapps/common/Kerbal Space Program</KSPBTSteamGameRoot> |
| 44 | + <!--Parse KSP platform-specific paths --> |
| 45 | + <PropertyGroup Condition=" '$(_KSPBT_ManagedRelativePath)' == '' "> |
| 46 | + <_KSPBT_ManagedRelativePath Condition=" $([MSBuild]::IsOsPlatform('Windows')) ">KSP_x64_Data/Managed</_KSPBT_ManagedRelativePath> |
| 47 | + <_KSPBT_ManagedRelativePath Condition=" $([MSBuild]::IsOsPlatform('OSX')) ">KSP.app/Contents/Resources/Data/Managed</_KSPBT_ManagedRelativePath> |
| 48 | + <_KSPBT_ManagedRelativePath Condition=" $([MSBuild]::IsOsPlatform('Linux')) ">KSP_Data/Managed</_KSPBT_ManagedRelativePath> |
42 | 49 | </PropertyGroup> |
43 | 50 |
|
44 | | - <!-- Calculate mod paths --> |
45 | | - <!-- These can be overwritten by user, csproj, and props files --> |
46 | 51 | <PropertyGroup> |
47 | | - <!-- The root directory of the mod, the folder that gets placed in GameData --> |
48 | | - <KSPBTModRoot Condition=" '$(KSPBTModRoot)' == '' ">$(MSBuildProjectDirectory)/../GameData/$(MSBuildProjectName)/</KSPBTModRoot> |
49 | | - <!-- The folder to place resulting DLLs into, relative to KSPBTModRoot --> |
50 | | - <KSPBTModPluginFolder Condition=" '$(KSPBTModPluginFolder)' == '' "/> |
| 52 | + <_KSPBT_GameExecutable Condition=" $([MSBuild]::IsOsPlatform('Windows')) ">KSP_x64.exe</_KSPBT_GameExecutable> |
| 53 | + <_KSPBT_GameExecutable Condition=" $([MSBuild]::IsOsPlatform('OSX')) ">KSP.app/Contents/MacOS/KSP</_KSPBT_GameExecutable> |
| 54 | + <_KSPBT_GameExecutable Condition=" $([MSBuild]::IsOsPlatform('Linux')) ">KSP.x86_64</_KSPBT_GameExecutable> |
| 55 | + <_KSPBT_SteamGameRoot Condition=" $([MSBuild]::IsOsPlatform('Windows')) ">C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program</_KSPBT_SteamGameRoot> |
| 56 | + <_KSPBT_SteamGameRoot Condition=" $([MSBuild]::IsOsPlatform('OSX')) ">$(HOME)/Library/Application Support/Steam/steamapps/common/Kerbal Space Program</_KSPBT_SteamGameRoot> |
51 | 57 | </PropertyGroup> |
52 | 58 |
|
53 | 59 | <!-- Import the csproj.user file. --> |
54 | | - <!-- This can overwrite KSPBTManagedRelativePath and KSPBTGameExecutable, |
55 | | - set KSPBTGameRoot and ReferencePath, and any other user-specific settings --> |
| 60 | + <!-- This can overwrite _KSPBT_ManagedRelativePath and _KSPBT_GameExecutable, |
| 61 | + set KSPBT_GameRoot and ReferencePath, and any other user-specific settings --> |
56 | 62 | <Import Project="$(MSBuildProjectFullPath).user" Condition="Exists('$(MSBuildProjectFullPath).user')"/> |
57 | 63 |
|
58 | 64 | <!-- Import a props.user file --> |
|
64 | 70 |
|
65 | 71 | <!-- Relative path that must exist for a path to be a valid KSP Install--> |
66 | 72 | <PropertyGroup> |
67 | | - <KSPBTGameIdentifier>$(KSPBTManagedRelativePath)/Assembly-CSharp.dll</KSPBTGameIdentifier> |
68 | | - <KSPBTGameRootSource Condition="'$(KSPBTGameRoot)' != ''">property</KSPBTGameRootSource> |
| 73 | + <KSPBT_GameIdentifier>$(_KSPBT_ManagedRelativePath)/Assembly-CSharp.dll</KSPBT_GameIdentifier> |
| 74 | + <KSPBT_GameRootSource Condition="'$(KSPBT_GameRoot)' != ''">property</KSPBT_GameRootSource> |
69 | 75 | </PropertyGroup> |
70 | 76 |
|
71 | | - <!-- Default KSPBTGameRoot to the "KSP_ROOT" environment variable if it exists --> |
| 77 | + <!-- Default KSPBT_GameRoot to the "KSP_ROOT" environment variable if it exists --> |
72 | 78 | <!-- Doing this skips any checks for a valid KSP install so be careful! --> |
73 | | - <PropertyGroup Condition=" '$(KSPBTGameRoot)' == '' And '$(KSP_ROOT)' != '' "> |
74 | | - <KSPBTGameRoot>$(KSP_ROOT)</KSPBTGameRoot> |
75 | | - <KSPBTGameRootSource>environment variable</KSPBTGameRootSource> |
| 79 | + <PropertyGroup Condition=" '$(KSPBT_GameRoot)' == '' And '$(KSP_ROOT)' != '' "> |
| 80 | + <KSPBT_GameRoot>$(KSP_ROOT)</KSPBT_GameRoot> |
| 81 | + <KSPBT_GameRootSource>environment variable</KSPBT_GameRootSource> |
76 | 82 | </PropertyGroup> |
77 | 83 | <ItemGroup> |
78 | | - <KSPBTGameRootCandidate Include="$(SolutionDir)KSP" source="solution directory"/> |
79 | | - <KSPBTGameRootCandidate Include="$(ReferencePath)" source="reference path"/> |
80 | | - <KSPBTGameRootCandidate Include="$(KSPBTSteamGameRoot)" source="steam"/> |
| 84 | + <KSPBT_GameRootCandidate Include="$(SolutionDir)KSP" source="solution directory"/> |
| 85 | + <KSPBT_GameRootCandidate Include="$(ReferencePath)" source="reference path"/> |
| 86 | + <KSPBT_GameRootCandidate Include="$(_KSPBT_SteamGameRoot)" source="steam"/> |
81 | 87 | </ItemGroup> |
82 | 88 |
|
83 | 89 | <!-- Look for KSP install in Solution dir --> |
84 | | - <PropertyGroup Condition=" '$(KSPBTGameRoot)' == '' And Exists('$(SolutionDir)KSP/$(KSPBTGameIdentifier)') "> |
85 | | - <KSPBTGameRoot>$(SolutionDir)KSP</KSPBTGameRoot> |
86 | | - <KSPBTGameRootSource>solution directory</KSPBTGameRootSource> |
| 90 | + <PropertyGroup Condition=" '$(KSPBT_GameRoot)' == '' And Exists('$(SolutionDir)KSP/$(KSPBT_GameIdentifier)') "> |
| 91 | + <KSPBT_GameRoot>$(SolutionDir)KSP</KSPBT_GameRoot> |
| 92 | + <KSPBT_GameRootSource>solution directory</KSPBT_GameRootSource> |
87 | 93 | </PropertyGroup> |
88 | 94 |
|
89 | 95 | <!-- Look for KSP install in ReferencePath --> |
90 | | - <PropertyGroup Condition=" '$(KSPBTGameRoot)' == '' And Exists('$(ReferencePath)/$(KSPBTGameIdentifier)') "> |
91 | | - <KSPBTGameRoot>$(ReferencePath)</KSPBTGameRoot> |
92 | | - <KSPBTGameRootSource>reference path</KSPBTGameRootSource> |
| 96 | + <PropertyGroup Condition=" '$(KSPBT_GameRoot)' == '' And Exists('$(ReferencePath)/$(KSPBT_GameIdentifier)') "> |
| 97 | + <KSPBT_GameRoot>$(ReferencePath)</KSPBT_GameRoot> |
| 98 | + <KSPBT_GameRootSource>reference path</KSPBT_GameRootSource> |
93 | 99 | </PropertyGroup> |
94 | 100 |
|
95 | 101 | <!-- Look for KSP steam install--> |
96 | | - <PropertyGroup Condition=" '$(KSPBTGameRoot)' == '' And Exists('$(KSPBTSteamGameRoot)/$(KSPBTGameIdentifier)') "> |
97 | | - <KSPBTGameRoot>$(KSPBTSteamGameRoot)</KSPBTGameRoot> |
98 | | - <KSPBTGameRootSource>steam</KSPBTGameRootSource> |
99 | | - </PropertyGroup> |
100 | | - |
101 | | - <!-- Calculate KSPBTManagedPath --> |
102 | | - <PropertyGroup Condition=" '$(KSPBTManagedPath)' == ''"> |
103 | | - <KSPBTManagedPath>$(KSPBTGameRoot)/$(KSPBTManagedRelativePath)</KSPBTManagedPath> |
| 102 | + <PropertyGroup Condition=" '$(KSPBT_GameRoot)' == '' And Exists('$(_KSPBT_SteamGameRoot)/$(KSPBT_GameIdentifier)') "> |
| 103 | + <KSPBT_GameRoot>$(_KSPBT_SteamGameRoot)</KSPBT_GameRoot> |
| 104 | + <KSPBT_GameRootSource>steam</KSPBT_GameRootSource> |
104 | 105 | </PropertyGroup> |
105 | 106 |
|
106 | 107 | <!-- set the start action so that you can launch directly from VS --> |
107 | 108 | <PropertyGroup> |
108 | 109 | <StartAction>Program</StartAction> |
109 | | - <StartProgram>$(KSPBTGameRoot)/$(KSPBTGameExecutable)</StartProgram> |
110 | | - <StartWorkingDirectory>$(KSPBTGameRoot)</StartWorkingDirectory> |
| 110 | + <StartProgram>$(KSPBT_GameRoot)/$(_KSPBT_GameExecutable)</StartProgram> |
| 111 | + <StartWorkingDirectory>$(KSPBT_GameRoot)</StartWorkingDirectory> |
111 | 112 | <DebugType>portable</DebugType> |
112 | 113 | </PropertyGroup> |
113 | 114 |
|
|
120 | 121 | <!-- Prevent the GetReferenceAssemblyPaths task in Microsoft.Common.CurrentVersion.targets |
121 | 122 | from attempting to locate an external copy of the reference assemblies. --> |
122 | 123 | <AutomaticallyUseReferenceAssemblyPackages>false</AutomaticallyUseReferenceAssemblyPackages> |
123 | | - <FrameworkPathOverride>$(KSPBTManagedPath)</FrameworkPathOverride> |
| 124 | + <FrameworkPathOverride>$(KSPBT_ManagedPath)</FrameworkPathOverride> |
124 | 125 | <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> |
125 | 126 | </PropertyGroup> |
126 | 127 |
|
|
0 commit comments