lib/omnibus/builder.rb
def appbundle(software_name, lockdir: nil, gem: nil, without: nil, extra_bin_files: nil , **options)
      build_commands << BuildCommand.new("appbundle `#{software_name}'") do
        bin_dir            = "#{install_dir}/bin"
        appbundler_bin     = embedded_bin("appbundler")

        lockdir ||=
          begin
            app_software = project.softwares.find do |p|
              p.name == software_name
            end
            if app_software.nil?
              raise "could not find software definition for #{software_name}, add a dependency to it, or pass a lockdir argument to appbundle command."
            end
            app_software.project_dir
          end

        command = [ appbundler_bin, "'#{lockdir}'", "'#{bin_dir}'" ]

        # This option is almost entirely for support of ChefDK and enables transitive gemfile lock construction in order
        # to be able to decouple the dev gems for all the different components of ChefDK.  AKA:  don't use it outside of
        # ChefDK.  You should also explicitly specify the lockdir when going down this road.
        command << [ "'#{gem}'" ] if gem

        # FIXME: appbundler lacks support for this argument when not also specifying the gem (2-arg appbundling lacks support)
        # (if you really need this bug fixed, though, fix it in appbundler, don't try using the 3-arg version to try to
        # get `--without` support, you will likely wind up going down a sad path).
        command << [ "--without", without.join(",") ] unless without.nil?

        command << [ "--extra-bin-files", extra_bin_files.join(",") ] unless extra_bin_files.nil? || extra_bin_files.empty?

        # Ensure the main bin dir exists
        FileUtils.mkdir_p(bin_dir)

        shellout!(command.join(" "), options)
      end
    end
def appbundle(software_name, lockdir: nil, gem: nil, without: nil, extra_bin_files: nil , **options)
      build_commands << BuildCommand.new("appbundle `#{software_name}'") do
        bin_dir            = "#{install_dir}/bin"
        appbundler_bin     = embedded_bin("appbundler")

        lockdir ||=
          begin
            app_software = project.softwares.find do |p|
              p.name == software_name
            end
            if app_software.nil?
              raise "could not find software definition for #{software_name}, add a dependency to it, or pass a lockdir argument to appbundle command."
            end
            app_software.project_dir
          end

        command = [ appbundler_bin, "'#{lockdir}'", "'#{bin_dir}'" ]

        # This option is almost entirely for support of ChefDK and enables transitive gemfile lock construction in order
        # to be able to decouple the dev gems for all the different components of ChefDK.  AKA:  don't use it outside of
        # ChefDK.  You should also explicitly specify the lockdir when going down this road.
        command << [ "'#{gem}'" ] if gem

        # FIXME: appbundler lacks support for this argument when not also specifying the gem (2-arg appbundling lacks support)
        # (if you really need this bug fixed, though, fix it in appbundler, don't try using the 3-arg version to try to
        # get `--without` support, you will likely wind up going down a sad path).
        command << [ "--without", without.join(",") ] unless without.nil?

        command << [ "--extra-bin-files", extra_bin_files.join(",") ] unless extra_bin_files.nil? || extra_bin_files.empty?

        # Ensure the main bin dir exists
        FileUtils.mkdir_p(bin_dir)

        shellout!(command.join(" "), options)
      end
    end
Execute the given appbundler command against the embedded Ruby's
 appbundler. This command assumes the +appbundle+ gem is installed and
 in the embedded Ruby. You should add a dependency on the +appbundler+
 software definition if you want to use this command.

 @example
   appbundle 'chef'

 @param software_name [String]
  The omnibus software definition name that you want to appbundle.  We
  assume that this software definition is a gem that already has `bundle
  install` ran on it so it has a Gemfile.lock to appbundle.
 @param (see #command)
 @return (see #command)