Skip to content

Commit

Permalink
Added Dokka for Kotlin Doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ocfmem committed Feb 3, 2020
1 parent 346f728 commit 3e9d91f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
1 change: 1 addition & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ buildscript {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.14.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.10.0"
}
}

Expand Down
25 changes: 11 additions & 14 deletions android/keyple-plugin/android-omapi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'org.jetbrains.dokka'

def version = "0.9.0"

Expand All @@ -13,11 +14,6 @@ if(project.getProperties().containsKey("release") && release=="true"){
project.version = version+'-'+ timestamp+ '-SNAPSHOT'
}

apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

archivesBaseName = "keyple-android-plugin-omapi"

group 'org.eclipse.keyple'
Expand Down Expand Up @@ -54,6 +50,11 @@ android {
abortOnError false
}

dokka {
outputFormat = 'html'
outputDirectory = "$buildDir/javadoc"
}

//generate output aar with a qualified name : with version number
libraryVariants.all { variant ->
variant.outputs.all { output ->
Expand Down Expand Up @@ -103,19 +104,15 @@ android {

}


//build javadoc
task javadoc(type: Javadoc) {
failOnError false
source = android.sourceSets.main.java.sourceFiles
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
task javadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = 'javadoc'
outputDirectory = dokka.outputDirectory
inputs.dir 'src/main/kotlin'
}

// build a jar with javadoc
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
from dokka.outputDirectory
}

//build sources jar
Expand Down

0 comments on commit 3e9d91f

Please sign in to comment.