forked from mirrors/org-mode
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:
parent
deb1517fe9
commit
ee3dbb0fdb
|
@ -53,7 +53,13 @@ directory, so we keep that as the default behavior.
|
||||||
|
|
||||||
[1] https://orgmode.org/manual/Results-of-Evaluation.html")
|
[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.")
|
"Java-specific header arguments.")
|
||||||
|
|
||||||
(defcustom org-babel-java-command "java"
|
(defcustom org-babel-java-command "java"
|
||||||
|
|
|
@ -21,9 +21,26 @@
|
||||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(require 'org-test "../testing/org-test")
|
(require 'org-test "../testing/org-test")
|
||||||
(require 'ob-core)
|
(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 "java")
|
||||||
(org-test-for-executable "javac")
|
(org-test-for-executable "javac")
|
||||||
(unless (featurep 'ob-java)
|
(unless (featurep 'ob-java)
|
||||||
|
|
Loading…
Reference in New Issue