forked from SubnauticaNitrox/Nitrox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDirectory.Build.props
79 lines (75 loc) · 4.2 KB
/
Directory.Build.props
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
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="PrepareForModding">
<!-- Set default properties for all projects (can be overridden per project) -->
<PropertyGroup>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<LangVersion>9</LangVersion>
<TestLibrary>false</TestLibrary>
<NitroxLibrary>false</NitroxLibrary>
<UnityModLibrary>false</UnityModLibrary>
<BuildToolDir>$(SolutionDir)Nitrox.BuildTool\bin\</BuildToolDir>
<BuildGenDir>$(BuildToolDir)generated_files\</BuildGenDir>
<BuildGenDllDir>$(BuildGenDir)publicized_assemblies\</BuildGenDllDir>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DefineConstants>TRACE;DEBUG</DefineConstants>
<OutputPath>bin\Debug\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>TRACE;RELEASE</DefineConstants>
<OutputPath>bin\Release\</OutputPath>
<DebugType>pdbonly</DebugType>
<DebugSymbols>false</DebugSymbols>
<Optimize>true</Optimize>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PathMap>$(MSBuildProjectDirectory)=$(MSBuildProjectName)</PathMap>
</PropertyGroup>
<PropertyGroup Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(MSBuildProjectName), '^Nitrox.*$'))">
<NitroxLibrary>true</NitroxLibrary>
<!-- Set default runtime target to windows (until we can do cross-platform code) -->
<RuntimeIdentifier>win</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(NitroxLibrary)' == 'true' and '$(MSBuildProjectName)' != 'NitroxModel' and '$(MSBuildProjectName)' != 'NitroxServer' and '$(MSBuildProjectName)' != 'Nitrox.Bootloader' and '$(MSBuildProjectName)' != 'Nitrox.BuildTool'">
<UnityModLibrary>true</UnityModLibrary>
</PropertyGroup>
<PropertyGroup Condition="'$(MSBuildProjectName)' == 'NitroxTest'">
<TestLibrary>true</TestLibrary>
</PropertyGroup>
<ItemGroup Condition="'$(NitroxLibrary)' == 'true'">
<!-- Include common assembly info if project name starts with Nitrox -->
<Compile Include="$(SolutionDir)AssemblyInfoCommon.cs">
<Link>Properties\AssemblyInfoCommon.cs</Link>
</Compile>
</ItemGroup>
<!-- Include default project references to all other "Nitrox*" projects -->
<Choose>
<When Condition="'$(UnityModLibrary)' == 'true'">
<ItemGroup>
<!-- Require other Nitrox projects (that need game DLLs) to wait on BuildTool. -->
<ProjectReference Include="$(SolutionDir)Nitrox.BuildTool\Nitrox.BuildTool.csproj">
<Project>{15C4C9C4-683C-4EF0-9E0F-0664A3BDA0CE}</Project>
<Name>Nitrox.BuildTool</Name>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)NitroxModel\NitroxModel.csproj">
<Project>{B16F4DE7-21AD-4FEF-955B-0A5A365FA4E3}</Project>
<Name>NitroxModel</Name>
</ProjectReference>
</ItemGroup>
</When>
</Choose>
<!-- Tell developer that it needs to build the Nitrox.BuildTool to fetch the game assemblies.
"dotnet restore" should still be allowed to run to fetch NuGet packages -->
<Target Name="PrepareForModding" AfterTargets="Restore;BeforeResolveReferences" Condition="'$(UnityModLibrary)' == 'true' and !Exists('$(BuildGenDir)publicized_assemblies')">
<Error Text="Run the Nitrox.BuildTool project to fetch the assemblies, before building other Nitrox projects." />
</Target>
<!-- Include generated build properties. -->
<Import Project="$(BuildGenDir)game.props" Condition="Exists('$(BuildGenDir)game.props')"/>
</Project>