[gentoo-commits] proj/java-ebuilder:master commit in: src/main/resources/, src/main/java/org/gentoo/java/ebuilder/, ...
commit: 3012503417562f24f1479c10bde1b86da1917817 Author: zongyu gmail com> AuthorDate: Thu Aug 20 10:50:38 2020 + Commit: Miroslav Šulc gentoo org> CommitDate: Thu Aug 20 14:04:15 2020 + URL:https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=30125034 accept multiple --portage-trees while generating cache Signed-off-by: zongyu gmail.com> src/main/java/org/gentoo/java/ebuilder/Config.java| 10 +- src/main/java/org/gentoo/java/ebuilder/Main.java | 19 +++ .../gentoo/java/ebuilder/portage/PortageParser.java | 8 +--- src/main/resources/usage.txt | 4 ++-- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/gentoo/java/ebuilder/Config.java b/src/main/java/org/gentoo/java/ebuilder/Config.java index 4502ab3..e9396ca 100644 --- a/src/main/java/org/gentoo/java/ebuilder/Config.java +++ b/src/main/java/org/gentoo/java/ebuilder/Config.java @@ -88,7 +88,7 @@ public class Config { /** * Path to portage tree. */ -private Path portageTree; +private SortedSet portageTree = new TreeSet<>(); /** * Whether ebuild cache should be refreshed. */ @@ -365,17 +365,17 @@ public class Config { * * @return {@link #portageTree} */ -public Path getPortageTree() { +public SortedSet getPortageTree() { return portageTree; } /** - * Setter for {@link #portageTree}. + * Add portageTrees to {@link #portageTree}. * * @param portageTree {@link #portageTree} */ -public void setPortageTree(final Path portageTree) { -this.portageTree = portageTree; +public void addPortageTree(final Path portageTree) { +this.portageTree.add(portageTree); } /** diff --git a/src/main/java/org/gentoo/java/ebuilder/Main.java b/src/main/java/org/gentoo/java/ebuilder/Main.java index 999f741..6aaf24a 100644 --- a/src/main/java/org/gentoo/java/ebuilder/Main.java +++ b/src/main/java/org/gentoo/java/ebuilder/Main.java @@ -7,6 +7,7 @@ import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.URI; import java.net.URISyntaxException; +import java.nio.file.Path; import java.nio.file.Paths; import java.text.MessageFormat; import java.util.List; @@ -63,16 +64,18 @@ public class Main { */ private static void checkArgs(final Config config) { if (config.isRefreshCache()) { -if (config.getPortageTree() == null) { -config.setPortageTree(Paths.get("/usr/portage")); +if (config.getPortageTree().isEmpty()) { +config.addPortageTree(Paths.get("/usr/portage")); } -if (!config.getPortageTree().toFile().exists()) { -config.getErrorWriter().println("ERROR: Portage tree " -+ config.getPortageTree() + " does not exist."); -Runtime.getRuntime().exit(1); +for (Path portageTree : config.getPortageTree()) { +if (!portageTree.toFile().exists()) { +config.getErrorWriter().println("ERROR: Portage tree " ++ portageTree + " does not exist."); +Runtime.getRuntime().exit(1); +} } -} else if (config.getPortageTree() != null) { +} else if (!config.getPortageTree().isEmpty()) { config.getErrorWriter().println("WARNING: Portage tree is used " + "only when refreshing cache."); } @@ -277,7 +280,7 @@ public class Main { case "--portage-tree": case "-t": i++; -config.setPortageTree(Paths.get(args[i]).toAbsolutePath(). +config.addPortageTree(Paths.get(args[i]).toAbsolutePath(). normalize()); break; case "--cache-file": 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 b48e0d2..a1a7075 100644 --- a/src/main/java/org/gentoo/java/ebuilder/portage/PortageParser.java +++ b/src/main/java/org/gentoo/java/ebuilder/portage/PortageParser.java @@ -139,9 +139,11 @@ public class PortageParser { processedEbuilds = 0; eclassesCounts.clear(); -config.getStdoutWriter().println("Parsing portage tree @ " -+ config.getPortageTree() + " ..."); -parseCategories(config.getPortageTree()); +for (Path portageTree : config.getPortageTree()) { +config.getStdoutWriter().println("Parsing portage tree @ " ++ portageTree + " ..."); +parseCategories(portageTree); +} final long endTimestamp = System.currentTimeMillis(); diff --git a/src/main/resources/usage.txt b/src/main/resources/usage.txt index
[gentoo-commits] proj/java-ebuilder:master commit in: src/main/resources/
commit: 8173b238277ef2c8f122c8676b84058eb9ea1fba Author: zongyu gmail com> AuthorDate: Tue Aug 11 09:08:47 2020 + Commit: Miroslav Šulc gentoo org> CommitDate: Tue Aug 18 08:05:09 2020 + URL:https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=8173b238 update licensemap Signed-off-by: zongyu gmail.com> src/main/resources/licenseMap.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/licenseMap.properties b/src/main/resources/licenseMap.properties index a2fdbc6..a574b2d 100644 --- a/src/main/resources/licenseMap.properties +++ b/src/main/resources/licenseMap.properties @@ -85,6 +85,7 @@ edl\ 1.0=EPL-1.0 epl=EPL-1.0 epl\ 2.0=EPL-2.0 epl-2.0=EPL-2.0 +gnu\ general\ lesser\ public\ license\ (lgpl)\ version\ 3.0=LGPL-3 gnu\ general\ public\ library=GPL-1 gnu\ general\ public\ license,\ version\ 2=GPL-2 gnu\ general\ public\ license\ version\ 2=GPL-2
[gentoo-commits] proj/java-ebuilder:master commit in: src/main/resources/, src/main/java/org/gentoo/java/ebuilder/maven/
commit: 1a0861fce9d1eed817114871b073edf1f527e21d Author: zongyu gmail com> AuthorDate: Sat Aug 1 09:16:04 2020 + Commit: Miroslav Šulc gentoo org> CommitDate: Sat Aug 1 15:25:32 2020 + URL:https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=1a0861fc update usage.txt, fix Copyright statement of Gentoo Signed-off-by: zongyu gmail.com> src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java | 2 +- src/main/resources/usage.txt| 5 - 2 files changed, 5 insertions(+), 2 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 3b5c3d6..8fceec6 100644 --- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java +++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java @@ -598,7 +598,7 @@ public class MavenEbuilder { * @param writer ebuild writer */ private void writeHeader(final PrintWriter writer) { -writer.printf("# Copyright 1999-%d Gentoo Foundation\n", +writer.printf("# Copyright 1999-%d Gentoo Authors\n", LocalDate.now().getYear()); writer.println("# Distributed under the terms of the GNU General " + "Public License v2"); diff --git a/src/main/resources/usage.txt b/src/main/resources/usage.txt index 725643c..78ab745 100644 --- a/src/main/resources/usage.txt +++ b/src/main/resources/usage.txt @@ -2,13 +2,16 @@ Usage: java-ebuilder Generating ebuild: --download-uri|-u uri that goes to SRC_URI +--binjar-uri uri that goes to binary jar --dump-projects|-d outputs information about parsed projects (useful for debugging) --ebuild|-e path to ebuild that should be created --force-min-java-version force minimum JDK/JRE version in dependencies +--from-maven-central make java-ebuilder inherit java-pkg-maven.eclass --generate-ebuild|-g generates ebuild from pom.xml --keywords|-karch keywords ---license|-l license name +--license|-l license name, if it is not specified, + java-ebuilder will determine LICENSE from pom.xml --pom|-p path to pom.xml that should be parsed, the path must be relative to workdir (can be specified multiple times)
[gentoo-commits] proj/java-ebuilder:master commit in: src/main/resources/, src/main/java/org/gentoo/java/ebuilder/maven/
commit: 1c7018663e04e676f4ff74a9604913a81ddbfbf4 Author: zongyu gmail com> AuthorDate: Sat Aug 1 09:04:07 2020 + Commit: Miroslav Šulc gentoo org> CommitDate: Sat Aug 1 15:17:55 2020 + URL:https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=1c701866 Use Set instead of List for storing Licenses, update license map Signed-off-by: zongyu gmail.com> .../gentoo/java/ebuilder/maven/MavenLicenses.java | 3 +- .../gentoo/java/ebuilder/maven/MavenProject.java | 12 +- src/main/resources/licenseMap.properties | 152 - 3 files changed, 161 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/gentoo/java/ebuilder/maven/MavenLicenses.java b/src/main/java/org/gentoo/java/ebuilder/maven/MavenLicenses.java index e2db62c..f2f4f9a 100644 --- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenLicenses.java +++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenLicenses.java @@ -51,7 +51,8 @@ public class MavenLicenses { * @return license identifier that works with Portage */ public String getEquivalentLicense(String licenseName) { -final String portageLicense = licenseMap.get(licenseName); +final String portageLicense = +licenseMap.get(licenseName.toLowerCase()); if (portageLicense == null) { return "!!!equivalentPortageLicenseName-not-found!!!"; 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 fa4958d..2fd88de 100644 --- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenProject.java +++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenProject.java @@ -4,7 +4,9 @@ import java.io.PrintWriter; import java.nio.file.Path; import java.util.ArrayList; import java.util.Collections; +import java.util.HashSet; import java.util.List; +import java.util.Set; /** * Contains information about maven project collected from pom.xml. @@ -44,7 +46,7 @@ public class MavenProject { /** * Lisences. */ -private List licenses = new ArrayList<>(10); +private Set licenses = new HashSet<>(10); /** * Homepage URL. */ @@ -113,8 +115,12 @@ public class MavenProject { * * @param license {@link #licenses} */ -public void addLicense(final String license) { -licenses.add(license); +public void addLicense(final String portageLicenses) { +final String[] parts = portageLicenses.split(":"); + +for (String eachLicense: parts) { +licenses.add(eachLicense); +} } /** diff --git a/src/main/resources/licenseMap.properties b/src/main/resources/licenseMap.properties index fe9262a..5cd2e5d 100644 --- a/src/main/resources/licenseMap.properties +++ b/src/main/resources/licenseMap.properties @@ -1,2 +1,150 @@ -#Fri Jul 31 23:28:29 CST 2020 -Apache\ License,\ Version\ 2.0=Apache-2.0 +#Sat Aug 01 15:44:04 CST 2020 +# A properties file that maps license name of pom.xml to +# portage compatible names. +# +# If the name indicates multiple licenses, please record +# the license like: +#@CODE +# name\ from\ pom.xml=GPL-2:MIT:BSD +#@CODE +# +# If it indicates multiple choices of licenses, please +# record the license like: +#@CODE +# name\ from\ pom.xml=||\ (\ GPL-2\ MIT\ ) +#@CODE +# +# according to dev-java/bcpkix::gentoo +bouncy\ castle\ licence=BSD +# according to dev-lang/scala::gentoo +bsd-like=BSD +# +3-clause\ bsd\ license=BSD +apache\ 2=Apache-2.0 +apache\ 2.0=Apache-2.0 +apache-2.0=Apache-2.0 +apache\ 2.0\ license=Apache-2.0 +apache\ license=Apache +apache\ license\ 2=Apache-2.0 +apache\ license\ 2.0=Apache-2.0 +apache\ license,\ 2.0=Apache-2.0 +apache\ license\ v2.0=Apache-2.0 +apache\ license\ version\ 2=Apache-2.0 +apache\ license,\ version\ 2.0=Apache-2.0 +apache\ license\ version\ 2.0=Apache-2.0 +apache\ license,\ version\ 2.0=Apache-2.0 +apache\ public\ license\ 2.0=Apache-2.0 +apache\ software\ license,\ version\ 1.1=Apache-1.1 +apache\ software\ license\ -\ version\ 2.0=Apache-2.0 +apache\ v2=Apache-2.0 +asf\ 2.0=Apache-2.0 +asl=Apache-2.0 +asl\ 2.0=Apache-2.0 +asl,\ version\ 2=Apache-2.0 +bsd=BSD-1 +bsd\ 2-clause=BSD-2 +bsd-2-clause=BSD-2 +bsd\ 2-clause\ license=BSD-2 +bsd\ 3-clause=BSD +bsd-3-clause=BSD +bsd\ licence=BSD-1 +bsd\ license=BSD-1 +bsd\ style=BSD +cc0=CC0-1.0 +cddl\ 1.0=CDDL +cddl\ 1.1=CDDL-1.1 +cddl+gpl\ license=CDDL:GPL-1 +cddl/gplv2+ce=||\ (\ CDDL\ GPL-2-with-classpath-exception\ ) +cddl\ +\ gplv2\ with\ classpath\ exception=CDDL:GPL-2-with-classpath-exception +cddl\ license=CDDL +cddl\ v1.1\ /\ gpl\ v2\ dual\ license=CDDL-1.1:GPL-2 +common\ development\ and\ distribution\ license=CDDL +common\ development\ and\ distribution\ license\ (cddl)\ plus\ gpl=CDDL:GPL +common\ development\ and\ distribution\ license\ (cddl)\ v1.0=CDDL +common\ development\ and\ distribution\ license\ (cddl)\ version\
[gentoo-commits] proj/java-ebuilder:master commit in: src/main/resources/, src/main/java/org/gentoo/java/ebuilder/maven/
commit: 1198ae64e71b5d8dab832c78ab16a103512eaf58 Author: zongyu gmail com> AuthorDate: Sun Aug 2 09:13:54 2020 + Commit: Miroslav Šulc gentoo org> CommitDate: Mon Aug 3 02:28:40 2020 + URL:https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=1198ae64 reformat the license/name string Signed-off-by: zongyu gmail.com> src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java | 4 +++- src/main/resources/licenseMap.properties | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java b/src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java index 8c64e37..d487024 100644 --- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java +++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java @@ -627,7 +627,9 @@ public class MavenParser { case "name": mavenProject.addLicense( mavenLicenses.getEquivalentLicense( -reader.getElementText())); +reader.getElementText(). +trim(). +replaceAll("[\n ]+", " "))); break; default: consumeElement(reader); diff --git a/src/main/resources/licenseMap.properties b/src/main/resources/licenseMap.properties index 5cd2e5d..a2fdbc6 100644 --- a/src/main/resources/licenseMap.properties +++ b/src/main/resources/licenseMap.properties @@ -59,7 +59,7 @@ cddl\ +\ gplv2\ with\ classpath\ exception=CDDL:GPL-2-with-classpath-exception cddl\ license=CDDL cddl\ v1.1\ /\ gpl\ v2\ dual\ license=CDDL-1.1:GPL-2 common\ development\ and\ distribution\ license=CDDL -common\ development\ and\ distribution\ license\ (cddl)\ plus\ gpl=CDDL:GPL +common\ development\ and\ distribution\ license\ (cddl)\ plus\ gpl=CDDL:GPL-1 common\ development\ and\ distribution\ license\ (cddl)\ v1.0=CDDL common\ development\ and\ distribution\ license\ (cddl)\ version\ 1.0=CDDL common\ public\ license\ -\ v\ 1.0=CPL-1.0 @@ -113,7 +113,8 @@ hsqldb\ license=BSD indiana\ university\ extreme!\ lab\ software\ license=Indiana-University-Extreme-Lab indiana\ university\ extreme!\ lab\ software\ license\ 1.1.1=Indiana-University-Extreme-Lab indiana\ university\ extreme!\ lab\ software\ license,\ vesion\ 1.1.1=Indiana-University-Extreme-Lab -jquery\ license=MIT:CC0 +jquery\ license=MIT:CC0-1.0 +jsr-000107\ jcache\ 2.9\ public\ review\ -\ updated\ specification\ license=Apache-2.0 lgpl=LGPL-3 lgpl\ 2.1=LGPL-2.1 lgpl-2.1=LGPL-2.1
[gentoo-commits] proj/java-ebuilder:master commit in: src/main/resources/
commit: 74183b4fabbf629ade1ba60b66c4f81db854af07 Author: Miroslav Šulc gentoo org> AuthorDate: Fri Nov 1 19:04:38 2019 + Commit: Miroslav Šulc gentoo org> CommitDate: Fri Nov 1 19:04:38 2019 + URL:https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=74183b4f updated usage Signed-off-by: Miroslav Šulc gentoo.org> src/main/resources/usage.txt | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/resources/usage.txt b/src/main/resources/usage.txt index c874ace..4ad06d7 100644 --- a/src/main/resources/usage.txt +++ b/src/main/resources/usage.txt @@ -1,4 +1,6 @@ Usage: java-ebuilder + +Generating ebuild: --download-uri|-u uri that goes to SRC_URI --ebuild|-e path to ebuild that should be created --generate-ebuild|-ggenerates ebuild from pom.xml @@ -7,9 +9,15 @@ Usage: java-ebuilder --pom|-p path to pom.xml that should be parsed, the path must be relative to workdir (can be specified multiple times) +--slot|-s SLOT number +--workdir|-w path to ebuild workdir (${WORKDIR}, default is +current directory) + +Refreshing cache: --portage-tree|-t path to portage tree that should be parsed when refreshing cache (default is /usr/portage) ---cache-file location of output cache file (default is ~/.java-ebuilder/cache) --refresh-cache|-c refreshes java ebuild cache ---slot|-s SLOT number ---workdir|-w path to workdir (default is current directory) + +Common: +--cache-file location of cache file (default is +~/.java-ebuilder/cache)
[gentoo-commits] proj/java-ebuilder:master commit in: src/main/resources/
commit: a9eaed866badaffb61c98b4ec9bf7281c6d4d30e Author: Miroslav Šulc gentoo org> AuthorDate: Wed Oct 30 20:00:05 2019 + Commit: Miroslav Šulc gentoo org> CommitDate: Wed Oct 30 20:00:05 2019 + URL:https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=a9eaed86 fixed usage app name Signed-off-by: Miroslav Šulc gentoo.org> src/main/resources/usage.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/usage.txt b/src/main/resources/usage.txt index 40e1914..c874ace 100644 --- a/src/main/resources/usage.txt +++ b/src/main/resources/usage.txt @@ -1,4 +1,4 @@ -Usage: jar +Usage: java-ebuilder --download-uri|-u uri that goes to SRC_URI --ebuild|-e path to ebuild that should be created --generate-ebuild|-ggenerates ebuild from pom.xml
[gentoo-commits] proj/java-ebuilder:master commit in: src/main/resources/, src/main/java/org/gentoo/java/ebuilder/
commit: b4b960aa7c929ff7884195dd077698b965605e99 Author: Benda Xu gentoo org> AuthorDate: Thu Oct 6 03:01:27 2016 + Commit: Michał Górny gentoo org> CommitDate: Thu Oct 6 03:03:54 2016 + URL:https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=b4b960aa add an option --cache-file to specify cache file. src/main/java/org/gentoo/java/ebuilder/Config.java | 11 ++- src/main/java/org/gentoo/java/ebuilder/Main.java | 7 ++- src/main/resources/usage.txt | 3 ++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/gentoo/java/ebuilder/Config.java b/src/main/java/org/gentoo/java/ebuilder/Config.java index 557117a..4127266 100644 --- a/src/main/java/org/gentoo/java/ebuilder/Config.java +++ b/src/main/java/org/gentoo/java/ebuilder/Config.java @@ -18,7 +18,7 @@ public class Config { /** * Path to portage ebuild cache. */ -private final Path cacheFile = Paths.get(System.getProperty("user.home"), +private Path cacheFile = Paths.get(System.getProperty("user.home"), ".java-ebuilder/cache"); /** * URI that goes to SRC_URI. @@ -99,6 +99,15 @@ public class Config { return cacheFile; } +/** + * Setter for {@link #cacheFile}. + * + * @param cacheFile {@link #cacheFile} + */ +public void setCacheFile(final Path cacheFile) { +this.cacheFile = cacheFile; +} + /** * Getter for {@link #downloadUri}. * diff --git a/src/main/java/org/gentoo/java/ebuilder/Main.java b/src/main/java/org/gentoo/java/ebuilder/Main.java index 5bf1490..0a69442 100644 --- a/src/main/java/org/gentoo/java/ebuilder/Main.java +++ b/src/main/java/org/gentoo/java/ebuilder/Main.java @@ -220,12 +220,17 @@ public class Main { i++; config.addPomFile(Paths.get(args[i])); break; -case "-portage-tree": +case "--portage-tree": case "-t": i++; config.setPortageTree(Paths.get(args[i]).toAbsolutePath(). normalize()); break; +case "--cache-file": +i++; +config.setCacheFile(Paths.get(args[i]).toAbsolutePath(). +normalize()); +break; case "--refresh-cache": case "-c": config.setRefreshCache(true); diff --git a/src/main/resources/usage.txt b/src/main/resources/usage.txt index a728607..40e1914 100644 --- a/src/main/resources/usage.txt +++ b/src/main/resources/usage.txt @@ -9,6 +9,7 @@ Usage: jar times) --portage-tree|-t path to portage tree that should be parsed when refreshing cache (default is /usr/portage) +--cache-file location of output cache file (default is ~/.java-ebuilder/cache) --refresh-cache|-c refreshes java ebuild cache --slot|-s SLOT number ---workdir|-w path to workdir (default is current directory) \ No newline at end of file +--workdir|-w path to workdir (default is current directory)