Skip to content

[2.x] java.io.File yields incorrect cache #8762

@xuwei-k

Description

@xuwei-k

steps

build.sbt

scalaVersion := "2.12.21"

@transient
val assembly = taskKey[Unit]("")

val assemblyOutputPath = taskKey[File]("")

val assemblyJarName = taskKey[String]("")

assembly / target := crossTarget.value

assembly / assemblyOutputPath := (assembly / target).value / (assembly / assemblyJarName).value

assembly / assemblyJarName := "foo.jar"

project/build.properties

sbt.version=2.0.0-RC9

problem

in sbt shell

sbt:assembly-output-path-cache-bug> print assembly / assemblyOutputPath
/Users/kenji/assembly-output-path-cache-bug/target/out/jvm/scala-2.12.21/assembly-output-path-cache-bug/foo.jar
sbt:assembly-output-path-cache-bug> ++ 2.13.18!
[info] Forcing Scala version to 2.13.18 on all projects.
[info] Reapplying settings...
[info] set current project to assembly-output-path-cache-bug (in build file:/Users/kenji/assembly-output-path-cache-bug/)
sbt:assembly-output-path-cache-bug> print assembly / assemblyOutputPath
/Users/kenji/assembly-output-path-cache-bug/target/out/jvm/scala-2.12.21/assembly-output-path-cache-bug/foo.jar

expectation

expect

- target/out/jvm/scala-2.12.21/assembly-output-path-cache-bug/foo.jar
+ target/out/jvm/scala-2.13.18/assembly-output-path-cache-bug/foo.jar

notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions