-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create 2.x branch and update accordingly (#38)
Create 2.x branch and update accordingly (#38) Signed-off-by: YANGDB <[email protected]>
- Loading branch information
Showing
6 changed files
with
67 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform | ||
|
||
|
||
buildscript { | ||
|
@@ -22,7 +21,7 @@ plugins { | |
id 'signing' | ||
} | ||
|
||
group 'org.opensearch.driver' | ||
group 'org.opensearch.client' | ||
|
||
// keep version in sync with version in Driver source | ||
version '2.0.0.0' | ||
|
@@ -47,49 +46,29 @@ repositories { | |
|
||
dependencies { | ||
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.13' | ||
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "2.13.3" | ||
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "2.13.4.2" | ||
implementation group: 'com.amazonaws', name: 'aws-java-sdk-core', version: '1.11.452' | ||
|
||
testImplementation('org.junit.jupiter:junit-jupiter-api:5.3.1') | ||
testImplementation('org.junit.jupiter:junit-jupiter-params:5.3.1') | ||
testImplementation('com.github.tomakehurst:wiremock:2.27.2') | ||
testImplementation('com.github.tomakehurst:wiremock-jre8-standalone:2.34.0') | ||
testImplementation('org.mockito:mockito-core:2.23.0') | ||
testImplementation('org.junit.jupiter:junit-jupiter-engine:5.3.1') | ||
testImplementation('org.junit-pioneer:junit-pioneer:0.3.0') | ||
testImplementation('org.eclipse.jetty:jetty-server:9.2.24.v20180105') | ||
testImplementation('org.eclipse.jetty:jetty-server:9.4.48.v20220622') | ||
|
||
// Enforce wiremock to use latest guava and json-smart | ||
// Enforce wiremock to use latest guava | ||
testImplementation('com.google.guava:guava:31.1-jre') | ||
testImplementation('net.minidev:json-smart:2.4.8') | ||
|
||
testRuntimeOnly('org.slf4j:slf4j-simple:1.7.25') // capture WireMock logging | ||
|
||
// JDBC drivers for comparison test. Somehow Apache Derby throws security permission exception. | ||
testImplementation fileTree('/build/libs') { | ||
include '*.jar' | ||
builtBy 'compileJdbc' | ||
} | ||
testImplementation group: 'com.h2database', name: 'h2', version: '2.1.210' | ||
testImplementation group: 'org.xerial', name: 'sqlite-jdbc', version: '3.28.0' | ||
testImplementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9' | ||
} | ||
|
||
task compileJdbc(type: Exec) { | ||
if (DefaultNativePlatform.getCurrentOperatingSystem().isWindows()) { | ||
commandLine './gradlew.bat', 'build' | ||
commandLine './gradlew.bat', 'shadowJar' | ||
} else { | ||
commandLine './gradlew', 'build' | ||
commandLine './gradlew', 'shadowJar' | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile) { | ||
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked" | ||
} | ||
|
||
static def getShadowPath(String path) { | ||
return 'org.opensearch.sql.jdbc.shadow.' + path | ||
return 'com.amazonaws.opensearch.sql.jdbc.shadow.' + path | ||
} | ||
|
||
shadowJar { | ||
|
@@ -107,14 +86,18 @@ shadowJar { | |
exclude 'META-INF/NOTICE*' | ||
exclude 'META-INF/DEPENDENCIES' | ||
|
||
relocate 'com.amazonaws', getShadowPath('com.amazonaws') | ||
relocate('com.amazonaws', getShadowPath('com.amazonaws')) { | ||
exclude 'com.amazonaws.opensearch.*/**' | ||
} | ||
|
||
relocate 'org.apache', getShadowPath('org.apache') | ||
relocate 'org.joda', getShadowPath('org.joda') | ||
relocate 'com.fasterxml', getShadowPath('com.fasterxml') | ||
relocate 'software.amazon', getShadowPath('software.amazon') | ||
} | ||
|
||
test { | ||
systemProperty("opensearch_jdbc_version", version); | ||
useJUnitPlatform() | ||
} | ||
|
||
|
@@ -136,59 +119,47 @@ publishing { | |
artifact javadocJar | ||
|
||
pom { | ||
name = "OpenSearch SQL JDBC Driver" | ||
packaging = "jar" | ||
url = "https://github.com/opensearch-project/sql/sql-jdbc" | ||
description = "OpenSearch SQL JDBC driver" | ||
scm { | ||
connection = "scm:[email protected]:opensearch-project/sql.git" | ||
developerConnection = "scm:[email protected]:opensearch-project/sql.git" | ||
url = "[email protected]:opensearch-project/sql.git" | ||
} | ||
licenses { | ||
license { | ||
name = "The Apache License, Version 2.0" | ||
url = "http://www.apache.org/licenses/LICENSE-2.0.txt" | ||
} | ||
name = "OpenSearch SQL JDBC Driver" | ||
packaging = "jar" | ||
url = "https://github.com/opensearch-project/sql" | ||
description = "OpenSearch SQL JDBC driver" | ||
scm { | ||
connection = "scm:[email protected]:opensearch-project/sql.git" | ||
developerConnection = "scm:[email protected]:opensearch-project/sql.git" | ||
url = "[email protected]:opensearch-project/sql.git" | ||
} | ||
licenses { | ||
license { | ||
name = "The Apache License, Version 2.0" | ||
url = "http://www.apache.org/licenses/LICENSE-2.0.txt" | ||
} | ||
developers { | ||
developer { | ||
name = 'OpenSearch' | ||
url = 'https://github.com/opensearch-project/sql' | ||
} | ||
} | ||
} | ||
} | ||
publishMaven(MavenPublication) { publication -> | ||
from components.java | ||
|
||
pom { | ||
name = "OpenSearch SQL JDBC Driver" | ||
packaging = "jar" | ||
url = "https://github.com/opensearch-project/sql/sql-jdbc" | ||
description = "OpenSearch SQL JDBC driver" | ||
scm { | ||
connection = "scm:[email protected]:opensearch-project/sql.git" | ||
developerConnection = "scm:[email protected]:opensearch-project/sql.git" | ||
url = "[email protected]:opensearch-project/sql.git" | ||
} | ||
licenses { | ||
license { | ||
name = "The Apache License, Version 2.0" | ||
url = "http://www.apache.org/licenses/LICENSE-2.0.txt" | ||
} | ||
} | ||
developers { | ||
developer { | ||
name = 'OpenSearch' | ||
url = 'https://github.com/opensearch-project/sql' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = "amazonwebservices" | ||
organization = "Amazon Web Services" | ||
organizationUrl = "https://aws.amazon.com" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
name = "internal-snapshots" | ||
url = "s3://snapshots.opendistroforelasticsearch.amazon.com/maven" | ||
authentication { | ||
awsIm(AwsImAuthentication) // load from EC2 role or env var | ||
} | ||
} | ||
maven { | ||
name = "internal-releases" | ||
url = "s3://artifacts.opendistroforelasticsearch.amazon.com/maven" | ||
authentication { | ||
awsIm(AwsImAuthentication) // load from EC2 role or env var | ||
} | ||
} | ||
maven { | ||
name = "sonatype-staging" | ||
url "https://aws.oss.sonatype.org/service/local/staging/deploy/maven2" | ||
|
@@ -197,10 +168,6 @@ publishing { | |
password project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : '' | ||
} | ||
} | ||
maven { | ||
name = "localRepo" | ||
url "${project.buildDir}/repository" | ||
} | ||
} | ||
|
||
// TODO - enabled debug logging for the time being, remove this eventually | ||
|
@@ -234,6 +201,4 @@ jacocoTestCoverageVerification { | |
} | ||
} | ||
|
||
|
||
|
||
check.dependsOn jacocoTestCoverageVerification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/test/java/org/opensearch/jdbc/internal/VersionMatchTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.opensearch.jdbc.internal; | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.opensearch.jdbc.internal.Version; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class VersionMatchTest { | ||
|
||
@Test | ||
void testVersionMatchesBuildGradleVersion() { | ||
assertEquals(Version.Current.getFullVersion(), System.getProperty("opensearch_jdbc_version")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters