Build all build targets specified in the Environment.

 When a block is passed to Environment.new, this method is automatically
 called after the block returns.

 @return [void]
426408
def process
      cache = Cache.instance
      failure = nil
      begin
        while @job_set.size > 0 or @threaded_commands.size > 0

          if failure
            @job_set.clear!
            job = nil
          else
            targets_still_building = @threaded_commands.map do |tc|
              tc.build_operation[:target]
            end
            job = @job_set.get_next_job_to_run(targets_still_building)
          end

          # TODO: have Cache determine when checksums may be invalid based on
          # file size and/or timestamp.
          cache.clear_checksum_cache!

          if job
            result = run_builder(job[:builder],
                                 job[:target],
                                 job[:sources],
                                 cache,
                                 job[:vars],
                                 allow_delayed_execution: true,
                                 setup_info: job[:setup_info])
            unless result
              failure = "Failed to build #{job[:target]}"
              Ansi.write($stderr, :red, failure, :reset, "\n")
              next
            end
          end

          completed_tcs = Set.new
          # First do a non-blocking wait to pick up any threads that have
          # completed since last time.
          while tc = wait_for_threaded_commands(nonblock: true)
            completed_tcs << tc
          end

          # If needed, do a blocking wait.
          if (@threaded_commands.size > 0) and
             ((completed_tcs.empty? and job.nil?) or (@threaded_commands.size >= n_threads))
            completed_tcs << wait_for_threaded_commands
          end

          # Process all completed {ThreadedCommand} objects.
          completed_tcs.each do |tc|
            result = finalize_builder(tc)
            if result
              @build_hooks[:post].each do |build_hook_block|
                build_hook_block.call(tc.build_operation)
              end
            else
              unless @echo == :command
                print_failed_command(tc.command)
              end
              failure = "Failed to build #{tc.build_operation[:target]}"
              Ansi.write($stderr, :red, failure, :reset, "\n")
              break
            end
          end

        end
      ensure
        cache.write
      end
      if failure
        raise BuildError.new(failure)
      end
    end
356375
def call(env)
      # Store environment, request and response for later
      req = ::Rack::Request.new(env)
      res = ::Rack::Response.new

      logger.debug "== Request: #{env['PATH_INFO']}"

      # Catch :halt exceptions and use that response if given
      catch(:halt) do
        process_request(env, req, res)
        res.status = 404
        res.finish
      end
    end
1168046
def set_from_env(*keys, &block)
      assert_keys_with_block(convert_to_keys(keys), block)
      key = flatten_keys(keys)
      env_key = block.nil? ? key : block.()
      env_key = to_env_key(env_key)
      @envs[key.to_s.downcase] = env_key
    end
991697
def build(self):
        
        if not self.build_cmds:
            LOGGER.debug('No build commands were found, skipping build step')

        with LogTask('Building {} disk {}'.format(self.name, self.disk_path)):
            for command in self.build_cmds:
                with LogTask('Running command {}'.format(command.name)):
                    LOGGER.debug(command.cmd)
                    result = utils.run_command(command.cmd)
                    if result:
                        raise BuildException(result.err)
769094
def run_build(self, compiler=GCC, inputs=None, output=None):
        
        logger.info("Running build steps ...")
        self.run_configure(mandatory=False)
        self.run_make(mandatory=False)
        self.run_compiler(compiler=compiler,
                          inputs=inputs,
                          output=output)
340633
def construct (self, properties = [], targets = []):
        
        if not targets:
            for name, project in self.projects ().projects ():
                targets.append (project.target ())

        property_groups = build_request.expand_no_defaults (properties)

        virtual_targets = []
        build_prop_sets = []
        for p in property_groups:
            build_prop_sets.append (property_set.create (feature.split (p)))

        if not build_prop_sets:
            build_prop_sets = [property_set.empty ()]

        for build_properties in build_prop_sets:
            for target in targets:
                result = target.generate (build_properties)
                virtual_targets.extend (result.targets ())

        actual_targets = []
        for virtual_target in virtual_targets:
            actual_targets.extend (virtual_target.actualize ())
933929
def targets_to_build (self):
        
        result = []

        if not self.built_main_targets_:
            self.build_main_targets ()

        # Collect all main targets here, except for "explicit" ones.
        for n, t  in self.main_target_.iteritems ():
            if not t.name () in self.explicit_targets_:
                result.append (t)

        # Collect all projects referenced via "projects-to-build" attribute.
        self_location = self.get ('location')
        for pn in self.get ('projects-to-build'):
            result.append (self.find(pn + "/"))

        return result
