You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: dependency is missing version element for groupId=$($groupId), artifactId=$($artifactId) should be <version></version> <!-- {x-version-update;$($groupId):$($artifactId);current|dependency|external_dependency<select one>} -->"
724
724
continue
725
725
}
726
-
if ($versionNode.NextSibling-and$versionNode.NextSibling.NodeType-eq"Comment")
726
+
727
+
if ($versionNode.FirstChild.Value.StartsWith('${'))
727
728
{
728
-
# unfortunately because there are POM exceptions we need to wildcard the group which may be
729
-
# something like <area>_groupId
730
-
if ($versionNode.NextSibling.Value.Trim() -notmatch"{x-version-update;(.+)?$($groupId):$($artifactId);\w+}")
729
+
# skip version checks when they have been intentionally applied via variables
730
+
}
731
+
else
732
+
{
733
+
if ($versionNode.NextSibling-and$versionNode.NextSibling.NodeType-eq"Comment")
731
734
{
732
-
$hasError=$true
733
-
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: dependency version update tag for groupId=$($groupId), artifactId=$($artifactId) should be <!-- {x-version-update;$($groupId):$($artifactId);current|dependency|external_dependency<select one>} -->"
735
+
# unfortunately because there are POM exceptions we need to wildcard the group which may be
736
+
# something like <area>_groupId
737
+
if ($versionNode.FirstChild.Value.StartsWith('${'))
738
+
{
739
+
# skip version checks when they have been intentionally applied via variables
740
+
}
741
+
else
742
+
{
743
+
if ($versionNode.NextSibling.Value.Trim() -notmatch"{x-version-update;(.+)?$($groupId):$($artifactId);\w+}")
744
+
{
745
+
$hasError=$true
746
+
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: dependency version update tag for groupId=$($groupId), artifactId=$($artifactId) should be <!-- {x-version-update;$($groupId):$($artifactId);current|dependency|external_dependency<select one>} -->"
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: Missing dependency version update tag for groupId=$($groupId), artifactId=$($artifactId). The tag should be <!-- {x-version-update;$($groupId):$($artifactId);current|dependency|external_dependency<select one>} -->"
744
764
}
745
-
}
746
-
else
747
-
{
748
-
$hasError=$true
749
-
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: Missing dependency version update tag for groupId=$($groupId), artifactId=$($artifactId). The tag should be <!-- {x-version-update;$($groupId):$($artifactId);current|dependency|external_dependency<select one>} -->"
750
-
}
765
+
}
751
766
}
752
767
# Verify every plugin has a group, artifact and version
753
768
# Verify every dependency has a group, artifact and version
# The groupId match has to be able to deal with <area>_ for external dependency exceptions
886
-
if (!$includeNode.NextSibling-or$includeNode.NextSibling.NodeType-ne"Comment")
887
-
{
888
-
$hasError=$true
889
-
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: <include> is missing the update tag which should be <!-- {x-include-update;$($groupId):$($artifactId);current|dependency|external_dependency<select one>} -->"
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: <include> version update tag for $($includeNode.InnerText) should be <!-- {x-include-update;$($groupId):$($artifactId);current|dependency|external_dependency<select one>} -->"
900
+
901
+
if ($version.StartsWith('[${')) {
902
+
# skip version checks when they have been intentionally applied via variables
895
903
}
896
904
else
897
905
{
898
-
#verify that the version is formatted correctly
899
-
if (!$version.StartsWith("[")-or!$version.EndsWith("]"))
906
+
#The groupId match has to be able to deal with <area>_ for external dependency exceptions
907
+
if (!$includeNode.NextSibling-or$includeNode.NextSibling.NodeType-ne"Comment")
900
908
{
901
909
$hasError=$true
902
-
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: the version entry '$($version)' for <include> '$($rawIncludeText)' is not formatted correctly. The include version needs to of the form '[<version>]', the braces lock the include to a specific version for these entries. -->"
910
+
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: <include> is missing the update tag which should be <!-- {x-include-update;$($groupId):$($artifactId);current|dependency|external_dependency<select one>} -->"
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: <include> version update tag for $($includeNode.InnerText) should be <!-- {x-include-update;$($groupId):$($artifactId);current|dependency|external_dependency<select one>} -->"
if (!$version.StartsWith("[") -or!$version.EndsWith("]"))
915
921
{
916
-
if ($extDepHash.ContainsKey($depKey))
917
-
{
918
-
if ($versionWithoutBraces-ne$extDepHash[$depKey].ver)
919
-
{
920
-
$hasError=$true
921
-
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: $($depKey)'s version is '$($versionWithoutBraces)' but the external_dependency version is listed as $($extDepHash[$depKey].ver)"
922
-
}
923
-
}
924
-
else
925
-
{
926
-
$hasError=$true
927
-
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: the groupId:artifactId entry '$($depKey)' for <include> '$($rawIncludeText)' is not a valid external dependency. Please verify the entry exists in the external_dependencies.txt file. -->"
928
-
}
922
+
$hasError=$true
923
+
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: the version entry '$($version)' for <include> '$($rawIncludeText)' is not formatted correctly. The include version needs to of the form '[<version>]', the braces lock the include to a specific version for these entries. -->"
929
924
}
925
+
# verify the version has the correct value
930
926
else
931
927
{
932
-
# If the tag isn't external_dependency then verify it exists in the library hash
933
-
if (!$libHash.ContainsKey($depKey))
934
-
{
935
-
$hasError=$true
936
-
return"Error: $($depKey)'s dependency type is '$($depType)' but the dependency does not exist in any of the version_*.txt files. Should this be an external_dependency? Please ensure the dependency type is correct or the dependency is added to the appropriate file."
if ($versionWithoutBraces-ne$libHash[$depKey].depVer)
937
+
if ($extDepHash.ContainsKey($depKey))
938
+
{
939
+
if ($versionWithoutBraces-ne$extDepHash[$depKey].ver)
940
+
{
941
+
$hasError=$true
942
+
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: $($depKey)'s version is '$($versionWithoutBraces)' but the external_dependency version is listed as $($extDepHash[$depKey].ver)"
943
+
}
944
+
}
945
+
else
942
946
{
943
947
$hasError=$true
944
-
return"Error: $($depKey)'s <version> is '$($versionString)' but the dependency version is listed as $($libHash[$depKey].depVer)"
948
+
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: the groupId:artifactId entry '$($depKey)' for <include> '$($rawIncludeText)' is not a valid external dependency. Please verify the entry exists in the external_dependencies.txt file. -->"
945
949
}
946
950
}
947
-
elseif ($depType-eq$DependencyTypeCurrent)
951
+
else
948
952
{
949
-
#Verify that none of the 'current' dependencies are using a groupId that starts with 'unreleased_' or 'beta_'
950
-
if ($depKey.StartsWith('unreleased_') -or$depKey.StartsWith('beta_'))
953
+
#If the tag isn't external_dependency then verify it exists in the library hash
954
+
if (!$libHash.ContainsKey($depKey))
951
955
{
952
956
$hasError=$true
953
-
return"Error: $($versionUpdateString) is using an unreleased_ or beta_ dependency and trying to set current value. Only dependency versions can be set with an unreleased or beta dependency."
957
+
return"Error: $($depKey)'s dependency type is '$($depType)' but the dependency does not exist in any of the version_*.txt files. Should this be an external_dependency? Please ensure the dependency type is correct or the dependency is added to the appropriate file."
958
+
954
959
}
955
-
if ($versionWithoutBraces-ne$libHash[$depKey].curVer)
960
+
if ($depType-eq$DependencyTypeDependency)
956
961
{
957
-
$hasError=$true
958
-
return"Error: $($depKey)'s <version> is '$($versionString)' but the current version is listed as $($libHash[$depKey].curVer)"
962
+
if ($versionWithoutBraces-ne$libHash[$depKey].depVer)
963
+
{
964
+
$hasError=$true
965
+
return"Error: $($depKey)'s <version> is '$($versionString)' but the dependency version is listed as $($libHash[$depKey].depVer)"
966
+
}
967
+
}
968
+
elseif ($depType-eq$DependencyTypeCurrent)
969
+
{
970
+
# Verify that none of the 'current' dependencies are using a groupId that starts with 'unreleased_' or 'beta_'
971
+
if ($depKey.StartsWith('unreleased_') -or$depKey.StartsWith('beta_'))
972
+
{
973
+
$hasError=$true
974
+
return"Error: $($versionUpdateString) is using an unreleased_ or beta_ dependency and trying to set current value. Only dependency versions can be set with an unreleased or beta dependency."
975
+
}
976
+
if ($versionWithoutBraces-ne$libHash[$depKey].curVer)
977
+
{
978
+
$hasError=$true
979
+
return"Error: $($depKey)'s <version> is '$($versionString)' but the current version is listed as $($libHash[$depKey].curVer)"
0 commit comments