OpenSearch/x-pack/build.gradle

55 lines
2.6 KiB
Groovy

import org.elasticsearch.gradle.BuildPlugin
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
import org.elasticsearch.gradle.Version
import org.elasticsearch.gradle.precommit.LicenseHeadersTask
Project xpackRootProject = project
subprojects {
group = 'org.elasticsearch.plugin'
ext.xpackRootProject = xpackRootProject
ext.xpackProject = { String projectName -> xpackRootProject.project(projectName) }
// helper method to find the path to a module
ext.xpackModule = { String moduleName -> xpackProject("plugin:${moduleName}").path }
plugins.withType(PluginBuildPlugin).whenPluginAdded {
project.esplugin.licenseFile = rootProject.file('licenses/ELASTIC-LICENSE.txt')
project.esplugin.noticeFile = xpackRootProject.file('NOTICE.txt')
}
if (project.name != 'protocol') {
tasks.withType(LicenseHeadersTask.class) {
approvedLicenses = ['Elastic License', 'Generated']
additionalLicense 'ELAST', 'Elastic License', 'Licensed under the Elastic License'
}
ext.licenseName = 'Elastic License'
ext.licenseUrl = ext.elasticLicenseUrl
project.ext.licenseFile = rootProject.file('licenses/ELASTIC-LICENSE.txt')
project.ext.noticeFile = xpackRootProject.file('NOTICE.txt')
}
}
File checkstyleSuppressions = file('dev-tools/checkstyle_suppressions.xml')
subprojects {
tasks.withType(Checkstyle) {
inputs.file(checkstyleSuppressions)
// Use x-pack-elasticsearch specific suppressions file rather than the open source one.
configProperties = [
suppressions: checkstyleSuppressions
]
}
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-core:${version}": xpackModule('core')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-deprecation:${version}": xpackModule('deprecation')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-graph:${version}": xpackModule('graph')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-logstash:${version}": xpackModule('logstash')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-ml:${version}": xpackModule('ml')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-monitoring:${version}": xpackModule('monitoring')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-security:${version}": xpackModule('security')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-sql:${version}": xpackModule('sql')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-upgrade:${version}": xpackModule('upgrade')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-watcher:${version}": xpackModule('watcher')]
}