I have a legacy java project that we have been moving to buildr/artifactory from ant/jars in svn.
The primary code is in the default (src/main/java) folder, but we have a few external source paths, for various tests that we can’t move into the default folder, but we want to have access with it.
Currently, when adding a new library/regenerating IDE fields, it does not pick up these source paths, and I can’t find a succinct discussion in the buildr manual for how to actually add them, rather than re-adding everything manually in eclipse (which just gets wiped out on the next regen).
Any idea how to have multiple source paths get picked up explicitly by buildr so that the idea/eclipse targets generate properly?
There are two ways that I know will work with IDEA. The second one might also work with Eclipse, while the first is specific to the
ideatask.The IDEA-specific solution:
imlalso hastest_source_directoriesandexcluded_directoriesarrays you can append to.The possibly eclipse-compatible solution, with more background than you probably want:
The
imlobject gets its default values for the main and test source directory arrays fromproject.compile.sourcesandproject.test.compile.sources(slight simplification; resources are considered also). Buildr defines these.sourcesproject attributes from the layout, so instead of explicitly appending to theimlattributes, you could use a custom layout for your project that includes your special source paths. That might work with theeclipsetask, but I haven’t tried it.