forked from spring-projects/spring-restdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
91 lines (75 loc) · 2.64 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
plugins {
id "io.spring.compatibility-test" version "0.0.3"
id "java-library"
id "java-test-fixtures"
id "maven-publish"
id "optional-dependencies"
}
description = "Spring REST Docs Core"
configurations {
jarjar
jmustache
testArtifacts.extendsFrom testRuntime
}
task jmustacheRepackJar(type: Jar) { repackJar ->
repackJar.archiveBaseName = "restdocs-jmustache-repack"
repackJar.archiveVersion = jmustacheVersion
doLast() {
project.ant {
taskdef name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask",
classpath: configurations.jarjar.asPath
jarjar(destfile: repackJar.archiveFile.get()) {
configurations.jmustache.each { originalJar ->
zipfileset(src: originalJar, includes: "**/*.class")
}
rule(pattern: "com.samskivert.**", result: "org.springframework.restdocs.@1")
}
}
}
}
dependencies {
implementation("com.fasterxml.jackson.core:jackson-databind")
implementation("org.springframework:spring-web")
implementation(files(jmustacheRepackJar))
internal(platform(project(":spring-restdocs-platform")))
jarjar("com.googlecode.jarjar:jarjar:1.3")
jmustache(platform(project(":spring-restdocs-platform")))
jmustache("com.samskivert:jmustache@jar")
optional(platform(project(":spring-restdocs-platform")))
optional("jakarta.validation:jakarta.validation-api")
optional("junit:junit")
optional("org.hibernate.validator:hibernate-validator")
optional("org.junit.jupiter:junit-jupiter-api")
testFixturesApi(platform(project(":spring-restdocs-platform")))
testFixturesApi("junit:junit")
testFixturesApi("org.assertj:assertj-core")
testFixturesApi("org.hamcrest:hamcrest-core")
testFixturesImplementation(files(jmustacheRepackJar))
testFixturesImplementation("org.hamcrest:hamcrest-library")
testFixturesImplementation("org.springframework:spring-core")
testFixturesImplementation("org.springframework:spring-web")
testImplementation("junit:junit")
testImplementation("org.assertj:assertj-core")
testImplementation("org.javamoney:moneta")
testImplementation("org.mockito:mockito-core")
testImplementation("org.springframework:spring-test")
testRuntimeOnly("org.apache.tomcat.embed:tomcat-embed-el")
}
jar {
dependsOn jmustacheRepackJar
from(zipTree(jmustacheRepackJar.archiveFile.get())) {
include "org/springframework/restdocs/**"
}
}
components.java.withVariantsFromConfiguration(configurations.testFixturesApiElements) {
skip()
}
components.java.withVariantsFromConfiguration(configurations.testFixturesRuntimeElements) {
skip()
}
compatibilityTest {
dependency("Spring Framework") { springFramework ->
springFramework.groupId = "org.springframework"
springFramework.versions = ["6.0.+", "6.2.+"]
}
}