From 1a695134a0833f8e3496072d8e6c1c5d7e5eba92 Mon Sep 17 00:00:00 2001 From: Simeon Widdis Date: Mon, 10 Nov 2025 19:05:18 +0000 Subject: [PATCH] Add setting for using a local SQL build Signed-off-by: Simeon Widdis --- .gitignore | 1 + gradle.properties | 5 +++++ settings.gradle | 28 ++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 gradle.properties create mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore index 9fe5a5c..0c9b6d9 100644 --- a/.gitignore +++ b/.gitignore @@ -70,6 +70,7 @@ target/ # Gradle .gradle +META-INF/ # Commands history .cli_history diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..91ee83e --- /dev/null +++ b/gradle.properties @@ -0,0 +1,5 @@ +# Gradle properties for SQL CLI + +# Uncomment to use local SQL project instead of published Maven artifacts +# This is useful for development when you need to make changes in both projects +# useLocalSql=true diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..af9aea8 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,28 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +rootProject.name = 'opensearch-sql-cli' + +// Optionally include the local SQL project as a composite build +// This allows you to develop against local changes in the sql project +// Enable by passing -PuseLocalSql=true or adding useLocalSql=true to gradle.properties +if (settings.hasProperty('useLocalSql') && settings.useLocalSql == 'true') { + println "Using local SQL project for unified-query dependencies" + + includeBuild('../sql') { + dependencySubstitution { + // Substitute the Maven artifacts with local project modules + substitute module('org.opensearch.query:unified-query-common') using project(':common') + substitute module('org.opensearch.query:unified-query-core') using project(':core') + substitute module('org.opensearch.query:unified-query-opensearch') using project(':opensearch') + substitute module('org.opensearch.query:unified-query-ppl') using project(':ppl') + substitute module('org.opensearch.query:unified-query-sql') using project(':sql') + substitute module('org.opensearch.query:unified-query-protocol') using project(':protocol') + } + } +} else { + println "Using published Maven artifacts for unified-query dependencies" + println "To use local SQL project, run with -PuseLocalSql=true" +}