Skip to content

Commit

Permalink
[MTGOSDK] Explicitly enumerate MTGO dependencies
Browse files Browse the repository at this point in the history
Avoids importing unnecessary reference assemblies during build.
  • Loading branch information
Qonfused committed Dec 16, 2023
1 parent 85ea738 commit fad49e3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 34 deletions.
2 changes: 1 addition & 1 deletion MTGOSDK.MSBuild/build/MTGOSDK.MSBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
<_MTGOSDK_Refs>$(SolutionDir)dist\$(Configuration)\Reference\MTGO</_MTGOSDK_Refs>
</PropertyGroup>

</Project>
</Project>
10 changes: 1 addition & 9 deletions MTGOSDK.MSBuild/build/MTGOSDK.MSBuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,6 @@
Importance="high" />
<Message Text="MTGOSDK.MSBuild: Reference assemblies are located at $(_MTGOSDK_Refs)"
Importance="high" />

<PropertyGroup>
<!--
We need to set the `ReferencePath` property to include the path to the
MTGO reference assemblies so that consuming projects can resolve them.
-->
<ReferencePath>$(ReferencePath);$(_MTGOSDK_Refs)</ReferencePath>
</PropertyGroup>
</Target>

</Project>
</Project>
14 changes: 1 addition & 13 deletions MTGOSDK.Ref/MTGOSDK.Ref.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@
<Import Project="..\MTGOSDK.MSBuild\build\MTGOSDK.MSBuild.props" />
<Import Project="..\MTGOSDK.MSBuild\build\MTGOSDK.MSBuild.targets" />

<!-- Merge any executables into a single DLL to be used as a reference. -->
<Target Name="ILMerge"
AfterTargets="GenerateReferenceAssemblies"
Condition="Exists('$(_MTGOSDK_Refs)')">
<Exec Command="$(ILMergeConsolePath) ^
MTGO.exe /ndebug ^
/target=library ^
/lib=$(_MTGOSDK_Refs) ^
/out=$(_MTGOSDK_Refs)\MTGO.dll"
/>
</Target>

<!-- Notify the user that the reference assemblies have been built. -->
<Target Name="NotifyRefsBuildComplete"
AfterTargets="ILMerge"
Expand All @@ -43,4 +31,4 @@
Importance="high" />
</Target>

</Project>
</Project>
31 changes: 20 additions & 11 deletions MTGOSDK/MTGOSDK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
<LangVersion>Preview</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<NoWarn>
CS8597; <!-- Thrown value may be null. -->
CS8600; <!-- Converting null literal or possible null value to non-nullable type. -->
CS8602; <!-- Possible dereference of a null reference. -->
CS8603; <!-- Possible null reference return. -->
CS8604; <!-- Possible null reference argument for parameter -->
CS8625; <!-- Cannot convert null literal to non-nullable reference type. -->
IDE0065; <!-- Using directives within a namespace declaration. -->
</NoWarn>
<!-- Disables unenforcable nullable warnings - breaks static analysis -->
<NoWarn>$(NoWarn);CS8597;CS8600;CS8602;CS8603;CS8604;CS8625;IDE0065;</NoWarn>
<!-- Used for referencing WPF assemblies at runtime (w/ reflection) -->
<UseWPF>true</UseWPF>
</PropertyGroup>

<!-- Publishing Configuration -->
<PropertyGroup>
<PublishDir>..\publish\</PublishDir>
<DebugType>embedded</DebugType>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\MTGOSDK.Win32\MTGOSDK.Win32.csproj" />
<ProjectReference Include="..\third_party\RemoteNET\src\RemoteNET\RemoteNET.csproj" />
Expand All @@ -29,6 +29,9 @@
import the MTGOSDK.MSBuild.props file before referencing the project.
-->
<Import Project="..\MTGOSDK.MSBuild\build\MTGOSDK.MSBuild.props" />
<PropertyGroup>
<MTGOSDK_Refs>$(_MTGOSDK_Refs)\3.4.*.*</MTGOSDK_Refs>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\MTGOSDK.Ref\MTGOSDK.Ref.csproj"
ReferenceOutputAssembly="false" />
Expand All @@ -37,10 +40,16 @@
Note that the '_MTGOSDK_Refs' path does not reference the updated version
subpath as it is only evaluated after building the MTGOSDK.Ref project.
-->
<Reference Include="$(_MTGOSDK_Refs)\3.4.*.*\*.dll" />
<Reference Include="$(MTGOSDK_Refs)\Core.dll" />
<Reference Include="$(MTGOSDK_Refs)\FlsClient.dll" />
<Reference Include="$(MTGOSDK_Refs)\MTGOEnumStruct.dll" />
<Reference Include="$(MTGOSDK_Refs)\WotC.MtGO.Client.Common.dll" />
<Reference Include="$(MTGOSDK_Refs)\WotC.MtGO.Client.Model.Chat.dll" />
<Reference Include="$(MTGOSDK_Refs)\WotC.MtGO.Client.Model.Core.dll" />
<Reference Include="$(MTGOSDK_Refs)\WotC.MtGO.Client.Model.Reference.dll" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ImpromptuInterface" Version="7.0.1" />
</ItemGroup>

</Project>
</Project>

0 comments on commit fad49e3

Please sign in to comment.