bee 0.8.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/egg/source.yml +21 -17
- data/lib/bee.rb +51 -0
- data/lib/bee_console.rb +1 -1
- data/lib/bee_task_default.rb +8 -4
- metadata +36 -17
data/README
CHANGED
data/egg/source.yml
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
- build:
|
2
|
-
default:
|
3
|
-
description:
|
1
|
+
- build: source
|
2
|
+
default: all
|
3
|
+
description: Generate a sample Ruby source file
|
4
4
|
|
5
5
|
- properties:
|
6
|
-
- name:
|
6
|
+
- name: source.rb
|
7
7
|
- description: This script will generate a sample Ruby source file.
|
8
8
|
|
9
|
-
- target:
|
10
|
-
description:
|
9
|
+
- target: welcome
|
10
|
+
description: Print information message
|
11
11
|
script:
|
12
12
|
- print: :description
|
13
13
|
|
14
|
-
- target:
|
15
|
-
depends:
|
16
|
-
description:
|
14
|
+
- target: prompt
|
15
|
+
depends: welcome
|
16
|
+
description: Prompt for project information
|
17
17
|
script:
|
18
18
|
- print: "Please answer following questions to generate the project:"
|
19
19
|
- prompt:
|
@@ -21,20 +21,24 @@
|
|
21
21
|
default: :name
|
22
22
|
property: name
|
23
23
|
|
24
|
-
- target:
|
25
|
-
depends:
|
26
|
-
description:
|
24
|
+
- target: generate
|
25
|
+
depends: prompt
|
26
|
+
description: Generate source
|
27
27
|
script:
|
28
|
-
- print: "Generating
|
28
|
+
- print: "Generating source..."
|
29
29
|
- erb:
|
30
30
|
src: "#{base}/source/source.rb"
|
31
31
|
dest: "#{here}/#{name}"
|
32
|
+
- if: "RUBY_PLATFORM.split('-')[1] != 'mswin32'"
|
33
|
+
then:
|
34
|
+
- chmod: { files: "#{here}/#{name}", mode: 0755 }
|
32
35
|
|
33
|
-
- target:
|
34
|
-
depends:
|
35
|
-
description:
|
36
|
+
- target: customization
|
37
|
+
depends: generate
|
38
|
+
description: Print information about project customization
|
36
39
|
script:
|
37
40
|
- print: Source file '#{name}' has been generated in this directory.
|
38
41
|
|
39
|
-
- target:
|
42
|
+
- target: all
|
40
43
|
depends: [welcome, prompt, generate, customization]
|
44
|
+
|
data/lib/bee.rb
CHANGED
@@ -36,6 +36,7 @@ module Bee
|
|
36
36
|
'description' => :optional,
|
37
37
|
'context' => :optional,
|
38
38
|
'extends' => :optional,
|
39
|
+
'includes' => :optional,
|
39
40
|
'abstract' => :optional
|
40
41
|
}
|
41
42
|
|
@@ -49,6 +50,8 @@ module Bee
|
|
49
50
|
attr_reader :name
|
50
51
|
# Parent build.
|
51
52
|
attr_reader :extends
|
53
|
+
# Included builds
|
54
|
+
attr_reader :includes
|
52
55
|
# Abstractness.
|
53
56
|
attr_reader :abstract
|
54
57
|
# Default target, specified with default entry or fist target in build file.
|
@@ -174,6 +177,13 @@ module Bee
|
|
174
177
|
@properties.extend(@parent.properties)
|
175
178
|
@targets.extend(@parent.targets)
|
176
179
|
end
|
180
|
+
# manage included builds
|
181
|
+
if @included
|
182
|
+
for include in @included.reverse
|
183
|
+
@properties.include(include.properties)
|
184
|
+
@targets.include(include.targets)
|
185
|
+
end
|
186
|
+
end
|
177
187
|
end
|
178
188
|
|
179
189
|
# Parse a build entry.
|
@@ -190,6 +200,7 @@ module Bee
|
|
190
200
|
@targets.default = @default
|
191
201
|
@description = entry['description']
|
192
202
|
@extends = entry['extends']
|
203
|
+
@includes = Array(entry['includes'])
|
193
204
|
@abstract = entry['abstract']
|
194
205
|
# load parent build if any
|
195
206
|
if @extends
|
@@ -203,6 +214,18 @@ module Bee
|
|
203
214
|
@targets.default = @default
|
204
215
|
@description = @description || @parent.description
|
205
216
|
end
|
217
|
+
# load included build files if any
|
218
|
+
if @includes
|
219
|
+
@included = []
|
220
|
+
for include in @includes
|
221
|
+
absolute_path = Bee::Util::absolute_path(include, @base)
|
222
|
+
begin
|
223
|
+
@included << Bee::Build::load(absolute_path)
|
224
|
+
rescue Exception
|
225
|
+
error "Error loading included build file '#{include}': #{$!}"
|
226
|
+
end
|
227
|
+
end
|
228
|
+
end
|
206
229
|
# load context files if any
|
207
230
|
context = entry['context']
|
208
231
|
if context
|
@@ -243,6 +266,9 @@ module Bee
|
|
243
266
|
# Key for properties entry.
|
244
267
|
KEY = 'properties'
|
245
268
|
|
269
|
+
# List of system properties
|
270
|
+
SYSTEM_PROPERTIES = [:base, :here]
|
271
|
+
|
246
272
|
# List of properties in order of evaluation.
|
247
273
|
attr_reader :list
|
248
274
|
# Hash of properties by name.
|
@@ -309,6 +335,12 @@ module Bee
|
|
309
335
|
end
|
310
336
|
end
|
311
337
|
|
338
|
+
# Include properties of included build.
|
339
|
+
# - properties: properties of parent build.
|
340
|
+
def include(properties)
|
341
|
+
extend(properties)
|
342
|
+
end
|
343
|
+
|
312
344
|
# Evaluate properties in context.
|
313
345
|
# - context: build context where properties must be evaluated.
|
314
346
|
def evaluate(context)
|
@@ -438,6 +470,25 @@ module Bee
|
|
438
470
|
@default = @default || parent.default
|
439
471
|
end
|
440
472
|
|
473
|
+
# Include included build file targets.
|
474
|
+
# - included: included build file targets.
|
475
|
+
def include(included)
|
476
|
+
# set appropriate targets for targets of parent
|
477
|
+
for targets in included.hash.values
|
478
|
+
for target in targets
|
479
|
+
target.targets = self
|
480
|
+
end
|
481
|
+
end
|
482
|
+
# look for targets already defined
|
483
|
+
duplicates = @hash.keys & included.hash.keys
|
484
|
+
error "Included target(s) '#{duplicates.join('\', \'')}' already defined" if
|
485
|
+
duplicates.length > 0
|
486
|
+
# insert included targets
|
487
|
+
for name in included.hash.keys
|
488
|
+
@hash[name] = included.hash[name]
|
489
|
+
end
|
490
|
+
end
|
491
|
+
|
441
492
|
# Run targets.
|
442
493
|
# - targets: list of target names to run.
|
443
494
|
def run(targets, dry)
|
data/lib/bee_console.rb
CHANGED
@@ -62,7 +62,7 @@ targets Targets to run (default target if omitted).'
|
|
62
62
|
| |__ ___ ___
|
63
63
|
____ | '_ \ / _ \/ _ \ _____ _____ _____ _____ _____ _____ _____ _____ _____
|
64
64
|
|____| | |_) | __/ __/ |_____|_____|_____|_____|_____|_____|_____|_____|_____|
|
65
|
-
|_.__/ \___|\___| 0.
|
65
|
+
|_.__/ \___|\___| 0.9.0 http://bee.rubyforge.org
|
66
66
|
|
67
67
|
EOF
|
68
68
|
|
data/lib/bee_task_default.rb
CHANGED
@@ -1453,10 +1453,14 @@ EOF
|
|
1453
1453
|
require 'zlib'
|
1454
1454
|
# parse parameters
|
1455
1455
|
params_desc = {
|
1456
|
-
:root => { :mandatory => false, :type => :string
|
1457
|
-
|
1458
|
-
:
|
1459
|
-
|
1456
|
+
:root => { :mandatory => false, :type => :string,
|
1457
|
+
:default => '.' },
|
1458
|
+
:includes => { :mandatory => false, :type => :string_or_array,
|
1459
|
+
:default => '**/*' },
|
1460
|
+
:excludes => { :mandatory => false, :type => :string_or_array,
|
1461
|
+
:default => nil },
|
1462
|
+
:dotmatch => { :mandatory => false, :type => :boolean,
|
1463
|
+
:default => false },
|
1460
1464
|
:dest => { :mandatory => true, :type => :string }
|
1461
1465
|
}
|
1462
1466
|
check_parameters(parameters, params_desc)
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 9
|
8
|
+
- 0
|
9
|
+
version: 0.9.0
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Michel Casabianca & Contributors
|
@@ -9,39 +14,51 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-06-03 00:00:00 +02:00
|
13
18
|
default_executable: bee
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: archive-tar-minitar
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
- 5
|
30
|
+
- 1
|
23
31
|
version: 0.5.1
|
24
|
-
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
25
34
|
- !ruby/object:Gem::Dependency
|
26
35
|
name: highline
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
38
|
requirements:
|
31
39
|
- - ">="
|
32
40
|
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 1
|
43
|
+
- 5
|
44
|
+
- 2
|
33
45
|
version: 1.5.2
|
34
|
-
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
35
48
|
- !ruby/object:Gem::Dependency
|
36
49
|
name: rubyzip
|
37
|
-
|
38
|
-
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
52
|
requirements:
|
41
53
|
- - ">="
|
42
54
|
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 0
|
57
|
+
- 9
|
58
|
+
- 1
|
43
59
|
version: 0.9.1
|
44
|
-
|
60
|
+
type: :runtime
|
61
|
+
version_requirements: *id003
|
45
62
|
description:
|
46
63
|
email: michel.casabianca@gmail.com
|
47
64
|
executables:
|
@@ -108,18 +125,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
108
125
|
requirements:
|
109
126
|
- - ">="
|
110
127
|
- !ruby/object:Gem::Version
|
128
|
+
segments:
|
129
|
+
- 0
|
111
130
|
version: "0"
|
112
|
-
version:
|
113
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
132
|
requirements:
|
115
133
|
- - ">="
|
116
134
|
- !ruby/object:Gem::Version
|
135
|
+
segments:
|
136
|
+
- 0
|
117
137
|
version: "0"
|
118
|
-
version:
|
119
138
|
requirements: []
|
120
139
|
|
121
140
|
rubyforge_project: bee
|
122
|
-
rubygems_version: 1.3.
|
141
|
+
rubygems_version: 1.3.6
|
123
142
|
signing_key:
|
124
143
|
specification_version: 3
|
125
144
|
summary: bee is a build tool
|