From patchwork Wed Nov 1 12:57:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 55791 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5C90727BBE9; Wed, 1 Nov 2023 12:58:42 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 491E427BBE2 for ; Wed, 1 Nov 2023 12:58:40 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyAnq-0004Nv-5b; Wed, 01 Nov 2023 08:58:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyAnk-0004N6-IC for guix-patches@gnu.org; Wed, 01 Nov 2023 08:58:28 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyAnk-0008Lh-7L for guix-patches@gnu.org; Wed, 01 Nov 2023 08:58:28 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qyAoI-0007Uk-GO; Wed, 01 Nov 2023 08:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66879] [PATCH 2/5] guix: ant: Optional build with java modules. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: bjoern.hoefling@bjoernhoefling.de, julien@lepiller.eu, guix-patches@gnu.org Resent-Date: Wed, 01 Nov 2023 12:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66879 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66879@debbugs.gnu.org Cc: =?utf-8?b?QmrDtnJuIEjDtmZsaW5n?= , Julien Lepiller X-Debbugs-Original-Xcc: =?utf-8?b?QmrDtnJuIEjDtmZsaW5n?= , Julien Lepiller Received: via spool by 66879-submit@debbugs.gnu.org id=B66879.169884350428720 (code B ref 66879); Wed, 01 Nov 2023 12:59:02 +0000 Received: (at 66879) by debbugs.gnu.org; 1 Nov 2023 12:58:24 +0000 Received: from localhost ([127.0.0.1]:50150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyAnf-0007T2-VV for submit@debbugs.gnu.org; Wed, 01 Nov 2023 08:58:24 -0400 Received: from lepiller.eu ([89.234.186.109]:57970 helo=localhost) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyAne-0007Sl-00 for 66879@debbugs.gnu.org; Wed, 01 Nov 2023 08:58:22 -0400 Received: from localhost (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id b7bfdf51 for <66879@debbugs.gnu.org>; Wed, 1 Nov 2023 12:57:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=4z51zshDp9ll2plgeopuz24ND meOJlB72NJ5nPE43oE=; b=NCXf8EtmEgRDRhHPRoZAv6guvpejaq6Aj3oHv3I+6 UmFM3wgQkOAQN+jI96jmzKXoSM8/evuExNR3s+s+TDP1Za/0YEG6wB8ZqgfpY5Dv XdmtfNXFc4moPrx+1Zd7n2WPKbErp1MMiLT8l4EnLbH0SvVK3i5Th+fxgZCfFEKZ mbevclqgHvRsPz3jTGOZFVwrDNwRNBo/S0IrKhl40OQoAPI8RcijBIt1S8KZF54h cwn04tO2rFse15jEaxggQAYkqF1M5+ho67u+ZJKL3c/xafF3Jb076LG9N36SUKfg eh7REaXTxcjrfQNlx5STQMqO99IjevUcdi9F0dM6QQJwg== Received: by localhost (OpenSMTPD) with ESMTPSA id 3f442090 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <66879@debbugs.gnu.org>; Wed, 1 Nov 2023 12:57:45 +0000 (UTC) From: Julien Lepiller Date: Wed, 1 Nov 2023 13:57:27 +0100 Message-ID: <1b6bf9340bf05c1c00c18bf69748950c4c9f95b5.1698843445.git.julien@lepiller.eu> X-Mailer: git-send-email 2.41.0 In-Reply-To: <1ba00a1093d068dafaef44959ee55a0999695d90.1698843445.git.julien@lepiller.eu> References: <1ba00a1093d068dafaef44959ee55a0999695d90.1698843445.git.julien@lepiller.eu> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Modules were introduced in Java 9 and are not supported by the default icedtea compiler, so this feature is disabled by default. * guix/build-system/ant.scm (ant-build): Add use-java-modules? parameter. * guix/build/ant-build-system.scm (default-build.xml) (configure): Use it. Change-Id: I3b99238e4cd262332fa5c818be1af5477c7374fd --- guix/build-system/ant.scm | 2 ++ guix/build/ant-build-system.scm | 31 +++++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/guix/build-system/ant.scm b/guix/build-system/ant.scm index e191fd3c99..84bf951fab 100644 --- a/guix/build-system/ant.scm +++ b/guix/build-system/ant.scm @@ -103,6 +103,7 @@ (define* (ant-build name inputs (build-target "jar") (jar-name #f) (main-class #f) + (use-java-modules? #f) (test-include (list "**/*Test.java")) (test-exclude (list "**/Abstract*.java")) (source-dir "src") @@ -131,6 +132,7 @@ (define* (ant-build name inputs #:build-target #$build-target #:jar-name #$jar-name #:main-class #$main-class + #:use-java-modules? #$use-java-modules? #:test-include (list #$@test-include) #:test-exclude (list #$@test-exclude) #:source-dir #$source-dir diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm index d29912bf59..ced34177f4 100644 --- a/guix/build/ant-build-system.scm +++ b/guix/build/ant-build-system.scm @@ -37,6 +37,7 @@ (define-module (guix build ant-build-system) (define* (default-build.xml jar-name prefix #:optional (source-dir ".") (test-dir "./test") (main-class #f) + (use-java-modules? #f) (test-include '("**/*Test.java")) (test-exclude '("**/Abstract*Test.java"))) "Create a simple build.xml with standard targets for Ant." @@ -65,7 +66,7 @@ (define* (default-build.xml jar-name prefix #:optional (value "first"))) (property (@ (environment "env"))) (path (@ (id "classpath")) - (pathelement (@ (location "${env.CLASSPATH}")))) + (pathelement (@ (path "${env.CLASSPATH}")))) (target (@ (name "manifest")) (mkdir (@ (dir "${manifest.dir}"))) @@ -79,18 +80,30 @@ (define* (default-build.xml jar-name prefix #:optional (mkdir (@ (dir "${classes.dir}"))) (javac (@ (includeantruntime "false") (srcdir ,source-dir) - (destdir "${classes.dir}") - (classpath (@ (refid "classpath")))))) + (destdir "${classes.dir}")) + ,(if use-java-modules? + `((modulepath (@ (refid "classpath")))) + '()) + (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}")))))) + ,(if use-java-modules? + `((classpath + (pathelement + (@ (path "${env.CLASSPATH}"))) + (pathelement + (@ (location "${classes.dir}"))) + (pathelement + (@ (location "${test.classes.dir}"))))) + '()) + (classpath + (pathelement (@ (path "${env.CLASSPATH}"))) + (pathelement (@ (location "${classes.dir}"))) + (pathelement (@ (location "${test.classes.dir}")))))) (target (@ (name "check") (depends "compile-tests")) @@ -156,13 +169,15 @@ (define* (configure #:key inputs outputs (jar-name #f) (source-dir "src") (test-dir "src/test") (main-class #f) + (use-java-modules? #f) (test-include '("**/*Test.java")) (test-exclude '("**/Abstract*.java")) #:allow-other-keys) (when jar-name (default-build.xml jar-name (string-append (assoc-ref outputs "out") "/share/java") - source-dir test-dir main-class test-include test-exclude)) + source-dir test-dir main-class use-java-modules? + test-include test-exclude)) (setenv "JAVA_HOME" (assoc-ref inputs "jdk")) (setenv "CLASSPATH" (generate-classpath inputs)) #t)