Skip to content

Commit

Permalink
LEP-6578
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.liferay.com/repos/public/plugins/trunk@17572 05bdf26c-840f-0410-9ced-eb539d925f36
  • Loading branch information
sez11a committed Jul 7, 2008
1 parent dc877cd commit e8670ed
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 0 deletions.
29 changes: 29 additions & 0 deletions layouttpl/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,33 @@
<property name="project.dir" value=".." />

<import file="../build-common-plugins.xml" />

<target name="create">
<if>
<equals arg1="${layouttpl.name}" arg2="$${layouttpl.name}" />
<then>
<echo message="This task must be called by the create script." />
</then>
<else>
<if>
<available file="${layouttpl.name}-layouttpl" />
<then>
<echo message="${layouttpl.name}-layouttpl already exists." />
</then>
<else>
<unzip src="layouttpl.zip" dest="${layouttpl.name}-layouttpl" />

<replace dir="${layouttpl.name}-layouttpl">
<replacefilter token="@layouttpl.name@" value="${layouttpl.name}" />
<replacefilter token="@layouttpl.display.name@" value="${layouttpl.display.name}" />
</replace>

<touch file="${layouttpl.name}-layouttpl/docroot/${layouttpl.name}.tpl"/>
<touch file="${layouttpl.name}-layouttpl/docroot/${layouttpl.name}.wap.tpl"/>

</else>
</if>
</else>
</if>
</target>
</project>
44 changes: 44 additions & 0 deletions layouttpl/create.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@echo off

if "" == "%1" goto errorCreate
if "" == "%2" goto errorCreate

call ant -Dlayouttpl.name=%1 -Dlayouttpl.display.name=%2 create

svn add %1-layouttpl

cd %1-layouttpl\docroot

svn ps svn:ignore -F .cvsignore .

svn remove --force .cvsignore

cd WEB-INF

svn ps svn:ignore -F .cvsignore .

svn remove --force .cvsignore

cd ..

cd ..

call ant deploy

cd ..

goto end

:errorCreate
echo.
echo Usage: create.bat hello-world "Hello World"
echo.
echo The first hello-world is your layouttpl id. A new directory will be created based
echo on the layouttpl id.
echo.
echo The second "Hello World" is the layouttpl's display name. The quotation marks are
echo only needed because there is a space in the display name.

goto end

:end
40 changes: 40 additions & 0 deletions layouttpl/create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/sh

#set -x

if [ -z "$1" ]; then
echo
echo Usage: ./create.sh hello-world \"Hello World\"
echo
echo The first hello-world is your layouttpl id. A new directory will be created based
echo on the layouttpl id.
echo
echo The second \"Hello World\" is the layouttpl\'s display name. The quotation marks are
echo only needed because there is a space in the display name.

exit 127
fi

ant -Dlayouttpl.name=$1 -Dlayouttpl.display.name=\"$2\" create

svn add $1-layouttpl

cd $1-layouttpl/docroot

svn ps svn:ignore -F .cvsignore .

svn remove --force .cvsignore

cd WEB-INF

svn ps svn:ignore -F .cvsignore .

svn remove --force .cvsignore

cd ..

cd ..

ant deploy

exit 0
Binary file added layouttpl/layouttpl.zip
Binary file not shown.

0 comments on commit e8670ed

Please sign in to comment.