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 D8F88138334 for ; Sun, 3 Nov 2019 10:12:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AEEA7E0829; Sun, 3 Nov 2019 10:12:28 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 8A85FE0829 for ; Sun, 3 Nov 2019 10:12:28 +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 28F3C34C759 for ; Sun, 3 Nov 2019 10:12:27 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A2FDE7F9 for ; Sun, 3 Nov 2019 10:12:25 +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: <1572775874.7f0292efdc6698bd28dc6137660c6145cd357690.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: 7f0292efdc6698bd28dc6137660c6145cd357690 X-VCS-Branch: master Date: Sun, 3 Nov 2019 10:12:25 +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: 312c8e7b-f688-4c06-b2f6-32699862f82f X-Archives-Hash: a32e5b96d94dd24f3b570f1e1db00d12 commit: 7f0292efdc6698bd28dc6137660c6145cd357690 Author: Miroslav Šulc gentoo org> AuthorDate: Sun Nov 3 10:11:14 2019 +0000 Commit: Miroslav Šulc gentoo org> CommitDate: Sun Nov 3 10:11:14 2019 +0000 URL: https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=7f0292ef fixed and reformatted ebuild variables Signed-off-by: Miroslav Šulc gentoo.org> .../gentoo/java/ebuilder/maven/MavenEbuilder.java | 96 ++++++++++++---------- 1 file changed, 52 insertions(+), 44 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 1be72cb..5953815 100644 --- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java +++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java @@ -618,6 +618,12 @@ public class MavenEbuilder { final MavenProject mavenProject, final PrintWriter writer) { writer.println(); + if (!"UTF-8".equals(mavenProject.getSourceEncoding())) { + writer.print("JAVA_ENCODING=\""); + writer.print(mavenProject.getSourceEncoding()); + writer.println("\"\n"); + } + if (!mavenProject.getCommonDependencies().isEmpty() || !mavenProject.getRuntimeDependencies().isEmpty()) { final List dependencies @@ -638,78 +644,80 @@ public class MavenEbuilder { writer.println('"'); } - if (!mavenProject.getTestDependencies().isEmpty()) { - writer.print("JAVA_GENTOO_TEST_CLASSPATH=\""); - writer.print(createClassPath(mavenProject.getTestDependencies())); + writer.print("JAVA_SRC_DIR=\""); + writer.print(replaceWithVars(config.getWorkdir().relativize( + mavenProject.getSourceDirectory()).toString(), config)); + writer.println('"'); + + if (mavenProject.getMainClass() != null) { + writer.print("JAVA_MAIN_CLASS=\""); + writer.print(mavenProject.getMainClass()); writer.println('"'); } + if (mavenProject.hasResources()) { + writer.println("JAVA_RESOURCE_DIRS=("); + + mavenProject.getResourceDirectories().forEach((directory) -> { + writer.print("\t\""); + writer.print(replaceWithVars( + config.getWorkdir().relativize(directory).toString(), + config)); + writer.println('"'); + }); + + writer.println(')'); + } + final String testingFramework = determineTestingFramework(mavenProject); + boolean firstTestVar = true; if (testingFramework != null) { + if (firstTestVar) { + writer.println(); + firstTestVar = false; + } + writer.print("JAVA_TESTING_FRAMEWORK=\""); writer.print(testingFramework); writer.println('"'); } - if (mavenProject.hasResources()) { - writer.print("JAVA_RESOURCE_DIRS=\""); - - boolean first = true; - - for (final Path resources : mavenProject.getResourceDirectories()) { - if (first) { - first = false; - } else { - writer.print(':'); - } - - writer.print(replaceWithVars( - config.getWorkdir().relativize(resources).toString(), - config)); + if (!mavenProject.getTestDependencies().isEmpty()) { + if (firstTestVar) { + writer.println(); + firstTestVar = false; } + writer.print("JAVA_GENTOO_TEST_CLASSPATH=\""); + writer.print(createClassPath(mavenProject.getTestDependencies())); writer.println('"'); } if (mavenProject.hasTests()) { + if (firstTestVar) { + writer.println(); + } + writer.print("JAVA_TEST_SRC_DIR=\""); writer.print(replaceWithVars(config.getWorkdir().relativize( mavenProject.getTestSourceDirectory()).toString(), config)); writer.println('"'); if (mavenProject.hasTestResources()) { - writer.print("JAVA_TEST_RESOURCE_DIRS=\""); - - boolean first = true; - - for (final Path resources : mavenProject. - getTestResourceDirectories()) { - if (first) { - first = false; - } else { - writer.print(':'); - } + writer.println("JAVA_TEST_RESOURCE_DIRS=("); + mavenProject.getTestResourceDirectories(). + forEach((directory) -> { + writer.print("\t\""); writer.print(replaceWithVars(config.getWorkdir(). - relativize(resources).toString(), config)); - } + relativize(directory).toString(), config)); + writer.println('"'); + }); - writer.println('"'); + writer.println(')'); } } - - if (!"UTF-8".equals(mavenProject.getSourceEncoding())) { - writer.print("JAVA_ENCODING=\""); - writer.print(mavenProject.getSourceEncoding()); - writer.println('"'); - } - - if (mavenProject.getMainClass() != null) { - writer.print("JAVA_MAIN_CLASS=\""); - writer.print(mavenProject.getMainClass()); - writer.println('"'); - } } /**