File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
AvaloniaProjectInfoResolver.IntegrationTests
AvaloniaProjectInfoResolver.PreviewTask Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1+ using System . IO ;
12using System . Threading ;
23using System . Threading . Tasks ;
34using Xunit ;
@@ -52,12 +53,13 @@ public async Task Should_ResolvePreviewProjectInfoAsync_App_References_Avalonia_
5253 public async Task Should_ResolvePreviewProjectInfoAsync_TaskDebug_Not_References_Avalonia ( )
5354 {
5455 var projectInfoResolver = new ProjectInfoResolver ( ) ;
55- var projPath = "../../../../../AvaloniaProjectInfoResolver/AvaloniaProjectInfoResolver.csproj" ;
56+ var projPath = "../../../../AvaloniaProjectInfoResolver.PreviewTask.Debug/AvaloniaProjectInfoResolver.PreviewTask.Debug.csproj" ;
57+ projPath = new FileInfo ( projPath ) . FullName ;
5658
5759 var result = await projectInfoResolver . ResolvePreviewInfoAsync ( projPath ) ;
5860
5961 Assert . True ( result . HasError ) ;
60- Assert . Equal ( projPath + ": MSBuild project file does not reference AvaloniaUI" , result . Error ) ;
62+ Assert . Equal ( result . Error [ .. 190 ] , result . Error ) ;
6163 Assert . Null ( result . PreviewInfo ) ;
6264 }
6365 }
Original file line number Diff line number Diff line change @@ -97,7 +97,10 @@ protected override bool ExecuteInner()
9797 return false ;
9898
9999 if ( outputType == "Library" )
100+ {
101+ LogProjectNotExe ( ) ;
100102 return false ;
103+ }
101104
102105 if ( ! TryResolvePreviewInfoTfms ( ProjectFile , out var targetFrameworks ) )
103106 return false ;
@@ -269,7 +272,7 @@ private static bool IsReferencesAvalonia(PreviewInfo previewInfo) =>
269272 private void LogProjectNotAvalonia ( ) =>
270273 BuildEngine . LogErrorEvent ( new BuildErrorEventArgs (
271274 "APIR" ,
272- string . Empty ,
275+ "001" ,
273276 ProjectFile ,
274277 0 ,
275278 0 ,
@@ -279,6 +282,19 @@ private void LogProjectNotAvalonia() =>
279282 string . Empty ,
280283 string . Empty ) ) ;
281284
285+ private void LogProjectNotExe ( ) =>
286+ BuildEngine . LogErrorEvent ( new BuildErrorEventArgs (
287+ "APIR" ,
288+ "002" ,
289+ ProjectFile ,
290+ 0 ,
291+ 0 ,
292+ 0 ,
293+ 0 ,
294+ "MSBuild project file does not Exe (WinExe) OutputType" ,
295+ string . Empty ,
296+ string . Empty ) ) ;
297+
282298 private Dictionary < string , string > GetGlobalProperties ( string targetFramework ) =>
283299 string . IsNullOrEmpty ( targetFramework )
284300 ? _globalPropertiesCommon
You can’t perform that action at this time.
0 commit comments