-
Notifications
You must be signed in to change notification settings - Fork 28
/
build.gradle
60 lines (49 loc) · 2.11 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
import java.nio.file.Files
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING
plugins {
id 'java'
id 'idea'
}
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:2.3.2'
implementation 'com.microsoft.azure:qpid-proton-j-extensions:1.2.4'
implementation 'com.microsoft.azure:azure-eventhubs-eph:2.5.2'
implementation 'com.microsoft.azure:azure-storage:8.6.6'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'org.apache.qpid:proton-j:0.33.9'
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
}
task generateGemJarRequiresFile {
doLast {
File jars_file = file('lib/logstash-input-azure_event_hubs.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 ->
File f = configurations.runtimeClasspath.filter { it.absolutePath.contains("${dep.group}" + File.separator + "${dep.name}" + File.separator + "${dep.version}") }.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)
}
}
}
vendor.dependsOn(generateGemJarRequiresFile)