From 724db1791a1dc1b55b6a02366c4ffdc337879c09 Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Fri, 11 Oct 2024 10:40:29 -0400 Subject: [PATCH] Add grpc Signed-off-by: Craig Perkins --- .../org/opensearch/gradle/VersionProperties.java | 14 +++++++------- gradle/libs.versions.toml | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/buildSrc/src/main/java/org/opensearch/gradle/VersionProperties.java b/buildSrc/src/main/java/org/opensearch/gradle/VersionProperties.java index 583f00ba4a766..d08ad17647d53 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/VersionProperties.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/VersionProperties.java @@ -127,15 +127,15 @@ public static Map getVersions() { } } - private static void flattenToml(TomlTable tomlTable, Properties properties, String prefix) { + private static void tomlVersionsToProperties(TomlTable tomlTable, Properties properties) { for (String key : tomlTable.keySet()) { - String fullKey = prefix.isEmpty() ? key : prefix + "." + key; Object value = tomlTable.get(key); - if (value instanceof TomlTable) { - flattenToml((TomlTable) value, properties, fullKey); - } else { - properties.setProperty(key, value.toString()); + if (key.equals("versions")) { + TomlTable versions = (TomlTable) value; + for (String library : versions.keySet()) { + properties.setProperty(library, versions.get(library).toString()); + } } } } @@ -149,7 +149,7 @@ private static Properties getVersionProperties() { } Properties properties = new Properties(); - flattenToml(toml, properties, ""); + tomlVersionsToProperties(toml, properties); return properties; } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 52d7eff1512b9..eeaeee6e750c5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -26,6 +26,7 @@ jakarta_annotation = "1.3.5" google_http_client = "1.44.1" tdigest = "3.3" hdrhistogram = "2.2.2" +grpc = "1.68.0" # when updating the JNA version, also update the version in buildSrc/build.gradle jna = "5.13.0"