Subject: Re: [bug#41360] [PATCH 03/12] gnu: java-openjfx-graphics: Implement a complete compilation.

From: Ludovic Courtès <[email-masked]>
Date: Sat, 23 May 2020 16:04:29 +0200

Alexey Abramov <[email-masked]> skribis:

> ---
>  gnu/packages/java.scm | 643 +++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 635 insertions(+), 8 deletions(-)

Please add a commit log.

> +              (java-aux-class?
> +               (lambda (class)
> +                 (string-match "\\$[0-9]+.class" class)))

Probably “\\.class” instead of “.class”?

> +           (add-after 'chdir-to-a-module-directory 'compile-prism-compilers
> +             (lambda _

Maybe add a comment explaining why this phase is necessary.

> +               (let ((prism-compilers-classes "build/classes/jsl-compilers/prism")
> +                     (prism-src "src/main/jsl-prism/"))
> +                 (mkdir-p prism-compilers-classes)
> +                 (apply invoke `("javac"
> +                                 "-d" ,prism-compilers-classes
> +                                 ,@javac/h-flags
> +                                 ,@(find-files prism-src "\\.java"))))

This can be shortened as:

  (apply invoke "javac" "-d" prism-compilers-classes
         (append javac/h-flags (find-files prism-src "\\.java")))

These two comments apply to the other phases too.

More generally, why are there so many phases?  How do people normally
build it?  Gradle?

Would it make sense to factorize helpers in a new (gnu build
java-openjfx) module or similar?

Thanks,
Ludo’.