From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id QLAfHYBLQmXWXwEAG6o9tA:P1 (envelope-from ) for ; Wed, 01 Nov 2023 13:58:40 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id QLAfHYBLQmXWXwEAG6o9tA (envelope-from ) for ; Wed, 01 Nov 2023 13:58:40 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 33BE7552A7 for ; Wed, 1 Nov 2023 13:58:40 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=NCXf8Etm; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1698843520; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=+tRBgQOQgkasEzH1xMZBDBQrtY0rHWNv/IRjo6cglsI=; b=fyFWP41StIbP9UvwdkZnvoFIV7N3rt52cjWBHamzIlObUzzhzJmh6xU/WGB3vv9yW1p8Sl fR3JM3pQdcAaubKjdGvwtsIyNo3h8g41ux/tm1C7Nq7QNbwOvVsNEwOqzLf8NUFvYK0UjZ fK/+ip95oVQSj7QdM/en2MoNPDGHxXOEGSRJuN8ZrXWrvKG6zyoziN4gsx6EmIZhQTWVEU 8+WO7W95EqHuf4KzU7JQKZqAOoDD4s5kYj10JEes6FmNXFoF2iTZ6QThcv2OletJ83P8Zd Ug+a/KhIcE5espj/bSqBMMxMyW9WIOL0F+cNP7pnXUXqYPJ5sL0G0Em4ZoQjlg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=NCXf8Etm; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1698843520; a=rsa-sha256; cv=none; b=TVcUedMwBTLKQ11orlHQ92Md2Pr+M09B1HnK+a/h5HZB6sYDMzvuk0AuDVJBuBoXqVIhVc q+mE6WqqXVU6WHNPoRzi0gc753a4BEUDK2TY1wqSEYP+7cr4LUL/QT6dp6JdTRbnZpxuFC 5pARnbyMokQG5sCT6bPHwFrLUvisTVTivRh2gZvGqjEotIKll19atu+DEnmgJOsjxI5NQZ Eb8jWIY0JhHJCTEopuuigcVMji770yf4aYSpyvTYZl/VTJVvXWFuBQQRQ8hLhIKY0duwbv IVd0chZz53wM2VcxWaEwfGMSrIDIOM3seDluregmS+bu/kfii1NmM7cNeGIiCA== 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?Q?Bj=C3=B6rn_?= =?UTF-8?Q?H=C3=B6fling?= , Julien Lepiller X-Debbugs-Original-Xcc: =?UTF-8?Q?Bj=C3=B6rn_?= =?UTF-8?Q?H=C3=B6fling?= , 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 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 5.89 X-Spam-Score: 5.89 X-Migadu-Queue-Id: 33BE7552A7 X-Migadu-Scanner: mx13.migadu.com X-TUID: 7jlg6ecItnCn 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) -- 2.41.0