@@ -147,7 +147,7 @@ public static string GetRootDirectory(string solutionOrProjectFilePath)
147
147
return string . IsNullOrEmpty ( fileDirectory ) ? Directory . GetCurrentDirectory ( ) : fileDirectory ;
148
148
}
149
149
150
- public static IEnumerable < ParallelizableTestModuleGroupWithSequentialInnerModules > GetProjectProperties ( string projectFilePath , ProjectCollection projectCollection , bool noLaunchProfile )
150
+ public static IEnumerable < ParallelizableTestModuleGroupWithSequentialInnerModules > GetProjectProperties ( string projectFilePath , ProjectCollection projectCollection , BuildOptions buildOptions )
151
151
{
152
152
var projects = new List < ParallelizableTestModuleGroupWithSequentialInnerModules > ( ) ;
153
153
ProjectInstance projectInstance = EvaluateProject ( projectCollection , projectFilePath , null ) ;
@@ -159,7 +159,7 @@ public static IEnumerable<ParallelizableTestModuleGroupWithSequentialInnerModule
159
159
160
160
if ( ! string . IsNullOrEmpty ( targetFramework ) || string . IsNullOrEmpty ( targetFrameworks ) )
161
161
{
162
- if ( GetModuleFromProject ( projectInstance , projectCollection . Loggers , noLaunchProfile ) is { } module )
162
+ if ( GetModuleFromProject ( projectInstance , projectCollection . Loggers , buildOptions ) is { } module )
163
163
{
164
164
projects . Add ( new ParallelizableTestModuleGroupWithSequentialInnerModules ( module ) ) ;
165
165
}
@@ -187,7 +187,7 @@ public static IEnumerable<ParallelizableTestModuleGroupWithSequentialInnerModule
187
187
projectInstance = EvaluateProject ( projectCollection , projectFilePath , framework ) ;
188
188
Logger . LogTrace ( ( ) => $ "Loaded inner project '{ Path . GetFileName ( projectFilePath ) } ' has '{ ProjectProperties . IsTestingPlatformApplication } ' = '{ projectInstance . GetPropertyValue ( ProjectProperties . IsTestingPlatformApplication ) } ' (TFM: '{ framework } ').") ;
189
189
190
- if ( GetModuleFromProject ( projectInstance , projectCollection . Loggers , noLaunchProfile ) is { } module )
190
+ if ( GetModuleFromProject ( projectInstance , projectCollection . Loggers , buildOptions ) is { } module )
191
191
{
192
192
projects . Add ( new ParallelizableTestModuleGroupWithSequentialInnerModules ( module ) ) ;
193
193
}
@@ -201,7 +201,7 @@ public static IEnumerable<ParallelizableTestModuleGroupWithSequentialInnerModule
201
201
projectInstance = EvaluateProject ( projectCollection , projectFilePath , framework ) ;
202
202
Logger . LogTrace ( ( ) => $ "Loaded inner project '{ Path . GetFileName ( projectFilePath ) } ' has '{ ProjectProperties . IsTestingPlatformApplication } ' = '{ projectInstance . GetPropertyValue ( ProjectProperties . IsTestingPlatformApplication ) } ' (TFM: '{ framework } ').") ;
203
203
204
- if ( GetModuleFromProject ( projectInstance , projectCollection . Loggers , noLaunchProfile ) is { } module )
204
+ if ( GetModuleFromProject ( projectInstance , projectCollection . Loggers , buildOptions ) is { } module )
205
205
{
206
206
innerModules ??= new List < TestModule > ( ) ;
207
207
innerModules . Add ( module ) ;
@@ -218,7 +218,7 @@ public static IEnumerable<ParallelizableTestModuleGroupWithSequentialInnerModule
218
218
return projects ;
219
219
}
220
220
221
- private static TestModule ? GetModuleFromProject ( ProjectInstance project , ICollection < ILogger > ? loggers , bool noLaunchProfile )
221
+ private static TestModule ? GetModuleFromProject ( ProjectInstance project , ICollection < ILogger > ? loggers , BuildOptions buildOptions )
222
222
{
223
223
_ = bool . TryParse ( project . GetPropertyValue ( ProjectProperties . IsTestProject ) , out bool isTestProject ) ;
224
224
_ = bool . TryParse ( project . GetPropertyValue ( ProjectProperties . IsTestingPlatformApplication ) , out bool isTestingPlatformApplication ) ;
@@ -248,7 +248,7 @@ public static IEnumerable<ParallelizableTestModuleGroupWithSequentialInnerModule
248
248
string projectFullPath = project . GetPropertyValue ( ProjectProperties . ProjectFullPath ) ;
249
249
250
250
// TODO: Support --launch-profile and pass it here.
251
- var launchSettings = TryGetLaunchProfileSettings ( Path . GetDirectoryName ( projectFullPath ) ! , Path . GetFileNameWithoutExtension ( projectFullPath ) , project . GetPropertyValue ( ProjectProperties . AppDesignerFolder ) , noLaunchProfile , profileName : null ) ;
251
+ var launchSettings = TryGetLaunchProfileSettings ( Path . GetDirectoryName ( projectFullPath ) ! , Path . GetFileNameWithoutExtension ( projectFullPath ) , project . GetPropertyValue ( ProjectProperties . AppDesignerFolder ) , buildOptions , profileName : null ) ;
252
252
253
253
return new TestModule ( runProperties , PathUtility . FixFilePath ( projectFullPath ) , targetFramework , isTestingPlatformApplication , isTestProject , launchSettings , project . GetPropertyValue ( ProjectProperties . TargetPath ) ) ;
254
254
@@ -270,9 +270,9 @@ static RunProperties GetRunProperties(ProjectInstance project, ICollection<ILogg
270
270
}
271
271
}
272
272
273
- private static ProjectLaunchSettingsModel ? TryGetLaunchProfileSettings ( string projectDirectory , string projectNameWithoutExtension , string appDesignerFolder , bool noLaunchProfile , string ? profileName )
273
+ private static ProjectLaunchSettingsModel ? TryGetLaunchProfileSettings ( string projectDirectory , string projectNameWithoutExtension , string appDesignerFolder , BuildOptions buildOptions , string ? profileName )
274
274
{
275
- if ( noLaunchProfile )
275
+ if ( buildOptions . NoLaunchProfile )
276
276
{
277
277
return null ;
278
278
}
@@ -299,6 +299,12 @@ static RunProperties GetRunProperties(ProjectInstance project, ICollection<ILogg
299
299
return null ;
300
300
}
301
301
302
+ // If buildOptions.Verbosity is null, we still want to print the message.
303
+ if ( buildOptions . Verbosity != VerbosityOptions . quiet )
304
+ {
305
+ Reporter . Output . WriteLine ( string . Format ( CliCommandStrings . UsingLaunchSettingsFromMessage , launchSettingsPath ) ) ;
306
+ }
307
+
302
308
var result = LaunchSettingsManager . TryApplyLaunchSettings ( launchSettingsPath , profileName ) ;
303
309
if ( ! result . Success )
304
310
{
0 commit comments