From 2f8f8a0a258dcd16fdf3e449b97aaf055792daeb Mon Sep 17 00:00:00 2001 From: XyperCode Date: Tue, 7 Nov 2023 19:09:08 +0100 Subject: [PATCH] Javadoc --- .github/workflows/javadoc-release.yml | 20 ++++++++++++++++++++ .github/workflows/javadoc.yml | 19 +++++++++++++++++++ build.gradle | 20 ++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 .github/workflows/javadoc-release.yml create mode 100644 .github/workflows/javadoc.yml diff --git a/.github/workflows/javadoc-release.yml b/.github/workflows/javadoc-release.yml new file mode 100644 index 0000000..fe30d7d --- /dev/null +++ b/.github/workflows/javadoc-release.yml @@ -0,0 +1,20 @@ +name: Deploy Javadoc + +on: + release: + types: + - released + - edited + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: 🚀 Deploy JavaDoc + uses: MathieuSoysal/Javadoc-publisher.yml@v2.4.0 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + javadoc-branch: javadoc + java-version: 17 + target-folder: docs/${{ github.event.release.tag_name }} + project: gradle diff --git a/.github/workflows/javadoc.yml b/.github/workflows/javadoc.yml new file mode 100644 index 0000000..b488857 --- /dev/null +++ b/.github/workflows/javadoc.yml @@ -0,0 +1,19 @@ +name: Deploy Javadoc + +on: + push: + branches: + - main + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: 🚀 Deploy JavaDoc + uses: MathieuSoysal/Javadoc-publisher.yml@v2.4.0 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + javadoc-branch: javadoc + java-version: 17 + target-folder: docs/latest + project: gradle diff --git a/build.gradle b/build.gradle index c4dfdd9..6e0c59e 100644 --- a/build.gradle +++ b/build.gradle @@ -4,6 +4,8 @@ group 'io.github.ultreon.corelibs' version '0.1.2' mkdir("${rootProject.projectDir}/.mvnrepo") +apply plugin: 'java' +apply plugin: "java-library" subprojects { apply plugin: 'java' @@ -74,3 +76,21 @@ subprojects { tasks.withType(GenerateModuleMetadata) { enabled = false } + +afterEvaluate { + javadoc { + source(subprojects.collect { subproject -> + subproject.sourceSets.main.allJava.sourceDirectories + }) + title = "CoreLibs" + description = "CoreLibs is the core library collection for Ultreon Team projects." + setDestinationDir(file("$rootProject.projectDir/build/docs/javadoc")) + // Configure the classpath + classpath = files(subprojects.collect { subproject -> + subproject.sourceSets.main.compileClasspath + }) + (options as StandardJavadocDocletOptions).links( + "https://javadoc.io/doc/org.jetbrains/annotations/$annotations_version", + ) + } +}