Skip to content

Commit 31852ae

Browse files
committed
move references back where they belong, fix whitespace
1 parent 08ad322 commit 31852ae

2 files changed

Lines changed: 66 additions & 96 deletions

File tree

KSPCommon.props

Lines changed: 66 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,77 +7,47 @@
77
<!-- default settings for KSPBT targets and references -->
88
<PropertyGroup>
99
<!-- 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>
10+
<ReferenceKSPSystemAssemblies Condition=" '$(ReferenceKSPSystemAssemblies)' == '' ">true</ReferenceKSPSystemAssemblies>
11+
<ReferenceKSPUnityAssemblies Condition=" '$(ReferenceKSPUnityAssemblies)' == '' ">true</ReferenceKSPUnityAssemblies>
12+
<ReferenceKSPGameAssemblies Condition=" '$(ReferenceKSPGameAssemblies)' == '' ">true</ReferenceKSPGameAssemblies>
1913

2014

2115
<!-- Copy DLLs to mod folder -->
22-
<CopyDLLsToPluginFolder Condition=" '$(CopyDLLsToPluginFolder)' == '' ">
23-
true
24-
</CopyDLLsToPluginFolder>
16+
<CopyDLLsToPluginFolder Condition=" '$(CopyDLLsToPluginFolder)' == '' ">true</CopyDLLsToPluginFolder>
2517

2618

27-
<GenerateKSPAssemblyAttribute Condition=" '$(GenerateKSPAssemblyAttribute)' == '' ">
28-
true
29-
</GenerateKSPAssemblyAttribute>
19+
<GenerateKSPAssemblyAttribute Condition=" '$(GenerateKSPAssemblyAttribute)' == '' ">true</GenerateKSPAssemblyAttribute>
3020

31-
<GenerateKSPAssemblyDependencyAttributes Condition=" '$(GenerateKSPAssemblyDependencyAttributes)' == '' ">
32-
true
33-
</GenerateKSPAssemblyDependencyAttributes>
21+
<GenerateKSPAssemblyDependencyAttributes Condition=" '$(GenerateKSPAssemblyDependencyAttributes)' == '' ">true</GenerateKSPAssemblyDependencyAttributes>
3422

35-
<GenerateKSPVersionFile Condition=" '$(GenerateKSPVersionFile)' == '' ">
36-
true
37-
</GenerateKSPVersionFile>
23+
<GenerateKSPVersionFile Condition=" '$(GenerateKSPVersionFile)' == '' ">true</GenerateKSPVersionFile>
3824

3925
<!-- default CKAN compatibility versions -->
40-
<CKANCompatibleVersions Condition=" '$(CKANCompatibleVersions)' == '' ">
41-
1.12 1.11 1.10 1.9 1.8
42-
</CKANCompatibleVersions>
26+
<CKANCompatibleVersions Condition=" '$(CKANCompatibleVersions)' == '' ">1.12 1.11 1.10 1.9 1.8</CKANCompatibleVersions>
4327
</PropertyGroup>
4428

4529
<!--Parse KSP platform-specific paths -->
4630
<!-- These can be overwritten by user and props files -->
4731
<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>
32+
<KSPManagedRelativePath Condition=" $([MSBuild]::IsOsPlatform('Windows')) ">KSP_x64_Data/Managed</KSPManagedRelativePath>
33+
<KSPManagedRelativePath Condition=" $([MSBuild]::IsOsPlatform('OSX')) ">KSP.app/Contents/Resources/Data/Managed</KSPManagedRelativePath>
34+
<KSPManagedRelativePath Condition=" $([MSBuild]::IsOsPlatform('Linux')) ">KSP_Data/Managed</KSPManagedRelativePath>
5735
</PropertyGroup>
5836

