@@ -146,12 +146,19 @@ IReadOnlyCollection<Output> MsBuildCommon(
146
146
ProcessTasks . StartProcess ( "xcodebuild" , args ) . AssertZeroExitCode ( ) ;
147
147
} ) ;
148
148
149
+ bool IsDotnetCoreOnlyBuild ( )
150
+ {
151
+ //avalonia can't build with msbuild from vs 2019 so we need vs 2022
152
+ var r = int . Parse ( VSWhere ( "-latest -nologo -property catalog_productLineVersion" ) . First ( ) . Text ) ;
153
+ return ForceDotNetCoreBuild || ( r <= 2019 ) ;
154
+ }
155
+
149
156
Target Compile => _ => _
150
157
. DependsOn ( Clean , CompileNative )
151
158
. DependsOn ( CompileHtmlPreviewer )
152
159
. Executes ( async ( ) =>
153
160
{
154
- if ( Parameters . IsRunningOnWindows )
161
+ if ( Parameters . IsRunningOnWindows && ! IsDotnetCoreOnlyBuild ( ) )
155
162
MsBuildCommon ( Parameters . MSBuildSolution , c => c
156
163
. SetProcessArgumentConfigurator ( a => a . Add ( "/r" ) )
157
164
. AddTargets ( "Build" )
@@ -188,7 +195,7 @@ await ObservablesForEventGenerator.ExtractEventsFromAssemblies(
188
195
}
189
196
190
197
var eventsProject = Path . Combine ( eventsDirectory , "Avalonia.ReactiveUI.Events.csproj" ) ;
191
- if ( Parameters . IsRunningOnWindows )
198
+ if ( Parameters . IsRunningOnWindows && ! IsDotnetCoreOnlyBuild ( ) )
192
199
MsBuildCommon ( eventsProject , c => c
193
200
. SetProcessArgumentConfigurator ( a => a . Add ( "/r" ) )
194
201
. AddTargets ( "Build" )
@@ -332,14 +339,15 @@ void RunCoreTest(string projectName)
332
339
. After ( RunTests )
333
340
. Executes ( ( ) =>
334
341
{
335
- if ( Parameters . IsRunningOnWindows )
342
+ if ( Parameters . IsRunningOnWindows && ! IsDotnetCoreOnlyBuild ( ) )
336
343
337
344
MsBuildCommon ( Parameters . MSBuildSolution , c => c
338
345
. AddTargets ( "Pack" ) ) ;
339
346
else
340
347
DotNetPack ( c => c
341
348
. SetProject ( Parameters . MSBuildSolution )
342
349
. SetConfiguration ( Parameters . Configuration )
350
+ . AddProperty ( "PackAvaloniaNative" , "true" )
343
351
. AddProperty ( "PackageVersion" , Parameters . Version ) ) ;
344
352
} ) ;
345
353
0 commit comments