简体   繁体   中英

How to have builders/source-folders of different types in same eclipse project

Is it possible to create one eclipse project that has [eg] Java and python code? Eg I want a project say called TestProject that has 2 source folders src_java and src_python . Just so I have one project where I can write all my quickies/test-code instead of having 10 different projects for java, c++, perl, python, ...

From my experiments it seems like I can set the project to one type or the other, not both.

  • I can't see options to add java builders to python project and vice versa.
  • I can't create a java source folder in a python project and vice versa.
  • ...

Thanks

So it seems like it's possible but not via GUI. One can modify the .project file manually to add additional natures.

If you are STFW then the right word to search for is nature ie a "eclipse project multiple natures"

See answer by Zoltan in this thread: Multiple nature for a single project in eclipse

The GUI does not have any option for creating such a multilanguage projects.

However, technically, project natures can be added independently from each other. So if you manage to programmatically create the required environment, it would work. If you want to do it manually, find the .project file in the project root, and add all natures and builders to one (you can look the required elements from other projects - do a copy-paste).

This would add the project natures and builders, but not any additional configuration required - eg in Java projects .classpath files are used to describe the source folders, in other languages different configurations are needed.

Alltogether, if you need to do this multiple times, create a plug-in that manages this configuration for you; if you need it for a single project, think about it whether it is worth the huge effort required.

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