aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzongyu <zzy2529420793@gmail.com>2020-06-18 15:11:21 +0800
committerzongyu <zzy2529420793@gmail.com>2020-07-06 17:48:27 +0800
commit59131006cb675af7b176225af7a670e2803649d8 (patch)
tree10aae50accf1cfd3847024a314ecb282f0e195ff
parentcompare maven version and required maven version correctly (diff)
downloadjava-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.java11
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);
}