Skip to content

Commit

Permalink
update JAR dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
yaauie committed Nov 11, 2022
1 parent d0a046c commit db4c019
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ description = "Beats/Lumberjack Netty implementation"
sourceCompatibility = 1.8
targetCompatibility = 1.8

String jacksonVersion = '2.13.3'
String jacksonDatabindVersion = '2.13.3'
String jacksonVersion = '2.14.0'
String jacksonDatabindVersion = '2.14.0'

repositories {
mavenCentral()
}

dependencies {
testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13.1'
testImplementation 'org.hamcrest:hamcrest-library:1.3'
testImplementation 'org.apache.logging.log4j:log4j-core:2.17.0'
implementation 'io.netty:netty-all:4.1.65.Final'
testImplementation 'org.apache.logging.log4j:log4j-core:2.17.1'
implementation 'io.netty:netty-all:4.1.68.Final'
implementation 'org.javassist:javassist:3.24.0-GA'
testImplementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
testImplementation "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}"
Expand Down Expand Up @@ -64,9 +64,12 @@ task generateGemJarRequiresFile {
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"
}
configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts
.collect {it.owner}
.sort { it.group }
.each {
w << "require_jar(\'${it.group}\', \'${it.name}\', \'${it.version}\')\n"
}
w << "require_jar(\'${project.group}\', \'${project.name}\', \'${project.version}\')\n"
}
}
Expand All @@ -75,13 +78,14 @@ task generateGemJarRequiresFile {
task vendor {
doLast {
String vendorPathPrefix = "vendor/jar-dependencies"
configurations.runtimeClasspath.allDependencies.each { dep ->
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)
}
configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts.each { artifact ->
ModuleVersionIdentifier dep = artifact.owner
File f = artifact.file
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()
Expand Down

0 comments on commit db4c019

Please sign in to comment.