diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58d2356305..ddb3dd5704 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -81,7 +81,7 @@ jobs: - name: Gradle Build run: | chmod +x gradlew - ./gradlew photon-server:build photon-lib:build -x check --max-workers 2 + ./gradlew build -x check --max-workers 2 - name: Gradle Tests run: ./gradlew testHeadless -i --max-workers 1 --stacktrace - name: Gradle Coverage diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000000..d016881a64 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,52 @@ +name: Build + +on: + push: + branches: [ master ] + tags: + - 'v*' + pull_request: + branches: [ master ] + +jobs: + run_docs: + runs-on: "ubuntu-22.04" + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Fetch tags + run: git fetch --tags --force + - name: Install Java 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: temurin + + - name: Set environment variables (Development) + run: | + echo "BRANCH=development" >> $GITHUB_ENV + if: github.ref == 'refs/heads/main' + - name: Set environment variables (Tag) + run: | + echo "BRANCH=beta" >> $GITHUB_ENV + if: startsWith(github.ref, 'refs/tags/v') + - name: Set environment variables (Release) + run: | + echo "BRANCH=release" >> $GITHUB_ENV + if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, 'alpha') && !contains(github.ref, 'beta') + + - name: Gradle Build + run: | + chmod +x gradlew + ./gradlew docs:generateJavaDocs docs:doxygen + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4.4.1 + with: + ssh-key: true + repository-name: photonvision/photonvision.github.io + branch: photonvision-${{ env.BRANCH }} + clean: true + single-commit: true + folder: docs/build/docs diff --git a/docs/build.gradle b/docs/build.gradle index f39f9190aa..a6436dc16d 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -154,7 +154,7 @@ doxygen { html_extra_stylesheet 'theme.css' html_timestamp true javadoc_autobrief true - project_name 'WPILibC++' + project_name 'PhotonVision C++' project_logo '../wpiutil/src/main/native/resources/wpilib-128.png' project_number pubVersion quiet true @@ -205,22 +205,17 @@ ext { useDocumentation = true } -// apply from: "${rootDir}/shared/opencv.gradle" - task generateJavaDocs(type: Javadoc) { - // classpath += project(":wpimath").sourceSets.main.compileClasspath + def exportedProjects = [':photon-core',':photon-server',':photon-targeting',':photon-lib'] + + source exportedProjects.collect { project(it).sourceSets.main.allJava } + classpath = files(exportedProjects.collect { project(it).sourceSets.main.compileClasspath }) + dependsOn project(':photon-core').writeCurrentVersion + options.links("https://docs.oracle.com/en/java/javase/17/docs/api/") options.addStringOption("tag", "pre:a:Pre-Condition") options.addBooleanOption("Xdoclint:html,missing,reference,syntax", true) options.addBooleanOption('html5', true) - options.linkSource(true) - dependsOn project(':photon-core').writeCurrentVersion - source project(':photon-core').sourceSets.main.java - source project(':photon-server').sourceSets.main.java - source project(':photon-targeting').sourceSets.main.java - source project(':photon-lib').sourceSets.main.java - source configurations.javaSource.collect { zipTree(it) } - include '**/*.java' failOnError = true title = "PhotonVision $pubVersion" diff --git a/settings.gradle b/settings.gradle index e9c9342118..117ee70a52 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,4 +2,4 @@ include 'photon-targeting' include 'photon-core' include 'photon-server' include 'photon-lib' -include 'docs' \ No newline at end of file +include 'docs'