@@ -278,28 +278,6 @@ case class ScalatronUser(name: String, scalatron: ScalatronImpl) extends Scalatr
278
278
list
279
279
}
280
280
281
- /*
282
- def createBackupVersion(policy: VersionPolicy, label: String, updatedSourceFiles: SourceFileCollection) =
283
- policy match {
284
- case VersionPolicy.IfDifferent =>
285
- if (git.status().call().isClean) {
286
- if(scalatron.verbose) println("VersionPolicy.IfDifferent, files are unchanged => not creating backup version")
287
- None
288
- } else {
289
- if(scalatron.verbose) println("VersionPolicy.IfDifferent, files are different => creating backup version")
290
- Some(updateSourcesAndCreateVersion(label, sourceFiles)) // backup old files as a version
291
- }
292
- case VersionPolicy.Always =>
293
- if(scalatron.verbose) println("VersionPolicy.Always => creating backup version")
294
- Some(updateSourcesAndCreateVersion(label, sourceFiles)) // backup old files as a version
295
-
296
- case VersionPolicy.Never =>
297
- if(scalatron.verbose) println("VersionPolicy.Never => not creating backup version")
298
- None // OK - nothing to back up
299
- }
300
- */
301
-
302
-
303
281
304
282
305
283
@@ -313,15 +291,20 @@ case class ScalatronUser(name: String, scalatron: ScalatronImpl) extends Scalatr
313
291
val backupJarFile = new File (backupJarFilePath)
314
292
if ( backupJarFile.exists ) {
315
293
if ( scalatron.verbose ) println(" deleting backup .jar file: " + backupJarFilePath)
316
- if ( ! backupJarFile.delete() ) throw new IllegalStateException (" failed to delete backup .jar file at: " + backupJarFilePath)
294
+ if ( ! backupJarFile.delete() ) {
295
+ System .err.println(" failed to delete backup .jar file at: %s" format backupJarFilePath)
296
+ throw new IllegalStateException (" failed to delete backup .jar file at: %s" format backupJarFilePath)
297
+ }
317
298
}
318
299
319
300
// then move away the current .jar file
320
301
val publishedJarFile = new File (publishedJarFilePath)
321
302
if ( publishedJarFile.exists ) {
322
303
if ( scalatron.verbose ) println(" backing up current .jar file: " + publishedJarFilePath + " => " + backupJarFilePath)
323
- if ( ! publishedJarFile.renameTo(backupJarFile) )
324
- throw new IllegalStateException (" failed to rename .jar file to backup: " + backupJarFilePath)
304
+ if ( ! publishedJarFile.renameTo(backupJarFile) ) {
305
+ System .err.println(" failed to rename .jar file to backup: %s" format backupJarFilePath)
306
+ throw new IllegalStateException (" failed to rename .jar file to backup: %s" format backupJarFilePath)
307
+ }
325
308
}
326
309
327
310
@@ -333,18 +316,21 @@ case class ScalatronUser(name: String, scalatron: ScalatronImpl) extends Scalatr
333
316
val userPluginDirectory = new File (userPluginDirectoryPath)
334
317
if ( ! userPluginDirectory.exists() ) {
335
318
if ( ! userPluginDirectory.mkdirs() ) {
336
- throw new IllegalStateException (" failed to create user plug-in directory: " + userPluginDirectoryPath)
319
+ System .err.println(" failed to create user plug-in directory: %s" format userPluginDirectoryPath)
320
+ throw new IllegalStateException (" failed to create user plug-in directory: %s" format userPluginDirectoryPath)
337
321
}
338
322
if ( scalatron.verbose ) println(" created user plug-in directory for '" + name + " ' at: " + userPluginDirectoryPath)
339
323
}
340
324
try {
341
325
copyFile(localJarFilePath, publishedJarFilePath)
342
326
} catch {
343
327
case t : Throwable =>
344
- throw new IllegalStateException (" failed to copy .jar file '" + localJarFilePath + " ' to '" + publishedJarFilePath + " ': " + t)
328
+ System .err.println(" failed to copy .jar file '%s' to '%s': %s" format(localJarFilePath, publishedJarFilePath, t.toString))
329
+ throw new IllegalStateException (" failed to copy .jar file '%s' to '%s': %s" format(localJarFilePath, publishedJarFilePath, t.toString))
345
330
}
346
331
} else {
347
- throw new IllegalStateException (" .jar file intended for publication does not exist: " + localJarFilePath)
332
+ System .err.println(" .jar file intended for publication does not exist: %s" format localJarFilePath)
333
+ throw new IllegalStateException (" .jar file intended for publication does not exist: %s" format localJarFilePath)
348
334
}
349
335
}
350
336
0 commit comments