File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
gradle/plugins/common/src/main/kotlin Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,28 @@ tasks.javadoc {
3939 noTimestamp(true )
4040 }
4141 }
42+
43+ doLast {
44+ val isCI = System .getenv(" CI" ) != null
45+ val targetString = " https://docs.junit.org/current"
46+
47+ val replacementString = if (isCI) {
48+ val versionNoSnapshot = project.version.toString().replace(" -SNAPSHOT" , " " )
49+ " https://docs.junit.org/$versionNoSnapshot "
50+ } else {
51+ " http://localhost:8080/user-guide"
52+ }
53+
54+ destinationDir?.walkTopDown()
55+ ?.filter { it.extension == " html" }
56+ ?.forEach { file ->
57+ val content = file.readText()
58+ if (content.contains(targetString)) {
59+ val updatedContent = content.replace(targetString, replacementString)
60+ file.writeText(updatedContent)
61+ }
62+ }
63+ }
4264}
4365
4466tasks.named<Jar >(" javadocJar" ).configure {
You can’t perform that action at this time.
0 commit comments