commit:     ab5d26a990de18f3ec1f2166f39da7971c910e2b
Author:     zongyu <zzy2529420793 <AT> gmail <DOT> com>
AuthorDate: Fri Aug  7 02:48:43 2020 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Fri Aug  7 03:14:36 2020 +0000
URL:        https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=ab5d26a9

minor bugfixes:

1. ebuild for jsch-agent-proxy can be generated by hand, remove the related 
lines
2. make java-pkg-binjar.eclass record dependencies of the pkg
3. fix typo: juniper -> jupiter
4. move the pre-process of maven's license name to MavenLicense

Signed-off-by: zongyu <zzy2529420793 <AT> gmail.com>

 maven/eclass/java-pkg-binjar.eclass                            |  6 +++++-
 maven/eclass/java-pkg-maven.eclass                             |  2 +-
 .../java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java     | 10 +++++-----
 .../java/org/gentoo/java/ebuilder/maven/MavenLicenses.java     |  6 ++++--
 src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java  | 10 +---------
 5 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/maven/eclass/java-pkg-binjar.eclass 
b/maven/eclass/java-pkg-binjar.eclass
index 79947e7..5406455 100644
--- a/maven/eclass/java-pkg-binjar.eclass
+++ b/maven/eclass/java-pkg-binjar.eclass
@@ -27,4 +27,8 @@ java-pkg-binjar_src_unpack() {
 # @FUNCTION: java-pkg-simple_src_compile
 # @DESCRIPTION:
 # Do nothing as we are doing binary install.
-java-pkg-binjar_src_compile() { :; }
+java-pkg-binjar_src_compile() {
+       for dependency in ${JAVA_GENTOO_CLASSPATH//,/ }; do
+               java-pkg_record-jar_ ${dependency}
+       done
+}

diff --git a/maven/eclass/java-pkg-maven.eclass 
b/maven/eclass/java-pkg-maven.eclass
index fb41bb2..68f6712 100644
--- a/maven/eclass/java-pkg-maven.eclass
+++ b/maven/eclass/java-pkg-maven.eclass
@@ -28,7 +28,7 @@ EXPORT_FUNCTIONS src_unpack
 # @DESCRIPTION:
 # A directory relative to ${S} which contains the resources of the
 # application. Give it a default value to handle src_unpack.
-: ${JAVA_RESOURCE_DIRS:=src/main/resources}
+: ${JAVA_RESOURCE_DIRS:=resources}
 
 # @ECLASS-VARIABLE: JAVA_RESOURCE_DIRS
 # @DEFAULT_UNSET

diff --git a/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java 
b/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java
index e73a1fd..bfedb68 100644
--- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java
+++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java
@@ -223,15 +223,15 @@ public class MavenEbuilder {
             return "testng";
         } else if ("org.junit.jupiter".equals(dependency.getGroupId())
                 && "junit-jupiter-engine".equals(dependency.getArtifactId())) {
-            // java-pkg-simple do not support now
-            return "junit-juniper";
+            // java-pkg-simple does not support this framework
+            return "junit-jupiter";
         } else if ("org.junit.vintage".equals(dependency.getGroupId())
                 && "junit-vintage-engine".equals(dependency.getArtifactId())) {
-            // java-pkg-simple do not support now
+            // java-pkg-simple does not support this framework
             return "junit-vintage";
         } else if ("io.cucumber".equals(dependency.getGroupId())
                 && "cucumber-junit".equals(dependency.getArtifactId())) {
-            // java-pkg-simple do not support now
+            // java-pkg-simple does not support this framework
             return "cucumber";
         } else {
             return null;
@@ -582,7 +582,7 @@ public class MavenEbuilder {
                 writer.println(dependency);
             });
 
-            // TODO: check whether amd64 is inside KEYWORDS
+            // TODO: is it necessary to check whether amd64 is inside KEYWORDS?
             if (config.hasBinjarUri()) {
                 writer.println(dependencyForPkgdiff);
             }

diff --git a/src/main/java/org/gentoo/java/ebuilder/maven/MavenLicenses.java 
b/src/main/java/org/gentoo/java/ebuilder/maven/MavenLicenses.java
index f2f4f9a..5309353 100644
--- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenLicenses.java
+++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenLicenses.java
@@ -34,7 +34,7 @@ public class MavenLicenses {
             try {
                 mapProperty.load(
                         this.getClass().getResourceAsStream(
-                        licenseMapFile));
+                                licenseMapFile));
             } catch (final IOException ex) {
                 throw new RuntimeException(
                         "Failed to read license map from resource", ex);
@@ -52,7 +52,9 @@ public class MavenLicenses {
          */
         public String getEquivalentLicense(String licenseName) {
             final String portageLicense =
-                    licenseMap.get(licenseName.toLowerCase());
+                    licenseMap.get(licenseName.trim().
+                                    replaceAll("[\n ]+", " ").
+                                    toLowerCase());
 
             if (portageLicense == null) {
                 return "!!!equivalentPortageLicenseName-not-found!!!";

diff --git a/src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java 
b/src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java
index 73acd6e..4630350 100644
--- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java
+++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java
@@ -544,12 +544,6 @@ public class MavenParser {
                 switch (reader.getLocalName()) {
                     case "artifactId":
                         artifactId = reader.getElementText();
-
-                        /* jsch.agentproxy is an empty artifact. */
-                        // TODO: this should go to a config file to ignore 
some artifacts
-                        if (artifactId.equals("jsch.agentproxy")) {
-                            return;
-                        }
                         break;
                     case "groupId":
                         groupId = reader.getElementText();
@@ -632,9 +626,7 @@ public class MavenParser {
                     case "name":
                         mavenProject.addLicense(
                                 mavenLicenses.getEquivalentLicense(
-                                reader.getElementText().
-                                        trim().
-                                        replaceAll("[\n ]+", " ")));
+                                reader.getElementText()));
                         break;
                     default:
                         consumeElement(reader);

Reply via email to