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+
112plugins {
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
1421ext {
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
2739apply plugin : ' java'
2840apply plugin : ' maven'
29-
30- sourceCompatibility = 1.7
31- targetCompatibility = 1.7
41+ apply plugin : ' signing'
42+ apply plugin : ' co.riiid.gradle'
3243
3344repositories {
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+
7792tasks. withType(JavaCompile ) {
78- options. compilerArgs << " -Xlint:unchecked" << " -Xlint: deprecation"
93+ options. compilerArgs << " -Xlint:unchecked, deprecation"
7994}
8095
8196test {
@@ -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-
122125task 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+
154173artifacts {
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'
0 commit comments