aboutsummaryrefslogtreecommitdiffstats
path: root/bundle-plugin
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2020-06-24 13:48:11 +0200
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2020-06-24 13:48:17 +0200
commit2635e09140e047b9b7b078d844082f3444d76f78 (patch)
treedd56baace511fe409fd7a3335f3a7db884a15a7f /bundle-plugin
parentd401fff24ac80a940ef01f80fabc05711a12fe94 (diff)
Add helper class for test bundles
Diffstat (limited to 'bundle-plugin')
-rw-r--r--bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/TestBundleUtils.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/TestBundleUtils.java b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/TestBundleUtils.java
new file mode 100644
index 00000000000..9a3fc89bbd5
--- /dev/null
+++ b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/TestBundleUtils.java
@@ -0,0 +1,25 @@
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.container.plugin.mojo;
+
+import org.apache.maven.project.MavenProject;
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.jar.JarFile;
+
+/**
+ * @author bjorncs
+ */
+class TestBundleUtils {
+ private TestBundleUtils() {}
+
+ static Path outputDirectory(MavenProject project) { return targetDirectory(project).resolve("test-bundle/"); }
+
+ static Path manifestFile(MavenProject project) { return outputDirectory(project).resolve(JarFile.MANIFEST_NAME); }
+
+ static Path archiveFile(MavenProject project) {
+ return targetDirectory(project).resolve(project.getBuild().getFinalName() + "-tests.jar");
+ }
+
+ private static Path targetDirectory(MavenProject project) { return Paths.get(project.getBuild().getDirectory()); }
+}