teapot 3.5.3 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/bin/teapot +2 -1
- data/lib/teapot/command/build.rb +10 -25
- data/lib/teapot/command/clean.rb +6 -21
- data/lib/teapot/command/clone.rb +10 -25
- data/lib/teapot/command/create.rb +19 -34
- data/lib/teapot/command/fetch.rb +27 -42
- data/lib/teapot/command/list.rb +7 -22
- data/lib/teapot/command/selection.rb +5 -20
- data/lib/teapot/command/status.rb +7 -22
- data/lib/teapot/command/visualize.rb +13 -28
- data/lib/teapot/command.rb +28 -43
- data/lib/teapot/configuration.rb +35 -50
- data/lib/teapot/context.rb +24 -39
- data/lib/teapot/definition.rb +7 -22
- data/lib/teapot/loader.rb +13 -28
- data/lib/teapot/package.rb +17 -32
- data/lib/teapot/project.rb +5 -20
- data/lib/teapot/select.rb +11 -26
- data/lib/teapot/target.rb +9 -24
- data/lib/teapot/version.rb +5 -20
- data/lib/teapot.rb +4 -19
- data/license.md +21 -0
- data/notes.md +74 -0
- data/readme.md +178 -0
- data/releases.md +5 -0
- data.tar.gz.sig +0 -0
- metadata +22 -65
- metadata.gz.sig +0 -0
data/lib/teapot/command.rb
CHANGED
|
@@ -1,41 +1,26 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
# furnished to do so, subject to the following conditions:
|
|
9
|
-
#
|
|
10
|
-
# The above copyright notice and this permission notice shall be included in
|
|
11
|
-
# all copies or substantial portions of the Software.
|
|
12
|
-
#
|
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
# THE SOFTWARE.
|
|
1
|
+
# frozen_string_literal: true
|
|
20
2
|
|
|
21
|
-
|
|
3
|
+
# Released under the MIT License.
|
|
4
|
+
# Copyright, 2016-2026, by Samuel Williams.
|
|
22
5
|
|
|
23
|
-
|
|
24
|
-
require_relative 'command/clean'
|
|
25
|
-
require_relative 'command/create'
|
|
26
|
-
require_relative 'command/clone'
|
|
27
|
-
require_relative 'command/fetch'
|
|
28
|
-
require_relative 'command/list'
|
|
29
|
-
require_relative 'command/status'
|
|
30
|
-
require_relative 'command/visualize'
|
|
6
|
+
require "samovar"
|
|
31
7
|
|
|
32
|
-
require_relative
|
|
33
|
-
require_relative
|
|
34
|
-
require_relative
|
|
8
|
+
require_relative "command/build"
|
|
9
|
+
require_relative "command/clean"
|
|
10
|
+
require_relative "command/create"
|
|
11
|
+
require_relative "command/clone"
|
|
12
|
+
require_relative "command/fetch"
|
|
13
|
+
require_relative "command/list"
|
|
14
|
+
require_relative "command/status"
|
|
15
|
+
require_relative "command/visualize"
|
|
35
16
|
|
|
36
|
-
|
|
17
|
+
require_relative "context"
|
|
18
|
+
require_relative "configuration"
|
|
19
|
+
require_relative "version"
|
|
37
20
|
|
|
38
|
-
require
|
|
21
|
+
require "fileutils"
|
|
22
|
+
|
|
23
|
+
require "console"
|
|
39
24
|
|
|
40
25
|
module Teapot
|
|
41
26
|
module Command
|
|
@@ -43,11 +28,11 @@ module Teapot
|
|
|
43
28
|
self.description = "A decentralised package manager and build tool."
|
|
44
29
|
|
|
45
30
|
options do
|
|
46
|
-
option
|
|
47
|
-
option
|
|
48
|
-
option
|
|
49
|
-
option
|
|
50
|
-
option
|
|
31
|
+
option "-c/--configuration <name>", "Specify a specific build configuration.", default: ENV["TEAPOT_CONFIGURATION"]
|
|
32
|
+
option "--root <path>", "Work in the given root directory."
|
|
33
|
+
option "--verbose | --quiet", "Verbosity of output for debugging.", key: :logging
|
|
34
|
+
option "-h/--help", "Print out help information."
|
|
35
|
+
option "-v/--version", "Print out the application version."
|
|
51
36
|
end
|
|
52
37
|
|
|
53
38
|
nested :command, {
|
|
@@ -59,7 +44,7 @@ module Teapot
|
|
|
59
44
|
"build" => Build,
|
|
60
45
|
"visualize" => Visualize,
|
|
61
46
|
"clean" => Clean,
|
|
62
|
-
}, default:
|
|
47
|
+
}, default: "build"
|
|
63
48
|
|
|
64
49
|
def root
|
|
65
50
|
::Build::Files::Path.expand(@options[:root] || Dir.getwd)
|
|
@@ -110,19 +95,19 @@ module Teapot
|
|
|
110
95
|
rescue ::Build::Dependency::UnresolvedDependencyError => error
|
|
111
96
|
logger.error(command, error) do |buffer|
|
|
112
97
|
buffer.puts "Unresolved dependencies:"
|
|
113
|
-
|
|
98
|
+
|
|
114
99
|
error.chain.unresolved.each do |name, parent|
|
|
115
100
|
buffer.puts "#{parent} depends on #{name.inspect}"
|
|
116
|
-
|
|
101
|
+
|
|
117
102
|
conflicts = error.chain.conflicts[name]
|
|
118
|
-
|
|
103
|
+
|
|
119
104
|
if conflicts
|
|
120
105
|
conflicts.each do |conflict|
|
|
121
106
|
buffer.puts " - provided by #{conflict.name}"
|
|
122
107
|
end
|
|
123
108
|
end
|
|
124
109
|
end
|
|
125
|
-
|
|
110
|
+
|
|
126
111
|
buffer.puts "Cannot continue due to unresolved dependencies!"
|
|
127
112
|
end
|
|
128
113
|
|
data/lib/teapot/configuration.rb
CHANGED
|
@@ -1,30 +1,15 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
# furnished to do so, subject to the following conditions:
|
|
9
|
-
#
|
|
10
|
-
# The above copyright notice and this permission notice shall be included in
|
|
11
|
-
# all copies or substantial portions of the Software.
|
|
12
|
-
#
|
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
# THE SOFTWARE.
|
|
1
|
+
# frozen_string_literal: true
|
|
20
2
|
|
|
21
|
-
|
|
22
|
-
|
|
3
|
+
# Released under the MIT License.
|
|
4
|
+
# Copyright, 2013-2026, by Samuel Williams.
|
|
23
5
|
|
|
24
|
-
require
|
|
6
|
+
require "pathname"
|
|
7
|
+
require "set"
|
|
25
8
|
|
|
26
|
-
require
|
|
27
|
-
|
|
9
|
+
require "yaml/store"
|
|
10
|
+
|
|
11
|
+
require "build/dependency/set"
|
|
12
|
+
require_relative "definition"
|
|
28
13
|
|
|
29
14
|
module Teapot
|
|
30
15
|
# A configuration represents a mapping between package/dependency names and actual source locations. Usually, there is only one configuration, but in some cases it is useful to have more than one, e.g. one for local development using local source code, one for continuous integration, and one for deployment.
|
|
@@ -37,18 +22,18 @@ module Teapot
|
|
|
37
22
|
|
|
38
23
|
def initialize(context, package, name, packages = [], **options)
|
|
39
24
|
super context, package, name
|
|
40
|
-
|
|
25
|
+
|
|
41
26
|
@options = DEFAULT_OPTIONS.merge(options)
|
|
42
|
-
|
|
27
|
+
|
|
43
28
|
@packages = Build::Dependency::Set.new(packages)
|
|
44
29
|
@imports = Build::Dependency::Set.new
|
|
45
|
-
|
|
30
|
+
|
|
46
31
|
@visibility = :private
|
|
47
|
-
|
|
32
|
+
|
|
48
33
|
# A list of named targets for specific purposes:
|
|
49
34
|
@targets = Hash.new{|hash,key| hash[key] = Array.new}
|
|
50
35
|
end
|
|
51
|
-
|
|
36
|
+
|
|
52
37
|
def freeze
|
|
53
38
|
return self if frozen?
|
|
54
39
|
|
|
@@ -62,7 +47,7 @@ module Teapot
|
|
|
62
47
|
|
|
63
48
|
super
|
|
64
49
|
end
|
|
65
|
-
|
|
50
|
+
|
|
66
51
|
def environment
|
|
67
52
|
configuration = self
|
|
68
53
|
|
|
@@ -71,30 +56,30 @@ module Teapot
|
|
|
71
56
|
default platforms_path configuration.build_path
|
|
72
57
|
end
|
|
73
58
|
end
|
|
74
|
-
|
|
59
|
+
|
|
75
60
|
# Controls how the configuration is exposed in the context.
|
|
76
61
|
attr :visibility
|
|
77
|
-
|
|
62
|
+
|
|
78
63
|
def public?
|
|
79
64
|
@visibility == :public
|
|
80
65
|
end
|
|
81
|
-
|
|
66
|
+
|
|
82
67
|
def public!
|
|
83
68
|
@visibility = :public
|
|
84
69
|
end
|
|
85
|
-
|
|
70
|
+
|
|
86
71
|
# A table of named targets for specific purposes.
|
|
87
72
|
attr :targets
|
|
88
|
-
|
|
73
|
+
|
|
89
74
|
# Options used to bind packages to this configuration.
|
|
90
75
|
attr :options
|
|
91
|
-
|
|
76
|
+
|
|
92
77
|
# A list of packages which are required by this configuration.
|
|
93
78
|
attr :packages
|
|
94
|
-
|
|
79
|
+
|
|
95
80
|
# A list of other configurations to include when materialising the list of packages.
|
|
96
81
|
attr :imports
|
|
97
|
-
|
|
82
|
+
|
|
98
83
|
# Specifies that this configuration depends on an external package of some sort.
|
|
99
84
|
def require(name, **options)
|
|
100
85
|
options = @options.merge(options)
|
|
@@ -107,12 +92,12 @@ module Teapot
|
|
|
107
92
|
import(options[:import])
|
|
108
93
|
end
|
|
109
94
|
end
|
|
110
|
-
|
|
95
|
+
|
|
111
96
|
# Specifies that this package will import additional configuration records from another definition.
|
|
112
97
|
def import(name, explicit = true)
|
|
113
98
|
@imports << Import.new(name, explicit, @options.dup)
|
|
114
99
|
end
|
|
115
|
-
|
|
100
|
+
|
|
116
101
|
# Create a group for configuration options which will be only be active within the group block.
|
|
117
102
|
def group
|
|
118
103
|
options = @options.dup
|
|
@@ -121,41 +106,41 @@ module Teapot
|
|
|
121
106
|
|
|
122
107
|
@options = options
|
|
123
108
|
end
|
|
124
|
-
|
|
109
|
+
|
|
125
110
|
# Set a configuration option.
|
|
126
111
|
def []= key, value
|
|
127
112
|
@options[key] = value
|
|
128
113
|
end
|
|
129
|
-
|
|
114
|
+
|
|
130
115
|
# Get a configuration option.
|
|
131
116
|
def [] key
|
|
132
117
|
@options[key]
|
|
133
118
|
end
|
|
134
|
-
|
|
119
|
+
|
|
135
120
|
# The path where packages will be located when fetched.
|
|
136
121
|
def packages_path
|
|
137
122
|
context.root + "teapot/packages/#{name}"
|
|
138
123
|
end
|
|
139
|
-
|
|
124
|
+
|
|
140
125
|
# The path where built products will be placed.
|
|
141
126
|
def build_path
|
|
142
127
|
context.root + "teapot/build/#{name}"
|
|
143
128
|
end
|
|
144
|
-
|
|
129
|
+
|
|
145
130
|
alias platforms_path build_path
|
|
146
|
-
|
|
131
|
+
|
|
147
132
|
def lock_path
|
|
148
133
|
context.root + "#{@name}-lock.yml"
|
|
149
134
|
end
|
|
150
|
-
|
|
135
|
+
|
|
151
136
|
def lock_store
|
|
152
|
-
YAML::Store.new(lock_path.to_s)
|
|
137
|
+
::YAML::Store.new(lock_path.to_s)
|
|
153
138
|
end
|
|
154
|
-
|
|
139
|
+
|
|
155
140
|
def to_s
|
|
156
141
|
"#<#{self.class} #{@name.dump} visibility=#{@visibility}>"
|
|
157
142
|
end
|
|
158
|
-
|
|
143
|
+
|
|
159
144
|
# Process all import directives and return a new configuration based on the current configuration. Import directives bring packages and other import directives from the specififed configuration definition.
|
|
160
145
|
def traverse(configurations, imported = Build::Dependency::Set.new, &block)
|
|
161
146
|
yield self # Whatever happens here, should ensure that...
|
data/lib/teapot/context.rb
CHANGED
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
# furnished to do so, subject to the following conditions:
|
|
9
|
-
#
|
|
10
|
-
# The above copyright notice and this permission notice shall be included in
|
|
11
|
-
# all copies or substantial portions of the Software.
|
|
12
|
-
#
|
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
# THE SOFTWARE.
|
|
1
|
+
# frozen_string_literal: true
|
|
20
2
|
|
|
21
|
-
|
|
3
|
+
# Released under the MIT License.
|
|
4
|
+
# Copyright, 2012-2026, by Samuel Williams.
|
|
5
|
+
|
|
6
|
+
require_relative "select"
|
|
22
7
|
|
|
23
8
|
module Teapot
|
|
24
9
|
# A context represents a specific root package instance with a given configuration and all related definitions. A context is stateful in the sense that package selection is specialized based on #select and #dependency_chain. These parameters are usually set up initially as part of the context setup.
|
|
@@ -26,24 +11,24 @@ module Teapot
|
|
|
26
11
|
def initialize(root, **options)
|
|
27
12
|
@root = Path[root]
|
|
28
13
|
@options = options
|
|
29
|
-
|
|
14
|
+
|
|
30
15
|
@configuration = nil
|
|
31
16
|
@project = nil
|
|
32
|
-
|
|
17
|
+
|
|
33
18
|
@loaded = {}
|
|
34
|
-
|
|
19
|
+
|
|
35
20
|
load_root_package(**options)
|
|
36
21
|
end
|
|
37
|
-
|
|
22
|
+
|
|
38
23
|
attr :root
|
|
39
24
|
attr :options
|
|
40
|
-
|
|
25
|
+
|
|
41
26
|
# The primary configuration.
|
|
42
27
|
attr :configuration
|
|
43
|
-
|
|
28
|
+
|
|
44
29
|
# The primary project.
|
|
45
30
|
attr :project
|
|
46
|
-
|
|
31
|
+
|
|
47
32
|
def repository
|
|
48
33
|
@repository ||= Rugged::Repository.discover(@root.to_s)
|
|
49
34
|
end
|
|
@@ -51,41 +36,41 @@ module Teapot
|
|
|
51
36
|
def select(names = nil, configuration = @configuration)
|
|
52
37
|
Select.new(self, configuration, names || [])
|
|
53
38
|
end
|
|
54
|
-
|
|
39
|
+
|
|
55
40
|
def substitutions
|
|
56
41
|
substitutions = Build::Text::Substitutions.new
|
|
57
42
|
|
|
58
|
-
substitutions[
|
|
43
|
+
substitutions["TEAPOT_VERSION"] = Teapot::VERSION
|
|
59
44
|
|
|
60
45
|
if @project
|
|
61
46
|
name = @project.name
|
|
62
47
|
|
|
63
48
|
# e.g. Foo Bar, typically used as a title, directory, etc.
|
|
64
|
-
substitutions[
|
|
49
|
+
substitutions["PROJECT_NAME"] = name.text
|
|
65
50
|
|
|
66
51
|
# e.g. FooBar, typically used as a namespace
|
|
67
|
-
substitutions[
|
|
52
|
+
substitutions["PROJECT_IDENTIFIER"] = name.identifier
|
|
68
53
|
|
|
69
54
|
# e.g. foo-bar, typically used for targets, executables
|
|
70
|
-
substitutions[
|
|
55
|
+
substitutions["PROJECT_TARGET_NAME"] = name.target
|
|
71
56
|
|
|
72
57
|
# e.g. foo_bar, typically used for variables.
|
|
73
|
-
substitutions[
|
|
58
|
+
substitutions["PROJECT_VARIABLE_NAME"] = name.key
|
|
74
59
|
|
|
75
|
-
substitutions[
|
|
60
|
+
substitutions["LICENSE"] = @project.license
|
|
76
61
|
end
|
|
77
62
|
|
|
78
63
|
# The user's current name:
|
|
79
|
-
substitutions[
|
|
80
|
-
substitutions[
|
|
64
|
+
substitutions["AUTHOR_NAME"] = repository.config["user.name"]
|
|
65
|
+
substitutions["AUTHOR_EMAIL"] = repository.config["user.email"]
|
|
81
66
|
|
|
82
67
|
current_date = Time.new
|
|
83
|
-
substitutions[
|
|
84
|
-
substitutions[
|
|
68
|
+
substitutions["DATE"] = current_date.strftime("%-d/%-m/%Y")
|
|
69
|
+
substitutions["YEAR"] = current_date.strftime("%Y")
|
|
85
70
|
|
|
86
71
|
return substitutions
|
|
87
72
|
end
|
|
88
|
-
|
|
73
|
+
|
|
89
74
|
def load(package)
|
|
90
75
|
if loader = @loaded[package]
|
|
91
76
|
return loader.script unless loader.changed?
|
data/lib/teapot/definition.rb
CHANGED
|
@@ -1,22 +1,7 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
# furnished to do so, subject to the following conditions:
|
|
9
|
-
#
|
|
10
|
-
# The above copyright notice and this permission notice shall be included in
|
|
11
|
-
# all copies or substantial portions of the Software.
|
|
12
|
-
#
|
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
# THE SOFTWARE.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Released under the MIT License.
|
|
4
|
+
# Copyright, 2013-2026, by Samuel Williams.
|
|
20
5
|
|
|
21
6
|
module Teapot
|
|
22
7
|
class Definition
|
|
@@ -35,11 +20,11 @@ module Teapot
|
|
|
35
20
|
|
|
36
21
|
super
|
|
37
22
|
end
|
|
38
|
-
|
|
23
|
+
|
|
39
24
|
def inspect
|
|
40
25
|
"\#<#{self.class.name} #{@name}>"
|
|
41
26
|
end
|
|
42
|
-
|
|
27
|
+
|
|
43
28
|
# The context in which the definition was loaded:
|
|
44
29
|
attr :context
|
|
45
30
|
|
|
@@ -54,7 +39,7 @@ module Teapot
|
|
|
54
39
|
|
|
55
40
|
def description=(text)
|
|
56
41
|
if text =~ /^(\t+)/
|
|
57
|
-
text = text.gsub(/#{$1}/,
|
|
42
|
+
text = text.gsub(/#{$1}/, "")
|
|
58
43
|
end
|
|
59
44
|
|
|
60
45
|
@description = text
|
data/lib/teapot/loader.rb
CHANGED
|
@@ -1,30 +1,15 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
# furnished to do so, subject to the following conditions:
|
|
9
|
-
#
|
|
10
|
-
# The above copyright notice and this permission notice shall be included in
|
|
11
|
-
# all copies or substantial portions of the Software.
|
|
12
|
-
#
|
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
# THE SOFTWARE.
|
|
1
|
+
# frozen_string_literal: true
|
|
20
2
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
require_relative 'configuration'
|
|
3
|
+
# Released under the MIT License.
|
|
4
|
+
# Copyright, 2013-2026, by Samuel Williams.
|
|
24
5
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
6
|
+
require_relative "project"
|
|
7
|
+
require_relative "target"
|
|
8
|
+
require_relative "configuration"
|
|
9
|
+
|
|
10
|
+
require "build/rule"
|
|
11
|
+
require "build/name"
|
|
12
|
+
require "build/files"
|
|
28
13
|
|
|
29
14
|
module Teapot
|
|
30
15
|
# Cannot load packages newer than this.
|
|
@@ -37,7 +22,7 @@ module Teapot
|
|
|
37
22
|
MINIMUM_LOADER_VERSION = "1.0"
|
|
38
23
|
|
|
39
24
|
# The package relative path to the file to load:
|
|
40
|
-
TEAPOT_FILE =
|
|
25
|
+
TEAPOT_FILE = "teapot.rb".freeze
|
|
41
26
|
|
|
42
27
|
class IncompatibleTeapotError < StandardError
|
|
43
28
|
def initialize(package, version)
|
|
@@ -118,9 +103,9 @@ module Teapot
|
|
|
118
103
|
|
|
119
104
|
def define_configuration(*arguments, **options)
|
|
120
105
|
configuration = Configuration.new(@context, @package, *arguments, **options)
|
|
121
|
-
|
|
106
|
+
|
|
122
107
|
yield configuration
|
|
123
|
-
|
|
108
|
+
|
|
124
109
|
@default_configuration ||= configuration
|
|
125
110
|
@defined << configuration
|
|
126
111
|
@configurations << configuration
|
data/lib/teapot/package.rb
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
# furnished to do so, subject to the following conditions:
|
|
9
|
-
#
|
|
10
|
-
# The above copyright notice and this permission notice shall be included in
|
|
11
|
-
# all copies or substantial portions of the Software.
|
|
12
|
-
#
|
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
# THE SOFTWARE.
|
|
1
|
+
# frozen_string_literal: true
|
|
20
2
|
|
|
21
|
-
|
|
22
|
-
|
|
3
|
+
# Released under the MIT License.
|
|
4
|
+
# Copyright, 2012-2026, by Samuel Williams.
|
|
23
5
|
|
|
24
|
-
|
|
6
|
+
require "build/files"
|
|
7
|
+
require "build/uri"
|
|
8
|
+
|
|
9
|
+
require_relative "definition"
|
|
25
10
|
|
|
26
11
|
module Teapot
|
|
27
12
|
Path = Build::Files::Path
|
|
@@ -30,12 +15,12 @@ module Teapot
|
|
|
30
15
|
def initialize(path, name, options = {})
|
|
31
16
|
# The path where the package is (or will be) located:
|
|
32
17
|
@path = Path[path]
|
|
33
|
-
|
|
18
|
+
|
|
34
19
|
# Get the name of the package from the options, if provided:
|
|
35
20
|
if options[:name]
|
|
36
21
|
@name = options[:name]
|
|
37
22
|
end
|
|
38
|
-
|
|
23
|
+
|
|
39
24
|
if Symbol === name
|
|
40
25
|
# If the name argument was symbolic, we convert it into a string, and use it for both the uri and the name itself:
|
|
41
26
|
@uri = name.to_s
|
|
@@ -58,34 +43,34 @@ module Teapot
|
|
|
58
43
|
|
|
59
44
|
super
|
|
60
45
|
end
|
|
61
|
-
|
|
46
|
+
|
|
62
47
|
attr :name
|
|
63
48
|
attr :path
|
|
64
|
-
|
|
49
|
+
|
|
65
50
|
attr :uri
|
|
66
51
|
attr_accessor :options
|
|
67
|
-
|
|
52
|
+
|
|
68
53
|
def local
|
|
69
54
|
@options[:local].to_s
|
|
70
55
|
end
|
|
71
|
-
|
|
56
|
+
|
|
72
57
|
def local?
|
|
73
58
|
@options.include?(:local)
|
|
74
59
|
end
|
|
75
|
-
|
|
60
|
+
|
|
76
61
|
def external?
|
|
77
62
|
@options.include?(:source)
|
|
78
63
|
end
|
|
79
|
-
|
|
64
|
+
|
|
80
65
|
# The source uri from which this package would be cloned. Might be relative, in which case it's relative to the root of the context.
|
|
81
66
|
def source_uri
|
|
82
67
|
Build::URI[@options[:source]]
|
|
83
68
|
end
|
|
84
|
-
|
|
69
|
+
|
|
85
70
|
def external_url(root_path = nil)
|
|
86
71
|
Build::URI[root_path] + source_uri + Build::URI[@uri]
|
|
87
72
|
end
|
|
88
|
-
|
|
73
|
+
|
|
89
74
|
def to_s
|
|
90
75
|
if self.local?
|
|
91
76
|
"links #{@name} from #{self.local}"
|
data/lib/teapot/project.rb
CHANGED
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
# furnished to do so, subject to the following conditions:
|
|
9
|
-
#
|
|
10
|
-
# The above copyright notice and this permission notice shall be included in
|
|
11
|
-
# all copies or substantial portions of the Software.
|
|
12
|
-
#
|
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
# THE SOFTWARE.
|
|
1
|
+
# frozen_string_literal: true
|
|
20
2
|
|
|
21
|
-
|
|
3
|
+
# Released under the MIT License.
|
|
4
|
+
# Copyright, 2013-2026, by Samuel Williams.
|
|
5
|
+
|
|
6
|
+
require_relative "definition"
|
|
22
7
|
|
|
23
8
|
module Teapot
|
|
24
9
|
class Project < Definition
|