Class: GNOME::Rake::PackageTask
- Inherits:
-
Object
- Object
- GNOME::Rake::PackageTask
show all
- Includes:
- Rake::DSL
- Defined in:
- lib/gnome/rake/package-task.rb
Defined Under Namespace
Classes: DependencyConfiguration
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(spec = nil, root_dir = nil) {|_self| ... } ⇒ PackageTask
Returns a new instance of PackageTask.
[View source]
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# 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
|
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
40
41
42
|
# File 'lib/gnome/rake/package-task.rb', line 40
def author
@author
end
|
#description ⇒ Object
Returns the value of attribute description.
40
41
42
|
# File 'lib/gnome/rake/package-task.rb', line 40
def description
@description
end
|
#email ⇒ Object
Returns the value of attribute email.
40
41
42
|
# File 'lib/gnome/rake/package-task.rb', line 40
def email
@email
end
|
#homepage ⇒ Object
Returns the value of attribute homepage.
40
41
42
|
# File 'lib/gnome/rake/package-task.rb', line 40
def homepage
@homepage
end
|
#name ⇒ Object
Returns the value of attribute name.
40
41
42
|
# File 'lib/gnome/rake/package-task.rb', line 40
def name
@name
end
|
#post_install_message ⇒ Object
Returns the value of attribute post_install_message.
40
41
42
|
# File 'lib/gnome/rake/package-task.rb', line 40
def post_install_message
@post_install_message
end
|
#required_ruby_version ⇒ Object
Returns the value of attribute required_ruby_version.
40
41
42
|
# File 'lib/gnome/rake/package-task.rb', line 40
def required_ruby_version
@required_ruby_version
end
|
#root_dir ⇒ Object
Returns the value of attribute root_dir.
41
42
43
|
# File 'lib/gnome/rake/package-task.rb', line 41
def root_dir
@root_dir
end
|
#summary ⇒ Object
Returns the value of attribute summary.
40
41
42
|
# File 'lib/gnome/rake/package-task.rb', line 40
def summary
@summary
end
|
Class Method Details
.define(spec, root_dir, &block) ⇒ Object
[View source]
33
34
35
|
# File 'lib/gnome/rake/package-task.rb', line 33
def define(spec, root_dir, &block)
new(spec, root_dir, &block).define
end
|
Instance Method Details
#cross_compiling(&block) ⇒ Object
[View source]
59
60
61
62
|
# 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 ⇒ Object
[View source]
64
65
66
67
68
|
# File 'lib/gnome/rake/package-task.rb', line 64
def define
task :default => :build
define_spec
define_package_tasks
end
|
#define_tasks ⇒ Object
Deprecated. Use #define instead.
[View source]
71
72
73
|
# File 'lib/gnome/rake/package-task.rb', line 71
def define_tasks
define
end
|
#dependency ⇒ Object
[View source]
79
80
81
|
# File 'lib/gnome/rake/package-task.rb', line 79
def dependency
@dependency_configuration
end
|
#external_packages ⇒ Object
[View source]
111
112
113
|
# File 'lib/gnome/rake/package-task.rb', line 111
def external_packages
@package.external_packages
end
|
#external_packages=(packages) ⇒ Object
[View source]
115
116
117
|
# File 'lib/gnome/rake/package-task.rb', line 115
def external_packages=(packages)
@package.external_packages = packages
end
|
#guess_version ⇒ Object
[View source]
99
100
101
102
103
104
105
106
107
108
109
|
# 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
|
#native ⇒ Object
[View source]
91
92
93
|
# File 'lib/gnome/rake/package-task.rb', line 91
def native
@package.native
end
|
#package ⇒ Object
[View source]
83
84
85
|
# File 'lib/gnome/rake/package-task.rb', line 83
def package
@package
end
|
#ruby_gnome2_package?(name) ⇒ Boolean
[View source]
75
76
77
|
# File 'lib/gnome/rake/package-task.rb', line 75
def ruby_gnome2_package?(name)
@packages.include?(name)
end
|
#version ⇒ Object
[View source]
95
96
97
|
# File 'lib/gnome/rake/package-task.rb', line 95
def version
ENV["VERSION"] || guess_version
end
|
#windows ⇒ Object
[View source]
87
88
89
|
# File 'lib/gnome/rake/package-task.rb', line 87
def windows
@package.windows
end
|
#windows_binary_build_task ⇒ Object
[View source]
119
120
121
|
# File 'lib/gnome/rake/package-task.rb', line 119
def windows_binary_build_task
@windows_binary_build_task ||= WindowsBinaryBuildTask.new(@package)
end
|