Skip to content

Commit 26819bb

Browse files
committed
Add copyJavadoc task
1 parent 0af3289 commit 26819bb

4 files changed

Lines changed: 26 additions & 8 deletions

File tree

MAINTAINERS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ Before publishing to Maven Central, consider publishing to Maven Local.
66

77
1. Run `./gradlew build` to build the code, run the tests, and verify that there are no formatting
88
issues
9-
2. Update the version string in `publishing-conventions.gradle`.
9+
2. Update the version string in `settings.gradle`.
1010
3. Commit your changes
11-
4. Run `export VERSION="2.0.x"` (replacing "2.0.x" with the version)
11+
4. Run `export VERSION="$(grep lib_version settings.gradle | cut -d'"' -f2)"`
1212
5. Add a git label by running `git tag -a -m "lib2813 ${VERSION} release" "${VERSION}"`
1313
6. Push to GitHub and merge to main
1414
7. Pull from main
1515
8. Copy `lib2813-maven-publishing.tar.gz.gpg` from [SW_Secrets](https://drive.google.com/drive/u/0/folders/1Jeea26SZV5YXSZJpCgnhf4oy-nHNJX9E)
16-
Decrypt `lib2813-maven-publishing.tar.gz.gpg`
17-
8Copy the last five lines of the decrypted file to your personal `gradle.properties` file
18-
9. Run `./gradlew publishToMavenCentral`
19-
10. Celebrate!
16+
9. Decrypt `lib2813-maven-publishing.tar.gz.gpg`
17+
10. Copy the last five lines of the decrypted file to your personal `gradle.properties` file
18+
11. Run `./gradlew publishToMavenCentral`
19+
12. Celebrate!

build.gradle

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,21 @@ allprojects {
2525
}
2626
}
2727
}
28-
}
28+
}
29+
30+
// Create a "copyJavadoc" task that copies the Jacadoc to one plaxce
31+
tasks.register("copyJavadoc");
32+
subprojects.forEach { project ->
33+
project.tasks.withType(Javadoc).configureEach { javadocTask ->
34+
// The below evaluates to "copyJavadoc-vendor-ctre" for ":vendor:ctre:javadoc"
35+
def taskName = "copyJavadoc" + project.path.replace(':', '-')
36+
def copyTask = tasks.register(taskName, Copy) {
37+
dependsOn javadocTask
38+
from javadocTask.destinationDir
39+
into layout.buildDirectory.dir("docs/javadoc/${gradle.lib_version}/" + javadocTask.project.name)
40+
}
41+
tasks.named("copyJavadoc") {
42+
dependsOn(copyTask)
43+
}
44+
}
45+
}

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'

0 commit comments

Comments
 (0)