Skip to content

Commit

Permalink
Add OpenSearch build script
Browse files Browse the repository at this point in the history
Signed-off-by: Sooraj Sinha <[email protected]>
  • Loading branch information
ankitkala authored and soosinha committed Aug 27, 2021
1 parent 7d7d2e4 commit 567209e
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,16 @@ import java.util.stream.Collectors
import org.opensearch.gradle.testclusters.OpenSearchCluster

buildscript {

ext {
opensearch_version = System.getProperty("opensearch_version", "1.1.0")
isSnapshot = "true" == System.getProperty("build.snapshot", "false")
opensearch_version = System.getProperty("opensearch.version", "1.1.0")
// Taken from https://github.com/opensearch-project/alerting/blob/main/build.gradle#L33
// 1.0.0 -> 1.0.0.0, and 1.0.0-SNAPSHOT -> 1.0.0.0-SNAPSHOT
opensearch_build = opensearch_version.replaceAll(/(\.\d)([^\d]*)$/, '$1.0$2')
common_utils_version = System.getProperty("common_utils.version", opensearch_build)
kotlin_version = System.getProperty("kotlin.version", "1.3.72")

}

repositories {
Expand All @@ -47,12 +54,18 @@ buildscript {
}
}


plugins {
id 'nebula.ospackage' version "8.3.0"
id "com.dorongold.task-tree" version "1.5"
}

allprojects {
group = "org.opensearch"
if (isSnapshot) {
version += "-SNAPSHOT"
}
}

apply plugin: 'java'
//apply plugin: 'jacoco'
apply plugin: 'idea'
Expand Down Expand Up @@ -93,7 +106,7 @@ dependencies {
compile "org.jetbrains:annotations:13.0"
compile "com.github.seancfoley:ipaddress:5.3.3"
compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5"
compile "org.opensearch:common-utils:${version}"
compile "org.opensearch:common-utils:${common_utils_version}"

testCompile "org.opensearch.test:framework:${opensearch_version}"
testImplementation "org.assertj:assertj-core:3.17.2"
Expand All @@ -107,6 +120,7 @@ repositories {
mavenLocal()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
jcenter()
}

compileKotlin {
Expand Down Expand Up @@ -135,6 +149,12 @@ opensearchplugin {
classname = "org.opensearch.replication.ReplicationPlugin"
}

java {
if (!isSnapshot) {
withJavadocJar()
withSourcesJar()
}
}

javadoc.enabled = false
licenseHeaders.enabled = false
Expand Down

0 comments on commit 567209e

Please sign in to comment.