Skip to content

Commit 8112f5e

Browse files
committed
update to Elasticsearch 2.1.2
1 parent 2689591 commit 8112f5e

File tree

3 files changed

+154
-55
lines changed

3 files changed

+154
-55
lines changed

build.gradle

Lines changed: 60 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,45 @@
1+
2+
buildscript {
3+
repositories {
4+
mavenCentral()
5+
}
6+
dependencies {
7+
classpath 'co.riiid:gradle-github-plugin:0.4.2'
8+
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3"
9+
}
10+
}
11+
112
plugins {
213
id 'java'
3-
id 'com.github.johnrengelman.shadow' version '1.2.2'
14+
id 'com.github.johnrengelman.shadow' version '1.2.3'
15+
id 'org.ajoberstar.grgit' version '1.4.2'
416
}
517

6-
def xbibGroup = 'org.xbib.elasticsearch.plugin'
7-
def xbibVersion = '2.2.0.0'
8-
9-
group = xbibGroup
10-
version = xbibVersion
11-
12-
println "Current JVM: " + org.gradle.internal.jvm.Jvm.current()
18+
group = 'org.xbib.elasticsearch.plugin'
19+
version = '2.1.2.0'
1320

1421
ext {
1522
pluginName = 'knapsack'
1623
pluginClassname = 'org.xbib.elasticsearch.plugin.knapsack.KnapsackPlugin'
1724
pluginDescription = 'An import/export plugin for Elasticsearch'
25+
user = 'jprante'
26+
name = 'elasticsearch-knapsack'
27+
scmUrl = 'https://github.com/' + user + '/' + name
28+
scmConnection = 'scm:git:git://github.com/' + user + '/' + name + '.git'
29+
scmDeveloperConnection = 'scm:git:git://github.com/' + user + '/' + name + '.git'
1830
versions = [
19-
'elasticsearch' : '2.2.0',
20-
'elasticsearch-helper' : '2.2.0.3',
21-
'log4j': '2.5',
22-
'junit' : '4.12',
23-
'wagon' : '2.10'
31+
'elasticsearch' : '2.1.2',
32+
'elasticsearch-helper' : '2.1.1.5',
33+
'log4j': '2.5',
34+
'junit' : '4.12',
35+
'wagon' : '2.10'
2436
]
2537
}
2638

2739
apply plugin: 'java'
2840
apply plugin: 'maven'
29-
30-
sourceCompatibility = 1.7
31-
targetCompatibility = 1.7
41+
apply plugin: 'signing'
42+
apply plugin: 'co.riiid.gradle'
3243

