Skip to content

Commit fc32218

Browse files
committed
Add a compiler.properties resource file like in Scala 2
This is used by sbt to get the compiler's version. The code to generate the resource comes from http://www.scala-sbt.org/0.13/docs/Howto-Generating-Files.html#Generate+resources
1 parent 2427f05 commit fc32218

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

project/Build.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ object DottyBuild extends Build {
3434
unmanagedSourceDirectories in Compile := Seq((scalaSource in Compile).value),
3535
unmanagedSourceDirectories in Test := Seq((scalaSource in Test).value),
3636

37+
// Generate compiler.properties, used by sbt
38+
resourceGenerators in Compile += Def.task {
39+
val file = (resourceManaged in Compile).value / "compiler.properties"
40+
val contents = s"version.number=${version.value}"
41+
IO.write(file, contents)
42+
Seq(file)
43+
}.taskValue,
44+
3745
// include sources in eclipse (downloads source code for all dependencies)
3846
//http://stackoverflow.com/questions/10472840/how-to-attach-sources-to-sbt-managed-dependencies-in-scala-ide#answer-11683728
3947
com.typesafe.sbteclipse.plugin.EclipsePlugin.EclipseKeys.withSource := true,

0 commit comments

Comments
 (0)