diff options
author | 2020-09-04 19:34:16 +0800 | |
---|---|---|
committer | 2020-09-04 20:15:53 +0800 | |
commit | 76e11179439770ad964985476562a390683e70f7 (patch) | |
tree | b196f39364ae2bfdbcca018f999f900eb9735a00 | |
parent | filtering out resource directories that are not valid (diff) | |
download | java-ebuilder-76e11179439770ad964985476562a390683e70f7.tar.gz java-ebuilder-76e11179439770ad964985476562a390683e70f7.tar.bz2 java-ebuilder-76e11179439770ad964985476562a390683e70f7.zip |
new switch: --skip-tests
specify it to prevent java-ebuilder from printing
lines that are related to src_test().
Signed-off-by: Zhang Zongyu <zzy2529420793@gmail.com>
-rw-r--r-- | scripts/resources/Makefiles/stage2.mk | 2 | ||||
-rw-r--r-- | src/main/java/org/gentoo/java/ebuilder/Config.java | 22 | ||||
-rw-r--r-- | src/main/java/org/gentoo/java/ebuilder/Main.java | 3 | ||||
-rw-r--r-- | src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java | 4 | ||||
-rw-r--r-- | src/main/resources/usage.txt | 1 |
5 files changed, 32 insertions, 0 deletions
diff --git a/scripts/resources/Makefiles/stage2.mk b/scripts/resources/Makefiles/stage2.mk index 764bc5c..71546ea 100644 --- a/scripts/resources/Makefiles/stage2.mk +++ b/scripts/resources/Makefiles/stage2.mk @@ -21,4 +21,6 @@ clean-stage2: \( -name \*.ebuild \ -o -name Manifest \)\ -delete;\ + find ${MAVEN_OVERLAY_DIR} -type d \ + -empty -delete;\ fi diff --git a/src/main/java/org/gentoo/java/ebuilder/Config.java b/src/main/java/org/gentoo/java/ebuilder/Config.java index e9396ca..731585d 100644 --- a/src/main/java/org/gentoo/java/ebuilder/Config.java +++ b/src/main/java/org/gentoo/java/ebuilder/Config.java @@ -94,6 +94,10 @@ public class Config { */ private boolean refreshCache; /** + * Whether java-ebuilder will explictly unset hasTests of the Maven project. + */ + private boolean skipTests; + /** * SLOT number. */ private String slot; @@ -526,4 +530,22 @@ public class Config { public void setRefreshCache(final boolean refreshCache) { this.refreshCache = refreshCache; } + + /** + * Getter for {@link #skipTests}. + * + * @return {@link #skipTests} + */ + public boolean willSkipTests() { + return skipTests; + } + + /** + * Setter for {@link #skipTests}. + * + * @param skipTests {@link #skipTests} + */ + public void setSkipTests(final boolean skipTests) { + this.skipTests = skipTests; + } } diff --git a/src/main/java/org/gentoo/java/ebuilder/Main.java b/src/main/java/org/gentoo/java/ebuilder/Main.java index 6aaf24a..80b3d8b 100644 --- a/src/main/java/org/gentoo/java/ebuilder/Main.java +++ b/src/main/java/org/gentoo/java/ebuilder/Main.java @@ -292,6 +292,9 @@ public class Main { case "-c": config.setRefreshCache(true); break; + case "--skip-tests": + config.setSkipTests(true); + break; case "--slot": case "-s": i++; 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 f69527f..07ae96e 100644 --- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java +++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java @@ -56,6 +56,10 @@ public class MavenParser { mavenProject.setHasTests(true); } + if (config.willSkipTests()) { + mavenProject.setHasTests(false); + } + result.add(mavenProject); }); diff --git a/src/main/resources/usage.txt b/src/main/resources/usage.txt index b197a39..2354315 100644 --- a/src/main/resources/usage.txt +++ b/src/main/resources/usage.txt @@ -16,6 +16,7 @@ Generating ebuild: --pom|-p <file> path to pom.xml that should be parsed, the path must be relative to workdir (can be specified multiple times) +--skip-tests disable testing framework detecting --slot|-s <slot> SLOT number --workdir|-w <dir> path to ebuild workdir (${WORKDIR}, default is current directory) |