2017-08-25 01:47:10 -04:00
|
|
|
import org.elasticsearch.gradle.BuildPlugin
|
2018-01-27 00:48:30 -05:00
|
|
|
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
|
2017-11-21 03:45:10 -05:00
|
|
|
import org.elasticsearch.gradle.Version
|
2016-09-29 06:03:14 -04:00
|
|
|
import org.elasticsearch.gradle.precommit.LicenseHeadersTask
|
2016-04-25 19:21:05 -04:00
|
|
|
|
2018-01-27 00:48:30 -05:00
|
|
|
Project xpackRootProject = project
|
|
|
|
|
2018-04-10 16:58:49 -04:00
|
|
|
apply plugin: 'nebula.info-scm'
|
|
|
|
final String licenseCommit
|
|
|
|
if (version.endsWith('-SNAPSHOT')) {
|
|
|
|
licenseCommit = xpackRootProject.scminfo.change ?: "master" // leniency for non git builds
|
|
|
|
} else {
|
|
|
|
licenseCommit = "v${version}"
|
|
|
|
}
|
|
|
|
|
2016-02-04 16:07:01 -05:00
|
|
|
subprojects {
|
2017-12-12 15:23:29 -05:00
|
|
|
group = 'org.elasticsearch.plugin'
|
2018-01-27 00:48:30 -05:00
|
|
|
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 }
|
2017-12-12 15:23:29 -05:00
|
|
|
|
2018-04-10 16:58:49 -04:00
|
|
|
ext.licenseName = 'Elastic License'
|
|
|
|
ext.licenseUrl = "https://raw.githubusercontent.com/elastic/elasticsearch/${licenseCommit}/licenses/ELASTIC-LICENSE.txt"
|
2017-08-25 01:47:10 -04:00
|
|
|
|
2018-04-25 09:38:31 -04:00
|
|
|
project.ext.licenseFile = rootProject.file('licenses/ELASTIC-LICENSE.txt')
|
|
|
|
project.ext.noticeFile = xpackRootProject.file('NOTICE.txt')
|
2018-01-27 00:48:30 -05:00
|
|
|
|
|
|
|
plugins.withType(PluginBuildPlugin).whenPluginAdded {
|
2018-04-10 16:58:49 -04:00
|
|
|
project.esplugin.licenseFile = rootProject.file('licenses/ELASTIC-LICENSE.txt')
|
2018-01-27 00:48:30 -05:00
|
|
|
project.esplugin.noticeFile = xpackRootProject.file('NOTICE.txt')
|
2017-08-25 01:47:10 -04:00
|
|
|
}
|
2016-02-04 16:07:01 -05:00
|
|
|
}
|
|
|
|
|
2016-09-29 06:03:14 -04:00
|
|
|
File checkstyleSuppressions = file('dev-tools/checkstyle_suppressions.xml')
|
|
|
|
subprojects {
|
|
|
|
tasks.withType(Checkstyle) {
|
|
|
|
inputs.file(checkstyleSuppressions)
|
2017-02-10 14:02:42 -05:00
|
|
|
// Use x-pack-elasticsearch specific suppressions file rather than the open source one.
|
2016-09-29 06:03:14 -04:00
|
|
|
configProperties = [
|
|
|
|
suppressions: checkstyleSuppressions
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(LicenseHeadersTask.class) {
|
2018-04-06 12:22:43 -04:00
|
|
|
approvedLicenses = ['Elastic License', 'Generated']
|
|
|
|
additionalLicense 'ELAST', 'Elastic License', 'Licensed under the Elastic License'
|
2016-09-29 06:03:14 -04:00
|
|
|
}
|
2018-01-27 00:48:30 -05:00
|
|
|
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-upgrade:${version}": xpackModule('upgrade')]
|
|
|
|
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-watcher:${version}": xpackModule('watcher')]
|
2017-05-30 09:04:27 -04:00
|
|
|
|
2018-02-09 16:03:08 -05:00
|
|
|
bwcVersions.snapshotProjectNames.each { snapshotName ->
|
|
|
|
Version snapshot = bwcVersions.getSnapshotForProject(snapshotName)
|
2018-02-10 10:52:36 -05:00
|
|
|
if (snapshot != null && snapshot.onOrAfter("6.3.0")) {
|
2018-01-30 02:11:48 -05:00
|
|
|
String snapshotProject = ":x-pack:plugin:bwc:${snapshotName}"
|
2018-02-09 16:03:08 -05:00
|
|
|
project(snapshotProject).ext.bwcVersion = snapshot
|
|
|
|
ext.projectSubstitutions["org.elasticsearch.plugin:x-pack:${snapshot}"] = snapshotProject
|
2018-02-23 11:03:17 -05:00
|
|
|
}
|
|
|
|
}
|
2016-09-29 06:03:14 -04:00
|
|
|
}
|