Skip to content

Commit 919cacc

Browse files
committed
Add a task that creates a tar.gz of the javadoc
1 parent 3fa6751 commit 919cacc

5 files changed

Lines changed: 65 additions & 2 deletions

File tree

build.gradle

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,32 @@ allprojects {
2525
}
2626
}
2727
}
28-
}
28+
}
29+
30+
tasks.register('archiveJavadoc', Tar) {
31+
archiveFileName = 'javadoc.tar.gz'
32+
compression = Compression.GZIP
33+
destinationDirectory = layout.buildDirectory.dir("docs/javadoc/${gradle.lib_version}")
34+
35+
from(tasks.named('generateJavadocIndex'))
36+
37+
subprojects.forEach { sub ->
38+
sub.tasks.withType(Javadoc).configureEach { javadocTask ->
39+
from(javadocTask.destinationDir) {
40+
into sub.name
41+
}
42+
}
43+
}
44+
}
45+
46+
tasks.register('generateJavadocIndex', Copy) {
47+
from 'site/javadoc/latest'
48+
include 'index.j2.html'
49+
into layout.buildDirectory.dir("docs/javadoc")
50+
51+
// Rename the file during the copy process
52+
rename { 'index.html' }
53+
54+
// This performs the variable substitution
55+
expand([version: gradle.lib_version])
56+
}

buildSrc/src/main/groovy/publishing-conventions.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
}
44

55
group = 'com.team2813.lib2813'
6-
version = "2.0.0"
6+
version = gradle.lib_version
77

88
mavenPublishing {
99

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
*/
99

1010
rootProject.name = 'lib2813'
11+
gradle.ext.lib_version = "2.0.0"
1112
include 'core', 'limelight', 'vision', 'testing'
1213
include 'vendor:ctre', 'vendor:rev'

site/javadoc/latest/index.j2.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE HTML>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>lib2813 2.0.0 Javadoc</title>
7+
<link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css">
8+
<link rel="stylesheet" href="../stylesheet.css">
9+
</head>
10+
<body>
11+
<header>
12+
<h1>lib2813 {{ version }} Javadoc</h1>
13+
</header>
14+
<main>
15+
<ul>
16+
<li><a href="core/">core</a></li>
17+
<li><a href="limelight/">limelight</a></li>
18+
<li><a href="testing/">testing</a></li>
19+
<li><a href="vendor-ctre/">vendor-ctre</a></li>
20+
<li><a href="vendor-rev/">vendor-rev</a></li>
21+
<li><a href="vision"/>vision</a></li>
22+
</ul>
23+
</main>
24+
<footer>
25+
<p>Copyright 2023-2026 Prospect Robotics SWENext Club</p>
26+
</footer>
27+
</body>
28+
</html>

site/javadoc/stylesheet.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
body > header {
2+
--accent-bg: #4D7A97;
3+
}
4+
:root {
5+
--accent: #4D7A97;
6+
}

0 commit comments

Comments
 (0)