5937
<PropertyGroup>
6038
<KSPExecutable Condition=" $([MSBuild]::IsOsPlatform('Windows')) ">KSP_x64.exe</KSPExecutable>
6139
<KSPExecutable Condition=" $([MSBuild]::IsOsPlatform('OSX')) ">KSP.app/Contents/MacOS/KSP</KSPExecutable>
6240
<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>
41+
<SteamKSPRoot Condition=" $([MSBuild]::IsOsPlatform('Windows')) ">C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program</SteamKSPRoot>
42+
<SteamKSPRoot Condition=" $([MSBuild]::IsOsPlatform('OSX')) ">$(HOME)/Library/Application Support/Steam/steamapps/common/Kerbal Space Program</SteamKSPRoot>
6943
</PropertyGroup>
7044

7145
<!-- Calculate mod paths -->
7246
<!-- These can be overwritten by user, csproj, and props files -->
7347
<PropertyGroup>
7448
<!-- 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>
49+
<KSPModRoot Condition=" '$(KSPModRoot)' == '' ">$(ProjectDir)/../GameData/$(ProjectName)/</KSPModRoot>
50+
<KSPModPluginFolder Condition=" '$(KSPModPluginFolder)' == '' ">$(KSPModGameData)/Plugins/</KSPModPluginFolder>
8151
</PropertyGroup>
8252

8353
<!-- Import the csproj.user file. -->
@@ -141,6 +111,57 @@
141111
<DebugType>portable</DebugType>
142112
</PropertyGroup>
143113

114+
<!-- Prevent the compiler from acquiring or referencing any external reference assemblies -->
115+
<PropertyGroup Condition=" '$(ReferenceKSPSystemAssemblies)' == 'true' ">
116+
<!-- Do not download the .NET Framework Target Pack NuGet package automatically -->
117+
<DisableTransitiveFrameworkReferenceDownloads>true</DisableTransitiveFrameworkReferenceDownloads>
118+
<!-- Instruct the compiler to not automatically reference mscorlib -->
119+
<NoStandardLib>true</NoStandardLib>
120+
<!-- Prevent the GetReferenceAssemblyPaths task in Microsoft.Common.CurrentVersion.targets
121+
from attempting to locate an external copy of the reference assemblies. -->
122+
<AutomaticallyUseReferenceAssemblyPackages>false</AutomaticallyUseReferenceAssemblyPackages>
123+
<FrameworkPathOverride>$(ManagedPath)</FrameworkPathOverride>
124+
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
125+
</PropertyGroup>
126+
127+
128+
<!-- Import references -->
129+
<ItemGroup Condition=" '$(ReferenceKSPSystemAssemblies)' == 'true' ">
130+
<Reference Include="$(ManagedPath)/System.dll">
131+
<Name>System (KSP/Mono)</Name>
132+
<Private>False</Private>
133+
</Reference>
134+
<Reference Include="$(ManagedPath)/System.Core.dll">
135+
<Name>System (KSP/Mono)</Name>
136+
<Private>False</Private>
137+
</Reference>
138+
<Reference Include="$(ManagedPath)/mscorlib.dll">
139+
<Name>System.Core (KSP/Mono)</Name>
140+
<Private>False</Private>
141+
</Reference>
142+
<Reference Include="$(ManagedPath)/System.Xml.dll">
143+
<Name>System.Xml (KSP/Mono)</Name>
144+
<Private>False</Private>
145+
</Reference>
146+
</ItemGroup>
147+
<ItemGroup Condition=" '$(ReferenceKSPUnityAssemblies)' == 'true' ">
148+
<Reference Include="$(ManagedPath)/UnityEngine*.dll">
149+
<Name>UnityEngine</Name>
150+
<Private>False</Private>
151+
</Reference>
152+
</ItemGroup>
153+
<ItemGroup Condition=" '$(ReferenceKSPGameAssemblies)' == 'true' ">
154+
<Reference Include="$(ManagedPath)/Assembly-CSharp.dll">
155+
<Name>Assembly-CSharp</Name>
156+
<Private>False</Private>
157+
</Reference>
158+
<Reference Include="$(ManagedPath)/Assembly-CSharp-firstpass.dll">
159+
<Name>Assembly-CSharp-firstpass</Name>
160+
<Private>False</Private>
161+
</Reference>
162+
</ItemGroup>
163+
164+
144165
<ItemGroup>
145166
<Compile Include="$(MSBuildThisFileDirectory)/include/*.cs" Condition="exists('$(MSBuildThisFileDirectory)/include')"/>
146167
</ItemGroup>

