diff options
-rw-r--r-- | src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java | 3 | ||||
-rw-r--r-- | src/main/java/org/gentoo/java/ebuilder/maven/MavenProject.java | 31 |
2 files changed, 34 insertions, 0 deletions
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 b16a64e..c1e84d1 100644 --- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java +++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java @@ -749,6 +749,7 @@ public class MavenEbuilder { // JAVA_CLASSPATH_EXTRA // JAVA_TEST_GENTOO_CLASSPATH // JAVA_ENCODING (unless it differs in projects) + // JAVA_NEED_TOOLS // Compile (jars, doc): // JAVA_SRC_DIR // JAVA_RESOURCE_DIRS @@ -878,6 +879,8 @@ public class MavenEbuilder { writer.println('"'); } + writer.print(mavenProject.getExtraJars(config.getStdoutWriter())); + writer.print("JAVA_SRC_DIR=\""); writer.print(replaceWithVars(config.getWorkdir().relativize( mavenProject.getSourceDirectory()).toString(), config)); diff --git a/src/main/java/org/gentoo/java/ebuilder/maven/MavenProject.java b/src/main/java/org/gentoo/java/ebuilder/maven/MavenProject.java index 794f992..b7553b0 100644 --- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenProject.java +++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenProject.java @@ -424,6 +424,37 @@ public class MavenProject { } /** + * deal with scope == "system" dependencies + * + * @return lines of ebuild variables + */ + @SuppressWarnings("unchecked") + public String getExtraJars(final PrintWriter writer) { + String ret = ""; + List<MavenDependency> systemDependencies = getDependencies(new String[]{"system"}); + + for (final MavenDependency dependency : systemDependencies) { + switch (dependency.getGroupId()) { + case "com.sun": + switch (dependency.getArtifactId()) { + case "tools": + ret += "JAVA_NEEDS_TOOLS=1\n"; + break; + default: + writer.println("Equivalent variable for " + + dependency.getArtifactId() + " not found."); + } + break; + default: + writer.println("Equivalent variable for " + + dependency.getGroupId() + " not found."); + } + } + + return ret; + } + + /** * Getter for {@link #targetVersion}. * * @return {@link #targetVersion} |