Skip to content

Commit 7c65bb3

Browse files
authored
don't rely on rubyUtils for versions.yml loading (#10)
1 parent 2241bd4 commit 7c65bb3

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

build.gradle

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,26 @@ import static java.nio.file.StandardCopyOption.REPLACE_EXISTING
44

55
buildscript {
66
ext {
7-
snakeYamlVersion = '1.33'
87
shadowGradlePluginVersion = '8.1.1'
98
}
109
repositories {
1110
mavenCentral()
1211
}
12+
dependencies {
13+
classpath "org.yaml:snakeyaml:2.2"
14+
}
1315
}
1416

1517
plugins {
1618
id 'com.github.johnrengelman.shadow' version '8.1.1'
1719
id 'java'
1820
}
1921

22+
// load versions.yml from core before loading rubyUtils.gradle
23+
import org.yaml.snakeyaml.Yaml
24+
def versionsFile = file(LOGSTASH_CORE_PATH + "/../versions.yml")
25+
gradle.ext.versions = new Yaml().load(versionsFile.text)
26+
2027
apply from: LOGSTASH_CORE_PATH + "/../rubyUtils.gradle"
2128

2229
// ===========================================================================
@@ -36,8 +43,8 @@ pluginInfo.pluginName = "java_codec_example" // must match the @LogstashPlu
3643
// ===========================================================================
3744

3845
java {
39-
sourceCompatibility = JavaVersion.VERSION_1_8
40-
targetCompatibility = JavaVersion.VERSION_1_8
46+
sourceCompatibility = JavaVersion.VERSION_11
47+
targetCompatibility = JavaVersion.VERSION_11
4148
}
4249

4350
repositories {
@@ -49,16 +56,16 @@ shadowJar {
4956
}
5057

5158
dependencies {
52-
implementation 'org.apache.logging.log4j:log4j-api:2.9.1'
53-
implementation 'org.apache.logging.log4j:log4j-core:2.9.1'
54-
implementation "com.fasterxml.jackson.core:jackson-core:2.9.5"
55-
implementation "com.fasterxml.jackson.core:jackson-databind:2.9.5"
56-
implementation "com.fasterxml.jackson.core:jackson-annotations:2.9.5"
57-
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.9.5"
58-
implementation fileTree(dir: LOGSTASH_CORE_PATH, include: "**/logstash-core-?.?.?.jar")
59+
implementation 'org.apache.logging.log4j:log4j-api:2.17.0'
60+
implementation 'org.apache.logging.log4j:log4j-core:2.17.0'
61+
implementation "com.fasterxml.jackson.core:jackson-core:${gradle.ext.versions.jackson}"
62+
implementation "com.fasterxml.jackson.core:jackson-databind:${gradle.ext.versions['jackson-databind']}"
63+
implementation "com.fasterxml.jackson.core:jackson-annotations:${gradle.ext.versions.jackson}"
64+
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${gradle.ext.versions.jackson}"
65+
implementation fileTree(dir: LOGSTASH_CORE_PATH, include: "**/logstash-core.jar")
5966

6067
testImplementation 'junit:junit:4.12'
61-
testImplementation 'org.jruby:jruby-complete:9.1.13.0'
68+
testImplementation "org.jruby:jruby-complete:${gradle.ext.versions.jruby.version}"
6269
}
6370

6471
clean {

0 commit comments

Comments
 (0)