NPE in checkResolvedTarget. Method moved closer to its only use.
build.ModuleChecker: refactor
build.ModuleChecker: refactor - drop module closure/partition builder dependency from gencontext, translate to original from outer (generator-aware) code.
MPS-19721 script that calculates dependencies to build a model shall respect dependencies of generators involved. If a generator (G1) extends another one (G2), we shall bring G2 to model build dependencies as well, otherwise G1 would fail to find rules from G2. It seems direct dependencies from generator modules are not respected, thus we add dependencies to generator's source language instead.
VisibleArtifacts can try to get original node without forcing client code to care about that - gencontext is owned by VisibleArtifacts anyway.
Drop unused code in j.m.project.ModuleUtil
Violation of Iterable contract, two subsequent #iterator() calls give different result (second and later calls are always empty).
MPSModulesClosure: when generator module G1 depends from generator module G2, add dependency to G2's source language instead - it looks that generator modules are not ok for dependencies in build language.
ModuleFinder: seems that there's no reason to expose dependency to a module that won't be compiled
FetchDependenciesProcessor: relaxed requirement to get non-transient nodes as input (see below); convert to 'original', if possible (to avoid fixing numerous calls).
VisibleArtifacts and BuildMps_Module_Behavior: there's bloody dirty hack about the way build-produced artifacts are collected and accessed during build script generation. MPSModulesClosures used to supply 'original' nodes, and VisibleArtifacts (which fills maps of DependencyHelper at the beginning of generation, to get accessed later on) asserts and expects non-transient nodes. HOWEVER, there's LocalArtifacts subclass, that requires transient nodes, hence we can't convert all nodes to 'original' in VisibleArtifacts.getResource(). With recent change in MPSModulesClosure (dependency from gencontext dropped), all these implicit assumptions hit me severely.
MPSModulesClosure: true recursion in collectDependencies (other than first level was ignored)
build language: build VisibleModules from actual model (drop translation of transient nodes to 'origin' model) - otherwise dependencies added by ModuleChecker point to non-transient models, while declared dependencies point to elements of transient models (as these references get updated during generation steps). With dependencies pointing to same BuildModule but in different model ('original' and transient), it's easy to face duplicated entries (regular collections care about == only). As there's little (or no) reason to convert everything to origin model, and transient models are fine for processing, collectors like VisibleModules shall use actual model supplied, and not introduce any artifcial dependency like one from gencontext.
ModuleFinder: revert recent change - non-compilable modules have to be part of dependency list for generation (e.g. MPS.Core is non-compile solution that in turn depends on mps-core.jar. Any module that depends from MPS.Core shall get appropriate dependency from mps-core.jar)
Build scripts regenerated to reflect ordering emitted by updated templates. New dependencies from devkits (e.g. in mpsBuildUI.xml) are questionable, but this is the way it's deemed to be (MPSModulePartitioner sensibly adds devkits to external dependencies, and there are other tasks that do depend from devkits, athough I don't see a reason to).
Merge remote-tracking branch 'origin/master' into 3.2/artem/default
Sort java module dependencies to ensure same order of compile task dependencies. Build scripts regenerated once again to reflect new ordering.
MPSModulesClosure: apparently, generator modules shall be in compile depdendencies as there could be helper classes needed in extending generators.
MPSModulesClosure: used languages back into design-time dependencies (erroneously dropped due to code refactoring). Build scripts regenerated for test tasks to pick up the changes.