Skip to content

Commit 8a6bf1a

Browse files
author
Matt Hartzler
committed
cassandra plugin skeleton
1 parent e278e45 commit 8a6bf1a

File tree

4 files changed

+174
-0
lines changed

4 files changed

+174
-0
lines changed

plugins/cassandra/build.gradle

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
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+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
plugin=org.elasticsearch.plugin.cassandra.CassandraGatewayPlugin
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Licensed to Elastic Search and Shay Banon under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. Elastic Search licenses this
6+
* file to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.elasticsearch.plugin.cassandra;
21+
22+
import org.elasticsearch.plugins.AbstractPlugin;
23+
24+
/**
25+
* @author matt.hartzler
26+
*/
27+
public class CassandraGatewayPlugin extends AbstractPlugin {
28+
29+
@Override public String name() {
30+
return "cassandra-gateway";
31+
}
32+
33+
@Override public String description() {
34+
return "Cassandra Gateway";
35+
}
36+
}

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ include 'plugins-river-rabbitmq'
2626
include 'plugins-river-couchdb'
2727

2828
include 'plugins-client-lru'
29+
include 'plugins-cassandra'
2930

3031
rootProject.name = 'elasticsearch-root'
3132
rootProject.children.each {project ->

0 commit comments

Comments
 (0)