RussellSpitzer commented on code in PR #15857:
URL: https://github.com/apache/iceberg/pull/15857#discussion_r3024718254
##########
build.gradle:
##########
@@ -128,6 +138,147 @@ subprojects {
apply plugin: 'java-library'
+ // Helper closure to truncate version to major.minor
+ ext.truncateVersion = { String version ->
+ if (version == null || version.isEmpty()) {
+ return version
+ }
+
+ // Remove any build metadata or qualifiers first (e.g., +something,
-SNAPSHOT)
+ def cleanVersion = version.replaceAll(/[+-].*$/, '')
+
+ // Split by dots and take first two parts
+ def parts = cleanVersion.split(/\./)
+ if (parts.length >= 2) {
+ return "${parts[0]}.${parts[1]}"
+ } else if (parts.length == 1) {
+ return parts[0]
+ }
+
+ return version
+ }
+
+ // Helper closure to resolve dependencies for a configuration
+ ext.resolveDependencies = { String configuration ->
+ def dependencies = new TreeSet<String>()
+
+ try {
+ def config = configurations.findByName(configuration)
+ if (config != null && config.canBeResolved) {
+ config.resolvedConfiguration.resolvedArtifacts.each { artifact ->
+ def id = artifact.moduleVersion.id
+ def groupId = id.group
+ def artifactId = id.name
+ def version = id.version
+
+ // Truncate version to major.minor (remove patch and beyond)
+ def truncatedVersion = truncateVersion(version)
Review Comment:
We are doing this on write here, it may be better to do this on read so the
files are contain the full dependency list and we just ignore the patches when
we compare.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]