From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 24621138334 for ; Sun, 3 Nov 2019 15:14:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 19E53E0870; Sun, 3 Nov 2019 15:14:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D6890E0870 for ; Sun, 3 Nov 2019 15:14:46 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8FE0C34C53A for ; Sun, 3 Nov 2019 15:14:45 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 999337F9 for ; Sun, 3 Nov 2019 15:14:43 +0000 (UTC) From: "Miroslav Šulc" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Miroslav Šulc" Message-ID: <1572794067.1d76ee8e7d73653f56e228fb3cc30742bfa0abd4.fordfrog@gentoo> Subject: [gentoo-commits] proj/java-ebuilder:master commit in: src/main/java/org/gentoo/java/ebuilder/maven/ X-VCS-Repository: proj/java-ebuilder X-VCS-Files: src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java X-VCS-Directories: src/main/java/org/gentoo/java/ebuilder/maven/ X-VCS-Committer: fordfrog X-VCS-Committer-Name: Miroslav Šulc X-VCS-Revision: 1d76ee8e7d73653f56e228fb3cc30742bfa0abd4 X-VCS-Branch: master Date: Sun, 3 Nov 2019 15:14:43 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 14ffe213-d47f-493a-b09b-8334e8f172af X-Archives-Hash: 6cefaeb1ee38a3aabf9563bc00fca68e commit: 1d76ee8e7d73653f56e228fb3cc30742bfa0abd4 Author: Miroslav Šulc gentoo org> AuthorDate: Sun Nov 3 15:14:27 2019 +0000 Commit: Miroslav Šulc gentoo org> CommitDate: Sun Nov 3 15:14:27 2019 +0000 URL: https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=1d76ee8e fixed test dependencies and reformatted dependencies Signed-off-by: Miroslav Šulc gentoo.org> .../gentoo/java/ebuilder/maven/MavenEbuilder.java | 132 ++++++++++----------- 1 file changed, 62 insertions(+), 70 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 61f97f2..5ddfd9b 100644 --- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java +++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java @@ -324,125 +324,117 @@ public class MavenEbuilder { mavenProjects, "compile"); final List runtimeDependencies = mergeSystemDependencies( mavenProjects, "runtime"); - boolean hasCDepend = !commonDependencies.isEmpty() - || !testDependencies.isEmpty(); + final boolean hasCDepend = !commonDependencies.isEmpty(); + + writer.println(); if (hasCDepend) { - writer.println(); writer.println("# Common dependencies"); - for (final MavenProject mavenProject : mavenProjects) { - if (mavenProject.getCommonDependencies().isEmpty() - && mavenProject.getTestDependencies().isEmpty()) { - continue; - } - - if (!mavenProject.getCommonDependencies().isEmpty()) { - writeDependenciesInfo(config, writer, - mavenProject.getPomFile(), - mavenProject.getCommonDependencies(), null); - } - - if (mavenProject.getTargetVersion() != null) { - writeDependenciesInfo(config, writer, - mavenProject.getPomFile(), - mavenProject.getTestDependencies(), "test?"); - } - - hasCDepend = true; - } + mavenProjects.stream(). + filter((mavenProject) + -> !mavenProject.getCommonDependencies().isEmpty()). + forEach((mavenProject) -> { + writeDependenciesInfo(config, writer, + mavenProject.getPomFile(), + mavenProject.getCommonDependencies(), null); + }); writer.println("\nCDEPEND=\""); - if (!commonDependencies.isEmpty()) { - commonDependencies.stream().forEach((dependency) -> { - writer.print('\t'); - writer.println(dependency); - }); - } - - if (!testDependencies.isEmpty()) { - writer.println("\ttest? ("); - - testDependencies.stream().forEach((dependency) -> { - writer.print("\t\t"); - writer.println(dependency); - }); - - writer.println("\t)"); - } + commonDependencies.stream().forEach((dependency) -> { + writer.print('\t'); + writer.println(dependency); + }); writer.println('"'); } - if (!compileDependencies.isEmpty()) { + writer.println(); + + if (!compileDependencies.isEmpty() + || !testDependencies.isEmpty()) { writer.println("# Compile dependencies"); - mavenProjects.stream().filter((mavenProject) -> - (!mavenProject.getCompileDependencies().isEmpty())) + mavenProjects.stream(). + filter((mavenProject) -> + !mavenProject.getCompileDependencies().isEmpty() + || !mavenProject.getTestDependencies().isEmpty()) .forEach((mavenProject) -> { - writeDependenciesInfo(config, writer, - mavenProject.getPomFile(), - mavenProject.getCompileDependencies(), null); + if (!mavenProject.getCompileDependencies().isEmpty()) { + writeDependenciesInfo(config, writer, + mavenProject.getPomFile(), + mavenProject.getCompileDependencies(), + null); + } + + if (!mavenProject.getTestDependencies().isEmpty()) { + writeDependenciesInfo(config, writer, + mavenProject.getPomFile(), + mavenProject.getTestDependencies(), + "test?"); + } }); - } else { - writer.println(); } - writer.print("DEPEND=\""); + writer.print("\nDEPEND=\"\n\t=virtual/jdk-"); + writer.print(getMinSourceVersion( + mavenProjects, config.getForceMinJavaVersion())); + writer.println(":*"); if (hasCDepend) { - writer.print("${CDEPEND}"); + writer.println("\t${CDEPEND}"); } - writer.println(); - writer.print("\t>=virtual/jdk-"); - writer.print(getMinSourceVersion( - mavenProjects, config.getForceMinJavaVersion())); - writer.print(":*"); - if (config.getDownloadUri() != null && config.getDownloadUri(). toString().matches("^.*?\\.(jar|zip)$")) { - writer.println(); - writer.print("\tapp-arch/unzip"); + writer.println("\tapp-arch/unzip"); } if (!compileDependencies.isEmpty()) { compileDependencies.stream().forEach((dependency) -> { - writer.println(); writer.print('\t'); writer.println(dependency); }); } + if (!testDependencies.isEmpty()) { + writer.println("\ttest? ("); + + testDependencies.stream().forEach((dependency) -> { + writer.print("\t\t"); + writer.println(dependency); + }); + + writer.println("\t)"); + } + writer.println('"'); + writer.println(); + if (!runtimeDependencies.isEmpty()) { writer.println("# Runtime dependencies"); - mavenProjects.stream().filter((mavenProject) -> (!mavenProject. - getRuntimeDependencies().isEmpty())) + mavenProjects.stream(). + filter((mavenProject) + -> !mavenProject.getRuntimeDependencies().isEmpty()) .forEach((mavenProject) -> { writeDependenciesInfo(config, writer, mavenProject.getPomFile(), mavenProject.getRuntimeDependencies(), null); }); - } else { - writer.println(); } - writer.print("RDEPEND=\""); + writer.print("RDEPEND=\"\n\t>=virtual/jre-"); + writer.print(getMinTargetVersion( + mavenProjects, config.getForceMinJavaVersion())); + writer.println(":*"); if (hasCDepend) { writer.print("${CDEPEND}"); } - writer.println(); - writer.print("\t>=virtual/jre-"); - writer.print(getMinTargetVersion( - mavenProjects, config.getForceMinJavaVersion())); - writer.print(":*"); - if (!runtimeDependencies.isEmpty()) { runtimeDependencies.stream().forEach((dependency) -> { writer.println();