sbt/sbt

clean does not seem to work with java projects

开放

#7,187 创建于 2023年3月24日

 (2 条评论) (0 个反应) (0 位负责人)Scala (1,036 个派生)batch import
area/incremental_compilerhelp wanted

仓库指标

星标
 (4,928 个星标)
PR 合并指标
 (平均合并 1天 15小时) (30 天内合并 66 个 PR)

描述

steps

  1. Make a minimal subproject in a multiproject build that has a few files of only java.
  2. compile the code: mysubproject/compile
  3. view that the class files are generated
  4. clean: mysubproject/clean
  5. verify that the classes are gone
  6. compile the code again and see that nothing happens.

problem

It seems that some in-memory state in sbt is failing to be synced with the disk state.

Workaround: exit sbt after the clean and restart and it works. Again this suggests it is memory state, not disk state that is incorrect.

expectation

javac should be invoked again on the sources.

notes

you can see an example of this in this repo: https://github.com/johnynek/bosatsu/pull/974

check it out at https://github.com/johnynek/bosatsu/pull/974/commits/c5a623de4a72ff6b9d29557afc46651d87f089e7 and try this set of steps:

  1. truffle/compile
  2. truffle/test (should pass)
  3. truffle/clean
  4. truffle/test (now it fails, and compile won't fix it. exit sbt and restart and it should work again).

贡献者指南