-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not work sbt 1.4 remote cache feature #10490
Comments
There is one other thing routes-generator embed |
I agree it would be better not to include a date there, to make the output more deterministic |
workaround:
routesGenerator := {
import play.routes.compiler.{RoutesCompiler, RoutesGenerator, Rule}
val base = InjectedRoutesGenerator
new RoutesGenerator {
override def generate(
task: RoutesCompiler.RoutesCompilerTask,
namespace: Option[String],
rules: List[Rule]
): Seq[(String, String)] = {
val baseDir = (ThisBuild / baseDirectory).value.getCanonicalPath + "/"
val sourceCommentPrefix = s"// @SOURCE:${baseDir}"
base.generate(task = task, namespace = namespace, rules = rules).map {
case (fileName, src) =>
fileName -> src.linesIterator
.filterNot(_ contains "@DATE")
.map {
case line if line.startsWith(sourceCommentPrefix) =>
line.replace(baseDir, "")
case line =>
line
}
.mkString("\n")
}
}
override def id = base.id
}
} |
Could this be the |
|
For the generated routes files i think we can fix this like we did with twirl by removing the generation date and keeping the source comment relative: |
Fix is here: #10707 |
Play Version
2.8.2
API
Maybe both(Java and Scala)
Operating System
Mac and Linux (also maybe Windows)
JDK
1.8
Library Dependencies
unrelated
Expected Behavior
it should work sbt 1.4 remote cache feature
Actual Behavior
recompile even if there is cache
Reproducible Test Case
step and log
app/controllers/Application.scala
build.sbt
conf/routes
project/build.properties
project/plugins.sbt
Note
playframework routes generator embed current
DATE
in generated source comments.I think it is the cause this issue 🤔
playframework/dev-mode/routes-compiler/src/main/twirl/play/routes/compiler/static/routesPrefix.scala.twirl
Lines 3 to 6 in a90ab0f
playframework/dev-mode/routes-compiler/src/main/scala/play/routes/compiler/RoutesGenerator.scala
Lines 55 to 56 in a90ab0f
cat target/scala-2.13/routes/main/router/RoutesPrefix.scala
different
@DATE
comment 😢after first compile
after second compile
(I want to use remote cache but play re-generate different source 😢 )
Is this a sbt bug or playframework bug? /cc @eed3si9n
playframework should not embed
@DATE
comment? 🤔The text was updated successfully, but these errors were encountered: