@@ -17,12 +17,11 @@ public class BuildContext : FrostingContext
1717 public BuildContext ( ICakeContext context ) : base ( context )
1818 {
1919 // General
20+ var configFile = context . Argument < string > ( "general-config" , "buildConfig.json" ) ;
2021 var project = context . Argument < string ? > ( "general-project" , null ) ;
2122 var profile = context . Argument < string > ( "general-profile" , "Release" ) ;
2223 var version = context . Argument < string > ( "general-version" , "12.34.56" ) ;
2324 var skipSubstitution = context . Argument ( "general-skipSubstitution" , false ) ;
24- var solutionConfigFile = context . Argument < string > ( "config-solution" , "buildConfig.json" ) ;
25- var projectConfigFile = context . Argument < string > ( "config-project" , "buildConfig.json" ) ;
2625
2726 // Internal config
2827 {
@@ -38,7 +37,7 @@ public BuildContext(ICakeContext context) : base(context)
3837
3938 // Solution config
4039 {
41- SolutionConfig = LoadConfig < SolutionConfig > ( context , Path . Combine ( ".." , solutionConfigFile ) ) ;
40+ SolutionConfig = LoadConfig < SolutionConfig > ( context , Path . Combine ( ".." , configFile ) ) ;
4241 }
4342
4443 // Project picking
@@ -47,7 +46,7 @@ public BuildContext(ICakeContext context) : base(context)
4746 {
4847 if ( SolutionConfig . DefaultProject is null )
4948 {
50- throw new InvalidOperationException ( "No project specified as an argument and no default project specified in the solution config" ) ;
49+ throw new InvalidOperationException ( "No project specified as an argument and no default project specified in the build config" ) ;
5150 }
5251
5352 InternalConfig . Project = SolutionConfig . DefaultProject ;
@@ -57,12 +56,7 @@ public BuildContext(ICakeContext context) : base(context)
5756 InternalConfig . Project = project ;
5857 }
5958
60- InternalConfig . ProjectFilePath = Path . Combine ( ".." , InternalConfig . Project , $ "{ InternalConfig . Project } .csproj") ;
61- }
62-
63- // Project config
64- {
65- ProjectConfig = LoadConfig < ProjectConfig > ( context , Path . Combine ( ".." , InternalConfig . Project , projectConfigFile ) ) ;
59+ ProjectConfig = SolutionConfig . Projects . First ( projectConfig => projectConfig . Name == InternalConfig . Project ) ;
6660 }
6761 }
6862
0 commit comments