|
4 | 4 | <KSPCommonPropsImported>true</KSPCommonPropsImported> |
5 | 5 | </PropertyGroup> |
6 | 6 |
|
7 | | - <!-- disable default .net framework imports; use the ones from KSP instead. There are a few differences that are sometimes important. --> |
| 7 | + <!-- default settings for KSPBT targets and references --> |
8 | 8 | <PropertyGroup> |
9 | | - <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> |
10 | | - </PropertyGroup> |
11 | | - |
12 | | - <!--reference unity and KSP assemblies unless explicitly disabled--> |
13 | | - <PropertyGroup> |
14 | | - <ReferenceUnityAssemblies Condition=" '$(ReferenceUnityAssemblies)' == '' ">true</ReferenceUnityAssemblies> |
15 | | - <ReferenceKSPAssemblies Condition=" '$(ReferenceKSPAssemblies)' == '' ">true</ReferenceKSPAssemblies> |
16 | | - </PropertyGroup> |
17 | | - |
18 | | - <!-- default CKAN compatibility versions --> |
19 | | - <PropertyGroup> |
20 | | - <CKANCompatibleVersions Condition="('$(CKANCompatibleVersions)' == '')">1.12 1.11 1.10 1.9 1.8</CKANCompatibleVersions> |
| 9 | + <!-- reference unity and KSP assemblies unless explicitly disabled --> |
| 10 | + <ReferenceKSPSystemAssemblies Condition=" '$(ReferenceKSPSystemAssemblies)' == '' "> |
| 11 | + true |
| 12 | + </ReferenceKSPSystemAssemblies> |
| 13 | + <ReferenceKSPUnityAssemblies Condition=" '$(ReferenceKSPUnityAssemblies)' == '' "> |
| 14 | + true |
| 15 | + </ReferenceKSPUnityAssemblies> |
| 16 | + <ReferenceKSPGameAssemblies Condition=" '$(ReferenceKSPGameAssemblies)' == '' "> |
| 17 | + true |
| 18 | + </ReferenceKSPGameAssemblies> |
| 19 | + |
| 20 | + |
| 21 | + <!-- Copy DLLs to mod folder --> |
| 22 | + <CopyDLLsToPluginFolder Condition=" '$(CopyDLLsToPluginFolder)' == '' "> |
| 23 | + true |
| 24 | + </CopyDLLsToPluginFolder> |
| 25 | + |
| 26 | + |
| 27 | + <GenerateKSPAssemblyAttribute Condition=" '$(GenerateKSPAssemblyAttribute)' == '' "> |
| 28 | + true |
| 29 | + </GenerateKSPAssemblyAttribute> |
| 30 | + |
| 31 | + <GenerateKSPAssemblyDependencyAttributes Condition=" '$(GenerateKSPAssemblyDependencyAttributes)' == '' "> |
| 32 | + true |
| 33 | + </GenerateKSPAssemblyDependencyAttributes> |
| 34 | + |
| 35 | + <GenerateKSPVersionFile Condition=" '$(GenerateKSPVersionFile)' == '' "> |
| 36 | + true |
| 37 | + </GenerateKSPVersionFile> |
| 38 | + |
| 39 | + <!-- default CKAN compatibility versions --> |
| 40 | + <CKANCompatibleVersions Condition=" '$(CKANCompatibleVersions)' == '' "> |
| 41 | + 1.12 1.11 1.10 1.9 1.8 |
| 42 | + </CKANCompatibleVersions> |
21 | 43 | </PropertyGroup> |
22 | 44 |
|
23 | 45 | <!--Parse KSP platform-specific paths --> |
24 | 46 | <!-- These can be overwritten by user and props files --> |
25 | | - <PropertyGroup Condition=" '$(ManagedRelativePath)' == '' "> |
26 | | - <ManagedRelativePath Condition="$([MSBuild]::IsOsPlatform('Windows'))">KSP_x64_Data\Managed</ManagedRelativePath> |
27 | | - <ManagedRelativePath Condition="$([MSBuild]::IsOsPlatform('OSX'))">KSP.app\Contents\Resources\Data\Managed</ManagedRelativePath> |
28 | | - <ManagedRelativePath Condition="$([MSBuild]::IsOsPlatform('Linux'))">KSP_Data\Managed</ManagedRelativePath> |
| 47 | + <PropertyGroup Condition=" '$(KSPManagedRelativePath)' == '' "> |
| 48 | + <KSPManagedRelativePath Condition=" $([MSBuild]::IsOsPlatform('Windows')) "> |
| 49 | + KSP_x64_Data/Managed |
| 50 | + </KSPManagedRelativePath> |
| 51 | + <KSPManagedRelativePath Condition=" $([MSBuild]::IsOsPlatform('OSX')) "> |
| 52 | + KSP.app/Contents/Resources/Data/Managed |
| 53 | + </KSPManagedRelativePath> |
| 54 | + <KSPManagedRelativePath Condition=" $([MSBuild]::IsOsPlatform('Linux')) "> |
| 55 | + KSP_Data/Managed |
| 56 | + </KSPManagedRelativePath> |
29 | 57 | </PropertyGroup> |
| 58 | + |
30 | 59 | <PropertyGroup> |
31 | | - <KSPExecutable Condition="$([MSBuild]::IsOsPlatform('Windows'))">KSP_x64.exe</KSPExecutable> |
32 | | - <KSPExecutable Condition="$([MSBuild]::IsOsPlatform('OSX'))">KSP.app/Contents/MacOS/KSP</KSPExecutable> |
33 | | - <KSPExecutable Condition="$([MSBuild]::IsOsPlatform('Linux'))">KSP.x86_64</KSPExecutable> |
34 | | - <SteamKSPRoot Condition="($([MSBuild]::IsOsPlatform('Windows')))">C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program</SteamKSPRoot> |
35 | | - <SteamKSPRoot Condition="($([MSBuild]::IsOsPlatform('OSX')))">$(HOME)/Library/Application Support/Steam/steamapps/common/Kerbal Space Program</SteamKSPRoot> |
| 60 | + <KSPExecutable Condition=" $([MSBuild]::IsOsPlatform('Windows')) ">KSP_x64.exe</KSPExecutable> |
| 61 | + <KSPExecutable Condition=" $([MSBuild]::IsOsPlatform('OSX')) ">KSP.app/Contents/MacOS/KSP</KSPExecutable> |
| 62 | + <KSPExecutable Condition=" $([MSBuild]::IsOsPlatform('Linux')) ">KSP.x86_64</KSPExecutable> |
| 63 | + <SteamKSPRoot Condition=" $([MSBuild]::IsOsPlatform('Windows')) "> |
| 64 | + C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program |
| 65 | + </SteamKSPRoot> |
| 66 | + <SteamKSPRoot Condition=" $([MSBuild]::IsOsPlatform('OSX')) "> |
| 67 | + $(HOME)/Library/Application Support/Steam/steamapps/common/Kerbal Space Program |
| 68 | + </SteamKSPRoot> |
36 | 69 | </PropertyGroup> |
37 | 70 |
|
38 | 71 | <!-- Calculate mod paths --> |
39 | 72 | <!-- These can be overwritten by user, csproj, and props files --> |
40 | 73 | <PropertyGroup> |
41 | | - <!-- The root directory of the mod repository --> |
42 | | - <RepoRootPath Condition=" '$(RepoRootPath)' == '' ">$(SolutionDir.TrimEnd([System.IO.Path]::DirectorySeparatorChar))</RepoRootPath> |
43 | | - <BinariesOutputRelativePath Condition=" '$(BinariesOutputRelativePath)' == '' ">GameData/$(SolutionName)</BinariesOutputRelativePath> |
| 74 | + <!-- The root directory of the mod, the folder that gets placed in GameData --> |
| 75 | + <KSPModRoot Condition=" '$(KSPModRoot)' == '' "> |
| 76 | + $(ProjectDir)/../GameData/$(ProjectName)/ |
| 77 | + </KSPModRoot> |
| 78 | + <KSPModPluginFolder Condition=" '$(KSPModPluginFolder)' == '' "> |
| 79 | + $(KSPModGameData)/Plugins/ |
| 80 | + </KSPModPluginFolder> |
44 | 81 | </PropertyGroup> |
45 | 82 |
|
46 | 83 | <!-- Import the csproj.user file. --> |
47 | | - <!-- This can overwrite ManagedRelativePath and KSPExecutable, |
| 84 | + <!-- This can overwrite KSPManagedRelativePath and KSPExecutable, |
48 | 85 | set KSPRoot and ReferencePath, and any other user-specific settings --> |
49 | 86 | <Import Project="$(MSBuildProjectFullPath).user" Condition="Exists('$(MSBuildProjectFullPath).user')"/> |
50 | 87 |
|
|
55 | 92 | <!-- Import solution-wide props if it exists --> |
56 | 93 | <Import Condition=" Exists('$(SolutionDir)$(SolutionName).props') " Project="$(SolutionDir)$(SolutionName).props"/> |
57 | 94 |
|
| 95 | + <!-- Relative path that must exist for a path to be a valid KSP Install--> |
58 | 96 | <PropertyGroup> |
59 | | - <!-- Relative path that must exist for a path to be a valid KSP Install--> |
60 | | - <KSPRootIdentifier>$(ManagedRelativePath)/Assembly-CSharp.dll</KSPRootIdentifier> |
| 97 | + <KSPRootIdentifier>$(KSPManagedRelativePath)/Assembly-CSharp.dll</KSPRootIdentifier> |
61 | 98 | <KSPRootSource Condition="'$(KSPRoot)' != ''">property</KSPRootSource> |
62 | 99 | </PropertyGroup> |
63 | 100 |
|
| 101 | + <!-- Default KSPRoot to the "KSP_ROOT" environment variable if it exists --> |
| 102 | + <!-- Doing this skips any checks for a valid KSP install so be careful! --> |
64 | 103 | <PropertyGroup Condition=" '$(KSPRoot)' == '' And '$(KSP_ROOT)' != '' "> |
65 | | - <!-- Default KSPRoot to the "KSP_ROOT" environment variable if it exists --> |
66 | | - <!-- Doing this skips any checks for a valid KSP install so be careful! --> |
67 | | - <KSPRoot >$(KSP_ROOT)</KSPRoot> |
| 104 | + <KSPRoot>$(KSP_ROOT)</KSPRoot> |
68 | 105 | <KSPRootSource>environment variable</KSPRootSource> |
69 | 106 | </PropertyGroup> |
70 | 107 | <ItemGroup> |
|
73 | 110 | <KSPRootCandidate Include="$(SteamKSPRoot)" source="steam"/> |
74 | 111 | </ItemGroup> |
75 | 112 |
|
| 113 | + <!-- Look for KSP install in Solution dir --> |
76 | 114 | <PropertyGroup Condition=" '$(KSPRoot)' == '' And Exists('$(SolutionDir)KSP/$(KSPRootIdentifier)') "> |
77 | | - <!-- Look for KSP install in Solution dir --> |
78 | | - <KSPRoot >$(SolutionDir)KSP</KSPRoot> |
| 115 | + <KSPRoot>$(SolutionDir)KSP</KSPRoot> |
79 | 116 | <KSPRootSource>solution directory</KSPRootSource> |
80 | 117 | </PropertyGroup> |
81 | 118 |
|
| 119 | + <!-- Look for KSP install in ReferencePath --> |
82 | 120 | <PropertyGroup Condition=" '$(KSPRoot)' == '' And Exists('$(ReferencePath)/$(KSPRootIdentifier)') "> |
83 | | - <!-- Look for KSP install in ReferencePath --> |
84 | 121 | <KSPRoot>$(ReferencePath)</KSPRoot> |
85 | 122 | <KSPRootSource>reference path</KSPRootSource> |
86 | 123 | </PropertyGroup> |
87 | 124 |
|
| 125 | + <!-- Look for KSP steam install--> |
88 | 126 | <PropertyGroup Condition=" '$(KSPRoot)' == '' And Exists('$(SteamKSPRoot)/$(KSPRootIdentifier)') "> |
89 | | - <!-- Look for KSP steam install--> |
90 | 127 | <KSPRoot>$(SteamKSPRoot)</KSPRoot> |
91 | 128 | <KSPRootSource>steam</KSPRootSource> |
92 | 129 | </PropertyGroup> |
93 | 130 |
|
94 | | - <PropertyGroup> |
95 | | - <!-- Calculate ManagedPath --> |
96 | | - <ManagedPath>$(KSPRoot)/$(ManagedRelativePath)</ManagedPath> |
| 131 | + <!-- Calculate ManagedPath --> |
| 132 | + <PropertyGroup Condition=" '$(ManagedPath)' == ''"> |
| 133 | + <ManagedPath>$(KSPRoot)/$(KSPManagedRelativePath)</ManagedPath> |
97 | 134 | </PropertyGroup> |
98 | 135 |
|
99 | 136 | <!-- set the start action so that you can launch directly from VS --> |
100 | 137 | <PropertyGroup> |
101 | 138 | <StartAction>Program</StartAction> |
102 | | - <StartProgram>$(KSPRoot)\$(KSPExecutable)</StartProgram> |
| 139 | + <StartProgram>$(KSPRoot)/$(KSPExecutable)</StartProgram> |
103 | 140 | <StartWorkingDirectory>$(KSPRoot)</StartWorkingDirectory> |
104 | 141 | <DebugType>portable</DebugType> |
105 | 142 | </PropertyGroup> |
106 | 143 |
|
107 | | - <!-- Prevent the compiler from acquiring or referencing any external reference assemblies --> |
108 | | - <PropertyGroup> |
109 | | - <!-- Do not download the .NET Framework Target Pack NuGet package automatically --> |
110 | | - <DisableTransitiveFrameworkReferenceDownloads>true</DisableTransitiveFrameworkReferenceDownloads> |
111 | | - <!-- Instruct the compiler to not automatically reference mscorlib --> |
112 | | - <NoStandardLib>true</NoStandardLib> |
113 | | - <!-- Prevent the GetReferenceAssemblyPaths task in Microsoft.Common.CurrentVersion.targets |
114 | | - from attempting to locate an external copy of the reference assemblies. --> |
115 | | - <AutomaticallyUseReferenceAssemblyPackages>false</AutomaticallyUseReferenceAssemblyPackages> |
116 | | - <FrameworkPathOverride>$(ManagedPath)</FrameworkPathOverride> |
117 | | - </PropertyGroup> |
118 | | - |
119 | | - <!--Import references--> |
120 | | - <ItemGroup> |
121 | | - <Reference Include="$(ManagedPath)\System.dll"> |
122 | | - <Name>System (KSP/Mono)</Name> |
123 | | - <Private>False</Private> |
124 | | - </Reference> |
125 | | - <Reference Include="$(ManagedPath)\System.Core.dll"> |
126 | | - <Name>System (KSP/Mono)</Name> |
127 | | - <Private>False</Private> |
128 | | - </Reference> |
129 | | - <Reference Include="$(ManagedPath)\mscorlib.dll"> |
130 | | - <Name>System.Core (KSP/Mono)</Name> |
131 | | - <Private>False</Private> |
132 | | - </Reference> |
133 | | - <Reference Include="$(ManagedPath)\System.Xml.dll"> |
134 | | - <Name>System.Xml (KSP/Mono)</Name> |
135 | | - <Private>False</Private> |
136 | | - </Reference> |
137 | | - </ItemGroup> |
138 | | - <ItemGroup Condition=" '$(ReferenceUnityAssemblies)' == 'true' "> |
139 | | - <Reference Include="$(ManagedPath)\UnityEngine*.dll"> |
140 | | - <Name>UnityEngine</Name> |
141 | | - <Private>False</Private> |
142 | | - </Reference> |
143 | | - </ItemGroup> |
144 | | - <ItemGroup Condition=" '$(ReferenceKSPAssemblies)' == 'true' "> |
145 | | - <Reference Include="$(ManagedPath)\Assembly-CSharp.dll"> |
146 | | - <Name>Assembly-CSharp</Name> |
147 | | - <Private>False</Private> |
148 | | - </Reference> |
149 | | - <Reference Include="$(ManagedPath)\Assembly-CSharp-firstpass.dll"> |
150 | | - <Name>Assembly-CSharp-firstpass</Name> |
151 | | - <Private>False</Private> |
152 | | - </Reference> |
153 | | - </ItemGroup> |
154 | | - |
155 | 144 | <ItemGroup> |
156 | | - <Compile Include = "$(MSBuildThisFileDirectory)/include/*.cs" Condition="exists('$(MSBuildThisFileDirectory)/include')"/> |
| 145 | + <Compile Include="$(MSBuildThisFileDirectory)/include/*.cs" Condition="exists('$(MSBuildThisFileDirectory)/include')"/> |
157 | 146 | </ItemGroup> |
158 | 147 | </Project> |
0 commit comments