|
1 | 1 | <Project> |
2 | 2 |
|
3 | 3 | <PropertyGroup> |
4 | | - <SentryNativeSourceDirectory>..\..\modules\sentry-native\</SentryNativeSourceDirectory> |
| 4 | + <SentryNativeSourceDirectory>$(MSBuildThisFileDirectory)..\..\..\..\modules\sentry-native\</SentryNativeSourceDirectory> |
5 | 5 | <SentryNativeLibraryName>sentry-native</SentryNativeLibraryName> |
6 | | - <SentryNativeBuildScript>../../scripts/build-sentry-native.ps1</SentryNativeBuildScript> |
7 | | - <SentryNativeBuildInputs>../../.git/modules/modules/sentry-native/HEAD;$(MSBuildThisFileDirectory)Sentry.Native.targets;$(SentryNativeBuildScript)</SentryNativeBuildInputs> |
| 6 | + <SentryNativeBuildScript>$(MSBuildThisFileDirectory)..\..\..\..\scripts\build-sentry-native.ps1</SentryNativeBuildScript> |
| 7 | + <SentryNativeBuildInputs>$(MSBuildThisFileDirectory)..\..\..\..\.git\modules\modules\sentry-native/HEAD;$(MSBuildThisFileDirectory)Sentry.Native.targets;$(SentryNativeBuildScript)</SentryNativeBuildInputs> |
8 | 8 | <SentryNativeOutputDirectory>$(MSBuildThisFileDirectory)sentry-native\</SentryNativeOutputDirectory> |
9 | 9 | <!-- List of runtime identifiers: https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json --> |
10 | 10 | <NativeLibRelativePath-win-x64>win-x64</NativeLibRelativePath-win-x64> |
|
85 | 85 | <!-- Build the Sentry Native SDK (this only runs on local machines because in CI we expect the SDK to be |
86 | 86 | built already on each native platform and fetched for the final .net build. --> |
87 | 87 | <Target Name="_BuildSentryNativeSDK" |
88 | | - BeforeTargets="DispatchToInnerBuilds;BeforeBuild" |
89 | | - Condition="'$(_SentryIsNet8OrGreater)' == 'true' and '$(CI)' != 'true'" |
90 | 88 | Inputs="$(SentryNativeBuildInputs)" |
91 | 89 | Outputs="$(SentryNativeBuildOutputs)"> |
92 | 90 | <!-- We want a "-Clean" because if the build script changes, previous cmake cache may contain invalid defines. --> |
93 | 91 | <Exec Command="pwsh $(SentryNativeBuildScript) -Clean" /> |
94 | 92 | </Target> |
| 93 | + |
| 94 | + <!-- We want to build the sentry-native only once, BEFORE building TFM specific verions of the SDK --> |
| 95 | + <!-- How to run a target exactly once: https://learn.microsoft.com/visualstudio/msbuild/run-target-exactly-once--> |
| 96 | + <Target Name="_BuildSentryNativeSDKBeforeOuterBuild" |
| 97 | + Condition="'$(_SentryIsNet8OrGreater)' == 'true' and '$(CI)' != 'true'" |
| 98 | + DependsOnTargets="_BuildSentryNativeSDK" |
| 99 | + BeforeTargets="DispatchToInnerBuilds"> |
| 100 | + </Target> |
| 101 | + |
| 102 | + <Target Name="_BuildSentryNativeSDKBeforeInnerBuild" |
| 103 | + Condition="'$(_SentryIsNet8OrGreater)' == 'true' and '$(CI)' != 'true'" |
| 104 | + BeforeTargets="BeforeBuild"> |
| 105 | + <MSBuild Projects="$(MSBuildProjectFullPath)" |
| 106 | + Targets="_BuildSentryNativeSDK" |
| 107 | + RemoveProperties="TargetFramework" /> |
| 108 | + </Target> |
95 | 109 | </Project> |
0 commit comments