forax / pro

A Java build tool that works seamlessly with modules
GNU General Public License v3.0
103 stars 15 forks source link

Rename test "module-info.java" to... #39

Closed sormuras closed 7 years ago

sormuras commented 7 years ago

As a follow-up from #4 and the just declined https://youtrack.jetbrains.com/issue/IDEA-172647 I think pro should use a different name for the test module-info.java overlay files. It confuses not only new pro users but also other build tools like IDEs.

Is it possible to name those files: module-info.test?

The extension .test automatically prevents other build tools to include it in their compile process. The dependencies required by the test code has to be supplied manually on the class-path ... for now. Until those tools adopt the merge strategy.

My current work-around is to use module-info.test already and move them before and after the pro run command:

java.nio.file.Files.move(
  java.nio.file.Paths.get("src/test/java/foo.bar").resolve("module-info.test"),
  java.nio.file.Paths.get("src/test/java/foo.bar").resolve("module-info.java")
)

run("resolver", "modulefixer", "compiler", "packager", "tester", "runner")

java.nio.file.Files.move(
  java.nio.file.Paths.get("src/test/java/foo.bar").resolve("module-info.java"),
  java.nio.file.Paths.get("src/test/java/foo.bar").resolve("module-info.test")
)
forax commented 7 years ago

The guy from JetBrain is wrong, you can have several modules with the same name if there are in different folders. This was designed to enable testing :)

sormuras commented 7 years ago

I'll tell them. (: