-
Android Dokka 사용법Android 2019. 9. 23. 15:44반응형
https://github.com/DNights/DokkaSample
DNights/DokkaSample
Contribute to DNights/DokkaSample development by creating an account on GitHub.
github.com
프로젝트의 코드를 분석하여 javadoc 형태의 문서를 만들어주는 Dokka 플러그인 사용 법이다.
일단 참고링크에 있는 내용을 읽어보실것을 추천드립니다.
일단 app 단에 있는 build.gradle 에 apply plugin: 'org.jetbrains.dokka-android' 를 추가합니다.
그리고 dokka 부분을 추가합니다.
dokka {
outputFormat = 'html'
outputDirectory = "$rootDir/javadocs"
}[app/build.gradle]
apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'org.jetbrains.dokka-android' android { compileSdkVersion 29 buildToolsVersion "29.0.2" defaultConfig { applicationId "com.dnights.dokkasample" minSdkVersion 21 targetSdkVersion 29 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } } dokka { outputFormat = 'html' outputDirectory = "$rootDir/javadocs" } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.core:core-ktx:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' }
[project/build.gradle]
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = '1.3.50' ext.dokka_version = '0.9.18' repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.5.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:${dokka_version}" } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }
terminal 에서 ./gradlew dokka 를 입력하면 아래와 같이 build 가 진행되며
dokka 의 outputDirectory 에 선언해둔 경로로 문서가 생성 됩니다.
javadocs 로 문서 생성 html포멧으로 만들경우 위의 화면처럼 html 문서가 작성됩니다.
그리고 주석으로 써두었던 내용도 모두 참조되어 적용됩니다.
[참고링크]
https://github.com/Kotlin/dokka
Kotlin/dokka
Documentation Engine for Kotlin. Contribute to Kotlin/dokka development by creating an account on GitHub.
github.com
https://kotlinlang.org/docs/reference/kotlin-doc.html
Documenting Kotlin Code - Kotlin Programming Language
kotlinlang.org
반응형'Android' 카테고리의 다른 글
Android Decompile Setting (0) 2019.11.28 Declarative UI Patterns (0) 2019.10.26 안드로이드 비동기 처리 질문 (Thread Sleep) (0) 2019.10.06 Android Paging Library (0) 2019.10.01 RecyclerView Header , Footer 생성 (0) 2019.09.17 안드로이드 스레드 (Android Thread) (0) 2019.08.21 안드로이드 런타임 (Android RunTime) (0) 2019.08.10 Droid knights 2019 - 코루틴 안전! 이쁘게 코루틴 사용하는 방법은? (0) 2019.08.06