/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ buildscript { apply from: 'build-tools/repositories.gradle' ext { opensearch_group = "org.opensearch" isSnapshot = "true" == System.getProperty("build.snapshot", "true") opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT") buildVersionQualifier = System.getProperty("build.version_qualifier", "") // 2.0.0-rc1-SNAPSHOT -> 2.0.0.0-rc1-SNAPSHOT version_tokens = opensearch_version.tokenize('-') opensearch_build = version_tokens[0] + '.0' if (buildVersionQualifier) { opensearch_build += "-${buildVersionQualifier}" } if (isSnapshot) { opensearch_build += "-SNAPSHOT" } common_utils_version = System.getProperty("common_utils.version", opensearch_build) } repositories { mavenLocal() maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" } mavenCentral() maven { url "https://plugins.gradle.org/m2/" } maven { url "https://d1nvenhzbhpy0q.cloudfront.net/snapshots/lucene/" } } dependencies { classpath "${opensearch_group}.gradle:build-tools:${opensearch_version}" classpath "gradle.plugin.com.dorongold.plugins:task-tree:1.5" } } plugins { id 'com.netflix.nebula.ospackage' version "11.1.0" id 'java' id "io.freefair.lombok" version "8.0.1" id 'jacoco' } apply plugin: "com.dorongold.task-tree" allprojects { group = 'org.opensearch' version = opensearch_build apply from: "$rootDir/build-tools/repositories.gradle" plugins.withId('java') { sourceCompatibility = targetCompatibility = JavaVersion.VERSION_11 } plugins.withId('jacoco') { jacoco.toolVersion = '0.8.10' } } subprojects { configurations { testImplementation.extendsFrom compileOnly } } ext { projectSubstitutions = [:] licenseFile = rootProject.file('LICENSE.txt') noticeFile = rootProject.file('NOTICE.txt') } // updateVersion: Task to auto increment to the next development iteration task updateVersion { onlyIf { System.getProperty('newVersion') } doLast { ext.newVersion = System.getProperty('newVersion') println "Setting version to ${newVersion}." // String tokenization to support -SNAPSHOT // Include the required files that needs to be updated with new Version ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true) } }