Skip to content

Instantly share code, notes, and snippets.

@michael-simons
Created December 23, 2022 13:14
Show Gist options
  • Save michael-simons/4966ad1be971453a2ae726fe19126d69 to your computer and use it in GitHub Desktop.
Save michael-simons/4966ad1be971453a2ae726fe19126d69 to your computer and use it in GitHub Desktop.
Formats Java source files with Google Formats.
//usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA 17+
//DEPS com.google.googlejavaformat:google-java-format:1.15.0
//RUNTIME_OPTIONS --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
//RUNTIME_OPTIONS --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
//RUNTIME_OPTIONS --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
//RUNTIME_OPTIONS --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
//RUNTIME_OPTIONS --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
import com.google.googlejavaformat.java.Main;
/**
* Formats Java source files with Google Formats.
*
* @author Michael J. Simons
*/
public class format_java {
public static void main(String... args) {
Main.main(args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment