I successfully built cocoon-linkrewriter using 'mvn package' with the
converted directory structure using the conversion script and 2 new and
one adopted pom file.
I wanted to attach them, but for some reasons my SMTP server rejected
them as SPAM. :-(
I used the following conventions for the block poms:
* version: 1.0-SNAPSHOT
* sample depends only on impl
* impl depends on cocoon-core (and other direct dependencies) - based on
the existing pom of the old block
* parent declares sample and impl as modules
Could somebody please have a look at the attached poms?
I'll try to extend the script to generate the parent and sample poms
automatically and adjust the impl pom (based on the old block pom).
Thanks,
Andreas
Andreas Hochsteger schrieb:
Reinhard Poetz schrieb:
Andreas Hochsteger wrote:
After analyzing the old blocks in more details I found the following
common directories.
It would be great, if you (or someone else involved in developing the
new blocks) can finish the mapping below ...
ok, forget my last response. I'll change it in some points:
WEB-INF/sitemap-additions -> ? (contains sitemap snippets in *.xconf
files)
cocoon-<block>-impl/src/main/resources/META-INF/legacy/sitemap-additions
WEB-INF/xconf -> cocoon-<block>-impl/src/main/resources/META-INF/xconf?
cocoon-<block>-impl/src/main/resources/META-INF/legacy/xconf
conf -> ? (contains *.xweb, *.properties and other files)
cocoon-<block>-impl/src/main/resources/META-INF/legacy/conf
java -> cocoon-<block>-impl/src/main/java
ok
samples -> cocoon-<block>-sample/src/main/resources/COB-INF
ok
test -> cocoon-<block>-impl/src/test/java
ok
The idea is to collect all old configuration files within one
directory. I called it legacy - if somebody has a better name, it
would be the right time now to let us know ;-)
Thanks, Reinhard, this really helped me very much!
Attached is a new version which uses the mappings from above.
The SVN-Commands are already added but commented-out and replaced with
copy commands to be easier to test.
One question popped up during testing:
Is it really required to move the directories?
Isn't it better to do a 'svn cp' (which is a cheap copy anyway) and keep
the old blocks at their old location?
This way it would be better to test and experiment since moving may
disrupt both the cocoon-trunk and blocks repository (which is also used
by 2.1 if I'm not mistaken).
It would be great, if somebody could try the script and give me some
more feedback.
Only 2 variables have to be adjusted:
* blksrc: Local directory where
https://svn.apache.org/repos/asf/cocoon/blocks is checked out
* blkdest: Local directory where
https://svn.apache.org/repos/asf/cocoon/trunk is checked out
Usage: ./m10n-blocks.sh <blockname>...
Example: ./m10n-blocks.sh asciiart faces
The script is written using standard Unix Shell and is tested on WinXP
using Cygwin.
Thanks,
Andreas
------------------------------------------------------------------------
#!/bin/sh
# Author: Andreas Hochsteger <[EMAIL PROTECTED]>
# Description:
# This script partly automates the conversion of the directory structure
# of the "old" blocks to the "mavenized" blocks.
# Usage: m10n-blocks.sh <blockname>...
# Local directory where https://svn.apache.org/repos/asf/cocoon/blocks is
checked out:
blksrc=cocoon-blocks
# Local directory where https://svn.apache.org/repos/asf/cocoon/trunk is
checked out:
blkdest=cocoon-trunk
# List of blocks (old name) to be converted - read from the command line:
blocks="$@"
# Argument: <from> <to>
function MoveDir() {
if [ -d $1 ]; then
echo "Moving $1 to $2 ..."
# TODO: This is just for testing:
cp -r $1 $2
# TODO: Replace cp from above with svn command:
#svn mv $1 $2
fi
}
# Argument: <blockname>
function ConvertBlock() {
block="$1"
blockbase=$blkdest/cocoon-$block
# Create initial directory structure:
mkdir -p $blockbase/cocoon-$block-impl/src/main/resources/META-INF/legacy
mkdir -p $blockbase/cocoon-$block-impl/src/test
mkdir -p $blockbase/cocoon-$block-sample/src/main/resources
# TODO: Add initial directory structure to svn:
#svn add $blockbase
# Move Java sources:
MoveDir $blksrc/$block/trunk/java
$blockbase/cocoon-$block-impl/src/main/java
# Move Java test sources:
MoveDir $blksrc/$block/trunk/test
$blockbase/cocoon-$block-impl/src/test/java
# Move xconf resources:
MoveDir $blksrc/$block/trunk/WEB-INF/xconf
$blockbase/cocoon-$block-impl/src/main/resources/META-INF/legacy/xconf
# Move sitemap-additions resources:
MoveDir $blksrc/$block/trunk/WEB-INF/sitemap-additions
$blockbase/cocoon-$block-impl/src/main/resources/META-INF/legacy/sitemap-additions
# Move WEB-INF resources:
MoveDir $blksrc/$block/trunk/conf
$blockbase/cocoon-$block-impl/src/main/resources/META-INF/legacy/conf
# Move sample resources:
MoveDir $blksrc/$block/trunk/samples
$blockbase/cocoon-$block-sample/src/main/resources/COB-INF
}
# Convert the blocks:
for b in $blocks; do
echo "Converting block $block ..."
ConvertBlock $b
echo
done