[PATCH] gnu: Add java-argparse4j.

  • Done
  • quality assurance status badge
Details
2 participants
  • Julien Lepiller
  • Artyom V. Poptsov
Owner
unassigned
Submitted by
Artyom V. Poptsov
Severity
normal

Debbugs page

Artyom V. Poptsov wrote 2 years ago
(address . guix-patches@gnu.org)
87czbsob4l.fsf@gmail.com
Hello,

this patch adds "argparse4j".
From d4f3e93b9fd322dfc9c71d7251cdf8c8b838a6f5 Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Sun, 18 Sep 2022 20:14:28 +0300
Subject: [PATCH] gnu: Add java-argparse4j.

* gnu/packages/java.scm (java-argparse4j): New variable.
---
gnu/packages/java.scm | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Toggle diff (51 lines)
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index c25a330c2a..2afc6f89ca 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -13965,6 +13965,44 @@ (define-public java-args4j
parse command line options/arguments in your CUI application.")
(license license:expat)))
+(define-public java-argparse4j
+ (package
+ (name "java-argparse4j")
+ (version "0.9.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/argparse4j/argparse4j")
+ (commit (string-append "argparse4j-" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1i0j3zs1ln48n0g8a90vqbv6528mcswhzys6252yp0c8w1ai64fb"))))
+ (build-system ant-build-system)
+ (arguments
+ (list #:jar-name "java-argparse4j.jar"
+ #:source-dir "main/src/main/"
+ #:test-dir "main/src/test/"
+ #:jdk openjdk11
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'copy-resources
+ (lambda _
+ ;; XXX: argparse4j expects input files for argument parser
+ ;; tests to be in "target" diretory.
+ (copy-recursively "main/src/test/resources"
+ "target/test-classes")
+ (copy-recursively "main/src/main/resources"
+ "build/classes")))
+ (replace 'install
+ (install-from-pom "pom.xml")))))
+ (inputs (list maven-enforcer-plugin))
+ (home-page "https://argparse4j.github.io/")
+ (synopsis "Java command-line argument parser library")
+ (description "Argparse4j is a command line argument parser library for
+Java based on Python's @code{argparse} module.")
+ (license license:expat)))
+
(define-public java-metadata-extractor
(package
(name "java-metadata-extractor")
--
2.34.1
Thanks,

- Artyom

References:
1. Java port of Python's famous argparse command-line argument parser.

--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQFNBAEBCgA3FiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmMnUqoZHHBvcHRzb3Yu
YXJ0eW9tQGdtYWlsLmNvbQAKCRDpxaLZCJigL4RZB/9M7rHcvrXRh3Pt898cXRb+
tFlw4gwQ9qJVghRkkdeGqa/zqQb2fiZWRhpm/9Yp7LG22abjmOZrKby5vxsQJVfa
f0QVdC3DDPoDrgSx6mhn91PpiQsXOQJoOg7uTxNocSjBXlUwKiWzfpsLhc6G7YbR
qdFn0Nhmv5+B7d7trpDPkC9ZkVr+e/VW3Sfsbs/LwSTZUKclF3ESUPpBUblBjgAA
g6mEV4MKHCT5Io9qs6pYtO01GgZ3BpFrJeHHqbv52IDPY8CroAr7/4HpjhNTvbYh
Q5HLKyUjL3G4vMCrWULq8xvxszPAlX1ibz4mas38uGNq42oy53fr7ctWEfHnMio0
=/Ej+
-----END PGP SIGNATURE-----

Julien Lepiller wrote 2 years ago
1D297848-AC16-4043-A64C-C2CBA3D23F16@lepiller.eu
This looks good from a distance, but I'm not sure you need maven-enforcer-plugin. Since you're using the ant-build-system, I don't think the plugin has a chance to run?

Le 18 septembre 2022 19:17:30 GMT+02:00, "Artyom V. Poptsov" <poptsov.artyom@gmail.com> a écrit :
Toggle quote (3 lines)
>Hello,
>
>this patch adds "argparse4j".
Attachment: file
Artyom V. Poptsov wrote 2 years ago
(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 57913@debbugs.gnu.org)
878rmgo72b.fsf@gmail.com
Hello Julien,

thank you for the patch review.

Toggle quote (4 lines)
> This looks good from a distance, but I'm not sure you need
> maven-enforcer-plugin. Since you're using the ant-build-system, I
> don't think the plugin has a chance to run?

Good catch. It seems that "java-argparse4j" builds fine w/o
"maven-enforcer-plugin". I removed this dependency and added
"java-junit" instead as it is required for the tests.
From c96118bb654a6120614c363b9ff3e37ac9162b06 Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Sun, 18 Sep 2022 20:14:28 +0300
Subject: [PATCH] gnu: Add java-argparse4j.

* gnu/packages/java.scm (java-argparse4j): New variable.
---
gnu/packages/java.scm | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)

Toggle diff (48 lines)
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index c25a330c2a..e4814d1acb 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -13965,6 +13965,41 @@ (define-public java-args4j
parse command line options/arguments in your CUI application.")
(license license:expat)))
+(define-public java-argparse4j
+ (package
+ (name "java-argparse4j")
+ (version "0.9.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/argparse4j/argparse4j")
+ (commit (string-append "argparse4j-" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1i0j3zs1ln48n0g8a90vqbv6528mcswhzys6252yp0c8w1ai64fb"))))
+ (build-system ant-build-system)
+ (arguments
+ (list #:jar-name "java-argparse4j.jar"
+ #:source-dir "main/src/main/"
+ #:test-dir "main/src/test/"
+ #:jdk openjdk11
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'copy-resources
+ (lambda _
+ (copy-recursively "main/src/test/resources"
+ "target/test-classes")
+ (copy-recursively "main/src/main/resources"
+ "build/classes")))
+ (replace 'install
+ (install-from-pom "pom.xml")))))
+ (inputs (list java-junit))
+ (home-page "https://argparse4j.github.io/")
+ (synopsis "Java command-line argument parser library")
+ (description "Argparse4j is a command line argument parser library for
+Java based on Python's @code{argparse} module.")
+ (license license:expat)))
+
(define-public java-metadata-extractor
(package
(name "java-metadata-extractor")
--
2.34.1
- Artyom

--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQFNBAEBCgA3FiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmMnZzwZHHBvcHRzb3Yu
YXJ0eW9tQGdtYWlsLmNvbQAKCRDpxaLZCJigL3IFCACONr/ZrzjbHLv/3vekUo+N
fLKa3+NOHPDjVToCxEhomkfBzRpawEquJ6bzK+7FHpUqSMVX+SPnRFlhhu4wtamI
6KgTJ5WrZUMq1GM3FN4phVSFg7edxBL77l7pzBUnZR0v+HNL2Z0fBAwODZux9gNg
fUQJXksvx5GyCEP0nt2FuMpd2TG5hA4RZN3TJ5JAtay/Bhj8YlQr+PM2E1jyDrXb
w6RlL9D1ltpm0m33Fz/sApehwZSwS6qXtMhnhMlADMEad9xSH2ydudnLHzM1ywj/
cOCJYtmEethL3t2KLUR2OU0OCW3y4Rc6kLmqNgXRm9okzfKttPodxoLzf4qgk+Wh
=4vss
-----END PGP SIGNATURE-----

Julien Lepiller wrote 2 years ago
(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)(address . 57913-done@debbugs.gnu.org)
20220919155249.45fd9867@sybil.lepiller.eu
Le Sun, 18 Sep 2022 21:45:16 +0300,
"Artyom V. Poptsov" <poptsov.artyom@gmail.com> a écrit :

Toggle quote (12 lines)
> Hello Julien,
>
> thank you for the patch review.
>
> > This looks good from a distance, but I'm not sure you need
> > maven-enforcer-plugin. Since you're using the ant-build-system, I
> > don't think the plugin has a chance to run?
>
> Good catch. It seems that "java-argparse4j" builds fine w/o
> "maven-enforcer-plugin". I removed this dependency and added
> "java-junit" instead as it is required for the tests.

Thanks for the patch, pushed to master as
72fe3c0a35f04a6616c17228953a20861ce9b690.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 57913@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 57913
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help