Skip to content

Commit 10686a3

Browse files
committed
update JAR dependencies
1 parent 9fb2f67 commit 10686a3

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

Rakefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ end
66

77
task :vendor => :install_jars
88

9+
Rake::Task["test"].clear
910
task :test do
1011
require 'rspec'
1112
require 'rspec/core/runner'
1213
Rake::Task[:install_jars].invoke
13-
sh './gradlew test'
14-
exit(RSpec::Core::Runner.run(Rake::FileList['spec/**/*_spec.rb']))
14+
sh(%{./gradlew test}) { |ok,res| exit(res) unless ok }
15+
exit(RSpec::Core::Runner.run(%w(--format documentation).concat(Rake::FileList['spec/**/*_spec.rb'])))
1516
end

build.gradle

+15-10
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies {
2424
testImplementation 'org.hamcrest:hamcrest-library:1.3'
2525
testImplementation "org.apache.logging.log4j:log4j-core:${log4jVersion}"
2626

27-
implementation 'io.netty:netty-all:4.1.65.Final'
27+
implementation 'io.netty:netty-all:4.1.68.Final'
2828
compileOnly "org.apache.logging.log4j:log4j-api:${log4jVersion}" // provided by Logstash
2929
}
3030

@@ -51,9 +51,12 @@ task generateGemJarRequiresFile {
5151
jars_file.newWriter().withWriter { w ->
5252
w << "# AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT.\n\n"
5353
w << "require \'jar_dependencies\'\n"
54-
configurations.runtimeClasspath.allDependencies.each {
55-
w << "require_jar(\'${it.group}\', \'${it.name}\', \'${it.version}\')\n"
56-
}
54+
configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts
55+
.collect {it.owner}
56+
.sort { it.group }
57+
.each {
58+
w << "require_jar(\'${it.group}\', \'${it.name}\', \'${it.version}\')\n"
59+
}
5760
w << "require_jar(\'${project.group}\', \'${project.name}\', \'${project.version}\')\n"
5861
}
5962
}
@@ -62,12 +65,14 @@ task generateGemJarRequiresFile {
6265
task vendor {
6366
doLast {
6467
String vendorPathPrefix = "vendor/jar-dependencies"
65-
configurations.runtimeClasspath.allDependencies.each { dep ->
66-
File f = configurations.runtimeClasspath.filter { it.absolutePath.contains("${dep.group}/${dep.name}/${dep.version}") }.singleFile
67-
String groupPath = dep.group.replaceAll('\\.', '/')
68-
File newJarFile = file("${vendorPathPrefix}/${groupPath}/${dep.name}/${dep.version}/${dep.name}-${dep.version}.jar")
69-
newJarFile.mkdirs()
70-
Files.copy(f.toPath(), newJarFile.toPath(), REPLACE_EXISTING)
68+
configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts.each { artifact ->
69+
ModuleVersionIdentifier dep = artifact.owner
70+
File f = artifact.file
71+
72+
String groupPath = dep.group.replaceAll('\\.', '/')
73+
File newJarFile = file("${vendorPathPrefix}/${groupPath}/${dep.name}/${dep.version}/${dep.name}-${dep.version}.jar")
74+
newJarFile.mkdirs()
75+
Files.copy(f.toPath(), newJarFile.toPath(), REPLACE_EXISTING)
7176
}
7277
String projectGroupPath = project.group.replaceAll('\\.', '/')
7378
File projectJarFile = file("${vendorPathPrefix}/${projectGroupPath}/${project.name}/${project.version}/${project.name}-${project.version}.jar")

0 commit comments

Comments
 (0)