Skip to content
This repository was archived by the owner on Feb 23, 2018. It is now read-only.

Commit 749c212

Browse files
committed
Merge pull request #120 from lrytz/master
Make sure modules are built and published using the final release
2 parents 56b6049 + 8079308 commit 749c212

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

job/scala-release-2.11.x

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,30 +187,43 @@ sbtResolve() {
187187
# then set the version to the right one and publish (which won't re-gen the docs).
188188
# Also tried publish-local without docs using 'set publishArtifact in (Compile, packageDoc) := false' and republishing, no dice.
189189

190+
# Each buildModule() function is invoked twice: first to build against locker and publish to private-repo, then
191+
# to build against the release and publish to sonatype (or publish-local if publishToSonatype is not "yes").
192+
# In the second round, sbtResolve is always true: the module will be found in the private-repo!
193+
# Therefore, if MODULE_BUILT is "yes" (in the second round), we know that we need to build (and publish) the
194+
# module again.
195+
#
196+
# Note: we tried an alternative solution in which sbtResolve would not look at private-repo, but that fails. For example,
197+
# scala-xml depends on scala-library, so sbt tries to find the scala-library of the version that we are currently building,
198+
# which exists only in private-repo.
199+
190200
buildXML() {
191-
if [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang.modules" "scala-xml" $XML_VER )
201+
if [ "$XML_BUILT" != "yes" ] && [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang.modules" "scala-xml" $XML_VER )
192202
then echo "Found scala-xml $XML_VER; not building."
193203
else
194204
update scala scala-xml "$XML_REF" && gfxd
195205
sbtBuild 'set version := "'$XML_VER'-DOC"' $clean doc 'set version := "'$XML_VER'"' "${buildTasks[@]}"
206+
XML_BUILT="yes" # ensure the module is built and published when buildXML is invoked for the second time, see comment above
196207
fi
197208
}
198209

199210
buildParsers() {
200-
if [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang.modules" "scala-parser-combinators" $PARSERS_VER )
211+
if [ "$PARSERS_BUILT" != "yes" ] && [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang.modules" "scala-parser-combinators" $PARSERS_VER )
201212
then echo "Found scala-parser-combinators $PARSERS_VER; not building."
202213
else
203214
update scala scala-parser-combinators "$PARSERS_REF" && gfxd
204215
sbtBuild 'set version := "'$PARSERS_VER'-DOC"' $clean doc 'set version := "'$PARSERS_VER'"' "${buildTasks[@]}"
216+
PARSERS_BUILT="yes"
205217
fi
206218
}
207219

208220
buildPartest() {
209-
if [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang.modules" "scala-partest" $PARTEST_VER )
221+
if [ "$PARTEST_BUILT" != "yes" ] && [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang.modules" "scala-partest" $PARTEST_VER )
210222
then echo "Found scala-partest $PARTEST_VER; not building."
211223
else
212224
update scala scala-partest "$PARTEST_REF" && gfxd
213225
sbtBuild 'set version :="'$PARTEST_VER'"' 'set VersionKeys.scalaXmlVersion := "'$XML_VER'"' 'set VersionKeys.scalaCheckVersion := "'$SCALACHECK_VER'"' $clean "${buildTasks[@]}"
226+
PARTEST_BUILT="yes"
214227
fi
215228
}
216229

@@ -224,48 +237,53 @@ buildPartest() {
224237
# }
225238

226239
buildContinuations() {
227-
if [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang.plugins" "scala-continuations-plugin" $CONTINUATIONS_VER full )
240+
if [ "$CONT_PLUG_BUILT" != "yes" ] && [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang.plugins" "scala-continuations-plugin" $CONTINUATIONS_VER full )
228241
then echo "Found scala-continuations-plugin $CONTINUATIONS_VER; not building."
229242
else
230243
update scala scala-continuations $CONTINUATIONS_REF && gfxd
231244

232245
$sbtCmd $sbtArgs 'project plugin' "${scalaVersionTasks[@]}" "${publishTasks[@]}" \
233246
'set version := "'$CONTINUATIONS_VER'"' $clean "compile:package" "${buildTasks[@]}" # https://github.com/scala/scala-continuations/pull/4
247+
CONT_PLUG_BUILT="yes"
234248
fi
235249

236-
if [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang.plugins" "scala-continuations-library" $CONTINUATIONS_VER )
250+
if [ "$CONT_LIB_BUILT" != "yes" ] && [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang.plugins" "scala-continuations-library" $CONTINUATIONS_VER )
237251
then echo "Found scala-continuations-library $CONTINUATIONS_VER; not building."
238252
else
239253
update scala scala-continuations $CONTINUATIONS_REF && gfxd
240254
$sbtCmd $sbtArgs 'project library' "${scalaVersionTasks[@]}" "${publishTasks[@]}" \
241255
'set version := "'$CONTINUATIONS_VER'"' $clean "${buildTasks[@]}"
256+
CONT_LIB_BUILT="yes"
242257
fi
243258
}
244259

245260
buildSwing() {
246-
if [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang.modules" "scala-swing" $SWING_VER )
261+
if [ "$SWING_BUILT" != "yes" ] && [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang.modules" "scala-swing" $SWING_VER )
247262
then echo "Found scala-swing $SWING_VER; not building."
248263
else
249264
update scala scala-swing "$SWING_REF" && gfxd
250265
sbtBuild 'set version := "'$SWING_VER'"' $clean "${buildTasks[@]}"
266+
SWING_BUILT="yes"
251267
fi
252268
}
253269

254270
buildActorsMigration(){
255-
if [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang" "scala-actors-migration" $ACTORS_MIGRATION_VER )
271+
if [ "$ACTORS_MIGRATION_BUILT" != "yes" ] && [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang" "scala-actors-migration" $ACTORS_MIGRATION_VER )
256272
then echo "Found scala-actors-migration $ACTORS_MIGRATION_VER; not building."
257273
else
258274
update scala actors-migration "$ACTORS_MIGRATION_REF" && gfxd
259275
sbtBuild 'set version := "'$ACTORS_MIGRATION_VER'"' 'set VersionKeys.continuationsVersion := "'$CONTINUATIONS_VER'"' $clean "${buildTasks[@]}"
276+
ACTORS_MIGRATION_BUILT="yes"
260277
fi
261278
}
262279

263280
buildScalacheck(){
264-
if [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scalacheck" "scalacheck" $SCALACHECK_VER )
281+
if [ "$SCALACHECK_BUILT" != "yes" ] && [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scalacheck" "scalacheck" $SCALACHECK_VER )
265282
then echo "Found scalacheck $SCALACHECK_VER; not building."
266283
else
267284
update rickynils scalacheck $SCALACHECK_REF && gfxd
268285
sbtBuild 'set version := "'$SCALACHECK_VER'"' 'set VersionKeys.scalaParserCombinatorsVersion := "'$PARSERS_VER'"' $clean $publishPrivateTask # test times out NOTE: never published to sonatype
286+
SCALACHECK_BUILT="yes"
269287
fi
270288
}
271289

0 commit comments

Comments
 (0)