@@ -62,13 +62,15 @@ object RepublishPlugin extends AutoPlugin {
62
62
val republishFetchLaunchers = taskKey[Set [File ]](" cache the launcher deps for the distribution" )
63
63
val republishFetchCoursier = taskKey[File ](" cache the coursier.jar for resolving the local maven repo." )
64
64
val republishPrepareBin = taskKey[File ](" prepare the bin directory, including launchers and scripts." )
65
+ val republishWriteExtraProps = taskKey[Option [File ]](" write extra properties for the launchers." )
65
66
val republishBinDir = settingKey[File ](" where to find static files for the bin dir." )
66
67
val republishCoursierDir = settingKey[File ](" where to download the coursier launcher jar." )
67
68
val republishBinOverrides = settingKey[Seq [File ]](" files to override those in bin-dir." )
68
69
val republish = taskKey[File ](" cache the dependencies and download launchers for the distribution" )
69
70
val republishRepo = settingKey[File ](" the location to store the republished artifacts." )
70
71
val republishLaunchers = settingKey[Seq [(String , String )]](" launchers to download. Sequence of (name, URL)." )
71
72
val republishCoursier = settingKey[Seq [(String , String )]](" coursier launcher to download. Sequence of (name, URL)." )
73
+ val republishExtraProps = settingKey[Seq [(String , String )]](" extra properties for launchers." )
72
74
}
73
75
74
76
import autoImport ._
@@ -276,6 +278,7 @@ object RepublishPlugin extends AutoPlugin {
276
278
republishLaunchers := Seq .empty,
277
279
republishCoursier := Seq .empty,
278
280
republishBinOverrides := Seq .empty,
281
+ republishExtraProps := Seq .empty,
279
282
republishLocalResolved / republishProjectRefs := {
280
283
val proj = thisProjectRef.value
281
284
val deps = buildDependencies.value
@@ -366,10 +369,31 @@ object RepublishPlugin extends AutoPlugin {
366
369
}
367
370
targetBin
368
371
},
372
+ republishWriteExtraProps := {
373
+ val s = streams.value
374
+ val log = s.log
375
+ val extraProps = republishExtraProps.value
376
+ if (extraProps.isEmpty) {
377
+ log.info(" [republish] No extra properties to write." )
378
+ None
379
+ }
380
+ else {
381
+ val repoDir = republishRepo.value
382
+ val propsFile = repoDir / " etc" / " EXTRA_PROPERTIES"
383
+ log.info(s " [republish] Writing extra properties to $propsFile... " )
384
+ Using .fileWriter()(propsFile) { writer =>
385
+ extraProps.foreach { case (k, v) =>
386
+ writer.write(s " $k:= $v\n " )
387
+ }
388
+ }
389
+ Some (propsFile)
390
+ }
391
+ },
369
392
republish := {
370
393
val cacheDir = republishRepo.value
371
394
val artifacts = republishClasspath.value
372
395
val launchers = republishFetchLaunchers.value
396
+ val extraProps = republishWriteExtraProps.value
373
397
cacheDir
374
398
}
375
399
)
0 commit comments