简体   繁体   中英

Gradle: generate separate eclipse projects for unit tests

I would love to generate a separate eclipse project from gradle modules with unit tests: one project for the main module, and another one for the unit test. This would help prevent the 'cross classpath' issues that happen in eclipse due to the test classpath becoming part of the main project classpath (for modules with unit tests adding extra entries to the classpath).

I wonder if anyone has tried this?

Thanks

I managed this in a recent PR , but the solution is messy and unpleasant: copy-pasting EclipsePlugin to create three new tasks to set up the second Eclipse project. I suspect the result is fragile against changes to Gradle, as well as being rather opaque for future maintainers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM