Skip to content

Commit

Permalink
Fix docs and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldmensch committed Jan 11, 2025
1 parent 6fd5052 commit 1852f06
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
distribution: 'temurin'
java-version: '23'
- name: Build with Maven
run: mvn -B package --file pom.xml
run: gradle build
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: target/site/jacoco/jacoco.xml
coverage-reports: jdac/build/reports/jacoco/test/jacocoTestReport.xml
4 changes: 2 additions & 2 deletions .github/workflows/javadocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
java-version: '23'
- name: Generate Documentation
run: |
mvn javadoc:aggregate
gradle javadoc
- name: Find target directory
id: target_dir
run: |
Expand All @@ -42,6 +42,6 @@ jobs:
if: ${{ steps.target_dir.outputs.name != 'ignore' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./target/site/apidocs
folder: ./jdac/build/docs/javadoc
branch: docs
target-folder: javadocs/${{ steps.target_dir.outputs.name }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/guilds.json
migration.md
target/
src/main/java/testing
**/testing
src/main/resources
/logs
.direnv
Expand Down
41 changes: 33 additions & 8 deletions jdac/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
`java-library`
`maven-publish`
jacoco
}

repositories {
Expand All @@ -26,23 +27,47 @@ group = "com.github.kaktushose"
version = "4.0.0-beta.3"
description = "jda-commands"


java.sourceCompatibility = JavaVersion.VERSION_23

publishing {
publications.create<MavenPublication>("maven") {
from(components["java"])
}
}

tasks.withType<JavaCompile>() {
options.encoding = "UTF-8"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(23)
}
}

tasks.withType<Javadoc>() {
tasks.test {
useJUnitPlatform()

finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run
}


tasks.jacocoTestReport {
reports {
xml.required = true
}
dependsOn(tasks.test) // tests are required to run before generating the report
}

tasks.withType<Javadoc> {
val options = options as StandardJavadocDocletOptions
options.encoding = "UTF-8"

options.tags("apiNote:a:API Note:", "implSpec:a:Implementation Requirements:", "implNote:a:Implementation Note:")
options.docFilesSubDirs(true)
options.overview = rootDir.path.plus("src/main/javadoc/overview.md")
options.overview = "src/main/javadoc/overview.md"
// doesn't work anyway, f u gradle
// options.docFilesSubDirs(true)

doLast {
copy {
include("**/doc-files/*")
from("src/main/javadoc")
into(project.layout.buildDirectory.dir("docs/javadoc"))
}

}
}

0 comments on commit 1852f06

Please sign in to comment.