When a directory contains both a java_library and junit_test def, make sure the IDE understands this is a test pth, not a lib path
Review Request #996 - Created Sept. 5, 2014 and submitted
In our repo we have projects with BUILD files with 2 targets like:java_libary(name='lib', ...) junit_test(name='test', ...)
Sometimes, the ide_gen code saw the 'java_library' target first and considered that a regular source path, not a test source path, which causes tests to break in the IDE if they depend on libraries only defined in another test source path. In project.iml, we would see the path defined with is_test="False"
This is just a workaround, as ide_gen still might not always add test folders properly: If there is a java_library defined in a BUILD file under /src/test/java but no junit_test, ide_gen mistakenly thinks this is plain source path, not a test source path.
Re-ran goal idea on our test targets, the folders containing both tests and libraries that were previously 'blue' (regular source paths) are now green as they should be.
the tuple can satisfy all your needs - consider a helper function to produce it, then:
@property def _tuple(self): return (self.root_dir, self.source_base, self.path) def __str__(self): return str(self._tuple) def __eq__(self, other): return self._tuple == other._tuple def __cmp__(self, other): return cmp(self._tuple, other._tuple)
Or just convert to a namedtuple baseclass.
This observation of fact is the thing that doesn't make sense. Marking a SourceSet as test or not should be a consistent operation. I think your email about SourceRoot might have been towards this end.