Skip to content

Commit

Permalink
Enable local maven build, e.g. ./gradlew build -Dopensearch.version=3…
Browse files Browse the repository at this point in the history
….0.0 -Dbuild.snapshot=false.

Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Jan 23, 2024
1 parent 7ec9d38 commit c27a05a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 32 deletions.
65 changes: 34 additions & 31 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,40 @@ def projectPath = 'org.opensearch'
def pathToPlugin = 'plugin.api'
def pluginClassName = 'APIPlugin'

group = "org.dblock"
buildscript {
ext {
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
}

apply from: 'repositories.gradle'

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

dependencies {
classpath "org.opensearch.gradle:build-tools:${opensearch_version}"
}
}

allprojects {
group = "org.dblock"

version = opensearch_version - "-SNAPSHOT" + ".0"

if (isSnapshot) {
version += "-SNAPSHOT"
}

plugins.withId('java') {
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_11
}
}

tasks.register("preparePluginPathDirs") {
mustRunAfter clean
Expand Down Expand Up @@ -65,36 +98,6 @@ validateNebulaPom.enabled = false
// Don't care about documentation
javadoc.enabled = false

buildscript {
ext {
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
}

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

dependencies {
classpath "org.opensearch.gradle:build-tools:${opensearch_version}"
}
}

version = opensearch_version - "-SNAPSHOT" + ".0"
if (isSnapshot) {
version += "-SNAPSHOT"
}

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

test {
include '**/*Tests.class'
}
Expand Down
11 changes: 11 additions & 0 deletions repositories.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

repositories {
mavenLocal()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
2 changes: 1 addition & 1 deletion src/yamlRestTest/resources/rest-api-spec/test/20_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
api: {}

- match: { info.title: "opensearch" }
- match: { info.version: /.*-SNAPSHOT/ }
- match: { info.version: /\d*\.\d*\.\d*.*/ }
- match: { info.description: "The OpenSearch Project: https://opensearch.org/" }

- match: { paths./_plugins/api.get: {} }
Expand Down

0 comments on commit c27a05a

Please sign in to comment.