mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-21 07:39:41 -10:00
* Make Is*Project properties unambiguous
Currently these properties exist which categorize projects:
- IsReferenceAssembly: The project's parent directory is 'ref'
- IsGeneratorProject: The project's parent directory is 'gen'
- IsTestProject: The project is located somewhere under a '/tests/'
directory and the project name's suffix is either
'.Tests' or '.UnitTests'.
- IsTrimmingTestProject: Same as IsTestProject but the project name's
suffix is '.TrimmingTests'.
- IsTestSupportProject: The project is located somewhere under a
'/tests/' directory and the above IsTestProject
property is false.
- UsingMicrosoftNoTargetsSdk: The project uses the NoTargets msbuild SDK
- UsingMicrosoftTraversalSdk: The project uses the Traversal msbuild SDK
- IsRuntimeAssembly: True when all above is false
- IsSourceProject: True when the project's parent directory is 'src'
The IsRuntimeAssembly and IsSourceProject properties meanings are
ambiguous and the property names aren't consistent (IsReferenceAssembly
vs IsGeneratorProject).
I'm changing the above to the following:
- **IsReferenceSourceProject: The project's parent directory is 'ref'
or the parent of the parent directory is 'ref'**
- IsGeneratorProject: The project's parent directory is 'gen'
- IsTestProject: The project is located somewhere under a '/tests/'
directory and the project name's suffix is either
'.Tests' or '.UnitTests'.
- IsTrimmingTestProject: Same as IsTestProject but the project name's
suffix is '.TrimmingTests'.
- IsTestSupportProject: The project is located somewhere under a
'/tests/' directory and the above IsTestProject
**and IsTrimmingTestProject** props are false.
- UsingMicrosoftNoTargetsSdk: The project uses the NoTargets msbuild SDK
- UsingMicrosoftTraversalSdk: The project uses the Traversal msbuild SDK
- IsSourceProject: **True when all above is false.**
* React to PR feedback
31 lines
1.7 KiB
XML
31 lines
1.7 KiB
XML
<Project>
|
|
|
|
<PropertyGroup Condition="'$(IsEligibleForNgenOptimization)' == ''">
|
|
<IsEligibleForNgenOptimization>true</IsEligibleForNgenOptimization>
|
|
<IsEligibleForNgenOptimization Condition="'$(IsReferenceAssemblyProject)' == 'true'">false</IsEligibleForNgenOptimization>
|
|
<IsEligibleForNgenOptimization Condition="'$(GeneratePlatformNotSupportedAssembly)' == 'true' or '$(GeneratePlatformNotSupportedAssemblyMessage)' != ''">false</IsEligibleForNgenOptimization>
|
|
<!-- There's an issue causing IBCMerge failures because of mismatched MVIDs
|
|
across many of our assemblies on Mac, so disable
|
|
IBCMerge optimizations on Mac for now to unblock the offical build.
|
|
See issue https://github.com/dotnet/runtime/issues/33303
|
|
-->
|
|
<IsEligibleForNgenOptimization Condition="'$(TargetOS)' == 'OSX' or '$(TargetsMobile)' == 'true'">false</IsEligibleForNgenOptimization>
|
|
</PropertyGroup>
|
|
|
|
<Target Name="SetApplyNgenOptimization"
|
|
Condition="'$(IsEligibleForNgenOptimization)' == 'true'"
|
|
BeforeTargets="CoreCompile">
|
|
<PropertyGroup>
|
|
<IbcOptimizationDataDir Condition="'$(TargetOS)' == 'Unix' or '$(TargetOS)' == 'Linux'">$(IbcOptimizationDataDir)Linux\</IbcOptimizationDataDir>
|
|
<IbcOptimizationDataDir Condition="'$(TargetOS)' == 'windows'">$(IbcOptimizationDataDir)Windows\</IbcOptimizationDataDir>
|
|
</PropertyGroup>
|
|
<ItemGroup>
|
|
<_optimizationDataAssembly Include="$(IbcOptimizationDataDir)**\$(TargetFileName)" />
|
|
</ItemGroup>
|
|
<PropertyGroup>
|
|
<ApplyNgenOptimization Condition="'@(_optimizationDataAssembly)' != ''">full</ApplyNgenOptimization>
|
|
</PropertyGroup>
|
|
</Target>
|
|
|
|
</Project>
|