Skip to content

Commit

Permalink
Cleanup javadoc, force UTF-8 encoding in Javadoc tasks (#938)
Browse files Browse the repository at this point in the history
Make `check` depend on javadoc task to enforce proper javadocs
  • Loading branch information
SamCarlberg authored Apr 19, 2019
1 parent d4d5d5e commit 11bfded
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,40 @@

/**
* The name of the operation being described.
*
* @return the name of the operation
*/
String name();

/**
* A brief summary of the operation. In-depth descriptions, usage guides, and examples
* should be on the wiki, not here.
*
* @return a summary of the operation
*/
String summary();

/**
* The category the operation belongs to. Defaults to
* {@link OperationCategory#MISCELLANEOUS MISCELLANEOUS}.
*
* @return the category to which the operation belongs
*/
OperationCategory category() default MISCELLANEOUS;

/**
* All known aliases of the operation. If the name of the operation changes, the previous name
* should be here. Defaults to an empty array.
*
* @return known aliases
*/
String[] aliases() default {};

/**
* The name of the icon to use to display the operation. If empty ({@code ""}), no icon will be
* shown. The icon should be located in {@code /edu/wpi/grip/ui/icons/}.
*
* @return the name of the icon
*/
String iconName() default "";

Expand Down
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ javaSubprojects {

tasks.withType<Javadoc> {
source(tasks.named<JavaCompile>("compileJava").map { it.source })
options.encoding = "UTF-8"
}

tasks.named("check").configure {
dependsOn("javadoc")
}

tasks.withType<JavaCompile>().configureEach {
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/java/edu/wpi/grip/core/Source.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected Source(ExceptionWitness.Factory exceptionWitnessFactory) {
/**
* Get the sockets for this source.
*
* @return @return An array of {@link OutputSocket}s for the outputs that the source produces.
* @return An array of {@link OutputSocket}s for the outputs that the source produces.
*/
public final ImmutableList<OutputSocket> getOutputSockets() {
final List<OutputSocket> outputSockets = createOutputSockets();
Expand Down Expand Up @@ -83,6 +83,8 @@ protected ExceptionWitness getExceptionWitness() {
* Initializes the source. This should not try to handle initialization exceptions. Instead, the
* {@link #initializeSafely()} should report the problem with initializing to the exception
* witness.
*
* @throws IOException if the source could not be initialized
*/
public abstract void initialize() throws IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public final void handle(String target,
* @param baseRequest the base HTTP request
* @param request the request after being wrapped or filtered by other handlers
* @param response the HTTP response to send to the client
* @throws IOException if an I/O error occurred while handling the request
* @throws ServletException if the request could not be handled
* @see AbstractHandler#handle(String, Request, HttpServletRequest, HttpServletResponse)
*/
protected abstract void handleIfPassed(String target,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public void setFile(Optional<File> file) {

/**
* Load the project from a file.
*
* @throws IOException if the project file could not be read
*/
public void open(File file) throws IOException {
try (InputStreamReader reader = new InputStreamReader(new FileInputStream(file),
Expand Down Expand Up @@ -138,6 +140,8 @@ public boolean trySave(File file) {

/**
* Save the project to a file.
*
* @throws IOException if the file could not written
*/
public void save(File file) throws IOException {
try (Writer writer = new OutputStreamWriter(new FileOutputStream(file),
Expand Down

0 comments on commit 11bfded

Please sign in to comment.