2017-08-25 01:47:10 -04:00
import org.elasticsearch.gradle.BuildPlugin
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
2017-02-10 14:02:42 -05:00
if ( project . projectDir . name ! = 'x-pack-elasticsearch' ) {
2017-02-14 17:16:18 -05:00
throw new GradleException ( 'You must checkout x-pack-elasticsearch in the following directory: <path to Elasticsearch checkout>/../elasticsearch-extra/x-pack-elasticsearch' )
2015-11-16 15:45:03 -05:00
}
2018-01-04 16:42:12 -05:00
task wrapper ( type: Wrapper )
2016-02-04 16:07:01 -05:00
subprojects {
2017-12-12 15:23:29 -05:00
group = 'org.elasticsearch.plugin'
2016-11-24 03:05:15 -05:00
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' )
}
}
}
2016-02-04 16:21:18 -05:00
}
2016-02-04 16:07:01 -05:00
}
2017-08-25 01:47:10 -04:00
plugins . withType ( BuildPlugin ) . whenPluginAdded {
project . licenseFile = project ( ':x-pack-elasticsearch' ) . file ( 'LICENSE.txt' )
project . noticeFile = project ( ':x-pack-elasticsearch' ) . file ( 'NOTICE.txt' )
}
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 ) {
2017-12-13 10:19:31 -05:00
approvedLicenses = [ 'Elasticsearch Confidential' , 'Generated' ]
2016-09-29 06:03:14 -04:00
additionalLicense 'ESCON' , 'Elasticsearch Confidential' , 'ELASTICSEARCH CONFIDENTIAL'
}
2017-05-18 13:33:53 -04:00
ext . projectSubstitutions + = [ "org.elasticsearch.plugin:x-pack-api:${version}" : ':x-pack-elasticsearch:plugin' ]
2017-12-12 15:23:29 -05:00
ext . projectSubstitutions + = [ "org.elasticsearch.plugin:x-pack-core:${version}" : ':x-pack-elasticsearch:plugin:core' ]
2017-05-30 09:04:27 -04:00
2017-11-21 03:45:10 -05:00
for ( final Version version : versionCollection . versionsIndexCompatibleWithCurrent ) {
if ( version . branch ! = null ) {
final String snapshotProject = ":x-pack-elasticsearch:plugin:bwc-snapshot-dummy-projects:bwc-snapshot-${version.branch}"
project ( snapshotProject ) . ext . bwcVersion = version
ext . projectSubstitutions [ "org.elasticsearch.plugin:x-pack:${version}" ] = snapshotProject
2017-05-30 09:04:27 -04:00
}
2017-05-18 13:33:53 -04:00
}
2016-09-29 06:03:14 -04:00
}