teapot 1.0.0.pre.rc9 → 1.0.0.pre.rc10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.simplecov +9 -0
- data/.travis.yml +4 -0
- data/Gemfile +5 -0
- data/README.md +3 -1
- data/Rakefile +3 -1
- data/bin/teapot +1 -1
- data/lib/teapot/configuration.rb +0 -1
- data/lib/teapot/context.rb +8 -2
- data/lib/teapot/controller/build.rb +3 -6
- data/lib/teapot/controller/create.rb +2 -2
- data/lib/teapot/controller/fetch.rb +1 -1
- data/lib/teapot/dependency.rb +0 -2
- data/lib/teapot/generator.rb +2 -2
- data/lib/teapot/loader.rb +4 -4
- data/lib/teapot/{name.rb → metadata.rb} +15 -22
- data/lib/teapot/package.rb +0 -2
- data/lib/teapot/repository.rb +1 -1
- data/lib/teapot/target.rb +5 -4
- data/lib/teapot/version.rb +1 -1
- data/{lib/teapot/environment.rb → spec/teapot/metadata_spec.rb} +11 -5
- data/teapot.gemspec +1 -3
- metadata +9 -49
- data/lib/teapot/build.rb +0 -254
- data/lib/teapot/environment/base.rb +0 -62
- data/lib/teapot/environment/constructor.rb +0 -133
- data/lib/teapot/environment/evaluator.rb +0 -51
- data/lib/teapot/environment/flatten.rb +0 -102
- data/lib/teapot/environment/system.rb +0 -56
- data/lib/teapot/rule.rb +0 -188
- data/lib/teapot/rulebook.rb +0 -91
- data/spec/teapot/build_spec.rb +0 -52
- data/spec/teapot/environment_spec.rb +0 -91
- data/spec/teapot/name_spec.rb +0 -50
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a24978c48e16ae8ae1dcf5e330149396f08cf233
|
4
|
+
data.tar.gz: b197ab21f377f556d084d06c2e2a88cfe275a2d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f460908b58d31f2683656d2f68087176f63698018f36ae3a29ae121a7c0d1a393929e31cf49e241b6e52e637b9ecc0d1178f4d9a86f557eb3cab0e3e5bfc28c
|
7
|
+
data.tar.gz: 23a8accc88acb6436fdfb54f8e8db448c24a982918fe212a43fce96965098174605ff1784db255cdb1bae3058fb46a47f6c7b0f4c6b7b32ac3b18fc4976946fa
|
data/.simplecov
ADDED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -9,6 +9,7 @@ Teapot is a decentralised build tool for managing complex cross-platform project
|
|
9
9
|
|
10
10
|
[![Build Status](https://secure.travis-ci.org/ioquatix/teapot.png)](http://travis-ci.org/ioquatix/teapot)
|
11
11
|
[![Code Climate](https://codeclimate.com/github/ioquatix/teapot.png)](https://codeclimate.com/github/ioquatix/teapot)
|
12
|
+
[![Coverage Status](https://coveralls.io/repos/ioquatix/teapot/badge.svg)](https://coveralls.io/r/ioquatix/teapot)
|
12
13
|
|
13
14
|
## Installation
|
14
15
|
|
@@ -33,7 +34,7 @@ In the resulting project directory that has been created, you can see the list o
|
|
33
34
|
|
34
35
|
To build your project:
|
35
36
|
|
36
|
-
$ teapot build Application/MyProject
|
37
|
+
$ teapot build Application/MyProject
|
37
38
|
|
38
39
|
When you build, you need to specify dependencies. If you haven't specified all dependencies, they will be suggested to you.
|
39
40
|
|
@@ -63,6 +64,7 @@ You need to make sure any basic tools, e.g. compilers, system libraries, are ins
|
|
63
64
|
- Should packages be built into a shared prefix or should they be built into unique prefixes and joined together either via install or `-L` and `-I`?
|
64
65
|
- Relative include paths might fail to work correctly if headers are not installed into same directory.
|
65
66
|
- Should packages expose the tools required to build themselves as dependencies? e.g. should `build-cmake` as required by, say, `OpenCV`, be exposed to all who depend on `OpenCV`? Should there be a mechanism for non-public dependencies, i.e. dependencies which are not exposed to dependants?
|
67
|
+
- Should packages have some way to expose system requirements, e.g. installed compiler, libraries, etc. Perhaps some kind of `Package#valid?` which allows custom logic?
|
66
68
|
|
67
69
|
## Contributing
|
68
70
|
|
data/Rakefile
CHANGED
data/bin/teapot
CHANGED
data/lib/teapot/configuration.rb
CHANGED
data/lib/teapot/context.rb
CHANGED
@@ -21,7 +21,8 @@
|
|
21
21
|
require 'teapot/loader'
|
22
22
|
require 'teapot/package'
|
23
23
|
|
24
|
-
require 'teapot/
|
24
|
+
require 'teapot/metadata'
|
25
|
+
require 'build/rulebook'
|
25
26
|
|
26
27
|
module Teapot
|
27
28
|
TEAPOT_FILE = 'teapot.rb'.freeze
|
@@ -44,11 +45,13 @@ module Teapot
|
|
44
45
|
@root = Path[root]
|
45
46
|
@options = options
|
46
47
|
|
48
|
+
@metadata = Metadata.new(self)
|
49
|
+
|
47
50
|
@targets = {}
|
48
51
|
@generators = {}
|
49
52
|
@configurations = {}
|
50
53
|
@projects = {}
|
51
|
-
@rules = Rulebook.new
|
54
|
+
@rules = Build::Rulebook.new
|
52
55
|
|
53
56
|
@dependencies = []
|
54
57
|
@selection = Set.new
|
@@ -67,6 +70,9 @@ module Teapot
|
|
67
70
|
attr :generators
|
68
71
|
attr :projects
|
69
72
|
|
73
|
+
# Context metadata
|
74
|
+
attr :metadata
|
75
|
+
|
70
76
|
# All public configurations.
|
71
77
|
attr :configurations
|
72
78
|
|
@@ -19,7 +19,7 @@
|
|
19
19
|
# THE SOFTWARE.
|
20
20
|
|
21
21
|
require 'teapot/controller'
|
22
|
-
require '
|
22
|
+
require 'build/controller'
|
23
23
|
|
24
24
|
$TEAPOT_DEBUG_GRAPH = false
|
25
25
|
|
@@ -37,7 +37,7 @@ module Teapot
|
|
37
37
|
ordered = context.direct_targets(ordered)
|
38
38
|
end
|
39
39
|
|
40
|
-
controller =
|
40
|
+
controller = Build::Controller.new do |controller|
|
41
41
|
ordered.each do |(target, dependency)|
|
42
42
|
environment = target.environment_for_configuration(context.configuration)
|
43
43
|
|
@@ -51,10 +51,7 @@ module Teapot
|
|
51
51
|
|
52
52
|
# We need to catch interrupt here, and exit with the correct exit code:
|
53
53
|
begin
|
54
|
-
controller.run do
|
55
|
-
# The graph has been dirtied because files have changed, traverse and update it:
|
56
|
-
walker = controller.update_with_log
|
57
|
-
|
54
|
+
controller.run do |walker|
|
58
55
|
if $TEAPOT_DEBUG_GRAPH
|
59
56
|
controller.nodes.each do |key, node|
|
60
57
|
puts "#{node.status} #{node.inspect}" unless node.clean?
|
@@ -21,12 +21,12 @@
|
|
21
21
|
require 'teapot/controller'
|
22
22
|
require 'teapot/controller/fetch'
|
23
23
|
|
24
|
-
require '
|
24
|
+
require 'build/name'
|
25
25
|
|
26
26
|
module Teapot
|
27
27
|
class Controller
|
28
28
|
def create(project_name, source, packages)
|
29
|
-
name = Name.new(project_name)
|
29
|
+
name = Build::Name.new(project_name)
|
30
30
|
|
31
31
|
log "Creating project named #{project_name} at path #{@root}...".color(:cyan)
|
32
32
|
|
@@ -81,7 +81,7 @@ module Teapot
|
|
81
81
|
local_path = context.root + package.options[:local]
|
82
82
|
|
83
83
|
# Make the top level directory if required:
|
84
|
-
destination_path.dirname.
|
84
|
+
destination_path.dirname.create
|
85
85
|
|
86
86
|
unless destination_path.exist?
|
87
87
|
destination_path.make_symlink(local_path)
|
data/lib/teapot/dependency.rb
CHANGED
data/lib/teapot/generator.rb
CHANGED
@@ -66,7 +66,7 @@ module Teapot
|
|
66
66
|
source_path = Pathname(path) + source
|
67
67
|
destination_path = Pathname(context.root) + destination
|
68
68
|
|
69
|
-
destination_path.dirname.
|
69
|
+
destination_path.dirname.create
|
70
70
|
|
71
71
|
File.open(destination_path, mode) do |file|
|
72
72
|
text = File.read(source_path)
|
@@ -113,7 +113,7 @@ module Teapot
|
|
113
113
|
end
|
114
114
|
|
115
115
|
def copy_binary(source_path, destination_path)
|
116
|
-
destination_path.dirname.
|
116
|
+
destination_path.dirname.create
|
117
117
|
FileUtils.cp source_path, destination_path
|
118
118
|
end
|
119
119
|
|
data/lib/teapot/loader.rb
CHANGED
@@ -22,10 +22,9 @@ require 'teapot/project'
|
|
22
22
|
require 'teapot/target'
|
23
23
|
require 'teapot/generator'
|
24
24
|
require 'teapot/configuration'
|
25
|
-
require 'teapot/rule'
|
26
|
-
|
27
|
-
require 'teapot/name'
|
28
25
|
|
26
|
+
require 'build/rule'
|
27
|
+
require 'build/name'
|
29
28
|
require 'build/files'
|
30
29
|
|
31
30
|
module Teapot
|
@@ -49,7 +48,8 @@ module Teapot
|
|
49
48
|
end
|
50
49
|
|
51
50
|
class Loader
|
52
|
-
Files =
|
51
|
+
Files = Build::Files
|
52
|
+
Rule = Build::Rule
|
53
53
|
|
54
54
|
class Definitions < Array
|
55
55
|
def default_configuration
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright,
|
1
|
+
# Copyright, 2014, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -19,31 +19,24 @@
|
|
19
19
|
# THE SOFTWARE.
|
20
20
|
|
21
21
|
module Teapot
|
22
|
-
class
|
23
|
-
|
24
|
-
|
22
|
+
# This is a very basic class for accessing metadata from a repository. In the future I expect this will be fleshed out a bit more.
|
23
|
+
class Metadata
|
24
|
+
class Section
|
25
|
+
def initialize(name)
|
26
|
+
@name = name
|
27
|
+
end
|
28
|
+
|
29
|
+
def method_missing(parameter_name)
|
30
|
+
`git config #{@name}.#{parameter_name}`.chomp!
|
31
|
+
end
|
25
32
|
end
|
26
33
|
|
27
|
-
def
|
28
|
-
|
34
|
+
def initialize(context)
|
35
|
+
@context = context
|
29
36
|
end
|
30
37
|
|
31
|
-
|
32
|
-
|
33
|
-
def identifier
|
34
|
-
@identifier ||= @text.gsub(/\s+/, '')
|
35
|
-
end
|
36
|
-
|
37
|
-
def target
|
38
|
-
@target ||= @text.gsub(/\s+/, '-').downcase
|
39
|
-
end
|
40
|
-
|
41
|
-
def macro(prefix = [])
|
42
|
-
(Array(prefix) + [@text]).collect{|name| name.upcase.gsub(/\s+/, '_')}.join('_')
|
43
|
-
end
|
44
|
-
|
45
|
-
def header_guard(path)
|
46
|
-
macro(path) + '_H'
|
38
|
+
def method_missing(name)
|
39
|
+
Section.new(name)
|
47
40
|
end
|
48
41
|
end
|
49
42
|
end
|
data/lib/teapot/package.rb
CHANGED
data/lib/teapot/repository.rb
CHANGED
data/lib/teapot/target.rb
CHANGED
@@ -22,7 +22,8 @@ require 'pathname'
|
|
22
22
|
require 'teapot/dependency'
|
23
23
|
require 'teapot/definition'
|
24
24
|
|
25
|
-
require '
|
25
|
+
require 'build/environment'
|
26
|
+
require 'build/rulebook'
|
26
27
|
|
27
28
|
module Teapot
|
28
29
|
class BuildError < StandardError
|
@@ -36,7 +37,7 @@ module Teapot
|
|
36
37
|
|
37
38
|
@build = nil
|
38
39
|
|
39
|
-
@rulebook = Rulebook.new
|
40
|
+
@rulebook = Build::Rulebook.new
|
40
41
|
end
|
41
42
|
|
42
43
|
attr :rulebook
|
@@ -55,14 +56,14 @@ module Teapot
|
|
55
56
|
|
56
57
|
# Calculate the dependency chain's ordered environments:
|
57
58
|
environments += chain.provisions.collect do |provision|
|
58
|
-
Environment.new(&provision.value)
|
59
|
+
Build::Environment.new(&provision.value)
|
59
60
|
end
|
60
61
|
|
61
62
|
# Per-configuration package package environment:
|
62
63
|
environments << @package.options[:environment]
|
63
64
|
|
64
65
|
# Merge all the environments together:
|
65
|
-
environment = Environment.combine(*environments)
|
66
|
+
environment = Build::Environment.combine(*environments)
|
66
67
|
|
67
68
|
environment.merge do
|
68
69
|
default platforms_path configuration.platforms_path
|
data/lib/teapot/version.rb
CHANGED
@@ -18,8 +18,14 @@
|
|
18
18
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
19
|
# THE SOFTWARE.
|
20
20
|
|
21
|
-
require 'teapot/
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
require 'teapot/metadata'
|
22
|
+
|
23
|
+
module Teapot::MetadataSpec
|
24
|
+
describe Teapot::Metadata do
|
25
|
+
let(:metadata) {Teapot::Metadata.new(nil)}
|
26
|
+
it "can provide user name" do
|
27
|
+
expect(metadata.user.name).to_not be nil
|
28
|
+
expect(metadata.user.name.length).to be > 0
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/teapot.gemspec
CHANGED
@@ -35,9 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
|
36
36
|
spec.add_dependency "graphviz", "~> 0.1.0"
|
37
37
|
|
38
|
-
spec.add_dependency "build
|
39
|
-
spec.add_dependency "build-graph", "~> 0.3.5"
|
40
|
-
spec.add_dependency "build-makefile", "~> 0.2.0"
|
38
|
+
spec.add_dependency "build", "~> 1.0.0"
|
41
39
|
|
42
40
|
spec.add_dependency "process-daemon", "~> 0.5.5"
|
43
41
|
spec.add_dependency "process-group", "~> 0.2.1"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teapot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.pre.
|
4
|
+
version: 1.0.0.pre.rc10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|
@@ -67,47 +67,19 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.1.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name: build
|
70
|
+
name: build
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 1.0.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: build-graph
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 0.3.5
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 0.3.5
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: build-makefile
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 0.2.0
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 0.2.0
|
82
|
+
version: 1.0.0
|
111
83
|
- !ruby/object:Gem::Dependency
|
112
84
|
name: process-daemon
|
113
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -190,13 +162,13 @@ extensions: []
|
|
190
162
|
extra_rdoc_files: []
|
191
163
|
files:
|
192
164
|
- ".gitignore"
|
165
|
+
- ".simplecov"
|
193
166
|
- ".travis.yml"
|
194
167
|
- Gemfile
|
195
168
|
- README.md
|
196
169
|
- Rakefile
|
197
170
|
- bin/teapot
|
198
171
|
- lib/teapot.rb
|
199
|
-
- lib/teapot/build.rb
|
200
172
|
- lib/teapot/configuration.rb
|
201
173
|
- lib/teapot/context.rb
|
202
174
|
- lib/teapot/controller.rb
|
@@ -209,29 +181,19 @@ files:
|
|
209
181
|
- lib/teapot/controller/visualize.rb
|
210
182
|
- lib/teapot/definition.rb
|
211
183
|
- lib/teapot/dependency.rb
|
212
|
-
- lib/teapot/environment.rb
|
213
|
-
- lib/teapot/environment/base.rb
|
214
|
-
- lib/teapot/environment/constructor.rb
|
215
|
-
- lib/teapot/environment/evaluator.rb
|
216
|
-
- lib/teapot/environment/flatten.rb
|
217
|
-
- lib/teapot/environment/system.rb
|
218
184
|
- lib/teapot/generator.rb
|
219
185
|
- lib/teapot/loader.rb
|
220
186
|
- lib/teapot/merge.rb
|
221
|
-
- lib/teapot/
|
187
|
+
- lib/teapot/metadata.rb
|
222
188
|
- lib/teapot/package.rb
|
223
189
|
- lib/teapot/project.rb
|
224
190
|
- lib/teapot/repository.rb
|
225
|
-
- lib/teapot/rule.rb
|
226
|
-
- lib/teapot/rulebook.rb
|
227
191
|
- lib/teapot/substitutions.rb
|
228
192
|
- lib/teapot/target.rb
|
229
193
|
- lib/teapot/version.rb
|
230
|
-
- spec/teapot/build_spec.rb
|
231
194
|
- spec/teapot/context_spec.rb
|
232
195
|
- spec/teapot/dependency_spec.rb
|
233
|
-
- spec/teapot/
|
234
|
-
- spec/teapot/name_spec.rb
|
196
|
+
- spec/teapot/metadata_spec.rb
|
235
197
|
- spec/teapot/substitutions_spec.rb
|
236
198
|
- spec/teapot/teapot.rb
|
237
199
|
- teapot.gemspec
|
@@ -260,10 +222,8 @@ signing_key:
|
|
260
222
|
specification_version: 4
|
261
223
|
summary: Teapot is a tool for managing complex cross-platform builds.
|
262
224
|
test_files:
|
263
|
-
- spec/teapot/build_spec.rb
|
264
225
|
- spec/teapot/context_spec.rb
|
265
226
|
- spec/teapot/dependency_spec.rb
|
266
|
-
- spec/teapot/
|
267
|
-
- spec/teapot/name_spec.rb
|
227
|
+
- spec/teapot/metadata_spec.rb
|
268
228
|
- spec/teapot/substitutions_spec.rb
|
269
229
|
- spec/teapot/teapot.rb
|