class GNOME::Rake::PackageTask

Attributes

author[RW]
description[RW]
email[RW]
homepage[RW]
name[RW]
post_install_message[RW]
required_ruby_version[RW]
root_dir[R]
summary[RW]

Private Class Methods

define(spec, root_dir, &block) click to toggle source
# File lib/gnome/rake/package-task.rb, line 33
def define(spec, root_dir, &block)
  new(spec, root_dir, &block).define
end
new(spec=nil, root_dir=nil) { |self| ... } click to toggle source
# File lib/gnome/rake/package-task.rb, line 42
def initialize(spec=nil, root_dir=nil)
  @spec = spec
  initialize_variables
  initialize_configurations
  if @spec
    @package = Package.new(@spec.name, root_dir)
  else
    file, line, method = caller[1].scan(/^(.*):(\d+)(?::.*`(.*)')?\Z/).first
    root_dir = File.dirname(file)
    @package = Package.new(File.basename(root_dir), root_dir)
  end
  @packages = FileList["#{@package.root_dir.parent}/*"].map{|f| File.directory?(f) ? File.basename(f) : nil}.compact
  @name = @package.name
  @cross_compiling_hooks = []
  yield(self) if block_given?
end

Private Instance Methods

cross_compiling(&block) click to toggle source
# File lib/gnome/rake/package-task.rb, line 59
def cross_compiling(&block)
  warn("cross compile support is dropped.")
  @cross_compiling_hooks << block
end
define() click to toggle source
# File lib/gnome/rake/package-task.rb, line 64
def define
  task :default => :build
  define_spec
  define_package_tasks
end
define_package_tasks() click to toggle source
# File lib/gnome/rake/package-task.rb, line 168
def define_package_tasks
  Gem::PackageTask.new(@spec) do |pkg|
  end
end
define_spec() click to toggle source
# File lib/gnome/rake/package-task.rb, line 137
def define_spec
  @spec ||= Gem::Specification.new do |s|
    warn("spec generation is deprecated. Use .gemspec instead.")
    s.name                  = @name
    s.summary               = @summary
    s.description           = @description
    s.author                = @author
    s.email                 = @email
    s.homepage              = @homepage
    s.licenses              = ["LGPL-2.1+"]
    s.version               = version
    extensions              = FileList["ext/#{@name}/extconf.rb",
                                       "dependency-check/Rakefile"]
    extensions.existing!
    s.extensions            = extensions
    s.require_paths         = ["lib"]
    files                   = FileList["ChangeLog", "README",
                                       "Rakefile", "extconf.rb",
                                       "dependency-check/Rakefile",
                                       "lib/**/*.rb",
                                       "ext/**/depend",
                                       "ext/**/*.{c,h,def,rb}",
                                       "{sample,test}/**/*"]
    files.existing!
    s.files                 = files
    s.required_ruby_version = @required_ruby_version || ">= 2.1.0"
    s.post_install_message  = @post_install_message
    @dependency_configuration.apply(s)
  end
end
define_tasks() click to toggle source

Deprecated. Use define instead.

# File lib/gnome/rake/package-task.rb, line 71
def define_tasks
  define
end
dependency() click to toggle source
# File lib/gnome/rake/package-task.rb, line 79
def dependency
  @dependency_configuration
end
external_packages() click to toggle source
# File lib/gnome/rake/package-task.rb, line 111
def external_packages
  @package.external_packages
end
external_packages=(packages) click to toggle source
# File lib/gnome/rake/package-task.rb, line 115
def external_packages=(packages)
  @package.external_packages = packages
end
guess_version() click to toggle source
# File lib/gnome/rake/package-task.rb, line 99
def guess_version
  versions = {}
  File.open("#{@package.glib2_root_dir}/ext/glib2/rbglib.h") do |rbglib_h|
    rbglib_h.each_line do |line|
      if /#define\s+RBGLIB_([A-Z]+)_VERSION\s+(\d+)/ =~ line
        versions[$1.downcase] = $2.to_i
      end
    end
  end
  ["major", "minor", "micro"].collect {|type| versions[type]}.compact.join(".")
end
initialize_configurations() click to toggle source
# File lib/gnome/rake/package-task.rb, line 133
def initialize_configurations
  @dependency_configuration = DependencyConfiguration.new(self)
end
initialize_variables() click to toggle source
# File lib/gnome/rake/package-task.rb, line 124
def initialize_variables
  @summary = ""
  @description = ""
  @author = "The Ruby-GNOME2 Project Team"
  @email = "ruby-gnome2-devel-en@lists.sourceforge.net"
  @homepage = "https://ruby-gnome.github.io/"
  @external_packages = []
end
native() click to toggle source
# File lib/gnome/rake/package-task.rb, line 91
def native
  @package.native
end
package() click to toggle source
# File lib/gnome/rake/package-task.rb, line 83
def package
  @package
end
ruby_gnome2_package?(name) click to toggle source
# File lib/gnome/rake/package-task.rb, line 75
def ruby_gnome2_package?(name)
  @packages.include?(name)
end
version() click to toggle source
# File lib/gnome/rake/package-task.rb, line 95
def version
  ENV["VERSION"] || guess_version
end
windows() click to toggle source
# File lib/gnome/rake/package-task.rb, line 87
def windows
  @package.windows
end
windows_binary_build_task() click to toggle source
# File lib/gnome/rake/package-task.rb, line 119
def windows_binary_build_task
  @windows_binary_build_task ||= WindowsBinaryBuildTask.new(@package)
end