aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZhang Zongyu <zzy2529420793@gmail.com>2020-09-04 19:34:16 +0800
committerZhang Zongyu <zzy2529420793@gmail.com>2020-09-04 20:15:53 +0800
commit76e11179439770ad964985476562a390683e70f7 (patch)
treeb196f39364ae2bfdbcca018f999f900eb9735a00 /src
parentfiltering out resource directories that are not valid (diff)
downloadjava-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>
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/gentoo/java/ebuilder/Config.java22
-rw-r--r--src/main/java/org/gentoo/java/ebuilder/Main.java3
-rw-r--r--src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java4
-rw-r--r--src/main/resources/usage.txt1
4 files changed, 30 insertions, 0 deletions
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)