Пример #1
0
        public IEnumerable <BuildObject> getIncludes(BuildObject beatsrc)
        {
            IHasher hasher = BuildEngine.theEngine.getHasher();
            OrderPreservingSet <BuildObject> includes = new OrderPreservingSet <BuildObject>();

            BuildObject ifcFile = hasher.search(this.includePathSearcher, beatsrc.getFileNameWithoutExtension(), ModPart.Ifc);
            BuildObject impFile = hasher.search(this.includePathSearcher, beatsrc.getFileNameWithoutExtension(), ModPart.Imp);

            Util.Assert(ifcFile.Equals(beatsrc) || impFile.Equals(beatsrc));
            includes.AddRange(this.directIncludes.getBasmIncludes(ifcFile));
            includes.AddRange(this.directIncludes.getBasmIncludes(impFile));
            return(includes);
        }
Пример #2
0
        public override IEnumerable <BuildObject> getDependencies(out DependencyDisposition ddisp)
        {
            ddisp = DependencyDisposition.Complete;

            OrderPreservingSet <BuildObject> deps = new OrderPreservingSet <BuildObject>();

            // Things we need to stitch the interface:
            deps.Add(this.genericStitch);
            deps.Add(this.appSpecificStitch);
            deps.AddRange(this.mainBeatVerb.getOutputs());

            // Things we need to stitch the imports into the imp file:
            deps.Add(this.entryImpInput);
            deps.Add(this.context.getContextOutput());
            IIncludePathContext pathContext = this.context.fetchIfAvailable(ref ddisp);

            if (pathContext != null)
            {
                this.dafnyMainIfcInput = pathContext.search("dafny_Main_i", ModPart.Ifc);
                Util.Assert(this.dafnyMainIfcInput != null);
                deps.Add(this.dafnyMainIfcInput);
                this.dafnyMainImpInput = pathContext.search("dafny_Main_i", ModPart.Ifc);
                Util.Assert(this.dafnyMainImpInput != null);
                deps.Add(this.dafnyMainImpInput);
            }

            return(deps);
        }
Пример #3
0
        //- The list belongs to the caller to .Add() to as desired.
        public static OrderPreservingSet <BuildObject> getBasmFlavoredTransitiveDependencies(IContextGeneratingVerb context, BuildObject rootObj, out DependencyDisposition ddisp)
        {
            OrderPreservingSet <BuildObject> result = new OrderPreservingSet <BuildObject>();
            TransitiveDepsVerb depsVerb             = getBasmFlavoredTransitiveDepVerb(context, rootObj);

            result.Add(depsVerb.depsObj());
            result.AddRange(depsVerb.getAvailableDeps(out ddisp));
            //- NB add root object at end of list, to keep it in definition-dependency order
            result.Add(rootObj);
            return(result);
        }
        public override IVerbWorker getWorker()
        {
            OrderPreservingSet <BuildObject> shallowDeps    = new OrderPreservingSet <BuildObject>();
            OrderPreservingSet <BuildObject> transitiveDeps = new OrderPreservingSet <BuildObject>();

            IEnumerable <BuildObject> includes = getIncludeFactory().getIncludes(obj);

            foreach (BuildObject child in includes)
            {
                shallowDeps.Add(child);
                transitiveDeps.AddRange(factory(child).getTransitiveIncludes());
                transitiveDeps.Add(child);
            }
            VirtualContents contents = new TransitiveDepsContents(shallowDeps, transitiveDeps);

            BuildEngine.theEngine.getNuObjContents().storeVirtual(depsObj(), new Fresh(), contents);
            return(new VerbSyncWorker(new Fresh()));
        }
Пример #5
0
        //- This used to use a BeatTransitiveDepsVerb, but we're going with shallow dependencies at the moment.
        //- We may want to restore that behavior later, if we can get some sane transitive dep tree worked out for
        //- Verve code.
        //- The returned list belongs to the caller to .Add() to as desired.
        //- TODO this really needs to be factored to supply the actual Beat-flavored references separately
        //- from the auxiliary deps (transitive dep objects and context dep objects), so we don't have
        //- client code trying to filter back out the part it wants. Brittle.
        public static OrderPreservingSet <BuildObject> getBeatFlavoredShallowDependencies(
            IContextGeneratingVerb contextVerb, BuildObject rootObj, out DependencyDisposition ddisp, BeatIncludes.ImportFilter filter)
        {
            OrderPreservingSet <BuildObject> result = new OrderPreservingSet <BuildObject>();

            result.Add(contextVerb.getContextOutput());
            try
            {
                result.AddRange(getBeatFlavoredShallowIncludes(contextVerb, rootObj, filter));
                ddisp = DependencyDisposition.Complete;
            }
            catch (ObjNotReadyException)
            {
                ddisp = DependencyDisposition.Incomplete;
            }
            catch (ObjFailedException)
            {
                ddisp = DependencyDisposition.Failed;
            }
            result.Add(rootObj);    //- root really needs to go at the end of the list.
            return(result);
        }