diff --git a/.github/workflows/publish_javadoc_to_github_pages.yml b/.github/workflows/publish_javadoc_to_github_pages.yml new file mode 100644 index 00000000..89750220 --- /dev/null +++ b/.github/workflows/publish_javadoc_to_github_pages.yml @@ -0,0 +1,21 @@ +name: Publish javadoc to GitHub pages + +on: + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: '11' + - name: Build javadoc + run: ./gradlew dokkaHtmlMultiModule + - name: Publish to GitHub pages + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: build/dokka + ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 8a7176f2..db478aa6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'kotlin' +apply plugin: 'org.jetbrains.dokka' apply from: 'gradle/versions.gradle' buildscript { @@ -28,3 +29,7 @@ allprojects { } } } + +dokkaHtmlMultiModule.configure { + outputDirectory.set(new File("$buildDir/dokka")) +} \ No newline at end of file diff --git a/cardio/build.gradle b/cardio/build.gradle index 74ab112a..9424d30e 100644 --- a/cardio/build.gradle +++ b/cardio/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' -apply from: '../gradle/dokka.gradle' +apply plugin: 'org.jetbrains.dokka' apply from: rootProject.file('gradle/versions.gradle') apply from: '../gradle/publish.gradle' @@ -24,6 +24,10 @@ android { } } +tasks.dokkaHtmlPartial.configure { + outputDirectory = file("../build/dokka/cardio") +} + dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion" diff --git a/core/build.gradle b/core/build.gradle index 7ded78a0..9d20c379 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'java' apply plugin: 'kotlin' -apply from: '../gradle/dokka.gradle' +apply plugin: 'org.jetbrains.dokka' apply from: '../gradle/versions.gradle' apply from: '../gradle/publish.gradle' @@ -11,6 +11,10 @@ repositories { mavenCentral() } +tasks.dokkaHtmlPartial.configure { + outputDirectory = file("../build/dokka/core") +} + dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "com.squareup.okhttp3:okhttp:${okHttpVersion}" diff --git a/gradle/dokka.gradle b/gradle/dokka.gradle index 7d134940..8700d1b7 100644 --- a/gradle/dokka.gradle +++ b/gradle/dokka.gradle @@ -2,4 +2,8 @@ apply plugin: 'org.jetbrains.dokka' tasks.dokkaHtml.configure { outputDirectory = file("$buildDir/dokka") +} + +tasks.dokkaHtmlPartial.configure { + outputDirectory = file("../dokka") } \ No newline at end of file diff --git a/ui/build.gradle b/ui/build.gradle index 879a4615..dd533422 100644 --- a/ui/build.gradle +++ b/ui/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' -apply from: '../gradle/dokka.gradle' +apply plugin: 'org.jetbrains.dokka' apply from: rootProject.file('gradle/versions.gradle') apply from: '../gradle/publish.gradle' @@ -29,6 +29,10 @@ android { } } +tasks.dokkaHtmlPartial.configure { + outputDirectory = file("../build/dokka/ui") +} + dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "androidx.appcompat:appcompat:$appCompatVersion"