Skip to content

Commit bf9d978

Browse files
committed
Attempt to fix nuget.config generation.
1 parent 437b174 commit bf9d978

File tree

1 file changed

+14
-0
lines changed
  • src/PostSharp.Engineering.BuildTools/Build/Model

1 file changed

+14
-0
lines changed

src/PostSharp.Engineering.BuildTools/Build/Model/Product.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,6 +1392,15 @@ private bool TryComputeVersion(
13921392

13931393
private static bool TryGenerateNuGetConfig( BuildContext context, DependenciesOverrideFile dependenciesOverrideFile, BuildSettings buildSettings )
13941394
{
1395+
if ( dependenciesOverrideFile.Dependencies.Values.Any( d => d.VersionFile == null ) )
1396+
{
1397+
// Fetch to resolve the VersionFile properties.
1398+
if ( !dependenciesOverrideFile.Fetch( context ) )
1399+
{
1400+
return false;
1401+
}
1402+
}
1403+
13951404
var product = context.Product;
13961405
var baseFilePath = Path.Combine( context.RepoDirectory, "nuget.base.config" );
13971406
var targetFilePath = Path.Combine( context.RepoDirectory, "nuget.config" );
@@ -1467,6 +1476,11 @@ private static bool TryGenerateNuGetConfig( BuildContext context, DependenciesOv
14671476

14681477
bool AddDirectory( string name, string directory, string[]? patterns )
14691478
{
1479+
if ( directory == null )
1480+
{
1481+
throw new ArgumentNullException( nameof(directory), $"Null directory for source '{name}'." );
1482+
}
1483+
14701484
var addElement = new XElement( "add" );
14711485
addElement.Add( new XAttribute( "key", name ) );
14721486
addElement.Add( new XAttribute( "value", directory ) );

0 commit comments

Comments
 (0)