OpenSearch/build.gradle

76 lines
2.4 KiB
Groovy

import org.elasticsearch.gradle.VersionProperties
import org.elasticsearch.gradle.precommit.LicenseHeadersTask
if (project.projectDir.name != 'x-pack') {
throw new GradleException('You must checkout x-pack in the following directory: <path to Elasticsearch checkout>/../elasticsearch-extra/x-pack')
}
subprojects {
plugins.withType(MavenPublishPlugin).whenPluginAdded {
publishing {
publications {
// add license information to generated poms
all {
pom.withXml { XmlProvider xml ->
Node node = xml.asNode()
Node license = node.appendNode('licenses').appendNode('license')
license.appendNode('name', 'Elastic Commercial Software End User License Agreement')
license.appendNode('url', 'https://www.elastic.co/eula/')
license.appendNode('distribution', 'repo')
Node developer = node.appendNode('developers').appendNode('developer')
developer.appendNode('name', 'Elastic')
developer.appendNode('url', 'http://www.elastic.co')
}
}
}
}
}
}
task bundlePack(type: Zip) {
onlyIf { project('kibana').bundlePlugin.enabled }
dependsOn 'elasticsearch:bundlePlugin'
dependsOn 'kibana:bundlePlugin'
from { zipTree(project('elasticsearch').bundlePlugin.outputs.files.singleFile) }
from { zipTree(project('kibana').bundlePlugin.outputs.files.singleFile) }
destinationDir file('build/distributions')
baseName = 'x-pack'
version = VersionProperties.elasticsearch
}
task assemble(dependsOn: bundlePack) {
group = 'Build'
description = 'Assembles the outputs of this project.'
}
task build(dependsOn: assemble) {
group = 'Build'
description = 'Assembles and tests this project.'
}
task clean(type: Delete) {
group = 'Build'
description = 'Deletes the build directory'
delete 'build'
}
File checkstyleSuppressions = file('dev-tools/checkstyle_suppressions.xml')
subprojects {
tasks.withType(Checkstyle) {
inputs.file(checkstyleSuppressions)
// Use x-pack specific suppressions file rather than the open source one.
configProperties = [
suppressions: checkstyleSuppressions
]
}
tasks.withType(LicenseHeadersTask.class) {
approvedLicenses = ['Elasticsearch Confidential']
additionalLicense 'ESCON', 'Elasticsearch Confidential', 'ELASTICSEARCH CONFIDENTIAL'
}
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-api:${version}": ':x-pack:elasticsearch' ]
}