all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Roel Janssen <roel@gnu.org>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: 26803@debbugs.gnu.org
Subject: bug#26803: [PATCH 02/36] ant-build-system: Add default "check" target.
Date: Sat, 06 May 2017 22:28:36 +0200	[thread overview]
Message-ID: <87r301k9vv.fsf@gnu.org> (raw)
In-Reply-To: <20170506153617.3074-2-rekado@elephly.net>


Ricardo Wurmus writes:

> * guix/build-system/ant.scm (ant-build): Change default test target to
> "check"; add "test-dir" argument.
> * guix/build/ant-build-system.scm (default-build.xml): Add "test-dir"
> argument; add ant targets "compile-tests" and "check".
> (configure): Add "test-dir" argument; pass it to "default-build.xml".
> ---
>  guix/build-system/ant.scm       |  4 +++-
>  guix/build/ant-build-system.scm | 40 +++++++++++++++++++++++++++++++++++++---
>  2 files changed, 40 insertions(+), 4 deletions(-)
>
> diff --git a/guix/build-system/ant.scm b/guix/build-system/ant.scm
> index a309a0c86..bf2f3b411 100644
> --- a/guix/build-system/ant.scm
> +++ b/guix/build-system/ant.scm
> @@ -93,12 +93,13 @@
>  (define* (ant-build store name inputs
>                      #:key
>                      (tests? #t)
> -                    (test-target "tests")
> +                    (test-target "check")
>                      (configure-flags ''())
>                      (make-flags ''())
>                      (build-target "jar")
>                      (jar-name #f)
>                      (source-dir "src")
> +                    (test-dir "src/test")
>                      (phases '(@ (guix build ant-build-system)
>                                  %standard-phases))
>                      (outputs '("out"))

Is this only for 'build.xml' files generated by the ant-build-system?
I'm not sure whether there is a consensus within the Java world about
the name of a test phase.  I think 'check' would be good, because it is
consistent with other build systems within Guix.

So.. long story short, it looks good to me.

> @@ -128,6 +129,7 @@
>                    #:build-target ,build-target
>                    #:jar-name ,jar-name
>                    #:source-dir ,source-dir
> +                  #:test-dir ,test-dir
>                    #:phases ,phases
>                    #:outputs %outputs
>                    #:search-paths ',(map search-path-specification->sexp
> diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm
> index 8ec7a9486..4042630a1 100644
> --- a/guix/build/ant-build-system.scm
> +++ b/guix/build/ant-build-system.scm
> @@ -36,7 +36,7 @@
>  ;; Code:
>  
>  (define* (default-build.xml jar-name prefix #:optional
> -                            (source-dir "."))
> +                            (source-dir ".") (test-dir "./test"))
>    "Create a simple build.xml with standard targets for Ant."
>    (call-with-output-file "build.xml"
>      (lambda (port)
> @@ -48,6 +48,10 @@
>                                (value "${basedir}/build/jar")))
>                   (property (@ (name "dist.dir")
>                                (value ,prefix)))
> +                 (property (@ (name "test.home")
> +                              (value ,test-dir)))
> +                 (property (@ (name "test.classes.dir")
> +                              (value "${basedir}/build/test-classes")))
>  
>                   ;; respect the CLASSPATH environment variable
>                   (property (@ (name "build.sysclasspath")
> @@ -63,6 +67,35 @@
>                                     (destdir "${classes.dir}")
>                                     (classpath (@ (refid "classpath"))))))
>  
> +                 (target (@ (name "compile-tests"))
> +                         (mkdir (@ (dir "${test.classes.dir}")))
> +                         (javac (@ (includeantruntime "false")
> +                                   (srcdir ,test-dir)
> +                                   (destdir "${test.classes.dir}"))
> +                                (classpath
> +                                 (pathelement (@ (path "${env.CLASSPATH}")))
> +                                 (pathelement (@ (location "${classes.dir}")))
> +                                 (pathelement (@ (location "${test.classes.dir}"))))))
> +
> +                 (target (@ (name "check")
> +                            (depends "compile-tests"))
> +                         (mkdir (@ (dir "${test.home}/test-reports")))
> +                         (junit (@ (printsummary "true")
> +                                   (showoutput "true")
> +                                   (fork "yes")
> +                                   (haltonfailure "yes"))
> +                                (classpath
> +                                 (pathelement (@ (path "${env.CLASSPATH}")))
> +                                 (pathelement (@ (location "${test.home}/resources")))
> +                                 (pathelement (@ (location "${classes.dir}")))
> +                                 (pathelement (@ (location "${test.classes.dir}"))))
> +                                (formatter (@ (type "plain")
> +                                              (usefile "true")))
> +                                (batchtest (@ (fork "yes")
> +                                              (todir "${test.home}/test-reports"))
> +                                           (fileset (@ (dir "${test.home}/java"))
> +                                                    (include (@ (name "**/*Test.java" )))))))
> +
>                   (target (@ (name "jar")
>                              (depends "compile"))
>                           (mkdir (@ (dir "${jar.dir}")))

Cool!

> @@ -99,12 +132,13 @@ to the default GNU unpack strategy."
>        ((assq-ref gnu:%standard-phases 'unpack) #:source source)))
>  
>  (define* (configure #:key inputs outputs (jar-name #f)
> -                    (source-dir "src") #:allow-other-keys)
> +                    (source-dir "src")
> +                    (test-dir "src/test") #:allow-other-keys)
>    (when jar-name
>      (default-build.xml jar-name
>                         (string-append (assoc-ref outputs "out")
>                                        "/share/java")
> -                       source-dir))
> +                       source-dir test-dir))
>    (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
>    (setenv "CLASSPATH" (generate-classpath inputs)))

LGTM.

Thanks a lot for this!

Kind regards,
Roel Janssen

  reply	other threads:[~2017-05-06 20:29 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-06 14:01 bug#26803: Java things Ricardo Wurmus
2017-05-06 15:35 ` bug#26803: [PATCH 01/36] ant-build-system: Allow specifying source directory Ricardo Wurmus
2017-05-06 15:35   ` bug#26803: [PATCH 02/36] ant-build-system: Add default "check" target Ricardo Wurmus
2017-05-06 20:28     ` Roel Janssen [this message]
2017-05-06 15:35   ` bug#26803: [PATCH 03/36] guix: Add java-utils Ricardo Wurmus
2017-05-06 20:31     ` Roel Janssen
2017-05-06 15:35   ` bug#26803: [PATCH 04/36] gnu: Add java-plexus-utils Ricardo Wurmus
2017-05-06 20:34     ` Roel Janssen
2017-05-06 15:35   ` bug#26803: [PATCH 05/36] gnu: Add java-plexus-interpolation Ricardo Wurmus
2017-05-06 20:36     ` Roel Janssen
2017-05-10 10:44       ` Ricardo Wurmus
2017-05-06 15:35   ` bug#26803: [PATCH 06/36] gnu: Add java-asm Ricardo Wurmus
2017-05-06 20:39     ` Roel Janssen
2017-05-10 13:58       ` Ricardo Wurmus
2017-05-06 15:35   ` bug#26803: [PATCH 07/36] gnu: Add java-cglib Ricardo Wurmus
2017-05-06 20:40     ` Roel Janssen
2017-05-06 20:49       ` Ricardo Wurmus
2017-05-06 15:35   ` bug#26803: [PATCH 08/36] gnu: Add java-objenesis Ricardo Wurmus
2017-05-06 20:41     ` Roel Janssen
2017-05-06 15:35   ` bug#26803: [PATCH 09/36] gnu: Add java-easymock Ricardo Wurmus
2017-05-06 21:28     ` Roel Janssen
2017-05-06 15:35   ` bug#26803: [PATCH 10/36] gnu: Add java-jopt-simple Ricardo Wurmus
2017-05-06 21:31     ` Roel Janssen
2017-05-06 15:35   ` bug#26803: [PATCH 11/36] gnu: java-hamcrest-core: Install all jars without version suffix Ricardo Wurmus
2017-05-06 21:39     ` Roel Janssen
2017-05-10 14:00       ` Ricardo Wurmus
2017-05-06 15:35   ` bug#26803: [PATCH 12/36] gnu: Add java-commons-math3 Ricardo Wurmus
2017-05-06 21:43     ` Roel Janssen
2017-05-10 14:01       ` Ricardo Wurmus
2017-05-06 15:35   ` bug#26803: [PATCH 13/36] gnu: Add java-jmh Ricardo Wurmus
2017-05-07 19:13     ` Roel Janssen
2017-05-06 15:35   ` bug#26803: [PATCH 14/36] gnu: Add java-commons-collections4 Ricardo Wurmus
2017-05-07 19:16     ` Roel Janssen
2017-05-06 15:35   ` bug#26803: [PATCH 15/36] gnu: Add java-commons-io Ricardo Wurmus
2017-05-08 10:41     ` Roel Janssen
2017-05-10 14:10       ` Ricardo Wurmus
2017-05-10 14:24         ` Roel Janssen
2017-05-10 14:34           ` Ricardo Wurmus
2017-05-06 15:35   ` bug#26803: [PATCH 16/36] gnu: Add java-commons-lang Ricardo Wurmus
2017-05-08 10:46     ` Roel Janssen
2017-05-10 14:13       ` Ricardo Wurmus
2017-05-10 14:23         ` Roel Janssen
2017-05-06 15:35   ` bug#26803: [PATCH 17/36] gnu: Add java-commons-lang3 Ricardo Wurmus
2017-05-08 11:20     ` Roel Janssen
2017-05-10 14:23       ` Ricardo Wurmus
2017-05-06 15:35   ` bug#26803: [PATCH 18/36] gnu: Add java-commons-cli Ricardo Wurmus
2017-05-08 14:13     ` Roel Janssen
2017-05-06 15:36   ` bug#26803: [PATCH 19/36] gnu: Add java-commons-codec Ricardo Wurmus
2017-05-10 10:09     ` Roel Janssen
2017-05-10 14:25       ` Ricardo Wurmus
2017-05-06 15:36   ` bug#26803: [PATCH 20/36] gnu: Add java-commons-daemon Ricardo Wurmus
2017-05-10 10:12     ` Roel Janssen
2017-05-10 16:03       ` Ricardo Wurmus
2017-05-06 15:36   ` bug#26803: [PATCH 21/36] gnu: Add java-jmock-1 Ricardo Wurmus
2017-05-10 10:15     ` Roel Janssen
2017-05-10 16:00       ` Ricardo Wurmus
2017-05-06 15:36   ` bug#26803: [PATCH 22/36] gnu: java-hamcrest-core: Declare test target Ricardo Wurmus
2017-05-10 10:15     ` Roel Janssen
2017-05-10 16:04       ` Ricardo Wurmus
2017-05-06 15:36   ` bug#26803: [PATCH 23/36] gnu: Add java-hamcrest-all Ricardo Wurmus
2017-05-10 18:02     ` Roel Janssen
2017-05-06 15:36   ` bug#26803: [PATCH 24/36] gnu: Add java-jsr305 Ricardo Wurmus
2017-05-10 18:04     ` Roel Janssen
2017-05-11  9:27       ` julien lepiller
2017-05-06 15:36   ` bug#26803: [PATCH 25/36] gnu: Add java-guava Ricardo Wurmus
2017-05-10 18:06     ` Roel Janssen
2017-05-10 19:43       ` Ricardo Wurmus
2017-05-11  9:38     ` julien lepiller
2017-05-06 15:36   ` bug#26803: [PATCH 26/36] gnu: Add java-commons-logging-minimal Ricardo Wurmus
2017-05-10 18:09     ` Roel Janssen
2017-05-10 19:46       ` Ricardo Wurmus
2017-05-06 15:36   ` bug#26803: [PATCH 27/36] gnu: Add java-mockito-1 Ricardo Wurmus
2017-05-11  8:13     ` Roel Janssen
2017-05-11  8:22       ` Ricardo Wurmus
2017-05-11  8:57         ` Roel Janssen
2017-05-06 15:36   ` bug#26803: [PATCH 28/36] gnu: Add java-httpcomponents-httpcore Ricardo Wurmus
2017-05-11  8:16     ` Roel Janssen
2017-05-06 15:36   ` bug#26803: [PATCH 29/36] gnu: Add java-httpcomponents-httpcore-nio Ricardo Wurmus
2017-05-11  8:18     ` Roel Janssen
2017-05-06 15:36   ` bug#26803: [PATCH 30/36] gnu: Add java-httpcomponents-httpcore-ab Ricardo Wurmus
2017-05-11  8:30     ` Roel Janssen
2017-05-06 15:36   ` bug#26803: [PATCH 31/36] gnu: Add java-httpcomponents-httpclient Ricardo Wurmus
2017-05-11  8:32     ` Roel Janssen
2017-05-15 19:44       ` Ricardo Wurmus
2017-05-15 21:26         ` Roel Janssen
2017-05-06 15:36   ` bug#26803: [PATCH 32/36] gnu: Add java-httpcomponents-httpmime Ricardo Wurmus
2017-05-11  8:32     ` Roel Janssen
2017-05-06 15:36   ` bug#26803: [PATCH 33/36] gnu: Add java-commons-httpclient Ricardo Wurmus
2017-05-11  8:35     ` Roel Janssen
2017-05-15 19:50       ` Ricardo Wurmus
2017-05-06 15:36   ` bug#26803: [PATCH 34/36] gnu: Add java-commons-net Ricardo Wurmus
2017-05-11  8:40     ` Roel Janssen
2017-05-15 19:53       ` Ricardo Wurmus
2017-05-06 15:36   ` bug#26803: [PATCH 35/36] gnu: Add java-jsch Ricardo Wurmus
2017-05-11  8:41     ` Roel Janssen
2017-05-15 19:54       ` Ricardo Wurmus
2017-05-06 15:36   ` bug#26803: [PATCH 36/36] gnu: Add java-commons-compress Ricardo Wurmus
2017-05-11  8:53     ` Roel Janssen
2017-05-15 19:56       ` Ricardo Wurmus
2017-05-06 20:22   ` bug#26803: [PATCH 01/36] ant-build-system: Allow specifying source directory Roel Janssen
2017-05-07 10:34 ` bug#26803: Java things Hartmut Goebel
2017-05-07 11:47   ` Ricardo Wurmus
2017-05-08  8:18     ` Hartmut Goebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r301k9vv.fsf@gnu.org \
    --to=roel@gnu.org \
    --cc=26803@debbugs.gnu.org \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.