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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c85e14574b10f98c7393860c30732ba0ce291322
4
- data.tar.gz: 7800be07e0609957751fcdd79bdd3f454b2e9042
3
+ metadata.gz: a24978c48e16ae8ae1dcf5e330149396f08cf233
4
+ data.tar.gz: b197ab21f377f556d084d06c2e2a88cfe275a2d0
5
5
  SHA512:
6
- metadata.gz: dc81b95ae0929cc0a7f6c1b387e8b71276b1db78b3f9e8948b7ec72053be173f9279a56c2bb9a6ef6b1f9a6a7de3fa300edd44400e14e64146b828333bcac9a6
7
- data.tar.gz: d097232b756dc542314069a3f464da5ed8ad7d456db959a6fe5c6c93b9bb8dc25056b0d0a8b3903ced6e33fcd308e480336735e5f6f898f25c13b0b8e738cad0
6
+ metadata.gz: 9f460908b58d31f2683656d2f68087176f63698018f36ae3a29ae121a7c0d1a393929e31cf49e241b6e52e637b9ecc0d1178f4d9a86f557eb3cab0e3e5bfc28c
7
+ data.tar.gz: 23a8accc88acb6436fdfb54f8e8db448c24a982918fe212a43fce96965098174605ff1784db255cdb1bae3058fb46a47f6c7b0f4c6b7b32ac3b18fc4976946fa
@@ -0,0 +1,9 @@
1
+
2
+ SimpleCov.start do
3
+ add_filter "/spec/"
4
+ end
5
+
6
+ if ENV['TRAVIS']
7
+ require 'coveralls'
8
+ Coveralls.wear!
9
+ end
@@ -1,4 +1,8 @@
1
1
  language: ruby
2
+ before_install:
3
+ # For testing purposes:
4
+ - git config --local user.name "Samuel Williams"
2
5
  rvm:
3
6
  - "2.0"
4
7
  - "2.1"
8
+ env: COVERAGE=true
data/Gemfile CHANGED
@@ -2,3 +2,8 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in teapot.gemspec
4
4
  gemspec
5
+
6
+ group :test do
7
+ gem 'simplecov'
8
+ gem 'coveralls', require: false
9
+ end
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 variant-debug
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
@@ -1,6 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
3
 
4
- RSpec::Core::RakeTask.new(:spec)
4
+ RSpec::Core::RakeTask.new(:spec) do |task|
5
+ task.rspec_opts = ["--require", "simplecov"] if ENV['COVERAGE']
6
+ end
5
7
 
6
8
  task :default => :spec
data/bin/teapot CHANGED
@@ -95,7 +95,7 @@ module Application
95
95
  end
96
96
 
97
97
  # Make the path:
98
- root.mkpath
98
+ root.create
99
99
 
100
100
  Teapot::Repository.new(root).init!
101
101
 
@@ -24,7 +24,6 @@ require 'set'
24
24
  require 'yaml/store'
25
25
 
26
26
  require 'teapot/context'
27
- require 'teapot/environment'
28
27
 
29
28
  require 'teapot/definition'
30
29
 
@@ -21,7 +21,8 @@
21
21
  require 'teapot/loader'
22
22
  require 'teapot/package'
23
23
 
24
- require 'teapot/rulebook'
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 'teapot/build'
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 = Teapot::Build::Controller.new do |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 'teapot/name'
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.mkpath
84
+ destination_path.dirname.create
85
85
 
86
86
  unless destination_path.exist?
87
87
  destination_path.make_symlink(local_path)
@@ -20,8 +20,6 @@
20
20
 
21
21
  require 'set'
22
22
 
23
- require 'teapot/environment'
24
-
25
23
  module Teapot
26
24
  module Dependency
27
25
  class UnresolvedDependencyError < StandardError
@@ -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.mkpath
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.mkpath
116
+ destination_path.dirname.create
117
117
  FileUtils.cp source_path, destination_path
118
118
  end
119
119
 
@@ -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 = ::Build::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, 2013, by Samuel G. D. Williams. <http://www.codeotaku.com>
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 Name
23
- def initialize(text)
24
- @text = text
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 self.from_target(string)
28
- self.new(string.gsub(/(^|[ \-_])(.)/){" " + $2.upcase}.strip)
34
+ def initialize(context)
35
+ @context = context
29
36
  end
30
37
 
31
- attr :text
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
@@ -21,8 +21,6 @@
21
21
  require 'build/files'
22
22
 
23
23
  require 'teapot/context'
24
- require 'teapot/environment'
25
-
26
24
  require 'teapot/definition'
27
25
 
28
26
  module Teapot
@@ -62,7 +62,7 @@ module Teapot
62
62
  def clone!(remote_url, branch = nil, commit = nil)
63
63
  branch_args = branch ? ["--branch", branch] : []
64
64
 
65
- @root.mkpath
65
+ @root.create
66
66
 
67
67
  run!("clone", remote_url, @root, *branch_args)
68
68
 
@@ -22,7 +22,8 @@ require 'pathname'
22
22
  require 'teapot/dependency'
23
23
  require 'teapot/definition'
24
24
 
25
- require 'teapot/rulebook'
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
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Teapot
22
- VERSION = "1.0.0-rc9"
22
+ VERSION = "1.0.0-rc10"
23
23
  end
@@ -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/environment/base'
22
- require 'teapot/environment/constructor'
23
- require 'teapot/environment/evaluator'
24
- require 'teapot/environment/flatten'
25
- require 'teapot/environment/system'
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
@@ -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-files", "~> 0.2.9"
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.rc9
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: 2014-10-15 00:00:00.000000000 Z
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-files
70
+ name: build
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.2.9
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.2.9
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/name.rb
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/environment_spec.rb
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/environment_spec.rb
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