132 строки
7.6 KiB
Groovy
132 строки
7.6 KiB
Groovy
import java.nio.file.Files
|
|
import java.nio.file.Paths
|
|
|
|
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING
|
|
|
|
apply plugin: 'java'
|
|
apply plugin: 'idea'
|
|
apply plugin: 'maven-publish'
|
|
|
|
// The gemspec contains the gem metadata to build and package the gem. The gradle build serves as a mechanism of getting these "vendor" files required for the gem.
|
|
// The alternative is to use ruby-maven gem to package, but this runs into classpath conflicts/issues with the logstash plugin.
|
|
group "org.logstash.outputs"
|
|
version Files.readAllLines(Paths.get("version")).first()
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
// These dependencies are required by the gemspec to build the gem. The easiest to arrive at this list is to look at the effective pom of kusto-ingest and arrive at this list
|
|
// even if we use the ruby-maven gem to package the gem, install and lock_jars will create the logstash_output_kusto_jars.rb file with the same list of dependencies.
|
|
// In the gradle way, running ./gradlew vendor creates the jar file list and adds them to vendor/jar-dependencies folder from where it is referenced in the gemspec (require_paths and files)
|
|
|
|
// update dependencies to bom azure-sdk-bom/1.2.24
|
|
|
|
dependencies {
|
|
implementation 'com.microsoft.azure.kusto:kusto-data:5.1.0'
|
|
implementation 'com.microsoft.azure.kusto:kusto-ingest:5.1.0'
|
|
implementation 'com.azure:azure-core-http-netty:1.15.0'
|
|
implementation 'com.azure:azure-core:1.49.0'
|
|
implementation 'com.azure:azure-data-tables:12.4.1'
|
|
implementation 'com.azure:azure-identity:1.12.1'
|
|
implementation 'com.azure:azure-json:1.1.0'
|
|
implementation 'com.azure:azure-storage-blob:12.26.0'
|
|
implementation 'com.azure:azure-storage-common:12.25.0'
|
|
implementation 'com.azure:azure-storage-queue:12.21.0'
|
|
implementation 'com.azure:azure-xml:1.0.0'
|
|
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.16.0'
|
|
implementation 'com.fasterxml.jackson.core:jackson-core:2.16.0'
|
|
implementation 'com.fasterxml.jackson.core:jackson-databind:2.16.0'
|
|
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.0'
|
|
implementation 'com.fasterxml.woodstox:woodstox-core:6.7.0'
|
|
implementation 'com.github.stephenc.jcip:jcip-annotations:1.0-1'
|
|
implementation 'com.microsoft.azure:msal4j:1.15.1'
|
|
implementation 'com.nimbusds:content-type:2.3'
|
|
implementation 'com.nimbusds:lang-tag:1.7'
|
|
implementation 'com.nimbusds:nimbus-jose-jwt:9.40'
|
|
implementation 'com.nimbusds:oauth2-oidc-sdk:11.13'
|
|
implementation 'com.univocity:univocity-parsers:2.9.1'
|
|
implementation 'commons-codec:commons-codec:1.16.1'
|
|
implementation 'commons-logging:commons-logging:1.3.1'
|
|
implementation 'io.github.resilience4j:resilience4j-core:1.7.1'
|
|
implementation 'io.github.resilience4j:resilience4j-retry:1.7.1'
|
|
implementation 'io.netty:netty-buffer:4.1.108.Final'
|
|
implementation 'io.netty:netty-codec-dns:4.1.108.Final'
|
|
implementation 'io.netty:netty-codec-http2:4.1.108.Final'
|
|
implementation 'io.netty:netty-codec-http:4.1.108.Final'
|
|
implementation 'io.netty:netty-codec-socks:4.1.108.Final'
|
|
implementation 'io.netty:netty-codec:4.1.108.Final'
|
|
implementation 'io.netty:netty-common:4.1.108.Final'
|
|
implementation 'io.netty:netty-handler-proxy:4.1.108.Final'
|
|
implementation 'io.netty:netty-handler:4.1.108.Final'
|
|
implementation 'io.netty:netty-resolver-dns-classes-macos:4.1.108.Final'
|
|
implementation 'io.netty:netty-resolver-dns-native-macos:4.1.108.Final:osx-x86_64'
|
|
implementation 'io.netty:netty-resolver-dns:4.1.108.Final'
|
|
implementation 'io.netty:netty-resolver:4.1.108.Final'
|
|
implementation 'io.netty:netty-tcnative-boringssl-static:2.0.65.Final'
|
|
implementation 'io.netty:netty-tcnative-classes:2.0.65.Final'
|
|
implementation 'io.netty:netty-transport-classes-epoll:4.1.108.Final'
|
|
implementation 'io.netty:netty-transport-classes-kqueue:4.1.108.Final'
|
|
implementation 'io.netty:netty-transport-native-epoll:4.1.108.Final:linux-x86_64'
|
|
implementation 'io.netty:netty-transport-native-kqueue:4.1.108.Final:osx-x86_64'
|
|
implementation 'io.netty:netty-transport-native-unix-common:4.1.108.Final'
|
|
implementation 'io.netty:netty-transport:4.1.108.Final'
|
|
implementation 'io.projectreactor.netty:reactor-netty-core:1.0.43'
|
|
implementation 'io.projectreactor.netty:reactor-netty-http:1.0.43'
|
|
implementation 'io.projectreactor:reactor-core:3.4.36'
|
|
implementation 'io.vavr:vavr:0.10.4'
|
|
implementation 'io.vavr:vavr-match:0.10.4'
|
|
implementation 'net.java.dev.jna:jna-platform:5.13.0'
|
|
implementation 'net.java.dev.jna:jna:5.13.0'
|
|
implementation 'net.minidev:accessors-smart:2.5.1'
|
|
implementation 'net.minidev:json-smart:2.5.1'
|
|
implementation 'org.apache.commons:commons-lang3:3.14.0'
|
|
implementation 'org.apache.commons:commons-text:1.11.0'
|
|
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
|
|
implementation 'org.apache.httpcomponents:httpcore:4.4.16'
|
|
implementation 'org.codehaus.woodstox:stax2-api:4.2.2'
|
|
implementation 'org.jetbrains:annotations:24.1.0'
|
|
implementation 'org.ow2.asm:asm:9.7'
|
|
implementation 'org.reactivestreams:reactive-streams:1.0.4'
|
|
implementation 'org.slf4j:slf4j-api:1.8.0-beta4'
|
|
implementation 'org.slf4j:slf4j-simple:1.8.0-beta4'
|
|
}
|
|
|
|
// This task generates the ruby file with all the dependencies. Once this task runs, look at the lib/logstash-output-kusto_jars.rb file
|
|
// that references all the dependent jar files. (the wrapper is the ./gradle vendor task)
|
|
task generateGemJarRequiresFile {
|
|
doLast {
|
|
File jars_file = file('lib/logstash-output-kusto_jars.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"
|
|
}
|
|
w << "require_jar(\'${project.group}\', \'${project.name}\', \'${project.version}\')\n"
|
|
}
|
|
}
|
|
}
|
|
// The vendor task copies the jars from the runtimeClasspath to the vendor/jar-dependencies folder.
|
|
// This is referenced in the gemspec as the require_paths and files. Once this vendor task runs, look at the lib/logstash-output-kusto_jars.rb file
|
|
// that references all the dependent jar files.
|
|
task vendor {
|
|
// take in all the dependencies from the runtimeClasspath and copy them to the vendor/jar-dependencies folder
|
|
doLast {
|
|
String vendorPathPrefix = "vendor/jar-dependencies"
|
|
configurations.runtimeClasspath.allDependencies.each { dep ->
|
|
println("Copying ${dep.group}:${dep.name}:${dep.version}")
|
|
File f = configurations.runtimeClasspath.filter { it.absolutePath.contains("${dep.group}/${dep.name}/${dep.version}") }.singleFile
|
|
String groupPath = dep.group.replaceAll('\\.', '/')
|
|
File newJarFile = file("${vendorPathPrefix}/${groupPath}/${dep.name}/${dep.version}/${dep.name}-${dep.version}.jar")
|
|
newJarFile.mkdirs()
|
|
Files.copy(f.toPath(), newJarFile.toPath(), REPLACE_EXISTING)
|
|
}
|
|
String projectGroupPath = project.group.replaceAll('\\.', '/')
|
|
File projectJarFile = file("${vendorPathPrefix}/${projectGroupPath}/${project.name}/${project.version}/${project.name}-${project.version}.jar")
|
|
projectJarFile.mkdirs()
|
|
Files.copy(file("$buildDir/libs/${project.name}-${project.version}.jar").toPath(), projectJarFile.toPath(), REPLACE_EXISTING)
|
|
}
|
|
}
|
|
// The jar task is the standard packaging task & the generateGemJarRequiresFile task generates the ruby file with all the dependencies.
|
|
vendor.dependsOn(jar, generateGemJarRequiresFile) |