2010-06-15 09:51:38 -04:00
|
|
|
apply plugin: 'java'
|
|
|
|
|
|
|
|
archivesBaseName = "$project.archivesBaseName"
|
|
|
|
|
|
|
|
dependencies {
|
2011-05-22 21:24:59 -04:00
|
|
|
runtime 'com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.2'
|
2011-05-16 15:56:10 -04:00
|
|
|
runtime 'com.google.guava:guava:r09'
|
2011-06-19 17:11:28 -04:00
|
|
|
runtime 'org.elasticsearch:es-trove:3.0.0rc2'
|
2011-07-09 19:16:58 -04:00
|
|
|
runtime 'org.elasticsearch:es-jsr166y:20110710'
|
2010-06-15 09:51:38 -04:00
|
|
|
|
2011-05-18 06:43:10 -04:00
|
|
|
runtime 'commons-codec:commons-codec:1.5'
|
2011-01-20 18:57:16 -05:00
|
|
|
|
2011-08-01 17:16:52 -04:00
|
|
|
// joda 2.0 moved to using volatile fields for datetime, which hurts performance for facets!
|
2011-06-24 11:42:53 -04:00
|
|
|
runtime 'joda-time:joda-time:1.6.2'
|
2011-08-09 09:52:59 -04:00
|
|
|
runtime 'org.mvel:mvel2:2.1.Beta6'
|
2010-06-15 09:51:38 -04:00
|
|
|
|
2011-08-09 10:16:27 -04:00
|
|
|
runtime 'org.codehaus.jackson:jackson-core-asl:1.8.5'
|
|
|
|
runtime 'org.codehaus.jackson:jackson-smile:1.8.5'
|
2010-06-15 09:51:38 -04:00
|
|
|
runtime 'org.yaml:snakeyaml:1.6'
|
|
|
|
|
2011-08-02 03:33:57 -04:00
|
|
|
runtime('org.jboss.netty:netty:3.2.5.Final') { transitive = false }
|
2010-06-15 09:51:38 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
tools
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
tools "org.elasticsearch:es-jarjar:1.0.0"
|
|
|
|
}
|
|
|
|
|
|
|
|
jar << {
|
|
|
|
jarjarArchivePath = new File(jar.archivePath.absolutePath + ".jarjar.jar")
|
|
|
|
project.ant {
|
|
|
|
taskdef name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask", classpath: configurations.tools.asPath
|
|
|
|
jarjar(jarfile: jarjarArchivePath) {
|
|
|
|
zipfileset(src: jar.archivePath)
|
|
|
|
configurations.runtime.files.findAll {file ->
|
2011-05-22 21:24:59 -04:00
|
|
|
['inject', 'codec', 'mvel', 'jackson', 'joda', 'snakeyaml', 'netty', 'guice', 'javax.inject', 'aopalliance', 'guava', 'concurrentlinkedhashmap', 'trove', 'jsr166y'].any { file.name.contains(it) }
|
2010-06-15 09:51:38 -04:00
|
|
|
}.each { jarjarFile ->
|
|
|
|
zipfileset(src: jarjarFile) {
|
|
|
|
exclude(name: "META-INF/**")
|
|
|
|
}
|
|
|
|
}
|
2011-05-22 21:24:59 -04:00
|
|
|
rule pattern: "com.googlecode.concurrentlinkedhashmap.**", result: "org.elasticsearch.common.concurrentlinkedhashmap.@1"
|
2010-06-15 09:51:38 -04:00
|
|
|
rule pattern: "com.google.common.**", result: "org.elasticsearch.common.@1"
|
|
|
|
rule pattern: "gnu.trove.**", result: "org.elasticsearch.common.trove.@1"
|
2010-06-15 10:28:05 -04:00
|
|
|
rule pattern: "jsr166y.**", result: "org.elasticsearch.common.util.concurrent.jsr166y.@1"
|
2010-06-15 09:51:38 -04:00
|
|
|
|
|
|
|
rule pattern: "org.aopalliance.**", result: "org.elasticsearch.common.aopalliance.@1"
|
2011-01-17 12:45:37 -05:00
|
|
|
rule pattern: "javax.inject.**", result: "org.elasticsearch.common.inject.jex.@1"
|
2010-06-15 09:51:38 -04:00
|
|
|
rule pattern: "com.google.inject.**", result: "org.elasticsearch.common.inject.@1"
|
|
|
|
|
2011-01-20 18:57:16 -05:00
|
|
|
rule pattern: "org.apache.commons.codec.**", result: "org.elasticsearch.common.codec.@1"
|
|
|
|
|
2010-06-15 09:51:38 -04:00
|
|
|
rule pattern: "org.mvel2.**", result: "org.elasticsearch.common.mvel2.@1"
|
|
|
|
|
|
|
|
rule pattern: "org.codehaus.jackson.**", result: "org.elasticsearch.common.jackson.@1"
|
|
|
|
rule pattern: "org.yaml.**", result: "org.elasticsearch.common.yaml.@1"
|
|
|
|
|
|
|
|
rule pattern: "org.joda.**", result: "org.elasticsearch.common.joda.@1"
|
|
|
|
|
|
|
|
rule pattern: "org.jboss.netty.**", result: "org.elasticsearch.common.netty.@1"
|
|
|
|
}
|
|
|
|
delete(file: jar.archivePath)
|
|
|
|
copy(file: jarjarArchivePath, tofile: jar.archivePath)
|
|
|
|
delete(file: jarjarArchivePath)
|
|
|
|
|
2010-09-01 16:21:26 -04:00
|
|
|
// seems like empty dirs still exists, unjar and clean them
|
2010-06-15 09:51:38 -04:00
|
|
|
unjar(src: jar.archivePath, dest: "build/tmp/extracted")
|
2010-10-31 05:45:10 -04:00
|
|
|
delete(file: "build/tmp/extracted/NOTICE")
|
|
|
|
delete(file: "build/tmp/extracted/LICENSE")
|
|
|
|
delete(file: "build/tmp/extracted/build.properties")
|
2010-06-15 10:28:05 -04:00
|
|
|
delete(dir: "build/tmp/extracted/jsr166y")
|
2010-10-31 05:45:10 -04:00
|
|
|
delete(dir: "build/tmp/extracted/gnu")
|
2010-06-15 09:51:38 -04:00
|
|
|
delete(dir: "build/tmp/extracted/org/codehaus")
|
|
|
|
delete(dir: "build/tmp/extracted/org/aopalliance")
|
|
|
|
delete(dir: "build/tmp/extracted/com/google")
|
|
|
|
delete(dir: "build/tmp/extracted/org/mvel2")
|
|
|
|
delete(dir: "build/tmp/extracted/org/joda")
|
|
|
|
delete(dir: "build/tmp/extracted/org/yaml")
|
|
|
|
delete(dir: "build/tmp/extracted/org/jboss")
|
|
|
|
|
|
|
|
delete(file: jar.archivePath)
|
|
|
|
jar(destfile: jar.archivePath, basedir: "build/tmp/extracted")
|
|
|
|
delete(dir: "build/tmp/extracted")
|
|
|
|
}
|
|
|
|
}
|