forked from JaidedAI/EasyOCR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
63 lines (57 loc) · 1.73 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
plugins {
`java-library`
}
repositories {
mavenCentral()
}
// tag::dependencies[]
dependencies {
// a dependency on Jackson Databind
implementation("com.fasterxml.jackson.core:jackson-databind:2.8.9")
// and a dependency on vert.x
implementation("io.vertx:vertx-core:3.5.3")
}
// end::dependencies[]
if (project.hasProperty("useBom")) {
// tag::use_bom_rule[]
dependencies {
components.all<JacksonBomAlignmentRule>()
}
// end::use_bom_rule[]
} else {
// tag::use_rule[]
dependencies {
components.all<JacksonAlignmentRule>()
}
// end::use_rule[]
// tag::enforced_platform[]
dependencies {
// Forcefully downgrade the virtual Jackson platform to 2.8.9
implementation(enforcedPlatform("com.fasterxml.jackson:jackson-virtual-platform:2.8.9"))
}
// end::enforced_platform[]
}
// tag::bom-alignment-rule[]
abstract class JacksonBomAlignmentRule: ComponentMetadataRule {
override fun execute(ctx: ComponentMetadataContext) {
ctx.details.run {
if (id.group.startsWith("com.fasterxml.jackson")) {
// declare that Jackson modules belong to the platform defined by the Jackson BOM
belongsTo("com.fasterxml.jackson:jackson-bom:${id.version}", false)
}
}
}
}
// end::bom-alignment-rule[]
// tag::alignment-rule[]
abstract class JacksonAlignmentRule: ComponentMetadataRule {
override fun execute(ctx: ComponentMetadataContext) {
ctx.details.run {
if (id.group.startsWith("com.fasterxml.jackson")) {
// declare that Jackson modules all belong to the Jackson virtual platform
belongsTo("com.fasterxml.jackson:jackson-virtual-platform:${id.version}")
}
}
}
}
// end::alignment-rule[]