1

I've implemented dokka in top build.gradle

apply plugin: 'org.jetbrains.dokka-android'

dokka {
    // These tasks will be used to determine source directories and classpath
    // see https://github.com/Kotlin/dokka/blob/master/README.md
    kotlinTasks {
        defaultKotlinTasks() + [':core:compileDebugKotlin']
    }
}

And in core module i have interface that want to be documented:

import com.f2prateek.rx.preferences2.RxSharedPreferences

/**
 * Интерфейс для работы с [android.content.SharedPreferences] с помощью [RxSharedPreferences]
 *
 * @property prefs Свойство для доступа к [android.content.SharedPreferences] через [RxSharedPreferences]
 * @see RxSharedPreferences
 */
interface FeaturePrefs {
    val prefs: RxSharedPreferences
}

When i run dokka task i got warnings

Can't find node by signature `com.f2prateek.rx.preferences2.RxSharedPreferences`, referenced at my.package.FeaturePrefs (FeaturePrefs.kt:5)

Is there a way to use third party libraries in documentation? I'd like to configure it to reference to github source code (https://github.com/f2prateek/rx-preferences). Already tried to configure it via "externalDocumentationLink", but no luck there, couldn't find any javadoc/package-list referenced to this lib.

If you click on android.content.SharedPreferences in documentation, you will be redirected to https://developer.android.com/reference/android/content/SharedPreferences.html, i want to achieve same behavior for rxprefs (redirect to github)

UPD: dokka configuration moved from root build.gradle to application's:

apply plugin: 'org.jetbrains.dokka-android'

dokka {
    externalDocumentationLink {
        url = new URL("http://reactivex.io/RxJava/javadoc/")
    }
    externalDocumentationLink {
        url = new URL("http://jakewharton.github.io/timber/")
    }
    externalDocumentationLink {
        url = new URL("https://dagger.dev/api/2.0/")
    }

    Set<ProjectDependency> deps =
        project.configurations.collectMany {
            it.allDependencies
        }.findAll {
            it instanceof ProjectDependency
        }

    sourceDirs = files(deps.collect {
        p ->
            def path = new File(p.getDependencyProject().projectDir, "/src/main/java")
        return path
    })
}

I've added some external documentation deps, but still getting a lot of warnings like

Can't find node by signature `javax.inject.Provider`

or

Can't find node by signature `androidx.fragment.app.Fragment`

Maybe it's impossible to have links on that kind of dependencies? I'd like to have only my code to be documented, but have external links for framework's and third party's dependecies, is it real?

0 Answers0