ob-java: Define the list of all supported header arguments

* lisp/ob-java.el (org-babel-header-args:java): Complete the list of
header arguments supported for Java source blocks.
* testing/lisp/test-ob-java.el (ob-java/lint-header-arguments): Test
that the linter approves of all the supported arguments.
This commit is contained in:
Rudolf Adamkovič 2022-10-20 21:31:37 +02:00 committed by Ihor Radchenko
parent deb1517fe9
commit ee3dbb0fdb
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
2 changed files with 24 additions and 1 deletions

View File

@ -53,7 +53,13 @@ directory, so we keep that as the default behavior.
[1] https://orgmode.org/manual/Results-of-Evaluation.html")
(defconst org-babel-header-args:java '((imports . :any))
(defconst org-babel-header-args:java
'((dir . :any)
(classname . :any)
(imports . :any)
(cmpflag . :any)
(cmdline . :any)
(cmdarg . :any))
"Java-specific header arguments.")
(defcustom org-babel-java-command "java"

View File

@ -21,9 +21,26 @@
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Code:
(require 'org-test "../testing/org-test")
(require 'ob-core)
;;; No Java required
(ert-deftest ob-java/lint-header-arguments ()
(org-test-with-temp-text "
#+header: :dir /tmp
#+header: :classname com.example.Example
#+header: :imports com.example.OtherExample
#+header: :cmpflag -classpath .:/tmp/example/
#+header: :cmdline -classpath .:/tmp/example/
#+header: :cmdarg -verbose
#+begin_src java
#+end_src"
(should-not (org-lint '(wrong-header-argument)))))
;;; Java required
(org-test-for-executable "java")
(org-test-for-executable "javac")
(unless (featurep 'ob-java)