about summary refs log tree commit diff
path: root/LibMatrix/LibMatrix.csproj
blob: 047869946a5a0abb4424884b688cb8c9e5df03e6 (plain) (blame)
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
<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <TargetFramework>net8.0</TargetFramework>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
        <LangVersion>preview</LangVersion>

        <Optimize>true</Optimize>
        <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
        
        <!-- event rewrite dev... -->
<!--        <DefineConstants Condition="!$(ExtraDefineConstants.Contains('WITH_LEGACY_EVENTS'))">$(DefineConstants);DISABLE_LEGACY_EVENTS</DefineConstants>-->
        <DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
        <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
    </ItemGroup>

    <ItemGroup>
        <ProjectReference Condition="Exists('..\ArcaneLibs\ArcaneLibs\ArcaneLibs.csproj')" Include="..\ArcaneLibs\ArcaneLibs\ArcaneLibs.csproj"/>
        <!-- This is dangerous, but eases development since locking the version will drift out of sync without noticing,
                which causes build errors due to missing functions.
                Using the NuGet version in development is annoying due to delays between pushing and being able to consume.
                If you want to use a time-appropriate version of the library, recursively clone https://cgit.rory.gay/matrix/MatrixUtils.git
                instead, since this will be locked by the MatrixUtils project, which contains both LibMatrix and ArcaneLibs as a submodule. -->
        <PackageReference Condition="!Exists('..\ArcaneLibs\ArcaneLibs\ArcaneLibs.csproj')" Include="ArcaneLibs" Version="*-preview*"/>
    </ItemGroup>
    
    <ItemGroup Condition="!$(DefineConstants.Contains('DISABLE_LEGACY_EVENTS'))">
        <ProjectReference Include="..\LibMatrix.LegacyEvents.EventTypes\LibMatrix.LegacyEvents.EventTypes.csproj" />
    </ItemGroup>
    <Target Name="ArcaneLibsNugetWarning" AfterTargets="AfterBuild">
        <Warning Text="ArcaneLibs is being referenced from NuGet, which is dangerous. Please read the warning in LibMatrix.csproj!" Condition="!Exists('..\ArcaneLibs\ArcaneLibs\ArcaneLibs.csproj')"/>
    </Target>

</Project>