Sebastian Sellmair [JB]
07/30/2020, 4:52 PMPaweł Marks
08/04/2020, 12:07 PMZach Klippenstein (he/him) [MOD]
08/10/2020, 9:26 PMLukas K-G
08/12/2020, 12:29 PM1.4.0-RC
at my company. We had dokka 0.10.0
before and it worked, but with 1.4.0-RC
I get the following error in the Creating documentation models
phase: Couldn't get delegate for class
Does anyone have an idea what that could be or how to get any information what class causes this problem?addamsson
08/13/2020, 9:33 PMSebastian Sellmair [JB]
08/17/2020, 11:05 AMdev
build available that we would be very happy to get feedback for 🎉
_Build_: 1.4.0-dev-35
_____
Gist of changes:
1. Gradle Plugin
Our Gradle Plugin had some very hard to fix issues and we put a lot of effort into
• Reducing complexity of its implementation
• Fixing internal issues e.g. (bad UP-TO-DATE) behaviour,...
• Fixing UX issues like "re-declaring source sets for mulitplatform projects", replacing paths with java.io.File, using Gradles Property/Provider APIs etc...
We hope that "just applying the dokka plugin" is all that most build authors need. The plugin can be seen as companion to the Kotlin Gradle Plugin.
See the pull-request for further details: Simplify Gradle Plugin
Feel free to drop me dm's if you need any help migrating or experience any issues!
2. Merging visible source sets
Issue: DokkaCollectorTask: Merge source set bubbles
This was noticed while running the collector task on larger projects like the Spring framework.
Source sets with the same displayName and platform will now be represented as one in the frontend. We hope that this unblocks some of you that rely on the collector task.
3. Updated compiler to 1.4.0
4. A lot of smaller bugfixes
Further details are available in our milestones:
• 1.4.0
• Stable
__
Some comment on version numbers
You already noticed, that we aligned our version number to the compiler version we bundle. (e.g. 1.4.0, 1.4.0-rc, ...).
There were some minor hick-ups when we changed to this numbering schema, but I would like to clarify some things.
Dokka 1.4.* is not a stable project. It is still considered alpha!
For now, we agreed on using the following naming schema
• `{comiler-version}-dev-{build-number}`: for preview builds
• {compiler-verison}
for releases and pre-releases (no dokka maturity included)
• {compiler-version}-{patch number}
for patch releases
__
Some comment on kotlin-dev
This will probably be the last build we push to the kotlin-dev
repository. We will migrate dev builds to space packages in the near future.Sebastian Sellmair [JB]
08/18/2020, 4:14 PMjdkVersion = 8
-> jdkVersion.set(8)
• Any path of type String
is now represented as <http://java.io|java.io>.File
• Any collection of files/directories is now represented as Gradles ConfigurableFileCollection
• Make sure (especially in Android Projects) to configure Dokka tasks lazy: tasks.withType<DokkaTask>() { // config }
-> tasks.withType<DokkaTask>().configureEach { }
, tasks.getByName
-> tasks.named
,etc. Good read https://docs.gradle.org/current/userguide/task_configuration_avoidance.html
• Note: MPP projects will have all source sets automatically configured. No need for register
yourself!
• Tip: Use ./gradlew --stacktrace
to get better error messages of what is wrong. I noticed, that the short error message for Groovy scripts is not useful at all
And as always: Feel free to drop me a DM at any time you encounter an issue ☺️
Have fun, folks. Enjoy Kotlin 1.4.0 ☺️ 🎊Hadi Lashkari
08/20/2020, 8:09 AMtasks.dokkaHtml {
outputDirectory = "$buildDir/dokka"
dokkaSourceSets {
register("commonMain") {
displayName = "common"
platform = "common"
}
register("jvmMain") {
displayName = "jvm"
platform = "jvm"
}
register("androidMain") {
noAndroidSdkLink = true
displayName = "android"
platform = "android"
}
}
}
but when I run ./gradlew dokkaJavadoc
I got
No source set with name 'main' found
In the main directory is the AndroidManifest.xml
without a source! So how can I unregister the main
?elect
08/21/2020, 10:29 PMJavier
08/23/2020, 6:02 PMval dokkaJar by tasks.creating(Jar::class) {
archiveClassifier.set("javadoc")
from(tasks.dokka)
dependsOn(tasks.dokka)
}
jaguililla
08/27/2020, 5:02 PMSebastian Sellmair [JB]
08/28/2020, 3:22 PMmaven("<https://maven.pkg.jetbrains.space/kotlin/p/dokka/dev>")
elect
08/28/2020, 3:52 PM@sample
. I find cumbersome adding file by file in build.gradle.kts
under samples: List
. Wouldn't be possible for the plugin to group all the @sample
from the sources and find the least necessary common group of files to be used for doc inlining?oshai
08/28/2020, 9:45 PM0.10.0
) with Kotlin 1.4.0? After upgrading Kotlin version only (without upgrading dokka) I see some errors for KMP project.elect
08/29/2020, 12:12 PMdokkaJavadocJar
a
java.lang.OutOfMemoryError: Metaspacenever ever saw this before, is it normal? It seems
org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m
in gradle.properties
solves the issueJorrit
08/29/2020, 5:45 PMmikehearn
09/01/2020, 2:41 PMNick Johnson
09/01/2020, 10:39 PMpniederw
09/02/2020, 5:19 PMRachel
09/04/2020, 9:16 AMOr Cohen
09/06/2020, 9:46 AMbuild.gradle.kts
script in which I apply the Dokka plugin to all libraries -
configure(subprojects.filter { it.parent?.name == "libs" }) {
apply {
plugin("org.jetbrains.dokka")
}
}
I’ve also added the following block that is mentioned in the docs for multi module support -
tasks.dokkaHtmlMultiModule.configure {
outputDirectory.set(buildDir.resolve("dokkaCustomMultiModuleOutput"))
documentationFileName.set("README.md")
}
I also have a README.md
file under each of my libraries under libs
folder, and I added the following to the build.gradle.kts
script of each of the libraries which I want to include in the generated docs -
tasks.withType<org.jetbrains.dokka.gradle.DokkaTask>().configureEach {
dokkaSourceSets.configureEach {
includes.from("README.md")
}
}
After running dokkaHtmlMultiModule
, it seems like I get a folder for each library under build/dokkaCustomMultiModuleOutput/libs
(with all generated docs inside), but I can’t seem to find any top-level index.html
file. In addition, none of the libraries are listed in the top level -modules.html
file.
Am I missing something, or doing something wrong?
Thanks in advance 🙏dfriehs
09/09/2020, 6:08 PMincludeNonPublic
, which works for the base class, but prints the property for any and all derived classes:Robert Jaros
09/10/2020, 11:52 AMExecution failed for task ':dokkaHtml'.
> There was a failure while populating the build operation queue: NPM project resolved without org.jetbrains.kotlin.gradle.targets.js.npm.KotlinNpmResolutionManager@5fdc639
Anyone else has this issue?AJ Alt
09/11/2020, 12:49 AMdokkaHtml
task create index.html at the top level rather than nested in a project folder? It's not clear how to publish the output as a static site (e.g. github pages) without having the root 404.shelbycohen
09/14/2020, 10:23 PMFelix
09/15/2020, 1:03 PMtravisspencer
09/15/2020, 6:30 PMFelix
09/16/2020, 11:33 AMdokka/html
doesn't have any index.html
in the root folder (only a navigation.html
without any include stylesheet). The first index.html
appears only inside the module. Is this supposed to be this way?Michael
09/19/2020, 6:27 PMJulien Verfaillie
09/21/2020, 1:27 PMJulien Verfaillie
09/21/2020, 1:27 PMSebastian Sellmair [JB]
09/21/2020, 1:52 PMJulien Verfaillie
09/21/2020, 1:58 PMimport com.github.spotbugs.SpotBugsTask
project.extensions.extraProperties.set('SpotBugsTask', SpotBugsTask)
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'org.jetbrains.dokka'
apply from: '../ci/staticAnalysis/spotbugs/XxxxxxSpotBugs.gradle'
android {
compileSdkVersion 29
buildToolsVersion '29.0.3'
afterEvaluate {
def originalFilePath = "$buildDir/outputs/aar/XxxxxxZzzz-release.aar"
def newFilePath = originalFilePath.replace(".aar", "_v${defaultConfig.versionName}.aar")
def debugFile = file(originalFilePath)
tasks.named("assembleRelease").configure {
doLast {
debugFile.renameTo(newFilePath)
}
}
}
defaultConfig {
minSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.9.0"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
consumerProguardFiles '<http://proguard-rules.pro|proguard-rules.pro>'
dimension "default"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), '<http://proguard-rules.pro|proguard-rules.pro>'
}
}
flavorDimensions "default"
productFlavors {
def useSecureFlagProd = rootProject.hasProperty("useSecureFlagProd") ? rootProject.useSecureFlagProd : true
def useSecureFlagDev = rootProject.hasProperty("useSecureFlagDev") ? rootProject.useSecureFlagDev : false
prod {
buildConfigField 'boolean', 'USE_SECURE_FLAG', "$useSecureFlagProd"
}
dev {
buildConfigField 'boolean', 'USE_SECURE_FLAG', "$useSecureFlagDev"
}
}
repositories {
flatDir {
dirs 'libs'
}
}
compileOptions {
// Flag to enable support for the new language APIs
// Source <https://developer.android.com/studio/write/java8-support>
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
lintOptions {
abortOnError false
}
testOptions {
unitTests.returnDefaultValues = true
}
}
dependencies {
// Specify Versions here to avoid coupling this module with the app.
def koinVersion = '2.1.6'
api project(path: ':XxxxxxYyyyy')
implementation fileTree(include: ['*.jar'], dir: 'libs')
// Source: <https://developer.android.com/studio/write/java8-support>
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10'
// Android x
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.core:core:1.3.1'
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
// Google Play services
implementation "com.google.android.gms:play-services-maps:17.0.0"
implementation "com.google.android.gms:play-services-location:17.0.0"
// When you update play-services-fitness to 18.0.0 or higher, observe the breaking changes
// here: <https://developers.google.com/android/guides/releases#august_22_2019>
implementation "com.google.android.gms:play-services-fitness:17.0.0"
implementation "com.google.android.gms:play-services-auth:17.0.0"
// Phone number parser
implementation 'com.googlecode.libphonenumber:libphonenumber:8.11.3'
// Barcode scanner
implementation 'com.journeyapps:zxing-android-embedded:3.6.0'
// Misc libs
implementation "com.google.code.gson:gson:2.8.6"
implementation 'com.squareup.okhttp3:okhttp:4.8.0'
implementation "com.afollestad.material-dialogs:core:0.9.0.2"
// Material components
api "com.google.android.material:material:1.2.0"
// Make this available to Zzzz and PAT.
// (latest Picasso is 2.5.2, not 2.7xxx, see picasso's website)
api "com.squareup.picasso:picasso:2.5.2"
// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
// Kotlin Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinCoroutinesVersion"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinCoroutinesVersion"
// Koin for Android
implementation "org.koin:koin-android:$koinVersion"
implementation "org.koin:koin-android-scope:$koinVersion"
implementation "org.koin:koin-androidx-viewmodel:$koinVersion"
testImplementation "org.koin:koin-test:$koinVersion"
// Navigation Component
implementation "androidx.navigation:navigation-fragment-ktx:2.3.0"
implementation "androidx.navigation:navigation-ui-ktx:2.3.0"
// Mockito framework
testImplementation "org.mockito:mockito-core:3.4.6"
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
// JUnit 4 framework
testImplementation 'junit:junit:4.13'
// OkHttp mock server
testImplementation 'com.squareup.okhttp3:mockwebserver:4.3.1'
}
buildscript {
ext {
dokkaVersion = "1.4.0"
kotlinVersion = "1.3.72"
kotlinCoroutinesVersion = '1.3.6'
}
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}"
}
}
//publishing pom configurations
def Zzzz_POM_GROUP = "com.Xxxxxx.Zzzz"
def Zzzz_POM_ARTIFACT_ID = "ZzzzSDK"
afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
pom.groupId = Zzzz_POM_GROUP
pom.artifactId = Zzzz_POM_ARTIFACT_ID
pom.version = android.defaultConfig.versionName
def deployPath = file('./')
repository(url: "file://${deployPath.absolutePath}/../sdkOutput/")
pom.whenConfigured { pom ->
pom.dependencies.forEach { dep ->
if (dep.getVersion() == "unspecified") {
dep.setVersion(android.defaultConfig.versionName)
}
}
}
}
}
}
}
// publishing task is not modifying the "unspecified" dependencies as uploadArchives does
publishing {
publications {
maven(MavenPublication) {
groupId Zzzz_POM_GROUP
artifactId Zzzz_POM_ARTIFACT_ID
version android.defaultConfig.versionName
artifact "$buildDir/../../sdkOutput/com/Xxxxxx/Zzzz/ZzzzSDK/${version}/ZzzzSDK-${version}.aar"
//generate pom nodes for dependencies
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
configurations.compile.allDependencies.each { dependency ->
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', dependency.group)
dependencyNode.appendNode('artifactId', dependency.name)
dependencyNode.appendNode('version', dependency.version)
}
}
}
}
//publish to filesystem repo
repositories{
maven {
url "$buildDir/repo"
}
}
}
Sebastian Sellmair [JB]
09/21/2020, 2:43 PM.gradlew tasks
or ./gradlew :{app}:tasks
Julien Verfaillie
09/21/2020, 2:50 PMThe Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build.
This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal.
Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects.
If the parent project does not need the plugin, add 'apply false' to the plugin line.
See: <https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl>
The Kotlin plugin was loaded in the following projects: ':ZzzzzZzzz', ':ZzzzzYyyyy'
> Task :tasks
------------------------------------------------------------
Tasks runnable from root project
------------------------------------------------------------
Android tasks
-------------
androidDependencies - Displays the Android dependencies of the project.
signingReport - Displays the signing info for the base and test modules
sourceSets - Prints out all the source sets defined in this project.
Build tasks
-----------
assemble - Assemble main outputs for all the variants.
assembleAndroidTest - Assembles all the Test applications.
assembleDebug - Assembles main outputs for all Debug variants.
assembleDev - Assembles main outputs for all Dev variants.
assembleProd - Assembles main outputs for all Prod variants.
assembleRelease - Assembles main outputs for all Release variants.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
classes - Assembles main classes.
clean - Deletes the build directory.
cleanBuildCache - Deletes the build cache directory.
compileDebugAndroidTestSources
compileDebugSources
compileDebugUnitTestSources
compileDevDebugAndroidTestSources
compileDevDebugSources
compileDevDebugUnitTestSources
compileDevReleaseSources
compileDevReleaseUnitTestSources
compileProdDebugAndroidTestSources
compileProdDebugSources
compileProdDebugUnitTestSources
compileProdReleaseSources
compileProdReleaseUnitTestSources
compileReleaseSources
compileReleaseUnitTestSources
extractDebugAnnotations - Extracts Android annotations for the debug variant into the archive file
extractDevDebugAnnotations - Extracts Android annotations for the devDebug variant into the archive file
extractDevReleaseAnnotations - Extracts Android annotations for the devRelease variant into the archive file
extractProdDebugAnnotations - Extracts Android annotations for the prodDebug variant into the archive file
extractProdReleaseAnnotations - Extracts Android annotations for the prodRelease variant into the archive file
extractReleaseAnnotations - Extracts Android annotations for the release variant into the archive file
Build Setup tasks
-----------------
init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.
Cleanup tasks
-------------
lintFix - Runs lint on all variants and applies any safe suggestions to the source code.
Documentation tasks
-------------------
dokka - Generates dokka documentation for Kotlin
Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'ZzzzLib'.
components - Displays the components produced by root project 'ZzzzLib'. [incubating]
dependencies - Displays all dependencies declared in root project 'ZzzzLib'.
dependencyInsight - Displays the insight into a specific dependency in root project 'ZzzzLib'.
dependentComponents - Displays the dependent components of components in root project 'ZzzzLib'. [incubating]
help - Displays a help message.
model - Displays the configuration model of root project 'ZzzzLib'. [incubating]
outgoingVariants - Displays the outgoing variants of root project 'ZzzzLib'.
projects - Displays the sub-projects of root project 'ZzzzLib'.
properties - Displays the properties of root project 'ZzzzLib'.
tasks - Displays the tasks runnable from root project 'ZzzzLib' (some of the displayed tasks may belong to subprojects).
Install tasks
-------------
installDebugAndroidTest - Installs the android (on device) tests for the Debug build.
installDevDebugAndroidTest - Installs the android (on device) tests for the DevDebug build.
installProdDebugAndroidTest - Installs the android (on device) tests for the ProdDebug build.
uninstallAll - Uninstall all applications.
uninstallDebugAndroidTest - Uninstalls the android (on device) tests for the Debug build.
uninstallDevDebugAndroidTest - Uninstalls the android (on device) tests for the DevDebug build.
uninstallProdDebugAndroidTest - Uninstalls the android (on device) tests for the ProdDebug build.
Publishing tasks
----------------
generateMetadataFileForMavenPublication - Generates the Gradle metadata file for publication 'maven'.
generatePomFileForMavenPublication - Generates the Maven POM file for publication 'maven'.
publish - Publishes all publications produced by this project.
publishAllPublicationsToMavenRepository - Publishes all Maven publications produced by this project to the maven repository.
publishMavenPublicationToMavenLocal - Publishes Maven publication 'maven' to the local Maven repository.
publishMavenPublicationToMavenRepository - Publishes Maven publication 'maven' to Maven repository 'maven'.
publishToMavenLocal - Publishes all Maven publications produced by this project to the local Maven cache.
Upload tasks
------------
uploadArchives - Uploads all artifacts belonging to configuration ':ZzzzzZzzz:archives'
Verification tasks
------------------
check - Runs all checks.
connectedAndroidTest - Installs and runs instrumentation tests for all flavors on connected devices.
connectedCheck - Runs all device checks on currently connected devices.
connectedDebugAndroidTest - Installs and runs the tests for debug on connected devices.
connectedDevDebugAndroidTest - Installs and runs the tests for devDebug on connected devices.
connectedProdDebugAndroidTest - Installs and runs the tests for prodDebug on connected devices.
deviceAndroidTest - Installs and runs instrumentation tests using all Device Providers.
deviceCheck - Runs all device checks using Device Providers and Test Servers.
lint - Runs lint on all variants.
lintDebug - Runs lint on the Debug build.
lintDevDebug - Runs lint on the DevDebug build.
lintDevRelease - Runs lint on the DevRelease build.
lintProdDebug - Runs lint on the ProdDebug build.
lintProdRelease - Runs lint on the ProdRelease build.
lintRelease - Runs lint on the Release build.
spotbugsMain - Run SpotBugs analysis for main classes
test - Run unit tests for all variants.
testDebugUnitTest - Run unit tests for the debug build.
testDevDebugUnitTest - Run unit tests for the devDebug build.
testDevReleaseUnitTest - Run unit tests for the devRelease build.
testProdDebugUnitTest - Run unit tests for the prodDebug build.
testProdReleaseUnitTest - Run unit tests for the prodRelease build.
testReleaseUnitTest - Run unit tests for the release build.
To see all tasks and more detail, run gradlew tasks --all
To see more detail about a task, run gradlew help --task <task>
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See <https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings>
BUILD SUCCESSFUL in 690ms
1 actionable task: 1 executed
Sebastian Sellmair [JB]
09/22/2020, 4:28 PMJulien Verfaillie
09/22/2020, 4:36 PMDocumentation tasks
-------------------
dokkaGfm - Generates documentation in GitHub flavored markdown format
dokkaHtml - Generates documentation in 'html' format
dokkaJavadoc - Generates documentation in 'javadoc' format
dokkaJekyll - Generates documentation in Jekyll flavored markdown format
Sebastian Sellmair [JB]
09/22/2020, 4:36 PMJulien Verfaillie
09/22/2020, 4:36 PM