8000 melting-pot: make melt.sh matching pom.xml · oeway/scijava-scripts@0fbeea8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0fbeea8

Browse files
committed
melting-pot: make melt.sh matching pom.xml
For multi-module components, */* is not the same as explicitly enumerating the child projects. See mpicbg:mpicbg and mpicbg:mpicbg_ for an example.
1 parent 6173aec commit 0fbeea8

File tree

1 file changed

+32
-15
lines changed

1 file changed

+32
-15
lines changed

melting-pot.sh

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,35 @@ generatePOM() {
533533
echo '</project>' >> pom.xml
534534
}
535535

536+
# Generates melt.sh script for all modules in the current directory.
537+
generateScript() {
538+
echo '#!/bin/sh' > melt.sh
539+
echo 'trap "exit" INT' >> melt.sh
540+
echo 'echo "Melting the pot..."' >> melt.sh
541+
echo 'dir=$(pwd)' >> melt.sh
542+
echo 'for f in \' >> melt.sh
543+
local dir
544+
for dir in */*
545+
do
546+
if [ "$(isProject "$dir")" ]
547+
then
548+
echo " $dir \\" >> melt.sh
549+
else
550+
# Check for a child component of a multi-module project.
551+
local childDir="$dir/$(basename "$dir")"
552+
test "$(isProject "$childDir")" &&
553+
echo " $childDir \\" >> melt.sh
554+
fi
555+
done
556+
echo >> melt.sh
557+
echo 'do (' >> melt.sh
558+
echo ' cd "$f"' >> melt.sh
559+
echo ' sh "$dir/build.sh" > build.log 2>&1 &&' >> melt.sh
560+
echo ' echo "[SUCCESS] $f" ||' >> melt.sh
561+
echo ' echo "[FAILURE] $f"' >> melt.sh
562+
echo ') done' >> melt.sh
563+
}
564+
536565
# Creates and tests an appropriate multi-module reactor for the given project.
537566
# All relevant dependencies which match the inclusion criteria are linked into
538567
# the multi-module build, with each changed GAV overridding the originally
@@ -596,23 +625,11 @@ meltDown() {
596625
# Prune the build, if applicable.
597626
test "$prune" && pruneReactor
598627

599-
# Generate the aggregator POM.
600-
info "Generating aggregator POM"
601-
generatePOM
602-
603628
# Generate build scripts.
629+
info "Generating build scripts"
630+
generatePOM
604631
echo "mvn $args \\\\\n test \$@" > build.sh
605-
echo '#!/bin/sh
606-
trap "exit" INT
607-
echo "Melting the pot..."
608-
dir=$(pwd)
609-
for f in */*
610-
do (
611-
cd "$f"
612-
sh "$dir/build.sh" > build.log 2>&1 &&
613-
echo "[SUCCESS] $f" ||
614-
echo "[FAILURE] $f"
615-
) done' > melt.sh
632+
generateScript
616633

617634
# Build everything.
618635
if [ "$skipBuild" ]

0 commit comments

Comments
 (0)
0