diff options
author | zongyu <zzy2529420793@gmail.com> | 2020-06-18 15:11:21 +0800 |
---|---|---|
committer | zongyu <zzy2529420793@gmail.com> | 2020-07-06 17:48:27 +0800 |
commit | 59131006cb675af7b176225af7a670e2803649d8 (patch) | |
tree | 10aae50accf1cfd3847024a314ecb282f0e195ff | |
parent | compare maven version and required maven version correctly (diff) | |
download | java-ebuilder-59131006cb675af7b176225af7a670e2803649d8.tar.gz java-ebuilder-59131006cb675af7b176225af7a670e2803649d8.tar.bz2 java-ebuilder-59131006cb675af7b176225af7a670e2803649d8.zip |
initial code to support MAVEN_PROVIDE
Signed-off-by: zongyu <zzy2529420793@gmail.com>
-rw-r--r-- | src/main/java/org/gentoo/java/ebuilder/portage/PortageParser.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/org/gentoo/java/ebuilder/portage/PortageParser.java b/src/main/java/org/gentoo/java/ebuilder/portage/PortageParser.java index 9da0fb7..a222956 100644 --- a/src/main/java/org/gentoo/java/ebuilder/portage/PortageParser.java +++ b/src/main/java/org/gentoo/java/ebuilder/portage/PortageParser.java @@ -258,6 +258,7 @@ public class PortageParser { String groupId = null; String artifactId = null; String mavenVersion = null; + String[] mavenProvide = null; try (final BufferedReader reader = new BufferedReader( new InputStreamReader(Files.newInputStream(ebuild.toPath(), @@ -298,6 +299,9 @@ public class PortageParser { } else if (line.startsWith("MAVEN_ID=")) { mavenId = line.substring("MAVEN_ID=".length()). replace("\"", ""); + } else if (line.startsWith("MAVEN_PROVIDE=")) { + mavenProvide = line.substring("MAVEN_PROVIDE=".length()). + replace("\"", "").split(" "); } } @@ -354,6 +358,13 @@ public class PortageParser { cacheItems.add(new CacheItem(category, pkg, version, slot, useFlag, groupId, artifactId, mavenVersion, eclasses)); + if (mavenP != null) { + for (String providedId: mavenProvide) { + parts = mavenProvide.split(":") + cacheItems.add(new CacheItem(category, pkg, version, slot, useFlag, + parts[0], parts[1], parts[2], eclasses)); + } + } countEclasses(eclasses); } |