class GNOME::Rake::PackageTask
Attributes
Private Class Methods
Source
# File lib/gnome/rake/package-task.rb, line 33 def define(spec, root_dir, &block) new(spec, root_dir, &block).define end
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
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
Source
# File lib/gnome/rake/package-task.rb, line 64 def define task :default => :build define_spec define_package_tasks end
Source
# File lib/gnome/rake/package-task.rb, line 168 def define_package_tasks Gem::PackageTask.new(@spec) do |pkg| end end
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
Source
# File lib/gnome/rake/package-task.rb, line 71 def define_tasks define end
Deprecated. Use define
instead.
Source
# File lib/gnome/rake/package-task.rb, line 79 def dependency @dependency_configuration end
Source
# File lib/gnome/rake/package-task.rb, line 111 def external_packages @package.external_packages end
Source
# File lib/gnome/rake/package-task.rb, line 115 def external_packages=(packages) @package.external_packages = packages end
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
Source
# File lib/gnome/rake/package-task.rb, line 133 def initialize_configurations @dependency_configuration = DependencyConfiguration.new(self) end
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
Source
# File lib/gnome/rake/package-task.rb, line 75 def ruby_gnome2_package?(name) @packages.include?(name) end
Source
# File lib/gnome/rake/package-task.rb, line 95 def version ENV["VERSION"] || guess_version end
Source
# File lib/gnome/rake/package-task.rb, line 119 def windows_binary_build_task @windows_binary_build_task ||= WindowsBinaryBuildTask.new(@package) end