KSPCommon.targets

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,6 @@
77
<!-- For GenerateKSPVersionFile -->
88
<PackageReference Include="JsonPoke" Version="1.2.0" Condition="'@(KSPVersionFile)' != ''"/>
99
</ItemGroup>
10-
11-
<!-- Prevent the compiler from acquiring or referencing any external reference assemblies -->
12-
<PropertyGroup Condition=" '$(ReferenceKSPSystemAssemblies)' == 'true' ">
13-
<!-- Do not download the .NET Framework Target Pack NuGet package automatically -->
14-
<DisableTransitiveFrameworkReferenceDownloads>true</DisableTransitiveFrameworkReferenceDownloads>
15-
<!-- Instruct the compiler to not automatically reference mscorlib -->
16-
<NoStandardLib>true</NoStandardLib>
17-
<!-- Prevent the GetReferenceAssemblyPaths task in Microsoft.Common.CurrentVersion.targets
18-
from attempting to locate an external copy of the reference assemblies. -->
19-
<AutomaticallyUseReferenceAssemblyPackages>false</AutomaticallyUseReferenceAssemblyPackages>
20-
<FrameworkPathOverride>$(ManagedPath)</FrameworkPathOverride>
21-
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
22-
</PropertyGroup>
23-
24-
<!-- Import references -->
25-
<ItemGroup Condition=" '$(ReferenceKSPSystemAssemblies)' == 'true' ">
26-
<Reference Include="$(ManagedPath)/System.dll">
27-
<Name>System (KSP/Mono)</Name>
28-
<Private>False</Private>
29-
</Reference>
30-
<Reference Include="$(ManagedPath)/System.Core.dll">
31-
<Name>System (KSP/Mono)</Name>
32-
<Private>False</Private>
33-
</Reference>
34-
<Reference Include="$(ManagedPath)/mscorlib.dll">
35-
<Name>System.Core (KSP/Mono)</Name>
36-
<Private>False</Private>
37-
</Reference>
38-
<Reference Include="$(ManagedPath)/System.Xml.dll">
39-
<Name>System.Xml (KSP/Mono)</Name>
40-
<Private>False</Private>
41-
</Reference>
42-
</ItemGroup>
43-
<ItemGroup Condition=" '$(ReferenceKSPUnityAssemblies)' == 'true' ">
44-
<Reference Include="$(ManagedPath)/UnityEngine*.dll">
45-
<Name>UnityEngine</Name>
46-
<Private>False</Private>
47-
</Reference>
48-
</ItemGroup>
49-
<ItemGroup Condition=" '$(ReferenceKSPGameAssemblies)' == 'true' ">
50-
<Reference Include="$(ManagedPath)/Assembly-CSharp.dll">
51-
<Name>Assembly-CSharp</Name>
52-
<Private>False</Private>
53-
</Reference>
54-
<Reference Include="$(ManagedPath)/Assembly-CSharp-firstpass.dll">
55-
<Name>Assembly-CSharp-firstpass</Name>
56-
<Private>False</Private>
57-
</Reference>
58-
</ItemGroup>
59-
60-
6110
<!--Custom Targets-->
6211
<Target Name="CheckForKSPRoot" BeforeTargets="ResolveReferences">
6312
<Error Text="KSPBuildTools was unable to find a KSP installation. Please set the ReferencePath or KSPRoot property

0 commit comments

Comments
 (0)