@@ -187,30 +187,43 @@ sbtResolve() {
187
187
# then set the version to the right one and publish (which won't re-gen the docs).
188
188
# Also tried publish-local without docs using 'set publishArtifact in (Compile, packageDoc) := false' and republishing, no dice.
189
189
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
+
190
200
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 )
192
202
then echo " Found scala-xml $XML_VER ; not building."
193
203
else
194
204
update scala scala-xml " $XML_REF " && gfxd
195
205
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
196
207
fi
197
208
}
198
209
199
210
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 )
201
212
then echo " Found scala-parser-combinators $PARSERS_VER ; not building."
202
213
else
203
214
update scala scala-parser-combinators " $PARSERS_REF " && gfxd
204
215
sbtBuild ' set version := "' $PARSERS_VER ' -DOC"' $clean doc ' set version := "' $PARSERS_VER ' "' " ${buildTasks[@]} "
216
+ PARSERS_BUILT=" yes"
205
217
fi
206
218
}
207
219
208
220
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 )
210
222
then echo " Found scala-partest $PARTEST_VER ; not building."
211
223
else
212
224
update scala scala-partest " $PARTEST_REF " && gfxd
213
225
sbtBuild ' set version :="' $PARTEST_VER ' "' ' set VersionKeys.scalaXmlVersion := "' $XML_VER ' "' ' set VersionKeys.scalaCheckVersion := "' $SCALACHECK_VER ' "' $clean " ${buildTasks[@]} "
226
+ PARTEST_BUILT=" yes"
214
227
fi
215
228
}
216
229
@@ -224,48 +237,53 @@ buildPartest() {
224
237
# }
225
238
226
239
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 )
228
241
then echo " Found scala-continuations-plugin $CONTINUATIONS_VER ; not building."
229
242
else
230
243
update scala scala-continuations $CONTINUATIONS_REF && gfxd
231
244
232
245
$sbtCmd $sbtArgs ' project plugin' " ${scalaVersionTasks[@]} " " ${publishTasks[@]} " \
233
246
' set version := "' $CONTINUATIONS_VER ' "' $clean " compile:package" " ${buildTasks[@]} " # https://github.com/scala/scala-continuations/pull/4
247
+ CONT_PLUG_BUILT=" yes"
234
248
fi
235
249
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 )
237
251
then echo " Found scala-continuations-library $CONTINUATIONS_VER ; not building."
238
252
else
239
253
update scala scala-continuations $CONTINUATIONS_REF && gfxd
240
254
$sbtCmd $sbtArgs ' project library' " ${scalaVersionTasks[@]} " " ${publishTasks[@]} " \
241
255
' set version := "' $CONTINUATIONS_VER ' "' $clean " ${buildTasks[@]} "
256
+ CONT_LIB_BUILT=" yes"
242
257
fi
243
258
}
244
259
245
260
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 )
247
262
then echo " Found scala-swing $SWING_VER ; not building."
248
263
else
249
264
update scala scala-swing " $SWING_REF " && gfxd
250
265
sbtBuild ' set version := "' $SWING_VER ' "' $clean " ${buildTasks[@]} "
266
+ SWING_BUILT=" yes"
251
267
fi
252
268
}
253
269
254
270
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 )
256
272
then echo " Found scala-actors-migration $ACTORS_MIGRATION_VER ; not building."
257
273
else
258
274
update scala actors-migration " $ACTORS_MIGRATION_REF " && gfxd
259
275
sbtBuild ' set version := "' $ACTORS_MIGRATION_VER ' "' ' set VersionKeys.continuationsVersion := "' $CONTINUATIONS_VER ' "' $clean " ${buildTasks[@]} "
276
+ ACTORS_MIGRATION_BUILT=" yes"
260
277
fi
261
278
}
262
279
263
280
buildScalacheck (){
264
- if [ " $forceRebuild " != " yes" ] && ( sbtResolve " org.scalacheck" " scalacheck" $SCALACHECK_VER )
281
+ if [ " $SCALACHECK_BUILT " != " yes " ] && [ " $ forceRebuild" != " yes" ] && ( sbtResolve " org.scalacheck" " scalacheck" $SCALACHECK_VER )
265
282
then echo " Found scalacheck $SCALACHECK_VER ; not building."
266
283
else
267
284
update rickynils scalacheck $SCALACHECK_REF && gfxd
268
285
sbtBuild ' set version := "' $SCALACHECK_VER ' "' ' set VersionKeys.scalaParserCombinatorsVersion := "' $PARSERS_VER ' "' $clean $publishPrivateTask # test times out NOTE: never published to sonatype
286
+ SCALACHECK_BUILT=" yes"
269
287
fi
270
288
}
271
289
0 commit comments