commit 23de5e80e072f1047ac073e8bdee592ee7c46a51
Author: Mikolaj Izdebski <mizdebsk(a)redhat.com>
Date: Mon Jan 7 19:35:34 2013 +0100
Implement %xmvn_alias, %xmvn_file and %xmvn_package macros
LICENSE | 2 +-
macros.xmvn | 17 ++++++++++++++++-
scripts/mvn-alias | 47 +++++++++++++++++++++++++++++++++++++++++++++++
scripts/mvn-build | 6 ++++++
scripts/mvn-file | 47 +++++++++++++++++++++++++++++++++++++++++++++++
scripts/mvn-package | 42 ++++++++++++++++++++++++++++++++++++++++++
6 files changed, 159 insertions(+), 2 deletions(-)
---
diff --git a/LICENSE b/LICENSE
index 2b342b9..5954358 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2011, 2012 Red Hat, Inc.
+Copyright (c) 2011-2013 Red Hat, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/macros.xmvn b/macros.xmvn
index bc80ab0..7b92a9e 100644
--- a/macros.xmvn
+++ b/macros.xmvn
@@ -1,4 +1,4 @@
-# Copyright (c) 2012 Red Hat, Inc.
+# Copyright (c) 2012-2013 Red Hat, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -35,6 +35,21 @@
# unless you are prepared to face consequences (FTBFS, API change etc.)
#
+# %mvn_package - TODO
+#
+%mvn_package mvn-package
+
+#
+# %mvn_alias - TODO
+#
+%mvn_alias mvn-alias
+
+#
+# %mvn_file - TODO
+#
+%mvn_file mvn-file
+
+#
# %mvn_build - build Maven project
#
%mvn_build mvn-build
diff --git a/scripts/mvn-alias b/scripts/mvn-alias
new file mode 100755
index 0000000..88d778c
--- /dev/null
+++ b/scripts/mvn-alias
@@ -0,0 +1,47 @@
+#!/bin/sh -e
+# Copyright (c) 2013 Red Hat, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name of Red Hat nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Mikolaj Izdebski <mizdebsk(a)redhat.com>
+
+if [ $# -lt 2 ]; then
+ echo "$0: At least 2 arguments are required." >&2
+ exit 1
+fi
+
+pattern="$1" shift
+
+while [ $# -gt 0 ]; do
+ echo "export
XMVN_INSTALL_DEPMAPS=\"\$XMVN_INSTALL_DEPMAPS\"'$pattern
+$1
+'" >>.xmvnrc
+ shift
+done
+
+exit 0
diff --git a/scripts/mvn-build b/scripts/mvn-build
index d1be9d2..3951c23 100755
--- a/scripts/mvn-build
+++ b/scripts/mvn-build
@@ -87,6 +87,7 @@ base_goal=verify
skip_tests=
install_goal=org.fedoraproject.xmvn:xmvn-mojo:install
javadoc_goal=org.apache.maven.plugins:maven-javadoc-plugin:aggregate
+builddep_goal=org.fedoraproject.xmvn:xmvn-mojo:builddep
add_depmaps=
singleton=test
pre_goals=
@@ -169,6 +170,10 @@ if $singleton; then
export XMVN_INSTALL_LAYOUT="$XMVN_INSTALL_LAYOUT;^(.*)$=>@1"
fi
+if [ -f .xmvnrc ]; then
+ . ./.xmvnrc
+fi
+
xmvn \
--offline \
@@ -180,4 +185,5 @@ xmvn \
$base_goal \
$install_goal \
$javadoc_goal \
+ $builddep_goal \
$post_goals
diff --git a/scripts/mvn-file b/scripts/mvn-file
new file mode 100755
index 0000000..93cc8da
--- /dev/null
+++ b/scripts/mvn-file
@@ -0,0 +1,47 @@
+#!/bin/sh -e
+# Copyright (c) 2013 Red Hat, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name of Red Hat nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Mikolaj Izdebski <mizdebsk(a)redhat.com>
+
+if [ $# -lt 2 ]; then
+ echo "$0: At least 2 arguments are required." >&2
+ exit 1
+fi
+
+pattern="$1" shift
+
+while [ $# -gt 0 ]; do
+ echo "export XMVN_INSTALL_FILES=\"\$XMVN_INSTALL_FILES\"'$pattern
+$1
+'" >>.xmvnrc
+ shift
+done
+
+exit 0
diff --git a/scripts/mvn-package b/scripts/mvn-package
new file mode 100755
index 0000000..fa3dc6b
--- /dev/null
+++ b/scripts/mvn-package
@@ -0,0 +1,42 @@
+#!/bin/sh -e
+# Copyright (c) 2013 Red Hat, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name of Red Hat nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Mikolaj Izdebski <mizdebsk(a)redhat.com>
+
+if [ $# -ne 2 ]; then
+ echo "$0: Exactly 2 arguments are required." >&2
+ exit 1
+fi
+
+echo "export XMVN_INSTALL_LAYOUT=\"\$XMVN_INSTALL_LAYOUT\"'$1
+$2
+'" >>.xmvnrc
+
+exit 0