Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
84 lines (71 sloc) 2.22 KB
apply plugin: 'java'
apply plugin: 'maven'
repositories {
mavenCentral()
}
configurations {
wagon
distJars {
extendsFrom runtime
exclude group: 'org.elasticsearch'
exclude module: 'lucene-core'
exclude module: 'lucene-analyzers-common'
exclude module: 'jna'
exclude module: 'jackson-core'
exclude module: 'jackson-dataformat-smile'
exclude module: 'jackson-dataformat-yaml'
exclude module: 'log4j-api'
}
}
apply from: 'gradle/ext.gradle'
dependencies {
compile "org.elasticsearch:elasticsearch:${project.property('elasticsearch.version')}"
compile "org.apache.logging.log4j:log4j-api:${project.property('log4j.version')}"
testCompile "junit:junit:${project.property('junit.version')}"
distJars "${project.group}:${project.name}:${project.version}"
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-profile" << "compact2"
}
task makePluginDescriptor(type: Copy) {
from 'src/main/templates'
into 'build/tmp/plugin'
expand([
'descriptor': [
'name': pluginName,
'classname': pluginClassname,
'description': pluginDescription,
'version': project.property('version'),
'javaVersion': project.property('targetCompatibility'),
'elasticsearchVersion' : project.property('elasticsearch.version')
]
])
}
task buildPluginZip(type: Zip, dependsOn: [':jar', ':makePluginDescriptor']) {
from configurations.distJars
from 'build/tmp/plugin'
into 'elasticsearch'
classifier = 'plugin'
}
task unpackPlugin(type: Copy, dependsOn: [':buildPluginZip']) {
delete "plugins"
from configurations.distJars
from 'build/tmp/plugin'
into "plugins/${pluginName}"
}
clean {
delete "plugins"
delete "data"
delete "logs"
}
task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
into 'build/tmp'
classifier 'sources'
}
artifacts {
archives sourcesJar, buildPluginZip
}
You can’t perform that action at this time.