@@ -21,16 +21,9 @@ public static bool TryWrite( BuildContext context, bool dry, out bool hasChanges
2121 var autoUpdatedDependencies = context . Product . DependencyDefinition . GetAllDependencies ( BuildConfiguration . Public )
2222 . Where ( d => d . Definition . AutoUpdateVersion )
2323 . ToArray ( ) ;
24-
25- if ( autoUpdatedDependencies . Length == 0 )
26- {
27- context . Console . WriteMessage ( "There are no auto-updated dependencies to check." ) ;
28-
29- return true ;
30- }
31-
24+
3225 // Load XML.
33- var thisAutoUpdatedVersionsFilePath = context . Product . AutoUpdatedVersionsFilePath ;
26+ var thisAutoUpdatedVersionsFilePath = Path . Combine ( context . RepoDirectory , context . Product . AutoUpdatedVersionsFilePath ) ;
3427 var thisAutoUpdatedVersionsDocument = XDocument . Load ( thisAutoUpdatedVersionsFilePath , LoadOptions . PreserveWhitespace ) ;
3528 var thisAutoUpdatedVersionsPropertyGroupElement = thisAutoUpdatedVersionsDocument . Root ! . Element ( "PropertyGroup" ) ! ;
3629
@@ -44,8 +37,8 @@ public static bool TryWrite( BuildContext context, bool dry, out bool hasChanges
4437
4538 string [ ] filePathCandidates =
4639 [
47- Path . Combine ( context . RepoDirectory , context . Product . SourceDependenciesDirectory , dependency . Name , "eng" , FileName ) ,
48- Path . Combine ( context . RepoDirectory , ".." , dependency . Name , "eng" , FileName )
40+ Path . GetFullPath ( Path . Combine ( context . RepoDirectory , context . Product . SourceDependenciesDirectory , dependency . Name , dependency . EngineeringDirectory , FileName ) ) ,
41+ Path . GetFullPath ( Path . Combine ( context . RepoDirectory , ".." , dependency . Name , dependency . EngineeringDirectory , FileName ) )
4942 ] ;
5043
5144 var theirAutoUpdatedVersionsFilePath = filePathCandidates . FirstOrDefault ( File . Exists ) ;
@@ -63,7 +56,7 @@ public static bool TryWrite( BuildContext context, bool dry, out bool hasChanges
6356
6457 var releasedVersionPropertyName = $ "{ dependency . NameWithoutDot } ReleaseVersion";
6558
66- var dependencyReleasedVersion = theirAutoUpdatedVersionsDocument . Root ? . Element ( "Project" )
59+ var dependencyReleasedVersion = theirAutoUpdatedVersionsDocument . Root
6760 ? . Element ( "PropertyGroup" )
6861 ? . Element ( releasedVersionPropertyName )
6962 ? . Value ;
@@ -105,9 +98,9 @@ public static bool TryWrite( BuildContext context, bool dry, out bool hasChanges
10598 {
10699 var releasedMainVersionPropertyName = $ "{ dependency . NameWithoutDot } ReleaseMainVersion";
107100
108- var releasedMainVersionPropertyValue = theirAutoUpdatedVersionsDocument . Root ? . Element ( "Project" )
101+ var releasedMainVersionPropertyValue = theirAutoUpdatedVersionsDocument . Root
109102 ? . Element ( "PropertyGroup" )
110- ? . Element ( releasedVersionPropertyName )
103+ ? . Element ( releasedMainVersionPropertyName )
111104 ? . Value ;
112105
113106 if ( string . IsNullOrEmpty ( releasedMainVersionPropertyValue ) )
@@ -165,8 +158,8 @@ public static bool TryWrite( BuildContext context, bool dry, out bool hasChanges
165158
166159 if ( thisMainVersionElement == null )
167160 {
168- thisMainVersionElement = new XElement ( $ "{ context . Product . ProductNameWithoutDot } ReleaseVersion " ) ;
169- thisAutoUpdatedVersionsPropertyGroupElement . Add ( thisVersionElement ) ;
161+ thisMainVersionElement = new XElement ( $ "{ context . Product . ProductNameWithoutDot } ReleaseMainVersion " ) ;
162+ thisAutoUpdatedVersionsPropertyGroupElement . Add ( thisMainVersionElement ) ;
170163 }
171164
172165 if ( thisMainVersionElement . Value != versionComponents . MainVersion )
0 commit comments