appbundle

in lib/omnibus/builder.rb [410:452]


    def appbundle(software_name, options = {})
      build_commands << BuildCommand.new("appbundle `#{software_name}'") do
        bin_dir            = "#{install_dir}/bin"
        appbundler_bin     = embedded_bin("appbundler")

        lockdir = options.delete(:lockdir)
        gem = options.delete(:gem)
        without = options.delete(:without)
        extra_bin_files = options.delete(:extra_bin_files)

        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}'" ]

        
        
        
        command << [ "'#{gem}'" ] if gem

        
        
        
        command << [ "--without", without.join(",") ] unless without.nil?

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

        
        FileUtils.mkdir_p(bin_dir)

        shellout!(command.join(" "), options)
      end
    end