Skip to content

Commit

Permalink
Common module
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Kwok <andy.kwok@improving.com>
  • Loading branch information
andy-k-improving committed Nov 14, 2024
1 parent 10a076a commit 8b3fa5b
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 1 deletion.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ configurations {
dependencies {
implementation "org.opensearch.plugin:geo:${opensearch_version}"
api project(":libs:h3")
api project(":geospatial-common")
yamlRestTestRuntimeOnly "org.apache.logging.log4j:log4j-core:${versions.log4j}"
testImplementation "org.hamcrest:hamcrest:${versions.hamcrest}"
testImplementation 'org.json:json:20231013'
Expand Down
35 changes: 35 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
plugins {
id 'java'
id 'maven-publish'

}

group = 'org.opensearch'
version = '3.0.0.0-SNAPSHOT'

repositories {
mavenLocal()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}

dependencies {
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
mavenLocal()
}
}

test {
useJUnitPlatform()
}
11 changes: 11 additions & 0 deletions common/src/main/java/org/opensearch/CommonMain.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.opensearch;

public class CommonMain {

public final static String TEST_STR = "TEST";

public static void main(String[] args) {

System.out.println("Hello world!");
}
}
5 changes: 4 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
rootProject.name = 'geospatial'

include ":libs"
include ":libs:h3"
include ":libs:h3"

include 'common'
project(":common").name = rootProject.name + "-common"
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.Map;
import java.util.function.Supplier;

import org.opensearch.CommonMain;
import org.opensearch.action.ActionRequest;
import org.opensearch.client.Client;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
Expand Down Expand Up @@ -220,6 +221,7 @@ public List<RestHandler> getRestHandlers(
new ActionHandler<>(UpdateDatasourceAction.INSTANCE, UpdateDatasourceTransportAction.class),
new ActionHandler<>(DeleteDatasourceAction.INSTANCE, DeleteDatasourceTransportAction.class)
);
String testStr = CommonMain.TEST_STR;

List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> allHandlers = new ArrayList<>();
allHandlers.addAll(geoJsonHandlers);
Expand Down

0 comments on commit 8b3fa5b

Please sign in to comment.