143 lines
4.1 KiB
Groovy
143 lines
4.1 KiB
Groovy
dependsOn(':elasticsearch')
|
|
|
|
apply plugin: 'java'
|
|
apply plugin: 'maven'
|
|
|
|
archivesBaseName = "elasticsearch-attachments"
|
|
|
|
explodedDistDir = new File(distsDir, 'exploded')
|
|
|
|
manifest.mainAttributes("Implementation-Title": "ElasticSearch::Plugins::Attachments", "Implementation-Version": rootProject.version, "Implementation-Date": buildTimeStr)
|
|
|
|
configurations.compile.transitive = true
|
|
configurations.testCompile.transitive = true
|
|
|
|
// no need to use the resource dir
|
|
sourceSets.main.resources.srcDir 'src/main/java'
|
|
sourceSets.test.resources.srcDir 'src/test/java'
|
|
|
|
// add the source files to the dist jar
|
|
jar {
|
|
from sourceSets.main.allJava
|
|
}
|
|
|
|
configurations {
|
|
dists
|
|
distLib {
|
|
visible = false
|
|
transitive = false
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compile project(':elasticsearch')
|
|
|
|
compile('org.apache.tika:tika-app:0.7') { transitive = false }
|
|
distLib('org.apache.tika:tika-app:0.7') { transitive = false }
|
|
|
|
|
|
testCompile project(':test-testng')
|
|
testCompile('org.testng:testng:5.10:jdk15') { transitive = false }
|
|
testCompile 'org.hamcrest:hamcrest-all:1.1'
|
|
}
|
|
|
|
test {
|
|
useTestNG()
|
|
jmvArgs = ["-ea", "-Xmx1024m"]
|
|
suiteName = project.name
|
|
listeners = ["org.elasticsearch.util.testng.Listeners"]
|
|
systemProperties["es.test.log.conf"] = System.getProperty("es.test.log.conf", "log4j-gradle.properties")
|
|
}
|
|
|
|
task explodedDist(dependsOn: [jar], description: 'Builds the plugin zip file') << {
|
|
[explodedDistDir]*.mkdirs()
|
|
|
|
copy {
|
|
from configurations.distLib
|
|
into explodedDistDir
|
|
}
|
|
|
|
// remove elasticsearch files (compile above adds the elasticsearch one)
|
|
ant.delete { fileset(dir: explodedDistDir, includes: "elasticsearch-*.jar") }
|
|
|
|
copy {
|
|
from libsDir
|
|
into explodedDistDir
|
|
}
|
|
|
|
ant.delete { fileset(dir: explodedDistDir, includes: "elasticsearch-*-javadoc.jar") }
|
|
ant.delete { fileset(dir: explodedDistDir, includes: "elasticsearch-*-sources.jar") }
|
|
}
|
|
|
|
task zip(type: Zip, dependsOn: ['explodedDist']) {
|
|
from(explodedDistDir) {
|
|
}
|
|
}
|
|
|
|
task release(dependsOn: [zip]) << {
|
|
ant.delete(dir: explodedDistDir)
|
|
copy {
|
|
from distsDir
|
|
into(new File(rootProject.distsDir, "plugins"))
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
deployerJars
|
|
}
|
|
|
|
dependencies {
|
|
deployerJars "org.apache.maven.wagon:wagon-http:1.0-beta-2"
|
|
}
|
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
classifier = 'sources'
|
|
from sourceSets.main.allSource
|
|
}
|
|
|
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
classifier = 'javadoc'
|
|
from javadoc.destinationDir
|
|
}
|
|
|
|
artifacts {
|
|
archives sourcesJar
|
|
archives javadocJar
|
|
}
|
|
|
|
uploadArchives {
|
|
repositories.mavenDeployer {
|
|
// repository(url: "file://localhost/" + rootProject.projectDir.absolutePath + "/build/maven/repository")
|
|
// snapshotRepository(url: "file://localhost/" + rootProject.projectDir.absolutePath + "/build/maven/snapshotRepository")
|
|
|
|
configuration = configurations.deployerJars
|
|
repository(url: "http://oss.sonatype.org/service/local/staging/deploy/maven2/") {
|
|
authentication(userName: "kimchy", password: System.getenv("REPO_PASS"))
|
|
}
|
|
snapshotRepository(url: "http://oss.sonatype.org/content/repositories/snapshots") {
|
|
authentication(userName: "kimchy", password: System.getenv("REPO_PASS"))
|
|
}
|
|
|
|
pom.project {
|
|
inceptionYear '2009'
|
|
name 'elasticsearch-plugins-attachments'
|
|
description 'Attachments Plugin for ElasticSearch'
|
|
licenses {
|
|
license {
|
|
name 'The Apache Software License, Version 2.0'
|
|
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
|
distribution 'repo'
|
|
}
|
|
}
|
|
scm {
|
|
connection 'git://github.com/elasticsearch/elasticsearch.git'
|
|
developerConnection 'git@github.com:elasticsearch/elasticsearch.git'
|
|
url 'http://github.com/elasticsearch/elasticsearch'
|
|
}
|
|
}
|
|
|
|
pom.whenConfigured {pom ->
|
|
pom.dependencies = pom.dependencies.findAll {dep -> dep.scope != 'test' } // removes the test scoped ones
|
|
}
|
|
}
|
|
} |