diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 084b30da..38523012 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -16,4 +16,7 @@ Before publishing to Maven Central, consider publishing to Maven Local. 9. Decrypt `lib2813-maven-publishing.tar.gz.gpg` 10. Copy the last five lines of the decrypted file to your personal `gradle.properties` file 11. Run `./gradlew publishToMavenCentral` -12. Celebrate! +12. Generate Javadoc by running `./gradlew archiveJavadoc` +13. Copy `build/docs/javadoc/javadoc.tar.gz` to the web site and extract it +14. Update the 'latest' symlink to point to the latest javadoc +15. Celebrate! diff --git a/build.gradle b/build.gradle index ce034fb9..1af37e5d 100644 --- a/build.gradle +++ b/build.gradle @@ -25,4 +25,32 @@ allprojects { } } } -} \ No newline at end of file +} + +tasks.register('archiveJavadoc', Tar) { + archiveFileName = 'javadoc.tar.gz' + compression = Compression.GZIP + destinationDirectory = layout.buildDirectory.dir("docs/javadoc") + + from(tasks.named('generateJavadocIndex')) + + subprojects.forEach { sub -> + sub.tasks.withType(Javadoc).configureEach { javadocTask -> + from(javadocTask.destinationDir) { + into sub.name + } + } + } +} + +tasks.register('generateJavadocIndex', Copy) { + from 'site/javadoc/latest' + include 'index.j2.html' + into layout.buildDirectory.dir("docs/javadoc") + + // Rename the file during the copy process + rename { 'index.html' } + + // This performs the variable substitution + expand([version: gradle.lib_version]) +} diff --git a/buildSrc/src/main/groovy/publishing-conventions.gradle b/buildSrc/src/main/groovy/publishing-conventions.gradle index 3d9d167f..3adba0ec 100644 --- a/buildSrc/src/main/groovy/publishing-conventions.gradle +++ b/buildSrc/src/main/groovy/publishing-conventions.gradle @@ -3,7 +3,7 @@ plugins { } group = 'com.team2813.lib2813' -version = "2.0.0" +version = gradle.lib_version mavenPublishing { diff --git a/settings.gradle b/settings.gradle index 226471d5..9470d2f0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -8,5 +8,6 @@ */ rootProject.name = 'lib2813' +gradle.ext.lib_version = "2.0.0" include 'core', 'limelight', 'vision', 'testing' include 'vendor:ctre', 'vendor:rev' diff --git a/site/javadoc/latest/index.j2.html b/site/javadoc/latest/index.j2.html new file mode 100644 index 00000000..45b26b2b --- /dev/null +++ b/site/javadoc/latest/index.j2.html @@ -0,0 +1,28 @@ + + + + + + lib2813 2.0.0 Javadoc + + + + +
+

lib2813 {{ version }} Javadoc

+
+
+ +
+ + + diff --git a/site/javadoc/stylesheet.css b/site/javadoc/stylesheet.css new file mode 100644 index 00000000..d21912ae --- /dev/null +++ b/site/javadoc/stylesheet.css @@ -0,0 +1,6 @@ +body > header { + --accent-bg: #4D7A97; +} +:root { + --accent: #4D7A97; +}