2016-09-09 16:51:03 +02:00
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
|
|
|
;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
|
|
|
|
;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
|
2018-10-17 21:08:31 +02:00
|
|
|
;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
|
2016-09-09 16:51:03 +02:00
|
|
|
;;;
|
|
|
|
;;; This file is part of GNU Guix.
|
|
|
|
;;;
|
|
|
|
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
|
|
|
;;; under the terms of the GNU General Public License as published by
|
|
|
|
;;; the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
;;; your option) any later version.
|
|
|
|
;;;
|
|
|
|
;;; GNU Guix is distributed in the hope that it will be useful, but
|
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;;; GNU General Public License for more details.
|
|
|
|
;;;
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
|
|
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
(define-module (guix build java-utils)
|
|
|
|
#:use-module (guix build utils)
|
|
|
|
#:export (ant-build-javadoc
|
|
|
|
install-jars
|
|
|
|
install-javadoc))
|
|
|
|
|
|
|
|
(define* (ant-build-javadoc #:key (target "javadoc") (make-flags '())
|
|
|
|
#:allow-other-keys)
|
gnu: java: Return #t from all phases and snippets.
* guix/build/java-utils.scm (ant-build-javadoc): Use invoke; return #t.
* guix/build/ant-build-system.scm (generate-jar-indices): Return #t and
remove vestigal plumbing.
* gnu/packages/java.scm (classpath-bootstrap, ant-bootstrap, classpath-devel)
(icedtea-6, icedtea-7, java-plexus-sec-dispatcher, ant/java8, clojure)
(java-classpathx-servletapi, java-swt, java-qdox-1.12, java-hamcrest-core)
(java-plexus-archiver, java-plexus-sec-dispatcher, java-modello-plugins-xml)
(java-asm, java-commons-collections, java-commons-bsf, java-slf4j-api)
(java-slf4j-api, java-slf4j-simple, java-stringtemplate-3)
(java-stringtemplate, antlr3, antlr3-3.3, antlr3-3.1, java-ops4j-base-lang)
(java-ops4j-pax-tinybundles, java-ops4j-pax-exam-core-spi)
(java-fasterxml-jackson-core, java-fasterxml-jackson-databind)
(java-fasterxml-jackson-modules-base-jaxb, java-ecj-3, java-ecj-3.5)
(java-fasterxml-jackson-dataformat-yaml, java-woodstox-core)
(java-fasterxml-jackson-dataformat-xml, java-testng, java-jnacl)
(java-bouncycastle, java-powermock-core, java-powermock-modules-junit4)
(java-jansi-native, java-jansi, java-commons-httpclient, java-commons-vfs)
(java-apache-ivy, java-janino, java-logback-core): Return #t from all phases
and snippets, use invoke where appropriate, and remove vestigial plumbing.
2018-06-28 09:52:08 +02:00
|
|
|
(apply invoke `("ant" ,target ,@make-flags)))
|
2016-09-09 16:51:03 +02:00
|
|
|
|
|
|
|
(define* (install-jars jar-directory)
|
|
|
|
"Install jar files from JAR-DIRECTORY to the default target directory. This
|
|
|
|
is used in case the build.xml does not include an install target."
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
(let ((share (string-append (assoc-ref outputs "out")
|
|
|
|
"/share/java")))
|
|
|
|
(for-each (lambda (f) (install-file f share))
|
|
|
|
(find-files jar-directory "\\.jar$"))
|
|
|
|
#t)))
|
|
|
|
|
|
|
|
(define* (install-javadoc apidoc-directory)
|
|
|
|
"Install the APIDOC-DIRECTORY to the target directory. This is used to
|
|
|
|
install javadocs when this is not done by the install target."
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
(let* ((out (assoc-ref outputs "out"))
|
2018-10-17 21:08:31 +02:00
|
|
|
(name-version (strip-store-file-name out))
|
2016-09-09 16:51:03 +02:00
|
|
|
(docs (string-append (or (assoc-ref outputs "doc") out)
|
2018-10-17 21:08:31 +02:00
|
|
|
"/share/doc/" name-version "/")))
|
2016-09-09 16:51:03 +02:00
|
|
|
(mkdir-p docs)
|
|
|
|
(copy-recursively apidoc-directory docs)
|
|
|
|
#t)))
|