|
| 1 | +dependsOn(':elasticsearch') |
| 2 | + |
| 3 | +apply plugin: 'java' |
| 4 | +apply plugin: 'maven' |
| 5 | + |
| 6 | +archivesBaseName = "elasticsearch-cassandra" |
| 7 | + |
| 8 | +explodedDistDir = new File(distsDir, 'exploded') |
| 9 | + |
| 10 | +manifest.mainAttributes("Implementation-Title": "ElasticSearch::Plugins::CassandraGatewayPlugin", "Implementation-Version": rootProject.version, "Implementation-Date": buildTimeStr) |
| 11 | + |
| 12 | +configurations.compile.transitive = true |
| 13 | +configurations.testCompile.transitive = true |
| 14 | + |
| 15 | +// no need to use the resource dir |
| 16 | +sourceSets.main.resources.srcDirs 'src/main/java' |
| 17 | +sourceSets.test.resources.srcDirs 'src/test/java' |
| 18 | + |
| 19 | +// add the source files to the dist jar |
| 20 | +//jar { |
| 21 | +// from sourceSets.main.allJava |
| 22 | +//} |
| 23 | + |
| 24 | +configurations { |
| 25 | + dists |
| 26 | + distLib { |
| 27 | + visible = false |
| 28 | + transitive = false |
| 29 | + } |
| 30 | +} |
| 31 | + |
| 32 | +dependencies { |
| 33 | + compile project(':elasticsearch') |
| 34 | + |
| 35 | + testCompile project(':test-testng') |
| 36 | + testCompile('org.testng:testng:5.10:jdk15') { transitive = false } |
| 37 | + testCompile 'org.hamcrest:hamcrest-all:1.1' |
| 38 | +} |
| 39 | + |
| 40 | +test { |
| 41 | + //useTestNG() |
| 42 | + //jmvArgs = ["-ea", "-Xmx1024m"] |
| 43 | + //suiteName = project.name |
| 44 | + //listeners = ["org.elasticsearch.util.testng.Listeners"] |
| 45 | + //systemProperties["es.test.log.conf"] = System.getProperty("es.test.log.conf", "log4j-gradle.properties") |
| 46 | +} |
| 47 | + |
| 48 | +task explodedDist(dependsOn: [jar], description: 'Builds the plugin zip file') << { |
| 49 | + [explodedDistDir]*.mkdirs() |
| 50 | + |
| 51 | + copy { |
| 52 | + from configurations.distLib |
| 53 | + into explodedDistDir |
| 54 | + } |
| 55 | + |
| 56 | + // remove elasticsearch files (compile above adds the elasticsearch one) |
| 57 | + ant.delete { fileset(dir: explodedDistDir, includes: "elasticsearch-*.jar") } |
| 58 | + |
| 59 | + copy { |
| 60 | + from libsDir |
| 61 | + into explodedDistDir |
| 62 | + } |
| 63 | + |
| 64 | + ant.delete { fileset(dir: explodedDistDir, includes: "elasticsearch-*-javadoc.jar") } |
| 65 | + ant.delete { fileset(dir: explodedDistDir, includes: "elasticsearch-*-sources.jar") } |
| 66 | +} |
| 67 | + |
| 68 | +task zip(type: Zip, dependsOn: ['explodedDist']) { |
| 69 | + from(explodedDistDir) { |
| 70 | + } |
| 71 | +} |
| 72 | + |
| 73 | +task release(dependsOn: [zip]) << { |
| 74 | + ant.delete(dir: explodedDistDir) |
| 75 | + copy { |
| 76 | + from distsDir |
| 77 | + into(new File(rootProject.distsDir, "plugins")) |
| 78 | + } |
| 79 | +} |
| 80 | + |
| 81 | +configurations { |
| 82 | + deployerJars |
| 83 | +} |
| 84 | + |
| 85 | +dependencies { |
| 86 | + deployerJars "org.apache.maven.wagon:wagon-http:1.0-beta-2" |
| 87 | +} |
| 88 | + |
| 89 | +task sourcesJar(type: Jar, dependsOn: classes) { |
| 90 | + classifier = 'sources' |
| 91 | + from sourceSets.main.allSource |
| 92 | +} |
| 93 | + |
| 94 | +task javadocJar(type: Jar, dependsOn: javadoc) { |
| 95 | + classifier = 'javadoc' |
| 96 | + from javadoc.destinationDir |
| 97 | +} |
| 98 | + |
| 99 | +artifacts { |
| 100 | + archives sourcesJar |
| 101 | + archives javadocJar |
| 102 | +} |
| 103 | + |
| 104 | +uploadArchives { |
| 105 | + repositories.mavenDeployer { |
| 106 | + configuration = configurations.deployerJars |
| 107 | + repository(url: rootProject.mavenRepoUrl) { |
| 108 | + authentication(userName: rootProject.mavenRepoUser, password: rootProject.mavenRepoPass) |
| 109 | + } |
| 110 | + snapshotRepository(url: rootProject.mavenSnapshotRepoUrl) { |
| 111 | + authentication(userName: rootProject.mavenRepoUser, password: rootProject.mavenRepoPass) |
| 112 | + } |
| 113 | + |
| 114 | + pom.project { |
| 115 | + inceptionYear '2010' |
| 116 | + name 'elasticsearch-plugins-lruclient' |
| 117 | + description 'Lru Client Plugin for ElasticSearch' |
| 118 | + licenses { |
| 119 | + license { |
| 120 | + name 'The Apache Software License, Version 2.0' |
| 121 | + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| 122 | + distribution 'repo' |
| 123 | + } |
| 124 | + } |
| 125 | + scm { |
| 126 | + connection 'git://github.com/elasticsearch/elasticsearch.git' |
| 127 | + developerConnection '[email protected]:elasticsearch/elasticsearch.git' |
| 128 | + url 'http://github.com/elasticsearch/elasticsearch' |
| 129 | + } |
| 130 | + } |
| 131 | + |
| 132 | + pom.whenConfigured {pom -> |
| 133 | + pom.dependencies = pom.dependencies.findAll {dep -> dep.scope != 'test' } // removes the test scoped ones |
| 134 | + } |
| 135 | + } |
| 136 | +} |
0 commit comments