forked from logstash-plugins/logstash-input-azure_event_hubs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
163 lines (141 loc) · 6.53 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
import java.nio.file.Files
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING
buildscript {
ext {
snakeYamlVersion = '2.2'
shadowGradlePluginVersion = '8.1.1'
}
repositories {
mavenCentral()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath "org.yaml:snakeyaml:${snakeYamlVersion}"
}
}
plugins {
id 'java'
id 'idea'
}
apply from: LOGSTASH_CORE_PATH + "/../rubyUtils.gradle"
// ===========================================================================
// plugin info
// ===========================================================================
version "${file("VERSION").text.trim()}" // read from required VERSION file
description = "Logstash input plugin for Azure Event Hubs"
pluginInfo.licenses = ['Apache-2.0'] // list of SPDX license IDs
pluginInfo.longDescription = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using \$LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
pluginInfo.authors = ['Elastic','UiPath']
pluginInfo.email = '[email protected]'
pluginInfo.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
pluginInfo.pluginType = "input"
pluginInfo.pluginClass = "AzureEventHubsUipath"
pluginInfo.pluginName = "azure_event_hubs_uipath"
// ===========================================================================
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
mavenCentral()
}
dependencies {
testImplementation 'junit:junit:4.12'
implementation 'com.microsoft.azure:azure-eventhubs:3.3.0'
implementation 'com.microsoft.azure:qpid-proton-j-extensions:1.2.4'
implementation 'com.microsoft.azure:azure-eventhubs-eph:3.3.0'
implementation 'com.microsoft.azure:azure-storage:8.6.6'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'org.apache.qpid:proton-j:0.33.8'
implementation 'com.microsoft.azure:azure-keyvault-core:1.2.4'
implementation 'com.microsoft.azure:adal4j:1.6.4'
implementation 'com.microsoft.azure:azure-annotations:1.10.0'
implementation 'com.microsoft.azure:azure-client-authentication:1.7.3'
implementation 'com.microsoft.azure:azure-client-runtime:1.7.3'
implementation 'com.microsoft.rest:client-runtime:1.7.3'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.12.7'
implementation 'com.fasterxml.jackson.core:jackson-core:2.12.7'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.7.1'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.12.7'
implementation 'com.github.stephenc.jcip:jcip-annotations:1.0-1'
implementation 'com.google.guava:guava:32.0.1-jre'
implementation 'com.nimbusds:lang-tag:1.7'
implementation 'com.nimbusds:nimbus-jose-jwt:9.37.2'
implementation 'com.nimbusds:oauth2-oidc-sdk:6.5'
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.2'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.12.2'
implementation 'com.squareup.okhttp3:okhttp:3.14.7'
implementation 'com.squareup.okio:okio:1.17.6'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.7.2'
implementation 'com.squareup.retrofit2:converter-jackson:2.7.2'
implementation 'com.squareup.retrofit2:retrofit:2.7.2'
implementation 'com.sun.mail:javax.mail:1.6.1'
implementation 'commons-codec:commons-codec:1.11'
implementation 'io.reactivex:rxjava:1.3.8'
implementation 'javax.activation:activation:1.1'
implementation 'net.minidev:json-smart:2.4.9'
implementation 'org.checkerframework:checker-compat-qual:2.0.0'
implementation 'org.codehaus.mojo:animal-sniffer-annotations:1.14'
compileOnly fileTree(dir: LOGSTASH_CORE_PATH, include: "**/logstash-core-?.?.?.jar")
compileOnly 'org.apache.logging.log4j:log4j-api:2.17.0' // provided by Logstash
testImplementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.0' // provided by Logstash
}
clean {
delete "${projectDir}/Gemfile"
delete "${projectDir}/" + pluginInfo.pluginFullName() + ".gemspec"
delete "${projectDir}/lib/"
delete "${projectDir}/vendor/"
new FileNameFinder().getFileNames(projectDir.toString(), pluginInfo.pluginFullName() + "-?.?.?.gem").each { filename ->
delete filename
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
task generateGemJarRequiresFile {
doLast {
File jars_file = file('lib/logstash-input-azure_event_hubs_uipath.rb')
jars_file.newWriter().withWriter { w ->
w << "# AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT.\n\n"
w << "require \'jar_dependencies\'\n"
configurations.runtimeClasspath.allDependencies.each {
w << "require_jar(\'${it.group}\', \'${it.name}\', \'${it.version}\')\n"
}
}
}
}
task vendor {
doLast {
String vendorPathPrefix = "vendor/jar-dependencies"
configurations.runtimeClasspath.allDependencies.each { dep ->
FileCollection fileCollection = configurations.runtimeClasspath.filter { it.absolutePath.contains("${dep.group}" + File.separator + "${dep.name}" + File.separator + "${dep.version}") }
if (fileCollection.isEmpty()) {
println "runtimeClasspath is empty for dependency ${dep.group}" + File.separator + "${dep.name}" + File.separator + "${dep.version}"
} else {
File f = fileCollection.singleFile
String groupPath = dep.group.replaceAll('\\.', '/')
File newJarFile = file("${vendorPathPrefix}" + File.separator + "${groupPath}" + File.separator + "${dep.name}" + File.separator + "${dep.version}" + File.separator + "${dep.name}-${dep.version}.jar")
newJarFile.mkdirs()
Files.copy(f.toPath(), newJarFile.toPath(), REPLACE_EXISTING)
}
}
}
}
task removeObsoleteJars() {
doLast {
new FileNameFinder().getFileNames(
projectDir.toString(),
"vendor/**/" + pluginInfo.pluginFullName() + "*.jar",
"vendor/**/" + pluginInfo.pluginFullName() + "-" + version + ".jar").each { f ->
delete f
}
}
}
task gem(dependsOn: [downloadAndInstallJRuby, removeObsoleteJars, vendor]) {
doLast {
buildGem(projectDir, buildDir, pluginInfo.pluginFullName() + ".gemspec")
}
}
vendor.dependsOn(generateGemJarRequiresFile)