File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,20 @@ java.modularity.inferModulePath.set(true)
3636
3737tasks {
3838
39+ val netlifyBadge by registering {
40+ doLast {
41+ val index = dokkaHtml.get().outputDirectory.get().resolve(" kotlin-unsigned" + File .separatorChar + " index.html" )
42+ val text = index.readText()
43+ val ofs = text.lastIndexOf(" </span>" ) + 7
44+ val badge = """
45+ <a href="https://www.netlify.com">
46+ <img src="https://www.netlify.com/img/global/badges/netlify-color-accent.svg" alt="Deploys by Netlify" style="vertical-align:middle;margin:10px 10px" />
47+ </a>
48+ """ .trimIndent()
49+ index.writeText(text.replaceRange(ofs, ofs, badge))
50+ }
51+ }
52+
3953 dokkaHtml {
4054 dokkaSourceSets.configureEach {
4155 sourceLink {
@@ -44,6 +58,7 @@ tasks {
4458 remoteLineSuffix.set(" #L" )
4559 }
4660 }
61+ finalizedBy(netlifyBadge)
4762 }
4863
4964 withType<KotlinCompile >().all {
You can’t perform that action at this time.
0 commit comments