Don't rewrite RunFromSource.classpath every time

In the sbt project, we often spuriously re-doc a number of projects that
haven't changed because we modify a file in the resource path.
This commit is contained in:
Ethan Atkins 2019-07-27 12:47:00 -07:00
parent e3e2f29bdd
commit 893f120dee
1 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import com.typesafe.tools.mima.core._, ProblemFilters._
import local.Scripted
import scala.xml.{ Node => XmlNode, NodeSeq => XmlNodeSeq, _ }
import scala.xml.transform.{ RewriteRule, RuleTransformer }
import scala.util.Try
ThisBuild / version := {
val v = "1.3.0-SNAPSHOT"
@ -402,7 +403,9 @@ lazy val scriptedSbtReduxProj = (project in file("scripted-sbt-redux"))
val extDepsCp = (externalDependencyClasspath in Compile in LocalProject("sbtProj")).value
val cpStrings = (mainClassDir +: testClassDir +: classDirs) ++ extDepsCp.files map (_.toString)
val file = (resourceManaged in Compile).value / "RunFromSource.classpath"
IO.writeLines(file, cpStrings)
if (!file.exists || Try(IO.readLines(file)).getOrElse(Nil).toSet != cpStrings.toSet) {
IO.writeLines(file, cpStrings)
}
List(file)
},
mimaSettings,