Skip to content

Commit c5754a4

Browse files
committed
Migrated to Gradle
1 parent c85a7f0 commit c5754a4

File tree

11 files changed

+99
-251
lines changed

11 files changed

+99
-251
lines changed

.gitignore

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@
88
*.iml
99
*.iws
1010

11+
# Gradle
12+
.gradle
13+
1114
# Mac
1215
.DS_Store
13-
14-
# Maven
15-
log/
16-
target/
17-
18-
# Vagrant
19-
.vagrant/

Vagrantfile

Lines changed: 0 additions & 7 deletions
This file was deleted.

build.gradle

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
apply plugin: 'java'
2+
apply plugin: 'maven'
3+
4+
println "Host: " + java.net.InetAddress.getLocalHost()
5+
println "Gradle: " + gradle.gradleVersion + " JVM: " + org.gradle.internal.jvm.Jvm.current() + " Groovy: " + GroovySystem.getVersion()
6+
println "Build: group: '${project.group}', name: '${project.name}', version: '${project.version}'"
7+
println "Timestamp: " + java.time.Instant.now().atZone(java.time.ZoneId.systemDefault()).toString()
8+
9+
ext {
10+
versions = [
11+
'elasticsearch' : "${version}".replaceAll(/\.[0-9]+$/, ""),
12+
'prometheus' : '0.0.23',
13+
'log4j': '2.6.2',
14+
]
15+
}
16+
17+
repositories {
18+
mavenCentral()
19+
mavenLocal()
20+
}
21+
22+
configurations {
23+
releaseJars {
24+
extendsFrom runtime
25+
exclude group: 'org.elasticsearch'
26+
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
27+
exclude group: 'org.apache.logging.log4j'
28+
}
29+
}
30+
31+
dependencies {
32+
compile "org.elasticsearch:elasticsearch:${versions.elasticsearch}"
33+
compile "io.prometheus:simpleclient:${versions.prometheus}"
34+
compile "io.prometheus:simpleclient_common:${versions.prometheus}"
35+
compile "org.apache.logging.log4j:log4j-api:${versions.log4j}"
36+
releaseJars "${project.group}:${project.name}:${project.version}"
37+
}
38+
39+
tasks.withType(JavaCompile) {
40+
options.compilerArgs << '-Xlint:unchecked,deprecation'
41+
}
42+
43+
task javadocJar(type: Jar, dependsOn: classes) {
44+
from javadoc
45+
into 'build/tmp'
46+
classifier 'javadoc'
47+
}
48+
49+
task sourcesJar(type: Jar, dependsOn: classes) {
50+
from sourceSets.main.allSource
51+
into 'build/tmp/sources'
52+
classifier 'sources'
53+
}
54+
55+
task makePluginDescriptor(type: Copy) {
56+
from 'src/main/templates'
57+
into 'build/tmp/plugin'
58+
expand([
59+
'descriptor': [
60+
'name': pluginName,
61+
'classname': pluginClassname,
62+
'description': pluginDescription,
63+
'version': project.property('version'),
64+
'javaVersion': project.property('targetCompatibility'),
65+
'elasticsearchVersion' : versions.elasticsearch
66+
]
67+
])
68+
}
69+
70+
task buildPluginZip(type: Zip, dependsOn: [':jar', ':makePluginDescriptor']) {
71+
from configurations.releaseJars
72+
from 'build/tmp/plugin'
73+
into 'elasticsearch'
74+
}
75+
76+
artifacts {
77+
archives javadocJar, sourcesJar, buildPluginZip
78+
}

gradle.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
org.gradle.daemon = true
2+
3+
group = org.elasticsearch.plugin.prometheus
4+
5+
version = 5.4.2.0
6+
7+
pluginName = prometheus-exporter
8+
pluginClassname = org.elasticsearch.plugin.prometheus.PrometheusExporterPlugin
9+
pluginDescription = Export ElasticSearch metrics to Prometheus

plugin-descriptor.properties

Lines changed: 0 additions & 72 deletions
This file was deleted.

pom.xml

Lines changed: 0 additions & 116 deletions
This file was deleted.

provision.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'elasticsearch-prometheus-exporter'

src/main/assemblies/plugin.xml

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
description=${descriptor.description}
2+
version=${descriptor.version}
3+
name=${descriptor.name}
4+
site=false
5+
jvm=true
6+
classname=${descriptor.classname}
7+
java.version=${descriptor.javaVersion}
8+
elasticsearch.version=${descriptor.elasticsearchVersion}

0 commit comments

Comments
 (0)