sebastianbenz/Jnario — pull request #153 by timw (2014-10-13 20:26:13+00:00)
Title: Speed up compilation of specs when there are .suites in the project

Currently any change to any specification (.spec/.feature/.suite) will trigger compilation of all .suite files, which becomes combinatorial (.spec -> all .suites -> all .suites etc.)

In the Jnario tests, this causes a build that can take up to a minute on any .spec save (which blocks test running).

This change:
- restricts triggering changes to the type identity of the top level Specification in a spec file (i.e. all other changes are very quick to build)
- triggers suite compile only if the changed specs are referenced by the suite (as resolved by the regular expressions (PatternReferences) in the .suite file)
- probably fixes compilation of suites when a spec file is deleted

Downside is the fix involves snooping on internals to identify the ResourceSet to load objects from (so spec names/declaring types and PatternReferences can be resolved). It has to be the actual ResourceSet the changes from from otherwise you can get stale objects (i.e. with non-existent PatternReferences) and exceptions loading objects.

Typical build times with this change in the Jnario tests are:
- instant for non top-level changes
- 1-2 sec for top level type changes that reference small suites
- ~5 sec for changes that reference a top level suite (ala AllSpecs.suite)