forked from 0x0ade/CelesteNet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CelesteNet.props
63 lines (50 loc) · 3.33 KB
/
CelesteNet.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
<Project>
<PropertyGroup>
<LangVersion>11</LangVersion>
<Nullable Condition="'$(Nullable)' == ''">enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsServer>$(AssemblyName.EndsWith('Server'))</IsServer>
<IsModule>$(AssemblyName.EndsWith('Module'))</IsModule>
<IsShared>$(AssemblyName.EndsWith('Shared'))</IsShared>
<IsClient>false</IsClient>
<IsClient Condition="!$(IsServer) And !$(IsModule) And !$(IsShared)">true</IsClient>
<!-- Set this to true so that server & shared don't get Celeste assembly refs, e.g. to test such builds -->
<!-- WARNING: This breaks Client builds because the "non-Celeste" CelesteNet.Shared assembly is only intended for Server and I'm not gonna fix this because it would be pointless :3 -->
<BuildServerWithoutCeleste>false</BuildServerWithoutCeleste>
<Version>2.0.0.0</Version>
<CelestePrefix Condition="'$(CelestePrefix)' == '' And Exists('..\..\..\Celeste.dll')">..\..\..</CelestePrefix>
<CelestePrefix Condition="'$(CelestePrefix)' == ''">..\lib-stripped</CelestePrefix>
<CelesteAvailable Condition="Exists('$(CelestePrefix)\Celeste.dll') And Exists('$(CelestePrefix)\MMHOOK_Celeste.dll')">true</CelesteAvailable>
<CelesteAvailable Condition="$(BuildServerWithoutCeleste) And !$(IsClient)">false</CelesteAvailable>
<CopyCeleste Condition="'$(CopyCeleste)' == ''">$(IsServer)</CopyCeleste>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\CelesteNet.Server\CelesteNet.Server.csproj" Private="false" Condition="$(IsModule)" />
</ItemGroup>
<Target Name="EnsureCelesteExists" BeforeTargets="PreBuildEvent">
<Error
Condition="!$(CelesteAvailable) And $(IsClient)"
Text="Cannot find Celeste. Make sure CelesteNet is cloned in your Celeste/Mods folder. Alternatively, copy Celeste.dll, FNA.dll and MMHOOK_Celeste.dll to a folder called 'lib-stripped' in the repository root." />
</Target>
<ItemGroup>
<PackageReference Include="MonoMod.RuntimeDetour" Version="25.0.2" PrivateAssets="all" ExcludeAssets="runtime" />
<PackageReference Include="MonoMod.Utils" Version="25.0.3" />
<PackageReference Include="YamlDotNet" Version="15.1.2" />
</ItemGroup>
<ItemGroup Condition="$(CelesteAvailable)">
<Reference Include="Celeste" HintPath="$(CelestePrefix)\Celeste.dll" Private="$(CopyCeleste)" />
<Reference Include="MMHOOK_Celeste" HintPath="$(CelestePrefix)\MMHOOK_Celeste.dll" Private="$(CopyCeleste)" />
</ItemGroup>
<ItemGroup>
<!-- core is always FNA, so we can ditch XNA :lfgeline: -->
<Reference Include="FNA" HintPath="$(CelestePrefix)\FNA.dll" Private="$(CopyCeleste)" />
</ItemGroup>
<Target Name="CopyModuleAssembly" AfterTargets="PostBuildEvent" Condition="$(IsModule)">
<ItemGroup>
<MainFiles Include="bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).*" Exclude="" />
<MiscFiles Include="bin\$(Configuration)\$(TargetFramework)\*" Exclude="@(MainFiles)" />
</ItemGroup>
<Copy SourceFiles="@(MiscFiles)" DestinationFolder="..\CelesteNet.Server\bin\$(Configuration)\$(TargetFramework)\Modules" SkipUnchangedFiles="true" ContinueOnError="true" Retries="1" />
<Copy SourceFiles="@(MainFiles)" DestinationFolder="..\CelesteNet.Server\bin\$(Configuration)\$(TargetFramework)\Modules" SkipUnchangedFiles="true" ContinueOnError="false" />
</Target>
</Project>