3344
repositories {
3445
mavenCentral()
@@ -70,12 +81,16 @@ dependencies {
7081
compile "org.apache.logging.log4j:log4j-core:${versions.log4j}"
7182
testCompile "junit:junit:${versions.junit}"
7283
integrationTestCompile "junit:junit:${versions.junit}"
84+
releaseJars "${project.group}:${project.name}:${project.version}"
7385
//releaseJars "${project.group}:${project.name}:${project.version}:all"
7486
wagon "org.apache.maven.wagon:wagon-ssh-external:${versions.wagon}"
7587
}
7688

89+
sourceCompatibility = 1.7
90+
targetCompatibility = 1.7
91+
7792
tasks.withType(JavaCompile) {
78-
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
93+
options.compilerArgs << "-Xlint:unchecked,deprecation"
7994
}
8095

8196
test {
@@ -107,18 +122,6 @@ clean {
107122
delete "logs"
108123
}
109124

110-
task sourcesJar(type: Jar, dependsOn: classes) {
111-
from sourceSets.main.allSource
112-
into 'build/tmp/sources'
113-
classifier 'sources'
114-
}
115-
116-
shadowJar {
117-
baseName = project.name
118-
version = project.version
119-
classifier = 'all'
120-
}
121-
122125
task makePluginDescriptor(type: Copy) {
123126
from 'src/main/templates'
124127
into 'build/tmp/plugin'
@@ -137,45 +140,47 @@ task makePluginDescriptor(type: Copy) {
137140
])
138141
}
139142

140-
task pluginZip(type: Zip, dependsOn: [':jar', ':makePluginDescriptor']) {
141-
from files(libsDir)
143+
task buildPluginZip(type: Zip, dependsOn: [':jar', ':makePluginDescriptor']) {
142144
from configurations.releaseJars
143145
from 'build/tmp/plugin'
144146
classifier = 'plugin'
145147
}
146148

147-
task unpackPlugin(type: Copy, dependsOn: [':pluginZip']) {
149+
task unpackPlugin(type: Copy, dependsOn: [':buildPluginZip']) {
148150
delete "plugins"
149151
from configurations.releaseJars
150152
from 'build/tmp/plugin'
151153
into "plugins/${pluginName}"
152154
}
153155

156+
task sourcesJar(type: Jar, dependsOn: classes) {
157+
from sourceSets.main.allSource
158+
into 'build/tmp/sources'
159+
classifier 'sources'
160+
}
161+
162+
shadowJar {
163+
baseName = project.name
164+
classifier = 'all'
165+
}
166+
167+
task javadocJar(type: Jar, dependsOn: classes) {
168+
from javadoc
169+
into 'build/tmp'
170+
classifier 'javadoc'
171+
}
172+
154173
artifacts {
155-
archives sourcesJar, shadowJar, pluginZip
174+
archives javadocJar, sourcesJar, shadowJar, buildPluginZip
156175
}
157176

158-
uploadArchives {
159-
repositories {
160-
if (project.hasProperty("xbibUsername")) {
161-
mavenDeployer {
162-
configuration = configurations.wagon
163-
repository(
164-
id: 'xbib.org',
165-
url: uri('scpexe://xbib.org/repository'),
166-
authentication: [userName: xbibUsername, privateKey: xbibPrivateKey]
167-
)
168-
pom.project {
169-
inceptionYear '2012'
170-
licenses {
171-
license {
172-
name 'The Apache Software License, Version 2.0'
173-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
174-
distribution 'repo'
175-
}
176-
}
177-
}
178-
}
179-
}
177+
if (project.hasProperty('signing.keyId')) {
178+
signing {
179+
sign configurations.archives
180180
}
181181
}
182+
183+
ext.grgit = org.ajoberstar.grgit.Grgit.open()
184+
185+
apply from: 'gradle/git.gradle'
186+
apply from: 'gradle/publish.gradle'

gradle/git.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
task gitRelease(dependsOn: build) << {
3+
grgit.add(patterns: ['.'], update: true)
4+
grgit.commit(message: "release of ${project.version}")
5+
grgit.tag.remove(names: [project.version])
6+
grgit.tag.add(name: project.version)
7+
grgit.push()
8+
grgit.push(tags: true)
9+
}

gradle/publish.gradle

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
apply plugin: 'io.codearte.nexus-staging'
2+
3+
/*
4+
nexus {
5+
attachJavadoc = true
6+
attachSources = true
7+
attachTests = true
8+
sign = true
9+
repositoryUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
10+
snapshotRepositoryUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
11+
}
12+
*/
13+
14+
nexusStaging {
15+
packageGroup = "org.xbib"
16+
}
17+
18+
uploadArchives {
19+
repositories {
20+
if (project.hasProperty("xbibUsername")) {
21+
mavenDeployer {
22+
configuration = configurations.wagon
23+
repository(id: 'xbib.org',
24+
url: uri('scpexe://xbib.org/repository'),
25+
authentication: [userName: xbibUsername, privateKey: xbibPrivateKey])
26+
}
27+
}
28+
if (project.hasProperty('ossrhUsername')) {
29+
mavenDeployer {
30+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
31+
repository(id: 'ossrh', url: uri(ossrhReleaseUrl),
32+
authentication: [userName: ossrhUsername, password: ossrhPassword])
33+
snapshotRepository(id: 'ossrh', url: uri(ossrhSnapshotUrl),
34+
authentication: [userName: ossrhUsername, password: ossrhPassword])
35+
pom.project {
36+
name pluginName
37+
description pluginDescription
38+
packaging 'jar'
39+
inceptionYear '2012'
40+
url url
41+
organization {
42+
name 'xbib'
43+
url 'http://xbib.org'
44+
}
45+
developers {
46+
developer {
47+
id user
48+
name 'Jörg Prante'
49+
email 'joergprante@gmail.com'
50+
url 'https://github.com/jprante'
51+
}
52+
}
53+
scm {
54+
url scmUrl
55+
connection scmConnection
56+
developerConnection scmDeveloperConnection
57+
}
58+
licenses {
59+
license {
60+
name 'The Apache License, Version 2.0'
61+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
62+
}
63+
}
64+
}
65+
}
66+
}
67+
}
68+
}
69+
70+
if (project.hasProperty('githubToken')) {
71+
github {
72+
owner = user
73+
token = githubToken
74+
repo = project.name
75+
name = project.version
76+
tagName = project.version
77+
targetCommitish = 'master'
78+
assets = [
79+
"build/distributions/${project.name}-${project.version}-plugin.zip"
80+
]
81+
}
82+
githubRelease {
83+
dependsOn gitRelease, buildPluginZip
84+
}
85+
}

0 commit comments

Comments
 (0)