1
1
import com.github.mgk.gradle.*
2
2
3
+ buildscript {
4
+ repositories {
5
+ mavenLocal()
6
+ mavenCentral()
7
+ jcenter()
8
+ }
9
+
10
+ dependencies {
11
+ classpath " org.elasticsearch.gradle:build-tools:6.4.2" // How can we use ${versions.elasticsearch} here ???
12
+ }
13
+ }
14
+
3
15
plugins {
4
16
id " java"
5
17
id " checkstyle"
6
18
id " co.riiid.gradle" version " 0.4.2"
7
19
id " com.github.mgk.gradle.s3" version " 1.4.0"
8
20
}
9
21
22
+ apply plugin : ' java'
23
+ apply plugin : ' idea'
24
+ apply plugin : ' elasticsearch.esplugin'
25
+
26
+ // license of this project
27
+ licenseFile = rootProject. file(' LICENSE.txt' )
28
+ // copyright notices
29
+ noticeFile = rootProject. file(' NOTICE.txt' )
30
+
31
+ // dependency license check needs can be enabled
32
+ dependencyLicenses. enabled = false
33
+
34
+ // thirdparty audit needs can be enabled
35
+ thirdPartyAudit. enabled = false
36
+
37
+ // license header checks can be disabled
38
+ licenseHeaders. enabled = true
39
+
40
+ // There are only integration tests
41
+ integTestRunner. enabled = true
42
+ test. enabled = false
43
+
10
44
println " Host: " + java.net.InetAddress . getLocalHost()
11
45
println " Gradle: " + gradle. gradleVersion + " JVM: " + org.gradle.internal.jvm.Jvm . current() + " Groovy: " + GroovySystem . getVersion()
12
46
println " Build: group: '${ project.group} ', name: '${ project.name} ', version: '${ project.version} '"
21
55
versions = [
22
56
" elasticsearch" : version. replaceAll(/ \. [0-9]+(|-SNAPSHOT)$/ , " " ),
23
57
" prometheus" : " 0.4.0" ,
24
- " log4j" : " 2.9 .1" ,
58
+ " log4j" : " 2.11 .1" ,
25
59
" junit" : " 4.12"
26
60
]
27
61
}
@@ -48,49 +82,25 @@ tasks.withType(JavaCompile) {
48
82
options. compilerArgs << " -Xlint:unchecked,deprecation"
49
83
}
50
84
51
- task javadocJar (type : Jar , dependsOn : classes) {
52
- from javadoc
53
- into " build/tmp"
54
- classifier " javadoc"
55
- }
56
-
57
- task sourcesJar (type : Jar , dependsOn : classes) {
58
- from sourceSets. main. allSource
59
- into " build/tmp/sources"
60
- classifier " sources"
61
- }
62
-
63
- task copyPluginFiles (type : Copy ) {
64
- from " src/main/templates"
65
- into " build/tmp/plugin"
66
- expand([
67
- " descriptor" : [
68
- " name" : pluginName,
69
- " classname" : pluginClassname,
70
- " description" : pluginDescription,
71
- " version" : project. property(" version" ),
72
- " javaVersion" : project. property(" targetCompatibility" ),
73
- " elasticsearchVersion" : versions. elasticsearch
74
- ]
75
- ])
76
- outputs. upToDateWhen { false }
77
- }
78
-
79
- task buildPluginZip (type : Zip , dependsOn : [" :jar" , " copyPluginFiles" ]) {
80
- from configurations. releaseJars
81
- from " build/tmp/plugin"
85
+ esplugin {
86
+ licenseFile rootProject. file(' LICENSE.txt' )
87
+ noticeFile rootProject. file(' NOTICE.txt' )
88
+ name pluginName
89
+ description pluginDescription
90
+ classname pluginClassname
82
91
}
83
92
84
- artifacts {
85
- archives javadocJar, sourcesJar, buildPluginZip
93
+ integTestCluster {
94
+ numNodes = 2
95
+ clusterName = " PrometheusExporterITCluster"
86
96
}
87
97
88
98
checkstyle {
89
99
configFile = new File (rootDir, " checkstyle.xml" )
90
100
toolVersion = " 8.2"
91
101
}
92
102
93
- task S3Upload (type : S3Upload , dependsOn : buildPluginZip) {
103
+ task S3Upload (type : S3Upload /* , dependsOn: buildPluginZip*/ ) {
94
104
bucket = s3_bucket
95
105
key = " elasticsearch/${ project.name} -${ version} .zip"
96
106
file = " build/distributions/${ project.name} -${ version} .zip"
@@ -109,7 +119,7 @@ github {
109
119
}
110
120
111
121
githubRelease {
112
- dependsOn(" buildPluginZip" )
122
+ // dependsOn("buildPluginZip")
113
123
mustRunAfter(" S3Upload" )
114
124
}
115
125
@@ -119,6 +129,7 @@ task release() {
119
129
println (" SNAPSHOT: Nothing to release !" )
120
130
}
121
131
} else {
122
- dependsOn([" S3Upload" , " githubRelease" ])
132
+ // dependsOn(["S3Upload", "githubRelease"])
133
+ dependsOn(" S3Upload" )
123
134
}
124
135
}
0 commit comments