diff options
| author | Alexander Goussas <71833228+aloussase@users.noreply.github.com> | 2020-12-10 13:55:00 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-10 13:55:00 -0500 |
| commit | 88385a0c6ddbb78840eaf1f5270435eabb240a1d (patch) | |
| tree | 7ed83a826799f5a04d546116f9e2eb840cf82356 /.local/bin/compiler | |
| parent | f190ab32c39a9471954078f8c387bc3ffc7cfddd (diff) | |
| download | eibhear-88385a0c6ddbb78840eaf1f5270435eabb240a1d.tar.gz eibhear-88385a0c6ddbb78840eaf1f5270435eabb240a1d.tar.zst eibhear-88385a0c6ddbb78840eaf1f5270435eabb240a1d.zip | |
Added Java support for compiler script (#860)
Tested it on a project with this structure:
```
- root
|- test
| - Test.java
```
The user must call `compiler` from the root of the project, but that should not
be an inconvenience because usually the working directory is the project's
root. Nonetheless, it also works for java files in the current working directory,
in case someone just wants to test some code quickly.
Diffstat (limited to '.local/bin/compiler')
| -rwxr-xr-x | .local/bin/compiler | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/.local/bin/compiler b/.local/bin/compiler index 0d0ce87..a087eff 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -34,6 +34,7 @@ case "$ext" in cs) mcs "$file" && mono "$base".exe ;; go) go run "$file" ;; h) sudo make install ;; + java) javac -d classes "$file" && java -cp classes "${1%.*}" ;; m) octave "$file" ;; md) if [ -x "$(command -v lowdown)" ]; then lowdown -d nointem -e super "$file" -Tms | groff -mpdfmark -ms -kept > "$base".pdf |
