66
77die () { echo " $* " >&2 ; exit 1; }
88
9- echo &&
10- printf ' Generating mega-melt project... ' &&
9+ sectionStart () {
10+ startTime=$( date +%s)
11+ echo
12+ printf " $1 ... "
13+ }
14+
15+ sectionEnd () {
16+ endTime=$( date +%s)
17+ echo " Done! [$(( endTime- startTime)) s]"
18+ }
19+
20+ sectionStart ' Generating mega-melt project'
1121
1222dir=$( dirname " $0 " )
1323pom=" $dir /../pom.xml"
@@ -36,21 +46,20 @@ cp "$pom" "$pomParent" &&
3646mvn -B -f " $pomParent " versions:set -DnewVersion=999-mega-melt > " $versionSwapLog " ||
3747 die " pom-scijava version update failed:\n$( cat " $versionSwapLog " ) "
3848python " $generateMegaMeltScript " " $megaMeltDir " || die ' Generation failed!'
39- echo ' Done! '
49+ sectionEnd # Generating mega-melt project
4050
4151# Ensure the mega-melt dependency structure validates.
4252# In particular, this runs our enforcer rules: the build
4353# will fail if there are any snapshot dependencies, or
4454# any duplicate classes across artifacts on the classpath.
45- echo &&
46- printf ' Validating mega-melt project... ' &&
55+ sectionStart ' Validating mega-melt project'
4756mvn -B -f " $megaMeltPOM " dependency:tree > " $dependencyTreeLog " ||
4857 die " Invalid dependency tree:\n$( cat " $dependencyTreeLog " ) "
4958mvn -B -f " $megaMeltPOM " -U clean package > " $validationLog " || {
5059 python " $filterBuildLogScript " " $validationLog " > " $validationErrorsLog "
5160 die " Validation build failed!\n\nDependency tree:\n$( cat " $dependencyTreeLog " ) \n\nBuild log:\n$( cat " $validationErrorsLog " ) "
5261}
53- echo ' Done! '
62+ sectionEnd # Validating mega-melt project
5463
5564# Run mega-melt through the melting pot, with all SciJava-affiliated groupIds,
5665# minus excluded artifacts (see ignoredArtifacts in generate-mega-melt.py).
@@ -95,14 +104,14 @@ chmod +x "$meltingPotScript" &&
95104grep -qF " [ERROR]" " $meltingPotLog " &&
96105 die ' Melting pot generation failed!'
97106
107+ sectionStart ' Adjusting the melting pot'
108+
98109# HACK: Remove known-duplicate artifactIds from version property overrides.
99110# The plan is for this step to become unnecessary once the melting pot has
100111# been improved to include a strategy for dealing with components with same
101112# artifactId but different groupIds. For now, we just prune these overrides.
102113buildScript=" $meltingPotDir /build.sh"
103114buildScriptTemp=" $buildScript .tmp"
104- echo &&
105- printf ' Adjusting melting pot build script... ' &&
106115cp " $buildScript " " $buildScript .original" &&
107116mv -f " $buildScript " " $buildScriptTemp " &&
108117awk ' !/-D(annotations|antlr|jocl|kryo|minlog|opencsv|trove4j)\.version/' " $buildScriptTemp " > " $buildScript " &&
@@ -122,24 +131,18 @@ sed -E 's; -Dij\.version=([^ ]*);& -Dimagej1.version=\1;' "$buildScriptTemp" > "
122131chmod +x " $buildScript " &&
123132rm " $buildScriptTemp " ||
124133 die ' Error adjusting melting pot build script!'
125- echo ' Done!'
126134
127135# HACK: Adjust component POMs to satisfy Maven HTTPS strictness.
128- echo &&
129- printf ' Adjusting melting pot project POMs... ' &&
130136find " $meltingPotDir " -name pom.xml | while read pom
131137do
132138 mv " $pom " " $pom .original" &&
133139 sed -E -e ' s_(https?://maven.imagej.net|http://maven.scijava.org)_https://maven.scijava.org_g' \
134140 -e ' s_http://maven.apache.org/xsd_https://maven.apache.org/xsd_g' " $pom .original" > " $pom " ||
135141 die " Failed to adjust $pom "
136142done
137- echo ' Done!'
138143
139144# HACK: Skip tests for projects with known problems.
140145
141- echo &&
142- printf ' Adjusting melting pot melt script... ' &&
143146mv " $meltScript " " $meltScript .original" &&
144147sed ' s_\s*"$dir/build.sh"_\
145148# HACK: If project is on the skipTests list, then skip the tests.\
@@ -149,7 +152,6 @@ grep -qxF "$f" $dir/skipTests.txt \&\& buildFlags=-DskipTests\
149152& $buildFlags_' " $meltScript .original" > " $meltScript " &&
150153chmod +x " $meltScript " ||
151154 die " Failed to adjust $meltScript "
152- echo ' Done!'
153155
154156# com.amazonaws.services.s3.model.AmazonS3Exception: The specified bucket does
155157# not exist (Service: Amazon S3; Status Code: 404; Error Code: NoSuchBucket;
@@ -164,6 +166,8 @@ echo "org.janelia.saalfeldlab/n5-zarr" >> "$skipTestsFile" &&
164166echo " sc.fiji/labkit-pixel-classification" >> " $skipTestsFile " ||
165167 die " Failed to generate $skipTestsFile "
166168
169+ sectionEnd # Adjusting the melting pot
170+
167171# Run the melting pot now, unless -s flag was given.
168172doMelt=t
169173for arg in " $@ "
0 commit comments