teapot 3.2.1 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/bin/teapot +1 -37
- data/lib/teapot/command.rb +32 -6
- data/lib/teapot/command/build.rb +1 -2
- data/lib/teapot/command/clean.rb +1 -1
- data/lib/teapot/command/clone.rb +2 -2
- data/lib/teapot/command/create.rb +4 -4
- data/lib/teapot/command/fetch.rb +1 -1
- data/lib/teapot/command/selection.rb +1 -1
- data/lib/teapot/version.rb +1 -1
- data/spec/teapot/command/clone_spec.rb +1 -1
- data/spec/teapot/command/fetch_spec.rb +5 -5
- data/spec/teapot/command_spec.rb +3 -3
- data/teapot.gemspec +3 -1
- metadata +22 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ddf54a5f033a10d5fc574f0222df4cb5f567416d4d279d0a272052527eacfad
|
4
|
+
data.tar.gz: 147d1d9e73c9fd945cdc3d64beba318b2f660aa2aabd974ac3dd9ec487455cc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e394f73f673ac474050f75fbbe2d8a9a2f3eaf381c49b5f928814deb6ec7d32fae0143155025d06da768dad39eadaa39bb7ee7ad89e3588a13f20205b34a9c80
|
7
|
+
data.tar.gz: bc7f8a41f4b8ded58880e777cb3f412245a198885f9cc0002ed43944673956d03c98fbe5c4cb3bd11902b131547e3135ac3537e54233ff0892a2c5a19591b60a
|
data/.gitignore
CHANGED
data/bin/teapot
CHANGED
@@ -22,40 +22,4 @@
|
|
22
22
|
|
23
23
|
require_relative '../lib/teapot/command'
|
24
24
|
|
25
|
-
|
26
|
-
logger = command.logger
|
27
|
-
|
28
|
-
begin
|
29
|
-
command.invoke
|
30
|
-
rescue Teapot::IncompatibleTeapotError => error
|
31
|
-
logger.error(command, error) do
|
32
|
-
"Supported minimum version #{Teapot::MINIMUM_LOADER_VERSION.dump} to #{Teapot::LOADER_VERSION.dump}."
|
33
|
-
end
|
34
|
-
|
35
|
-
exit 1
|
36
|
-
rescue Build::Dependency::UnresolvedDependencyError => error
|
37
|
-
logger.error(command, error) do |buffer|
|
38
|
-
buffer.puts "Unresolved dependencies:"
|
39
|
-
|
40
|
-
error.chain.unresolved.each do |name, parent|
|
41
|
-
buffer.puts "#{parent} depends on #{name.inspect}"
|
42
|
-
|
43
|
-
conflicts = error.chain.conflicts[name]
|
44
|
-
|
45
|
-
if conflicts
|
46
|
-
conflicts.each do |conflict|
|
47
|
-
buffer.puts " - provided by #{conflict.name}"
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
buffer.puts "Cannot continue due to unresolved dependencies!"
|
53
|
-
end
|
54
|
-
|
55
|
-
exit 2
|
56
|
-
rescue StandardError => error
|
57
|
-
logger.error(command, error)
|
58
|
-
|
59
|
-
exit 3
|
60
|
-
end
|
61
|
-
end
|
25
|
+
Teapot::Command::Top.call
|
data/lib/teapot/command.rb
CHANGED
@@ -39,10 +39,6 @@ require 'console'
|
|
39
39
|
|
40
40
|
module Teapot
|
41
41
|
module Command
|
42
|
-
def self.parse(*args)
|
43
|
-
Top.parse(*args)
|
44
|
-
end
|
45
|
-
|
46
42
|
class Top < Samovar::Command
|
47
43
|
self.description = "A decentralised package manager and build tool."
|
48
44
|
|
@@ -97,14 +93,44 @@ module Teapot
|
|
97
93
|
Context.new(root, configuration: configuration)
|
98
94
|
end
|
99
95
|
|
100
|
-
def
|
96
|
+
def call
|
101
97
|
if @options[:version]
|
102
98
|
puts "teapot v#{Teapot::VERSION}"
|
103
99
|
elsif @options[:help]
|
104
100
|
print_usage(output: $stdout)
|
105
101
|
else
|
106
|
-
@command.
|
102
|
+
@command.call
|
103
|
+
end
|
104
|
+
rescue Teapot::IncompatibleTeapotError => error
|
105
|
+
logger.error(command, error) do
|
106
|
+
"Supported minimum version #{Teapot::MINIMUM_LOADER_VERSION.dump} to #{Teapot::LOADER_VERSION.dump}."
|
107
|
+
end
|
108
|
+
|
109
|
+
raise
|
110
|
+
rescue ::Build::Dependency::UnresolvedDependencyError => error
|
111
|
+
logger.error(command, error) do |buffer|
|
112
|
+
buffer.puts "Unresolved dependencies:"
|
113
|
+
|
114
|
+
error.chain.unresolved.each do |name, parent|
|
115
|
+
buffer.puts "#{parent} depends on #{name.inspect}"
|
116
|
+
|
117
|
+
conflicts = error.chain.conflicts[name]
|
118
|
+
|
119
|
+
if conflicts
|
120
|
+
conflicts.each do |conflict|
|
121
|
+
buffer.puts " - provided by #{conflict.name}"
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
buffer.puts "Cannot continue due to unresolved dependencies!"
|
107
127
|
end
|
128
|
+
|
129
|
+
raise
|
130
|
+
rescue StandardError => error
|
131
|
+
logger.error(command, error)
|
132
|
+
|
133
|
+
raise
|
108
134
|
end
|
109
135
|
end
|
110
136
|
end
|
data/lib/teapot/command/build.rb
CHANGED
@@ -38,7 +38,7 @@ module Teapot
|
|
38
38
|
many :targets, "Build these targets, or use them to help the dependency resolution process."
|
39
39
|
split :argv, "Arguments passed to child process(es) of build if any."
|
40
40
|
|
41
|
-
def
|
41
|
+
def call
|
42
42
|
context = parent.context
|
43
43
|
|
44
44
|
# The targets to build:
|
@@ -52,7 +52,6 @@ module Teapot
|
|
52
52
|
environment = context.configuration.environment
|
53
53
|
|
54
54
|
controller = ::Build::Controller.new(logger: parent.logger, limit: @options[:limit]) do |controller|
|
55
|
-
|
56
55
|
controller.add_chain(chain, self.argv, environment)
|
57
56
|
end
|
58
57
|
|
data/lib/teapot/command/clean.rb
CHANGED
data/lib/teapot/command/clone.rb
CHANGED
@@ -33,7 +33,7 @@ module Teapot
|
|
33
33
|
|
34
34
|
one :source, "The source repository to clone.", required: true
|
35
35
|
|
36
|
-
def
|
36
|
+
def call
|
37
37
|
logger = parent.logger
|
38
38
|
|
39
39
|
name = File.basename(::Build::URI[@source].path, ".git")
|
@@ -49,7 +49,7 @@ module Teapot
|
|
49
49
|
_repository = Rugged::Repository.clone_at(@source, root.to_s, credentials: self.method(:credentials))
|
50
50
|
|
51
51
|
# Fetch the initial packages:
|
52
|
-
Fetch[parent: nested].
|
52
|
+
Fetch[parent: nested].call
|
53
53
|
end
|
54
54
|
|
55
55
|
def credentials(url, username, types)
|
@@ -33,7 +33,7 @@ module Teapot
|
|
33
33
|
one :source, "The source repository to use for fetching packages, e.g. https://github.com/kurocha.", required: true
|
34
34
|
many :packages, "Any packages you'd like to include in the project.", default: ["generate-project"]
|
35
35
|
|
36
|
-
def
|
36
|
+
def call
|
37
37
|
logger = parent.logger
|
38
38
|
|
39
39
|
nested = parent['--root', parent.options[:root] || name.gsub(/\s+/, '-').downcase]
|
@@ -52,7 +52,7 @@ module Teapot
|
|
52
52
|
generate_project(root, @name, @source, @packages)
|
53
53
|
|
54
54
|
# Fetch the initial packages:
|
55
|
-
Fetch[parent: nested].
|
55
|
+
Fetch[parent: nested].call
|
56
56
|
|
57
57
|
context = nested.context
|
58
58
|
selection = context.select
|
@@ -60,10 +60,10 @@ module Teapot
|
|
60
60
|
|
61
61
|
if target_names.any?
|
62
62
|
# Generate the initial project files:
|
63
|
-
Build[*target_names, parent: nested].
|
63
|
+
Build[*target_names, parent: nested].call
|
64
64
|
|
65
65
|
# Fetch any additional packages:
|
66
|
-
Fetch[parent: nested].
|
66
|
+
Fetch[parent: nested].call
|
67
67
|
end
|
68
68
|
|
69
69
|
# Stage all files:
|
data/lib/teapot/command/fetch.rb
CHANGED
data/lib/teapot/version.rb
CHANGED
@@ -35,7 +35,7 @@ RSpec.describe Teapot::Command::Clone, order: :defined do
|
|
35
35
|
subject {top['clone', source]}
|
36
36
|
|
37
37
|
it "should checkout files" do
|
38
|
-
expect{subject.
|
38
|
+
expect{subject.call}.to_not raise_error
|
39
39
|
|
40
40
|
expect(File).to be_exist(root + "teapot.rb")
|
41
41
|
|
@@ -33,7 +33,7 @@ RSpec.describe Teapot::Command::Fetch, order: :defined do
|
|
33
33
|
subject {top['clean']}
|
34
34
|
|
35
35
|
it "should delete all packages" do
|
36
|
-
expect{subject.
|
36
|
+
expect{subject.call}.to_not raise_error
|
37
37
|
|
38
38
|
expect(File).to_not be_exist(root + "test-project/teapot/packages/test")
|
39
39
|
end
|
@@ -59,14 +59,14 @@ RSpec.describe Teapot::Command::Fetch, order: :defined do
|
|
59
59
|
subject {top['fetch']}
|
60
60
|
|
61
61
|
it "should fetch repositories" do
|
62
|
-
expect{subject.
|
62
|
+
expect{subject.call}.to_not raise_error
|
63
63
|
|
64
64
|
# Did the thing package checkout correctly?
|
65
65
|
expect(File).to be_exist(root + "test-project/teapot/packages/test/thing/teapot.rb")
|
66
66
|
end
|
67
67
|
|
68
68
|
it "should fetch repositories with no changes" do
|
69
|
-
expect{subject.
|
69
|
+
expect{subject.call}.to_not raise_error
|
70
70
|
|
71
71
|
# Did the thing package checkout correctly?
|
72
72
|
expect(File).to be_exist(root + "test-project/teapot/packages/test/thing/teapot.rb")
|
@@ -84,7 +84,7 @@ RSpec.describe Teapot::Command::Fetch, order: :defined do
|
|
84
84
|
end
|
85
85
|
|
86
86
|
it "can't fetch with local modifications" do
|
87
|
-
expect{subject.
|
87
|
+
expect{subject.call}.to raise_error(Teapot::Command::FetchError, /local modifications/)
|
88
88
|
|
89
89
|
path.delete
|
90
90
|
end
|
@@ -99,7 +99,7 @@ RSpec.describe Teapot::Command::Fetch, order: :defined do
|
|
99
99
|
end
|
100
100
|
|
101
101
|
it "can fetch changes" do
|
102
|
-
expect{subject.
|
102
|
+
expect{subject.call}.to_not raise_error
|
103
103
|
|
104
104
|
expect(File).to be_exist(thing_package_path + "README.md")
|
105
105
|
end
|
data/spec/teapot/command_spec.rb
CHANGED
@@ -35,7 +35,7 @@ RSpec.describe Teapot::Command, order: :defined do
|
|
35
35
|
it "should create a new project" do
|
36
36
|
root.delete
|
37
37
|
|
38
|
-
expect{subject.
|
38
|
+
expect{subject.call}.to_not raise_error
|
39
39
|
expect(project_path + "teapot.rb").to be_exist
|
40
40
|
expect(project_path + ".travis.yml").to be_exist
|
41
41
|
end
|
@@ -45,7 +45,7 @@ RSpec.describe Teapot::Command, order: :defined do
|
|
45
45
|
subject {top["build", "Run/TestProject"]}
|
46
46
|
|
47
47
|
it "should build project" do
|
48
|
-
expect{subject.
|
48
|
+
expect{subject.call}.to_not raise_error
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -53,7 +53,7 @@ RSpec.describe Teapot::Command, order: :defined do
|
|
53
53
|
subject {top["fetch"]}
|
54
54
|
|
55
55
|
it "should fetch any changes" do
|
56
|
-
expect{subject.
|
56
|
+
expect{subject.call}.to_not raise_error
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
data/teapot.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.required_ruby_version = '>= 2.1.0'
|
26
26
|
|
27
27
|
spec.add_dependency "graphviz", "~> 1.0"
|
28
|
-
spec.add_dependency "rugged", "~>
|
28
|
+
spec.add_dependency "rugged", "~> 1.0"
|
29
29
|
|
30
30
|
spec.add_dependency "build", "~> 2.4"
|
31
31
|
spec.add_dependency "build-environment", "~> 1.10"
|
@@ -34,6 +34,8 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_dependency "build-uri", "~> 1.0"
|
35
35
|
spec.add_dependency "build-text", "~> 1.0"
|
36
36
|
|
37
|
+
spec.add_dependency "process-group", "~> 1.2"
|
38
|
+
|
37
39
|
spec.add_dependency "console", "~> 1.0"
|
38
40
|
spec.add_dependency "samovar", "~> 2.0"
|
39
41
|
|
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: 3.
|
4
|
+
version: 3.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphviz
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '1.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '1.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: build
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '1.0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: process-group
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '1.2'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '1.2'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: console
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -267,7 +281,7 @@ homepage: http://www.teapot.nz
|
|
267
281
|
licenses:
|
268
282
|
- MIT
|
269
283
|
metadata: {}
|
270
|
-
post_install_message:
|
284
|
+
post_install_message:
|
271
285
|
rdoc_options: []
|
272
286
|
require_paths:
|
273
287
|
- lib
|
@@ -282,8 +296,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
282
296
|
- !ruby/object:Gem::Version
|
283
297
|
version: '0'
|
284
298
|
requirements: []
|
285
|
-
rubygems_version: 3.
|
286
|
-
signing_key:
|
299
|
+
rubygems_version: 3.1.2
|
300
|
+
signing_key:
|
287
301
|
specification_version: 4
|
288
302
|
summary: Teapot is a tool for managing complex cross-platform builds.
|
289
303
|
test_files:
|