Sha256: f736e5ed4819536828aed6ada3f38b54aa0605b30ebca2b239ae8396c9d31d7d

Contents?: true

Size: 1.19 KB

Versions: 6

Compression:

Stored size: 1.19 KB

Contents

require 'rubygems/tasks/task'

require 'rubygems/builder'

module Gem
  class Tasks
    module Build
      class Task < Tasks::Task

        protected

        def build_task(name,extname=name)
          directory Project::PKG_DIR

          @project.builds.each do |build,packages|
            namespace :build do
              namespace name do
                gemspec = @project.gemspecs[build]
                path    = packages[extname]

                # define file tasks, so the packages are not needless re-built
                file(path => [Project::PKG_DIR, *gemspec.files]) do
                  status "Building #{File.basename(path)} ..."

                  build(path,gemspec)
                end

                task build => path
              end
            end

            task "build:#{build}" => "build:#{name}:#{build}"
          end

          gemspec_tasks "build:#{name}"

          desc "Builds all packages" unless task?(:build)
          task :build => "build:#{name}"
        end

        #
        # @param [String] path
        #
        # @param [Gem::Specification] gemspec
        #
        # @abstract
        #
        def build(path,gemspec)
        end

      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubygems-tasks-0.1.2 lib/rubygems/tasks/build/task.rb
rubygems-tasks-0.1.1 lib/rubygems/tasks/build/task.rb
rubygems-tasks-0.1.0 lib/rubygems/tasks/build/task.rb
rubygems-tasks-0.1.0.pre3 lib/rubygems/tasks/build/task.rb
rubygems-tasks-0.1.0.pre2 lib/rubygems/tasks/build/task.rb
rubygems-tasks-0.1.0.pre1 lib/rubygems/tasks/build/task.rb