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
1 changed files with 9 additions and 8 deletions

View File

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