662320
def build(&block)
      raise 'build must be called with a block' if !block_given?

      root = menu_items.build(title: 'Home', url: '/', lft: 1, rgt: 2)
      root.parent = true
      instance_exec(&block) # A call to dropdown or item
      root.rgt = menu_items.map(&:rgt).max
      self
    end
416091
def validate_paths!
      if self.build_path.exist?
        log self, "Cleaning up previous build \"#{self.build_path}\""
        rm_rf(self.build_path)
      end
        
      if !self.target_path.exist?
        log self, "Creating target path \"#{self.target_path}\""
        mkdir self.target_path
      end
    end
774965
def build(self):
        
        docker_build = docker.from_env().api.build
        build_actions = []
        for a in docker_build(
            str(settings.project_customization.path), tag=settings.tag
        ):
            build_actions.append(a)
941673
def create_build_phases *base_phase_names
      
      base_phase_names.compact.flatten.map do |phase_name|
        build_phase = create_build_phase phase_name do |build_phase|
          yield build_phase if block_given?
        end
        
        build_phase.save!
      end
      
    end
672497
def targets
      @targets ||= Dir.glob(File.join(target_dir, '*.rb'))
                      .collect { |t| t.gsub("#{target_dir}/", '').gsub('.rb', '').intern }
    end
643884
def _create_nodes(self, env, target = None, source = None):
        
        src_suf = self.get_src_suffix(env)

        target_factory = env.get_factory(self.target_factory)
        source_factory = env.get_factory(self.source_factory)

        source = self._adjustixes(source, None, src_suf)
        slist = env.arg2nodes(source, source_factory)

        pre = self.get_prefix(env, slist)
        suf = self.get_suffix(env, slist)

        if target is None:
            try:
                t_from_s = slist[0].target_from_source
            except AttributeError:
                raise UserError("Do not know how to create a target from source `%s'" % slist[0])
            except IndexError:
                tlist = []
            else:
                splitext = lambda S: self.splitext(S,env)
                tlist = [ t_from_s(pre, suf, splitext) ]
        else:
            target = self._adjustixes(target, pre, suf, self.ensure_suffix)
            tlist = env.arg2nodes(target, target_factory, target=target, source=source)

        if self.emitter:
            # The emitter is going to do str(node), but because we're
            # being called *from* a builder invocation, the new targets
            # don't yet have a builder set on them and will look like
            # source files.  Fool the emitter's str() calls by setting
            # up a temporary builder on the new targets.
            new_targets = []
            for t in tlist:
                if not t.is_derived():
                    t.builder_set(self)
                    new_targets.append(t)

            orig_tlist = tlist[:]
            orig_slist = slist[:]

            target, source = self.emitter(target=tlist, source=slist, env=env)

            # Now delete the temporary builders that we attached to any
            # new targets, so that _node_errors() doesn't do weird stuff
            # to them because it thinks they already have builders.
            for t in new_targets:
                if t.builder is self:
                    # Only delete the temporary builder if the emitter
                    # didn't change it on us.
                    t.builder_set(None)

            # Have to call arg2nodes yet again, since it is legal for
            # emitters to spit out strings as well as Node instances.
            tlist = env.arg2nodes(target, target_factory,
                                  target=orig_tlist, source=orig_slist)
            slist = env.arg2nodes(source, source_factory,
                                  target=orig_tlist, source=orig_slist)

        return tlist, slist
301372
def build(self):
        
        p = self.do_build()
        p += self.build_padding()
        p = self.build_done(p)
        return p
91834
def build(name, options={})
      @builds[name] = build = Build.new(options)
      with_scope(build) { yield }
    end
680858
def built(self):
        """"""

        # Clear the implicit dependency caches of any Nodes
        # waiting for this Node to be built.
        for parent in self.waiting_parents:
            parent.implicit = None

        self.clear()

        if self.pseudo:
            if self.exists():
                raise SCons.Errors.UserError("Pseudo target " + str(self) + " must not exist")
        else:
            if not self.exists() and do_store_info:
                SCons.Warnings.warn(SCons.Warnings.TargetNotBuiltWarning,
                                    "Cannot find target " + str(self) + " after building")
        self.ninfo.update(self)
117588
def setup_rake_dependencies(task, multitask = nil)
      dependencies.reverse_each do |d|
        begin
          bb = ALL_BUILDING_BLOCKS[d]
          raise "Error: tried to add the dependencies of \"#{d}\" to \"#{@name}\" but such a building block could not be found!" unless bb

          if multitask and bb.pre_step
            multitask.prerequisites.unshift(bb.get_task_name)
          else
            task.prerequisites.unshift(bb.get_task_name)
          end
        rescue ExitHelperException
          raise
        rescue Exception => e
          Printer.printError e.message
          ExitHelper.exit(1)
        end
      end

      task
    end