Skip to content

Commit

Permalink
MAIN-T-119 Publish JavaDoc to GitHub Pages (#94)
Browse files Browse the repository at this point in the history
* Update build configuration and rename source root from Java to Kotlin

Updated the Gradle configuration to set Kotlin as the primary language and included the Dokka library. Renamed all Java source roots to Kotlin to streamline development and take the full benefit of Kotlin features. This ensures better concise code and avoids unnecessary Java compatibility configurations.

* Implement documentation generation

The current commit introduces the generation of JavaDocs. A new GitHub Actions workflow named 'publish-javadoc.yml' has been added to generate and publish JavaDocs on every push to the 'main' branch. The README.md file has been updated with a badge to provide direct access to the online JavaDocs.

This modification fosters better code documentation and visibility.
  • Loading branch information
hanna-eismant authored Apr 26, 2024
1 parent e88bcca commit 35d5b49
Show file tree
Hide file tree
Showing 92 changed files with 64 additions and 33 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/gradle-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,13 @@ name: tests
on:
push:
branches: [ "main" ]
# pull_request:
# branches: [ "main" ]

defaults:
run:
working-directory: ./server

jobs:

# qodana:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set up JDK 17
# uses: actions/setup-java@v4
# with:
# java-version: '17'
# distribution: 'temurin'
# args: --project-dir,server,--baseline,qodana.sarif.json
# - name: 'Qodana Scan'
# uses: JetBrains/[email protected]
# env:
# QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}

unit:
runs-on: ubuntu-latest
permissions:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/gradle-pr.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: tests

on:
# push:
# branches: [ "main" ]
pull_request:
branches: [ "main" ]

Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/publish-javadoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: documentation

on:
push:
branches: [ "main" ]

jobs:

publish-javadoc:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
- name: Generate documentation with Gradle Wrapper
working-directory: server
run: ./gradlew dokkaHtml
- name: Deploy JavaDoc 🚀
uses: JamesIves/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: javadoc
clean: true
folder: server/build/dokka/html
target-folder: javadoc
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![tests](https://github.com/hanna-eismant/doky/actions/workflows/gradle-main.yml/badge.svg)](https://github.com/hanna-eismant/doky/actions/workflows/gradle-main.yml)
![GitHub License](https://img.shields.io/github/license/hanna-eismant/doky)
[![Javadoc](https://img.shields.io/badge/JavaDoc-Online-green)](https://hanna-eismant.github.io/doky/javadoc/)


> [!NOTE]
Expand Down
10 changes: 7 additions & 3 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ plugins {
id 'org.springframework.boot' version '3.1.2'
id 'io.spring.dependency-management' version '1.1.2'
id 'com.microsoft.azure.azurewebapp' version '1.7.1'
id "org.jetbrains.kotlinx.kover" version "0.7.6"
id 'org.jetbrains.kotlinx.kover' version '0.7.6'
id 'org.jetbrains.dokka' version '1.9.20'
}

group = 'org.hkurh.doky'

java {
sourceCompatibility = '17'
compileKotlin {
kotlinOptions.jvmTarget = '1.8'
}
compileTestKotlin {
kotlinOptions.jvmTarget = '1.8'
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import org.hkurh.doky.documents.db.DocumentEntityRepository
import org.hkurh.doky.users.db.UserEntityRepository
import org.junit.Rule
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertNotNull
import org.junit.jupiter.api.Assertions.assertNull
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
import org.junit.rules.TemporaryFolder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ import org.springframework.test.context.jdbc.SqlMergeMode
@SqlMergeMode(SqlMergeMode.MergeMode.MERGE)
@Sql(scripts = ["classpath:sql/create_base_test_data.sql"], executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
@Sql(scripts = ["classpath:sql/cleanup_base_test_data.sql"], executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
class DokyIntegrationTest {
}
class DokyIntegrationTest
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
package org.hkurh.doky.documents.db

import jakarta.persistence.*
import jakarta.persistence.Column
import jakarta.persistence.Entity
import jakarta.persistence.EntityListeners
import jakarta.persistence.GeneratedValue
import jakarta.persistence.GenerationType
import jakarta.persistence.Id
import jakarta.persistence.JoinColumn
import jakarta.persistence.Lob
import jakarta.persistence.ManyToOne
import jakarta.persistence.Table
import org.hkurh.doky.users.db.UserEntity
import org.springframework.data.annotation.CreatedBy
import org.springframework.data.annotation.CreatedDate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package org.hkurh.doky.documents.impl
import org.apache.commons.lang3.StringUtils
import org.hkurh.doky.documents.DocumentFacade
import org.hkurh.doky.documents.DocumentService
import org.hkurh.doky.documents.api.DocumentResponse
import org.hkurh.doky.documents.api.DocumentRequest
import org.hkurh.doky.documents.api.DocumentResponse
import org.hkurh.doky.errorhandling.DokyNotFoundException
import org.hkurh.doky.filestorage.FileStorageService
import org.hkurh.doky.toDto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse
import io.swagger.v3.oas.annotations.responses.ApiResponses
import io.swagger.v3.oas.annotations.security.SecurityRequirement
import io.swagger.v3.oas.annotations.tags.Tag
import jakarta.validation.constraints.NotBlank
import jakarta.validation.constraints.Pattern
import jakarta.validation.constraints.Size
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.RequestBody

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ import io.swagger.v3.oas.annotations.tags.Tag

@Tag(name = "Documents")
@SecurityRequirement(name = "Bearer Token")
interface DocumentSearchApi {
}
interface DocumentSearchApi
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
package org.hkurh.doky.users.db

import jakarta.persistence.*
import jakarta.persistence.Column
import jakarta.persistence.Entity
import jakarta.persistence.GeneratedValue
import jakarta.persistence.GenerationType
import jakarta.persistence.Id
import jakarta.persistence.Index
import jakarta.persistence.Table
import jakarta.persistence.UniqueConstraint

@Entity
@Table(name = "user",
Expand Down

0 comments on commit 35d5b49

Please sign in to comment.