aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Kotlin
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-02-10 15:02:26 +0100
committerKamil Doległo <kamilok1965@interia.pl>2020-02-10 15:02:26 +0100
commit0d0d41f594f1095b4ccc999cffe01a6ef9a22dbb (patch)
tree32b09319400677750af154034e09d82d4706a396 /core/src/main/kotlin/Kotlin
parent23fbfa0e8e793314cea8d96ac1584d72ec70bb60 (diff)
parent465ea3d23be40d0d21df7f7cab51ec2d42e3237f (diff)
downloaddokka-0d0d41f594f1095b4ccc999cffe01a6ef9a22dbb.tar.gz
dokka-0d0d41f594f1095b4ccc999cffe01a6ef9a22dbb.tar.bz2
dokka-0d0d41f594f1095b4ccc999cffe01a6ef9a22dbb.zip
Merge dev-0.10.1 into master
Diffstat (limited to 'core/src/main/kotlin/Kotlin')
-rw-r--r--core/src/main/kotlin/Kotlin/DocumentationBuilder.kt8
-rw-r--r--core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt6
2 files changed, 8 insertions, 6 deletions
diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
index 3168e033..13bbbb11 100644
--- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
+++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
@@ -423,7 +423,7 @@ class DocumentationBuilder
fun DocumentationModule.appendFragments(fragments: Collection<PackageFragmentDescriptor>,
packageContent: Map<String, Content>,
packageDocumentationBuilder: PackageDocumentationBuilder) {
- val allFqNames = fragments.filter{ it.isDocumented(passConfiguration) }.map { it.fqName }.distinct()
+ val allFqNames = fragments.filter { it.isDocumented(passConfiguration) }.map { it.fqName }.distinct()
for (packageName in allFqNames) {
if (packageName.isRoot && !passConfiguration.includeRootPackage) continue
@@ -713,7 +713,7 @@ class DocumentationBuilder
}
fun FunctionDescriptor.build(external: Boolean = false): DocumentationNode {
- if (ErrorUtils.containsErrorType(this)) {
+ if (ErrorUtils.containsErrorTypeInParameters(this) || ErrorUtils.containsErrorType(this.returnType)) {
logger.warn("Found an unresolved type in ${signatureWithSourceLocation()}")
}
@@ -1157,7 +1157,9 @@ fun ClassDescriptor.supertypesWithAnyPrecise(): Collection<KotlinType> {
fun PassConfiguration.effectivePackageOptions(pack: String): DokkaConfiguration.PackageOptions {
val rootPackageOptions = PackageOptionsImpl("", includeNonPublic, reportUndocumented, skipDeprecated, false)
- return perPackageOptions.firstOrNull { pack == it.prefix || pack.startsWith(it.prefix + ".") } ?: rootPackageOptions
+ return perPackageOptions.firstOrNull { pack == it.prefix }
+ ?: perPackageOptions.firstOrNull { pack.startsWith(it.prefix + ".") }
+ ?: rootPackageOptions
}
fun PassConfiguration.effectivePackageOptions(pack: FqName): DokkaConfiguration.PackageOptions = effectivePackageOptions(pack.asString())
diff --git a/core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt b/core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt
index 793f9589..bd8b9cf5 100644
--- a/core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt
+++ b/core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt
@@ -42,7 +42,7 @@ class PackageListProvider @Inject constructor(
configuration.cacheRoot == "default" -> Paths.get(System.getProperty("user.home"), ".cache", "dokka")
configuration.cacheRoot != null -> Paths.get(configuration.cacheRoot)
else -> null
- }?.resolve("packageListCache")?.apply { createDirectories() }
+ }?.resolve("packageListCache")?.apply { toFile().mkdirs() }
val cachedProtocols = setOf("http", "https", "ftp")
@@ -105,13 +105,13 @@ class PackageListProvider @Inject constructor(
val digest = MessageDigest.getInstance("SHA-256")
val hash = digest.digest(packageListLink.toByteArray(Charsets.UTF_8)).toHexString()
- val cacheEntry = cacheDir.resolve(hash)
+ val cacheEntry = cacheDir.resolve(hash).toFile()
if (cacheEntry.exists()) {
try {
val connection = packageListUrl.doOpenConnectionToReadContent()
val originModifiedDate = connection.date
- val cacheDate = cacheEntry.lastModified().toMillis()
+ val cacheDate = cacheEntry.lastModified()
if (originModifiedDate > cacheDate || originModifiedDate == 0L) {
if (originModifiedDate == 0L)
logger.warn("No date header for $packageListUrl, downloading anyway")