mcy
mcy

Reputation: 1268

Dokka does not include members and functions of Activity and Fragment classes

When I run the dokkaHtml gradle task, the generated documentation file includes the classes and their definitions, but not their functions, members and properties (that are not inherited from their classes, but defined by me).

This is the dokka configuration in the app build.gradle file:

tasks.dokkaHtml {
    moduleName.set("SMMS")
    moduleVersion.set("1.7.0.001")
    outputDirectory.set(file("$buildDir/docs/html"))
    failOnWarning.set(true)
    suppressInheritedMembers.set(true)
    sourceSets {
        configureEach {
            includeNonPublic.set(true)
            skipDeprecated.set(false)
            reportUndocumented.set(true)
            skipEmptyPackages.set(false)
            noAndroidSdkLink.set(true)
        }


    }
}

This is the general view of the activity class file:


/**
 * The activity that is responsible for all barrier inspection actions by manipulating a
 * [BarrierInspection] instance.
 *
 * It requires the following keys with values in the intent:
 *
 * - dataGroup: The [DataGroup] instance that holds the barrier that the inspection belongs to.
 * - structureDTO: The [StructureDTO] instance that holds the necessary structure data.
 * - dataSectionHeader: The header property of the current DataSection, as [String]. It is
 * required to update the app bar title.
 *
 * @member dbService The [IRemoteDbService] instance that holds the remote database service
 * that will be used to save the inspection.
 * @member structureDTO The [StructureDTO] instance that holds the necessary structure data.
 * @member dataSectionHeader The header property of the current DataSection, as [String]. It is
 * required to update the app bar title.
 * @member dataGroup The [DataGroup] instance that holds the barrier that the inspection belongs to.
 * @member barrierInspection The [BarrierInspection] instance that holds the inspection data.
 * @member replacementList The list of [ReplacementServiceLifeEvent] instances that holds the
 * @member viewModel The [BarrierInspectionViewModel] instance that holds the view-model
 * for this activity.
 */
class BarrierInspectionActivity : AppCompatActivity() {
    /**
     * The [ActivityBarrierInspectionBinding] instance that holds the binding
     */
    private lateinit var binding: ActivityBarrierInspectionBinding
    private var dbService: IRemoteDbService = FirebaseRemoteDbService()
    private var structureDTO: StructureDTO? = null
    private var dataSectionHeader: String = ""
    private var dataGroup: DataGroup? = null
    private lateinit var barrierInspection: BarrierInspection
    private lateinit var replacementList: List<ReplacementServiceLifeEvent>
    private lateinit var viewModel: BarrierInspectionViewModel

    ...

    /**
     * Registers all the flow collectors.
     *
     * Launch this function on a separate scope since it suspends caller coroutine until the
     * lifecycle reaches [Lifecycle.State.DESTROYED]
     */
    private suspend fun registerCollectors() {
        lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
            launch {
                viewModel.shouldShowAddLocation.collect {
                    if (it && viewModel.isIdle.value) {
                        navigateToAddLocationFragment()
                        viewModel.onAddLocationShown()
                    }
                }
            }
            launch {
                viewModel.shouldShowDefectDetails.collect {
                    if (it && viewModel.isIdle.value) {
                        navigateToDetailsFragment()
                        viewModel.onDetailsShown()
                    }
                }
            }
            launch {
                viewModel.shouldShowUpdateDefectFragment.collect {
                    if (it && viewModel.isIdle.value) {
                        navigateToUpdateDefectFragment()
                        viewModel.onUpdateDefectShown()
                    }
                }
            }
            launch {
                viewModel.shouldGoToAppHome.collect {
                    if (it && viewModel.isIdle.value) {
                        navigateToHomeActivity()
                    }
                }
            }
            launch {
                viewModel.shouldShowInspectionHome.collect {
                    if (it && viewModel.isIdle.value) {
                        navigateToInspectionHomeFragment()
                        viewModel.onInspectionHomeShown()
                    }
                }
            }
        }
    }

    /**
     * Goes back one screen by launching a new [MapsActivity]
     */
    private fun navigateToHomeActivity() {
        startActivity(Intent(this, MapsActivity::class.java))
    }

    /**
     * Replaces the current fragment with the Inspection home fragment ([BarrierInspectionDetailsFragment])
     */
    private fun navigateToInspectionHomeFragment() {
        supportFragmentManager.commit {
            setReorderingAllowed(true)
            replace<BarrierInspectionDetailsFragment>(R.id.activity_barrier_inspection_fragment_container)
        }
    }

    /**
     * Replaces the current fragment with the [BarrierInspectionUpdateDefectFragment]
     */
    private fun navigateToUpdateDefectFragment() {
        supportFragmentManager.commit {
            setReorderingAllowed(true)
            replace<BarrierInspectionUpdateDefectFragment>(R.id.activity_barrier_inspection_fragment_container)
        }
    }

    /**
     * Replaces the current fragment with the [BarrierInspectionDefectDetailsFragment]
     */
    private fun navigateToDetailsFragment() {
        supportFragmentManager.commit {
            setReorderingAllowed(true)
            replace<BarrierInspectionDefectDetailsFragment>(R.id.activity_barrier_inspection_fragment_container)
        }
    }

    /**
     * Replaces the current fragment with the [BarrierInspectionAddLocationFragment]
     */
    private fun navigateToAddLocationFragment() {
        supportFragmentManager.commit {
            setReorderingAllowed(true)
            replace<BarrierInspectionAddLocationFragment>(R.id.activity_barrier_inspection_fragment_container)
        }
    }

    /**
     * Updates the app/action bar title and subtitle
     */
    private fun updateActionBarText() {
        supportActionBar?.apply {
            subtitle = dataSectionHeader
            title = "${structureDTO!!.name} ${structureDTO!!.structureType} - Inspection Mode"
        }
    }
}

In the generated html documentation, I would expect to see all the functions above and the class members, but they are not present:

The generated html page

I have tried to change the option suppressInheritedMembers to false, but it only added the functions of the AppCompatActivity and not any of my functions.

Upvotes: 0

Views: 238

Answers (0)

Related Questions