forked from rock-core/package_set
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.rb
98 lines (82 loc) · 3.34 KB
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#
# Orocos Specific ignore rules
#
# Ignore log files generated from the orocos/orogen components
ignore(/\.log$/, /\.ior$/, /\.idx$/)
# Ignore all text files except CMakeLists.txt
ignore(/(^|\/)(?!CMakeLists)[^\/]+\.txt$/)
# We don't care about the manifest being changed, as autoproj *will* take
# dependency changes into account
ignore(/manifest\.xml$/)
# Ignore vim swap files
ignore(/\.sw?$/)
# Ignore the numerous backup files
ignore(/~$/)
# Verify that Ruby is NOT 1.8. 1.8 is unsupported
if defined?(RUBY_VERSION) && (RUBY_VERSION =~ /^1\.8\./)
Autoproj.error "Ruby 1.8 is not supported by Rock anymore"
Autoproj.error ""
Autoproj.error "Use Rock's bootstrap.sh script to install Rock"
Autoproj.error "See http://rock-robotics.org/documentation/installation.html for more information"
exit 1
end
require 'autoproj/gitorious'
if !Autoproj.has_source_handler? 'gitorious'
Autoproj.gitorious_server_configuration('GITORIOUS', 'gitorious.org')
end
if !Autoproj.has_source_handler? 'github'
Autoproj.gitorious_server_configuration('GITHUB', 'github.com', :http_url => 'https://github.com')
end
require File.join(File.dirname(__FILE__), 'rock/flavor_definition')
require File.join(File.dirname(__FILE__), 'rock/flavor_manager')
require File.join(File.dirname(__FILE__), 'rock/in_flavor_context')
Rock.flavors.define 'stable'
Rock.flavors.define 'next', :includes => ['stable']
Rock.flavors.define 'master', :includes => ['stable', 'next'], :implicit => true
configuration_option('ROCK_FLAVOR', 'string',
:default => 'stable',
:possible_values => Rock.flavors.flavors.keys,
:doc => [
"Which flavor of Rock do you want to use ?",
"The 'stable' flavor is not updated often, but will contain well-tested code",
"The 'next' flavor is updated more often, and might contain less tested code",
"it is updated from 'master' to test new features before they get pushed in 'stable'",
"Finally, 'master' is where the development takes place. It should generally be in",
"a good state, but will break every once in a while",
"",
"See http://rock-robotics.org/startup/releases.html for more information"])
Rock.flavors.select_current_flavor_by_name(
ENV['ROCK_FORCE_FLAVOR'] || Autoproj.user_config('ROCK_FLAVOR'))
Autoproj.change_option('ROCK_FLAVOR', Rock.flavors.current_flavor.name, true)
def enabled_flavor_system
Rock.flavors.register_flavored_package_set(Autoproj.current_package_set)
end
def in_flavor(*flavors, &block)
Rock.flavors.in_flavor(*flavors, &block)
end
def only_in_flavor(*flavors, &block)
Rock.flavors.only_in_flavor(*flavors, &block)
end
def flavor_defined?(flavor_name)
Rock.flavors.has_flavor?(flavor_name)
end
def package_in_flavor?(pkg, flavor_name)
Rock.flavors.package_in_flavor?(pkg, flavor_name)
end
def add_packages_to_flavors(mappings)
Rock.flavors.add_packages_to_flavors(Autoproj.current_package_set, mappings)
end
def remove_packages_from_flavors(mappings)
Rock.flavors.remove_packages_from_flavors(Autoproj.current_package_set, mappings)
end
# Defines a bundle package in the installation
#
# So far, bundles are mostly Ruby packages
def bundle_package(*args, &block)
ruby_package(*args) do |pkg|
Autoproj.env_add_path 'ROCK_BUNDLE_PATH', pkg.srcdir
if block_given?
pkg.instance_eval(&block)
end
end
end