You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by pr...@apache.org on 2007/06/14 19:09:13 UTC

svn commit: r547316 - in /geronimo/samples/trunk/samples: createSample.bat createSample.sh

Author: prasad
Date: Thu Jun 14 10:09:12 2007
New Revision: 547316

URL: http://svn.apache.org/viewvc?view=rev&rev=547316
Log:
* simple script to create sample from sample-archetype and tweak it.

Added:
    geronimo/samples/trunk/samples/createSample.bat   (with props)
    geronimo/samples/trunk/samples/createSample.sh   (with props)

Added: geronimo/samples/trunk/samples/createSample.bat
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/createSample.bat?view=auto&rev=547316
==============================================================================
--- geronimo/samples/trunk/samples/createSample.bat (added)
+++ geronimo/samples/trunk/samples/createSample.bat Thu Jun 14 10:09:12 2007
@@ -0,0 +1,56 @@
+@echo off 
+@REM
+@REM  Licensed to the Apache Software Foundation (ASF) under one or more
+@REM  contributor license agreements.  See the NOTICE file distributed with
+@REM  this work for additional information regarding copyright ownership.
+@REM  The ASF licenses this file to You under the Apache License, Version 2.0
+@REM  (the "License"); you may not use this file except in compliance with
+@REM  the License.  You may obtain a copy of the License at
+@REM
+@REM      http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM  Unless required by applicable law or agreed to in writing, software
+@REM  distributed under the License is distributed on an "AS IS" BASIS,
+@REM  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM  See the License for the specific language governing permissions and
+@REM  limitations under the License.
+@REM
+@REM --------------------------------------------------------------------
+@REM $Rev: 531321 $ $Date: 2007-04-22 23:28:26 -0400 (Sun, 14 June 2007) $
+@REM --------------------------------------------------------------------
+
+@REM This script will help you create a sample template.
+@REM It will also tweak the template to suit your sample name and version.
+@REM
+@REM USAGE: createSample.bat <sample_name> <sample_version>
+
+
+IF "%1"=="" GOTO usage
+IF "%2"=="" GOTO usage
+
+
+call mvn archetype:create^
+ -DarchetypeGroupId=org.apache.geronimo.samples^
+ -DarchetypeArtifactId=geronimo-samples-archetype^
+ -DarchetypeVersion=2.0-SNAPSHOT^
+ -DartifactId=%1%^
+ -Dversion=%2%
+
+cd %1%
+
+move sample-ear %1%-ear
+move sample-ejb %1%-ejb
+move sample-war %1%-war
+
+
+echo "A sample template with the name %1% has been created."
+echo "Add/delete maven child modules to this sample as required."
+echo "Do not forget to modify the %1%/pom.xml and %1%-ear/pom.xml appropriately"
+
+goto end
+
+:usage
+echo "ERROR: Sample name and/or version missing !"
+echo "USAGE: %0 <sample_name> <sample_version>"
+
+:end

Propchange: geronimo/samples/trunk/samples/createSample.bat
------------------------------------------------------------------------------
    svn:eol-style = CRLF

Propchange: geronimo/samples/trunk/samples/createSample.bat
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/trunk/samples/createSample.sh
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/createSample.sh?view=auto&rev=547316
==============================================================================
--- geronimo/samples/trunk/samples/createSample.sh (added)
+++ geronimo/samples/trunk/samples/createSample.sh Thu Jun 14 10:09:12 2007
@@ -0,0 +1,53 @@
+
+#!/bin/sh
+#
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+# 
+#      http://www.apache.org/licenses/LICENSE-2.0
+# 
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+
+# --------------------------------------------------------------------
+# $Rev$ $Date$
+# --------------------------------------------------------------------
+
+# This script will help you create a sample template.
+# It will create the template and tweak it to suit your sample name and version.
+#
+# USAGE: createSample.sh <sample_name> <sample_version>
+#
+
+if [ $# -lt 2 ]
+then
+   echo "ERROR: Sample name and/or version missing !"
+   echo "USAGE: $0 <sample_name> <sample_version>"
+   exit 1
+fi
+
+. mvn archetype:create \
+ -DarchetypeGroupId=org.apache.geronimo.samples \
+ -DarchetypeArtifactId=geronimo-samples-archetype \
+ -DarchetypeVersion=2.0-SNAPSHOT \
+ -DartifactId=$1 \
+ -Dversion=$2
+
+cd $1
+
+mv -f sample-ear $1-ear
+mv -f sample-ejb $1-ejb
+mv -f sample-war $1-war
+
+echo "A sample template with the name $1 has been created."
+echo "Add/delete maven child modules to this sample as required."
+echo "Do not forget to modify the $1/pom.xml and $1-ear/pom.xml appropriately"
+
+exit 0

Propchange: geronimo/samples/trunk/samples/createSample.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/trunk/samples/createSample.sh
------------------------------------------------------------------------------
    svn:executable = *

Propchange: geronimo/samples/trunk/samples/createSample.sh
------------------------------------------------------------------------------
    svn:keywords = Date Revision