Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Docs

on:
push:
branches:
- master
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build documentation with Dokka
run: ./gradlew :TeamCode:dokkaGeneratePublicationHtml --no-daemon

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./TeamCode/build/dokka/html

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
31 changes: 30 additions & 1 deletion TeamCode/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//
// build.gradle in TeamCode
//

import java.time.Year
// Most of the definitions for building your module reside in a common, shared
// file 'build.common.gradle'. Being factored in this way makes it easier to
// integrate updates to the FTC into your code. If you really need to customize
Expand All @@ -16,11 +18,28 @@ plugins {
id("com.android.application")
id("org.jlleitschuh.gradle.ktlint") version "13.1.0"
id("org.jetbrains.kotlin.android")
alias(libs.plugins.dokka)
}

// Include common definitions from above.
apply { from("../build.common.gradle") }

// Dokka configuration
dokka {
dokkaPublications.html {
// Customize colors and styling
moduleName.set("Pioneer Robotics Documentation")

pluginsConfiguration.html {
// Custom CSS for colors
// customStyleSheets.from("dokka-styles.css")

// Footer text
footerMessage.set("© ${Year.now().value} Pioneer Robotics")
}
}
}

ktlint {
android = true
ignoreFailures = true // Allow build to succeed, but still show warnings
Expand Down Expand Up @@ -61,4 +80,14 @@ dependencies {

//kotlin {
// jvmToolchain(8)
//}
//}

tasks.register("dokkaHtmlMultiModule") {
dependsOn(":TeamCode:dokkaGeneratePublicationHtml")
doLast {
copy {
from(layout.buildDirectory.dir("dokka/html"))
into(layout.projectDirectory.dir("../docs"))
}
}
}
4 changes: 4 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ftc = "11.0.0"
androidx-appcompat = "1.2.0"
dashboard = "0.5.1"
junit = "4.13.2"
dokka = "2.1.0"

[libraries]
ftc-inspection = { module = "org.firstinspires.ftc:Inspection", version.ref = "ftc" }
Expand All @@ -16,3 +17,6 @@ ftc-vision = { module = "org.firstinspires.ftc:Vision", version.ref = "ftc" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
acmerobotics-dashboard = { module = "com.acmerobotics.dashboard:dashboard", version.ref = "dashboard" }
junit = { module = "junit:junit", version.ref = "junit" }

[plugins]
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include(":FtcRobotController")
include(":TeamCode")
include(":TeamCode")