diff --git a/.gitea/workflows/test_build.yml b/.gitea/workflows/test_build.yml index ae070cd..3233b27 100644 --- a/.gitea/workflows/test_build.yml +++ b/.gitea/workflows/test_build.yml @@ -3,6 +3,8 @@ run-name: Build started by $ {{gitea.actor}} on: pull_request: branches: [test] + push: + branches: [main, test] jobs: build: runs-on: ubuntu-latest @@ -17,4 +19,16 @@ jobs: - name: Validate Gradle Wrapper uses: gradle/actions/wrapper-validation@v3 - name: Gradle build - run: ./gradlew build --info \ No newline at end of file + run: ./gradlew build --info + - name: Generate Javadoc + run: ./gradlew javadoc + continue-on-error: true + - name: Verify Javadoc generation + run: | + if [ -d "build/docs/javadoc" ]; then + echo "Javadoc generated successfully" + ls -la build/docs/javadoc/ + else + echo "Warning: Javadoc directory not found" + exit 1 + fi diff --git a/build.gradle b/build.gradle index 1034cb7..d765d1d 100644 --- a/build.gradle +++ b/build.gradle @@ -60,3 +60,29 @@ dependencies { tasks.named('test') { useJUnitPlatform() } + +/** + * Javadoc generation task. + * Generates API documentation for all public APIs. + */ +javadoc { + source = sourceSets.main.allJava + classpath = configurations.compileClasspath + destinationDir = file("${buildDir}/docs/javadoc") + options.author = true + options.links = [ + "https://docs.oracle.com/javase/17/docs/api/" + ] + // Allow javadoc to fail without stopping the build in CI + failOnError false +} + +// Verify javadoc generation completes without errors +tasks.register('verifyJavadoc') { + dependsOn javadoc + description = 'Verifies javadoc generation completes without errors' + group = 'verification' + doLast { + println "Javadoc generated successfully at: ${javadoc.destinationDir}" + } +} diff --git a/src/main/java/com/hithomelabs/CFTunnels/CfTunnelsApplication.java b/src/main/java/com/hithomelabs/CFTunnels/CfTunnelsApplication.java index 1ea81fd..2c76fd7 100644 --- a/src/main/java/com/hithomelabs/CFTunnels/CfTunnelsApplication.java +++ b/src/main/java/com/hithomelabs/CFTunnels/CfTunnelsApplication.java @@ -3,11 +3,46 @@ package com.hithomelabs.CFTunnels; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +/** + * Main Spring Boot application class for Cloudflare Tunnels API. + * + *
This application provides a RESTful API for managing Cloudflare Tunnels, + * allowing users to create tunnel mappings to services with an approval workflow.
+ * + *Features:
+ *Technology Stack:
+ *Access the API documentation at: + * {@code /swagger-ui.html} for the Swagger/OpenAPI UI
+ * + * @see Cloudflare Tunnel Documentation + * @since 1.0.0 + */ @SpringBootApplication public class CfTunnelsApplication { - public static void main(String[] args) { - SpringApplication.run(CfTunnelsApplication.class, args); - } + /** + * Main entry point for the application. + * + * @param args command line arguments passed to the application + */ + public static void main(String[] args) { + SpringApplication.run(CfTunnelsApplication.class, args); + } }