Esempio n. 1
0
        /// <summary>
        /// Prepares the working directory tree for a verb's execution.
        /// </summary>
        /// <param name="verb">The verb whose execution we're preparing for.</param>
        private void PrepareForVerb(WorkingDirectory workingDirectory, IVerb verb)
        {
            // Debugging aide: write out the abstract id for this verb.
            File.WriteAllText(workingDirectory.PathTo("Debug.txt"), verb.getAbstractIdentifier().ToString());

            Repository repository = BuildEngine.theEngine.Repository;

            // Copy all verb inputs from the item cache to here.
            DependencyDisposition ddisp;

            foreach (BuildObject input in verb.getDependencies(out ddisp))
            {
                if (!(input is VirtualBuildObject))
                {
                    workingDirectory.CreateDirectoryFor(input);  // REVIEW: No longer needed?
                    repository.Fetch(workingDirectory, input);
                }
            }

            // Ensures that the directory tree for each of the verb's outputs exists.
            foreach (BuildObject output in verb.getOutputs())
            {
                workingDirectory.CreateDirectoryFor(output);
            }
        }
        public IEnumerable <BuildObject> getDependencies(IVerb verb, out DependencyDisposition ddisp)
        {
            dbgQueries += 1;
            DependencyResult result;
            bool             present = theCache.TryGetValue(verb, out result);

            if (!present)
            {
                dbgMisses  += 1;
                result      = new DependencyResult();
                result.deps = verb.getDependencies(out result.ddisp);
                if (result.ddisp != DependencyDisposition.Incomplete)
                {
                    //- Can't cache incomplete results, since they may change upon
                    //- later inspection.
                    theCache[verb] = result;
                }
            }
            ddisp = result.ddisp;
            return(result.deps);
        }
Esempio n. 3
0
        public IEnumerable<BuildObject> getDependencies(IVerb verb, out DependencyDisposition ddisp)
        {
            this.dbgQueries += 1;
            DependencyResult result;
            bool present = this.theCache.TryGetValue(verb, out result);
            if (!present)
            {
                this.dbgMisses += 1;
                result = new DependencyResult();
                result.deps = verb.getDependencies(out result.ddisp);
                if (result.ddisp != DependencyDisposition.Incomplete)
                {
                    // Can't cache incomplete results, since they may change upon
                    // later inspection.
                    this.theCache[verb] = result;
                }
            }

            ddisp = result.ddisp;
            return result.deps;
        }
Esempio n. 4
0
        /// <summary>
        /// Prepares the working directory tree for a verb's execution.
        /// </summary>
        /// <param name="verb">The verb whose execution we're preparing for.</param>
        private void PrepareForVerb(WorkingDirectory workingDirectory, IVerb verb)
        {
            // Debugging aide: write out the abstract id for this verb.
            File.WriteAllText(workingDirectory.PathTo("Debug.txt"), verb.getAbstractIdentifier().ToString());

            Repository repository = BuildEngine.theEngine.Repository;

            // Copy all verb inputs from the item cache to here.
            DependencyDisposition ddisp;
            foreach (BuildObject input in verb.getDependencies(out ddisp))
            {
                if (!(input is VirtualBuildObject))
                {
                    workingDirectory.CreateDirectoryFor(input);  // REVIEW: No longer needed?
                    repository.Fetch(workingDirectory, input);
                }
            }

            // Ensures that the directory tree for each of the verb's outputs exists.
            foreach (BuildObject output in verb.getOutputs())
            {
                workingDirectory.CreateDirectoryFor(output);
            }
        }