|
2 | 2 |
|
3 | 3 | @file:JvmName("ReleaseNotesGenerator") |
4 | 4 | @file:CompilerOptions("-jvm-target", "11") |
5 | | -@file:CompilerOptions("-Xopt-in", "kotlin.RequiresOptIn") |
6 | | -@file:OptIn(kotlin.time.ExperimentalTime::class) |
7 | 5 | @file:Repository("https://repo.maven.apache.org/maven2") |
8 | 6 | @file:Repository("https://jcenter.bintray.com") |
9 | 7 | @file:Repository("https://jitpack.io") |
@@ -77,10 +75,10 @@ fun <T> tryTo( |
77 | 75 |
|
78 | 76 | fun toLink(element: Element) = element.attr("href") |
79 | 77 |
|
80 | | -// FIXME: Use plain Jsoup.connect()... and remove Pair() |
| 78 | +// FIXME: Use plain Jsoup.connect()... and remove Pair creation (to) |
81 | 79 | // See https://github.com/jhy/jsoup/issues/1686 for the reason. |
82 | 80 | fun toDocument(link: String) = tryTo("get $link") { |
83 | | - Pair(link, Jsoup.connect(link).get()) |
| 81 | + link to Jsoup.connect(link).get() |
84 | 82 | } |
85 | 83 |
|
86 | 84 | fun toReleaseNote(pair: Pair<String, Document>): String { |
@@ -128,6 +126,7 @@ fun Document.extractChangelog(id: String) = this |
128 | 126 | // This is a coroutine version of the code. |
129 | 127 | // Needs `org.jetbrains.kotlinx:kotlinx-coroutines-core` |
130 | 128 | // which seems to not work in Kotlin scripts. |
| 129 | +// Probably fixed in Kotlin 1.7 |
131 | 130 | /* |
132 | 131 | fun main() = runBlocking { |
133 | 132 | val init = async(Dispatchers.IO) { |
|
0 commit comments