gnu: stringtemplate4: Prettify "generate-grammar" phase.

* gnu/packages/java.scm (stringtemplate4)[arguments]: Rewrite
"generate-grammar" phase to use "with-directory-excursion" and to report
success or failure.
This commit is contained in:
Ricardo Wurmus 2017-05-16 13:19:32 +02:00
parent 407df789cf
commit f4aa4cfe00
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC

View File

@ -3226,17 +3226,18 @@ StringTemplate also powers ANTLR.")
(arguments
`(#:tests? #f
#:jar-name (string-append ,name "-" ,version ".jar")
#:modules ((guix build ant-build-system)
(guix build utils)
(srfi srfi-1))
#:phases
(modify-phases %standard-phases
(add-before 'build 'generate-grammar
(lambda* (#:key inputs #:allow-other-keys)
(chdir "src/org/stringtemplate/v4/compiler/")
(for-each (lambda (file)
(display file)
(newline)
(system* "antlr3" file))
'("STParser.g" "Group.g" "CodeGenerator.g"))
(chdir "../../../../.."))))))
(lambda _
(with-directory-excursion "src/org/stringtemplate/v4/compiler/"
(every (lambda (file)
(format #t "~a\n" file)
(zero? (system* "antlr3" file)))
'("STParser.g" "Group.g" "CodeGenerator.g"))))))))
(inputs
`(("antlr3" ,antlr3-bootstrap)
("antlr2" ,antlr2)