Esempio n. 1
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(genericStitch);
            deps.Add(appSpecificStitch);
            deps.AddRange(mainBeatVerb.getOutputs());

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

            if (pathContext != null)
            {
                dafnyMainIfcInput = pathContext.search("dafny_Main_i", ModPart.Ifc);
                Util.Assert(dafnyMainIfcInput != null);
                deps.Add(dafnyMainIfcInput);
                dafnyMainImpInput = pathContext.search("dafny_Main_i", ModPart.Ifc);
                Util.Assert(dafnyMainImpInput != null);
                deps.Add(dafnyMainImpInput);
            }
            return(deps);
        }
Esempio n. 2
0
        private static IEnumerable <BeatIncludes.LabeledInclude> getBeatFlavoredShallowIncludesLabeled(
            IContextGeneratingVerb contextVerb, BuildObject rootObj)
        {
            ContextContents context = (ContextContents)
                                      BuildEngine.theEngine.Repository.FetchVirtual(contextVerb.getContextOutput());
            BeatIncludes includes = new BeatIncludes(context.Context);
            OrderPreservingSet <BeatIncludes.LabeledInclude> result = new OrderPreservingSet <BeatIncludes.LabeledInclude>(
                includes.getLabeledIncludes(rootObj));

            if (BeatExtensions.whichPart(rootObj) == ModPart.Imp)
            {
                BuildObject rootIfc = context.Context.search(rootObj.getFileNameWithoutExtension(), ModPart.Ifc);
                result.Add(new BeatIncludes.LabeledInclude(BeatIncludes.ImportFilter.ForBeatOrBasm, rootIfc));
            }

            return(result);
        }
Esempio n. 3
0
        private static IEnumerable<BeatIncludes.LabeledInclude> getBeatFlavoredShallowIncludesLabeled(
            IContextGeneratingVerb contextVerb, BuildObject rootObj)
        {
            ContextContents context = (ContextContents)
                BuildEngine.theEngine.Repository.FetchVirtual(contextVerb.getContextOutput());
            BeatIncludes includes = new BeatIncludes(context.Context);
            OrderPreservingSet<BeatIncludes.LabeledInclude> result = new OrderPreservingSet<BeatIncludes.LabeledInclude>(
                includes.getLabeledIncludes(rootObj));

            if (BeatExtensions.whichPart(rootObj) == ModPart.Imp)
            {
                BuildObject rootIfc = context.Context.search(rootObj.getFileNameWithoutExtension(), ModPart.Ifc);
                result.Add(new BeatIncludes.LabeledInclude(BeatIncludes.ImportFilter.ForBeatOrBasm, rootIfc));
            }

            return result;
        }
        internal static IIncludePathContext fetchIfAvailable(this IContextGeneratingVerb verb, ref DependencyDisposition ddisp)
        {
            try
            {
                return(((ContextContents)
                        BuildEngine.theEngine.Repository.FetchVirtual(verb.getContextOutput())).Context);
            }
            catch (ObjectNotReadyException)
            {
                // Oh, we don't even have the context object yet.
                ddisp = ddisp.combine(DependencyDisposition.Incomplete);
            }
            catch (ObjectFailedException)
            {
                ddisp = ddisp.combine(DependencyDisposition.Failed);
            }

            return(null);
        }
Esempio n. 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);
        }
Esempio n. 6
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 (ObjectNotReadyException)
            {
                ddisp = DependencyDisposition.Incomplete;
            }
            catch (ObjectFailedException)
            {
                ddisp = DependencyDisposition.Failed;
            }

            result.Add(rootObj);    // root really needs to go at the end of the list.
            return result;
        }
 protected override void extendDeps(List <BuildObject> deps)
 {
     deps.Add(contextVerb.getContextOutput());
 }