-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
46 lines (39 loc) · 1.66 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
import java.nio.file.Files
import java.nio.file.Paths
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING
apply plugin: "java"
sourceCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
}
dependencies {
compile 'org.apache.qpid:proton-j:0.31.0'
compile 'com.microsoft.azure:qpid-proton-j-extensions:1.2.0'
compile 'org.slf4j:slf4j-api:1.7.25'
compile 'com.microsoft.azure:azure-eventhubs:2.3.2'
}
task generateGemJarRequiresFile {
doLast {
File jars_file = file('lib/logstash-output-azure_event_hubs_jars.rb')
jars_file.newWriter().withWriter { w ->
w << "# AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT.\n\n"
w << "require \'jar_dependencies\'\n"
configurations.runtime.allDependencies.each {
w << "require_jar(\'${it.group}\', \'${it.name}\', \'${it.version}\')\n"
}
}
}
}
task vendor {
doLast {
String vendorPathPrefix = "vendor/jar-dependencies"
configurations.runtime.allDependencies.each { dep ->
File f = configurations.runtime.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)