teapot 3.6.0 → 3.7.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/context/getting-started.md +139 -0
- data/context/index.yaml +13 -0
- data/lib/teapot/command/build.rb +10 -3
- data/lib/teapot/command/clean.rb +2 -0
- data/lib/teapot/command/clone.rb +7 -0
- data/lib/teapot/command/create.rb +7 -0
- data/lib/teapot/command/fetch.rb +7 -0
- data/lib/teapot/command/list.rb +6 -0
- data/lib/teapot/command/selection.rb +7 -0
- data/lib/teapot/command/status.rb +9 -0
- data/lib/teapot/command/visualize.rb +153 -27
- data/lib/teapot/command.rb +16 -0
- data/lib/teapot/configuration.rb +17 -1
- data/lib/teapot/context.rb +13 -0
- data/lib/teapot/definition.rb +10 -0
- data/lib/teapot/loader.rb +27 -0
- data/lib/teapot/package.rb +21 -0
- data/lib/teapot/project.rb +11 -0
- data/lib/teapot/select.rb +15 -0
- data/lib/teapot/target.rb +8 -0
- data/lib/teapot/version.rb +2 -1
- data/lib/teapot.rb +0 -4
- data/readme.md +8 -118
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +19 -15
- metadata.gz.sig +0 -0
data/lib/teapot/configuration.rb
CHANGED
|
@@ -20,6 +20,11 @@ module Teapot
|
|
|
20
20
|
:import => true
|
|
21
21
|
}.freeze
|
|
22
22
|
|
|
23
|
+
# Initialize a new configuration.
|
|
24
|
+
# @parameter context [Context] The project context.
|
|
25
|
+
# @parameter package [Package] The package.
|
|
26
|
+
# @parameter name [String] The configuration name.
|
|
27
|
+
# @parameter packages [Array] The list of packages.
|
|
23
28
|
def initialize(context, package, name, packages = [], **options)
|
|
24
29
|
super context, package, name
|
|
25
30
|
|
|
@@ -34,6 +39,7 @@ module Teapot
|
|
|
34
39
|
@targets = Hash.new{|hash,key| hash[key] = Array.new}
|
|
35
40
|
end
|
|
36
41
|
|
|
42
|
+
# Make the configuration immutable to prevent modification after targets and packages are resolved.
|
|
37
43
|
def freeze
|
|
38
44
|
return self if frozen?
|
|
39
45
|
|
|
@@ -48,6 +54,8 @@ module Teapot
|
|
|
48
54
|
super
|
|
49
55
|
end
|
|
50
56
|
|
|
57
|
+
# Create an environment for this configuration.
|
|
58
|
+
# @returns [Build::Environment] The build environment.
|
|
51
59
|
def environment
|
|
52
60
|
configuration = self
|
|
53
61
|
|
|
@@ -60,10 +68,13 @@ module Teapot
|
|
|
60
68
|
# Controls how the configuration is exposed in the context.
|
|
61
69
|
attr :visibility
|
|
62
70
|
|
|
71
|
+
# Whether this configuration is publicly accessible (not hidden from listings).
|
|
72
|
+
# @returns [Boolean] True if public.
|
|
63
73
|
def public?
|
|
64
74
|
@visibility == :public
|
|
65
75
|
end
|
|
66
76
|
|
|
77
|
+
# Mark this configuration as publicly visible in listings and help output.
|
|
67
78
|
def public!
|
|
68
79
|
@visibility = :public
|
|
69
80
|
end
|
|
@@ -112,7 +123,7 @@ module Teapot
|
|
|
112
123
|
@options[key] = value
|
|
113
124
|
end
|
|
114
125
|
|
|
115
|
-
#
|
|
126
|
+
# Access configuration-specific settings that control build behavior and environment variables.
|
|
116
127
|
def [] key
|
|
117
128
|
@options[key]
|
|
118
129
|
end
|
|
@@ -129,14 +140,19 @@ module Teapot
|
|
|
129
140
|
|
|
130
141
|
alias platforms_path build_path
|
|
131
142
|
|
|
143
|
+
# Get the path to the lock file.
|
|
144
|
+
# @returns [Build::Files::Path] The lock file path.
|
|
132
145
|
def lock_path
|
|
133
146
|
context.root + "#{@name}-lock.yml"
|
|
134
147
|
end
|
|
135
148
|
|
|
149
|
+
# Get the lock store for persisting state.
|
|
150
|
+
# @returns [YAML::Store] The lock store.
|
|
136
151
|
def lock_store
|
|
137
152
|
::YAML::Store.new(lock_path.to_s)
|
|
138
153
|
end
|
|
139
154
|
|
|
155
|
+
# @returns [String] The string representation.
|
|
140
156
|
def to_s
|
|
141
157
|
"#<#{self.class} #{@name.dump} visibility=#{@visibility}>"
|
|
142
158
|
end
|
data/lib/teapot/context.rb
CHANGED
|
@@ -8,6 +8,8 @@ require_relative "select"
|
|
|
8
8
|
module Teapot
|
|
9
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.
|
|
10
10
|
class Context
|
|
11
|
+
# Initialize a new context.
|
|
12
|
+
# @parameter root [String] The root path.
|
|
11
13
|
def initialize(root, **options)
|
|
12
14
|
@root = Path[root]
|
|
13
15
|
@options = options
|
|
@@ -29,14 +31,22 @@ module Teapot
|
|
|
29
31
|
# The primary project.
|
|
30
32
|
attr :project
|
|
31
33
|
|
|
34
|
+
# Discover and open the git repository for this context's root directory.
|
|
35
|
+
# @returns [Rugged::Repository] The git repository.
|
|
32
36
|
def repository
|
|
33
37
|
@repository ||= Rugged::Repository.discover(@root.to_s)
|
|
34
38
|
end
|
|
35
39
|
|
|
40
|
+
# Create a selection that resolves dependencies and loads definitions for the specified targets or configurations.
|
|
41
|
+
# @parameter names [Array | Nil] The names to select.
|
|
42
|
+
# @parameter configuration [Configuration] The configuration to use.
|
|
43
|
+
# @returns [Select] The selection.
|
|
36
44
|
def select(names = nil, configuration = @configuration)
|
|
37
45
|
Select.new(self, configuration, names || [])
|
|
38
46
|
end
|
|
39
47
|
|
|
48
|
+
# Get substitutions for template generation.
|
|
49
|
+
# @returns [Build::Text::Substitutions] The substitutions.
|
|
40
50
|
def substitutions
|
|
41
51
|
substitutions = Build::Text::Substitutions.new
|
|
42
52
|
|
|
@@ -71,6 +81,9 @@ module Teapot
|
|
|
71
81
|
return substitutions
|
|
72
82
|
end
|
|
73
83
|
|
|
84
|
+
# Load a package from its teapot.rb, tracking loaded packages to prevent duplicates.
|
|
85
|
+
# @parameter package [Package] The package to load.
|
|
86
|
+
# @returns [Script] The loaded script.
|
|
74
87
|
def load(package)
|
|
75
88
|
if loader = @loaded[package]
|
|
76
89
|
return loader.script unless loader.changed?
|
data/lib/teapot/definition.rb
CHANGED
|
@@ -4,7 +4,12 @@
|
|
|
4
4
|
# Copyright, 2013-2026, by Samuel Williams.
|
|
5
5
|
|
|
6
6
|
module Teapot
|
|
7
|
+
# Base class for definitions (target, configuration, or project).
|
|
7
8
|
class Definition
|
|
9
|
+
# Initialize a new definition.
|
|
10
|
+
# @parameter context [Context] The project context.
|
|
11
|
+
# @parameter package [Package] The package.
|
|
12
|
+
# @parameter name [String] The definition name.
|
|
8
13
|
def initialize(context, package, name)
|
|
9
14
|
@context = context
|
|
10
15
|
@package = package
|
|
@@ -14,6 +19,7 @@ module Teapot
|
|
|
14
19
|
@description = nil
|
|
15
20
|
end
|
|
16
21
|
|
|
22
|
+
# Make the definition immutable after it has been loaded from a teapot file.
|
|
17
23
|
def freeze
|
|
18
24
|
@name.freeze
|
|
19
25
|
@description.freeze
|
|
@@ -21,6 +27,7 @@ module Teapot
|
|
|
21
27
|
super
|
|
22
28
|
end
|
|
23
29
|
|
|
30
|
+
# @returns [String] The string representation.
|
|
24
31
|
def inspect
|
|
25
32
|
"\#<#{self.class.name} #{@name}>"
|
|
26
33
|
end
|
|
@@ -37,6 +44,8 @@ module Teapot
|
|
|
37
44
|
# A textual description of the definition, possibly in markdown format:
|
|
38
45
|
attr :description
|
|
39
46
|
|
|
47
|
+
# Assign a description with automatic removal of common leading indentation.
|
|
48
|
+
# @parameter text [String] The description text.
|
|
40
49
|
def description=(text)
|
|
41
50
|
if text =~ /^(\t+)/
|
|
42
51
|
text = text.gsub(/#{$1}/, "")
|
|
@@ -50,6 +59,7 @@ module Teapot
|
|
|
50
59
|
@package.path
|
|
51
60
|
end
|
|
52
61
|
|
|
62
|
+
# @returns [String] The string representation.
|
|
53
63
|
def to_s
|
|
54
64
|
"#<#{self.class} #{@name.dump}>"
|
|
55
65
|
end
|
data/lib/teapot/loader.rb
CHANGED
|
@@ -24,7 +24,10 @@ module Teapot
|
|
|
24
24
|
# The package relative path to the file to load:
|
|
25
25
|
TEAPOT_FILE = "teapot.rb".freeze
|
|
26
26
|
|
|
27
|
+
# Raised when a teapot file requires an incompatible version.
|
|
27
28
|
class IncompatibleTeapotError < StandardError
|
|
29
|
+
# @parameter package [Package] The package.
|
|
30
|
+
# @parameter version [String] The version.
|
|
28
31
|
def initialize(package, version)
|
|
29
32
|
super "Unsupported teapot_version #{version} in #{package.path}!"
|
|
30
33
|
end
|
|
@@ -32,7 +35,9 @@ module Teapot
|
|
|
32
35
|
attr :version
|
|
33
36
|
end
|
|
34
37
|
|
|
38
|
+
# Raised when a teapot file cannot be found.
|
|
35
39
|
class MissingTeapotError < StandardError
|
|
40
|
+
# @parameter path [String] The file path.
|
|
36
41
|
def initialize(path)
|
|
37
42
|
super "Could not read file at #{path}!"
|
|
38
43
|
end
|
|
@@ -45,6 +50,10 @@ module Teapot
|
|
|
45
50
|
Files = Build::Files
|
|
46
51
|
Rule = Build::Rule
|
|
47
52
|
|
|
53
|
+
# Initialize a new script.
|
|
54
|
+
# @parameter context [Context] The project context.
|
|
55
|
+
# @parameter package [Package] The package.
|
|
56
|
+
# @parameter path [String] The teapot file path.
|
|
48
57
|
def initialize(context, package, path = TEAPOT_FILE)
|
|
49
58
|
@context = context
|
|
50
59
|
@package = package
|
|
@@ -70,6 +79,8 @@ module Teapot
|
|
|
70
79
|
attr :default_project
|
|
71
80
|
attr :default_configuration
|
|
72
81
|
|
|
82
|
+
# Specify the minimum required teapot gem version for compatibility checks.
|
|
83
|
+
# @parameter version [String] The required version.
|
|
73
84
|
def teapot_version(version)
|
|
74
85
|
version = version[0..2]
|
|
75
86
|
|
|
@@ -82,6 +93,8 @@ module Teapot
|
|
|
82
93
|
|
|
83
94
|
alias required_version teapot_version
|
|
84
95
|
|
|
96
|
+
# Define a new project.
|
|
97
|
+
# @parameter arguments [Array] The definition arguments.
|
|
85
98
|
def define_project(*arguments, **options)
|
|
86
99
|
project = Project.new(@context, @package, *arguments, **options)
|
|
87
100
|
|
|
@@ -91,6 +104,8 @@ module Teapot
|
|
|
91
104
|
@defined << project
|
|
92
105
|
end
|
|
93
106
|
|
|
107
|
+
# Define a new target.
|
|
108
|
+
# @parameter arguments [Array] The definition arguments.
|
|
94
109
|
def define_target(*arguments, **options)
|
|
95
110
|
target = Target.new(@context, @package, *arguments, **options)
|
|
96
111
|
|
|
@@ -101,6 +116,8 @@ module Teapot
|
|
|
101
116
|
@defined << target
|
|
102
117
|
end
|
|
103
118
|
|
|
119
|
+
# Define a new configuration.
|
|
120
|
+
# @parameter arguments [Array] The definition arguments.
|
|
104
121
|
def define_configuration(*arguments, **options)
|
|
105
122
|
configuration = Configuration.new(@context, @package, *arguments, **options)
|
|
106
123
|
|
|
@@ -127,6 +144,10 @@ module Teapot
|
|
|
127
144
|
|
|
128
145
|
# Loads the teapot.rb script and can reload it if it was changed.
|
|
129
146
|
class Loader
|
|
147
|
+
# Initialize a new loader.
|
|
148
|
+
# @parameter context [Context] The project context.
|
|
149
|
+
# @parameter package [Package] The package.
|
|
150
|
+
# @parameter path [String] The teapot file path.
|
|
130
151
|
def initialize(context, package, path = TEAPOT_FILE)
|
|
131
152
|
@context = context
|
|
132
153
|
@package = package
|
|
@@ -139,14 +160,20 @@ module Teapot
|
|
|
139
160
|
|
|
140
161
|
attr :script
|
|
141
162
|
|
|
163
|
+
# The absolute path to the teapot.rb file for this package.
|
|
164
|
+
# @returns [Build::Files::Path] The teapot file path.
|
|
142
165
|
def teapot_path
|
|
143
166
|
@package.path + @path
|
|
144
167
|
end
|
|
145
168
|
|
|
169
|
+
# Whether the teapot file has been modified since it was loaded.
|
|
170
|
+
# @returns [Boolean] True if changed.
|
|
146
171
|
def changed?
|
|
147
172
|
File.mtime(teapot_path) > @mtime
|
|
148
173
|
end
|
|
149
174
|
|
|
175
|
+
# Reload the loader with fresh data.
|
|
176
|
+
# @returns [Loader] A new loader instance.
|
|
150
177
|
def reload
|
|
151
178
|
self.class.new(@context, @package, @path)
|
|
152
179
|
end
|
data/lib/teapot/package.rb
CHANGED
|
@@ -11,7 +11,12 @@ require_relative "definition"
|
|
|
11
11
|
module Teapot
|
|
12
12
|
Path = Build::Files::Path
|
|
13
13
|
|
|
14
|
+
# A package in the dependency graph.
|
|
14
15
|
class Package
|
|
16
|
+
# Initialize a new package.
|
|
17
|
+
# @parameter path [String] The package path.
|
|
18
|
+
# @parameter name [String | Symbol] The package name or URI.
|
|
19
|
+
# @parameter options [Hash] Additional options.
|
|
15
20
|
def initialize(path, name, options = {})
|
|
16
21
|
# The path where the package is (or will be) located:
|
|
17
22
|
@path = Path[path]
|
|
@@ -35,6 +40,7 @@ module Teapot
|
|
|
35
40
|
@options = options
|
|
36
41
|
end
|
|
37
42
|
|
|
43
|
+
# Make the package immutable to prevent modification after it's been loaded and processed.
|
|
38
44
|
def freeze
|
|
39
45
|
@path.freeze
|
|
40
46
|
@name.freeze
|
|
@@ -50,14 +56,20 @@ module Teapot
|
|
|
50
56
|
attr :uri
|
|
51
57
|
attr_accessor :options
|
|
52
58
|
|
|
59
|
+
# The local filesystem path if this package is linked rather than cloned.
|
|
60
|
+
# @returns [String] The local path.
|
|
53
61
|
def local
|
|
54
62
|
@options[:local].to_s
|
|
55
63
|
end
|
|
56
64
|
|
|
65
|
+
# Whether this package is linked from a local path instead of being cloned from a remote repository.
|
|
66
|
+
# @returns [Boolean] True if local.
|
|
57
67
|
def local?
|
|
58
68
|
@options.include?(:local)
|
|
59
69
|
end
|
|
60
70
|
|
|
71
|
+
# Whether this package should be cloned from an external source repository.
|
|
72
|
+
# @returns [Boolean] True if external.
|
|
61
73
|
def external?
|
|
62
74
|
@options.include?(:source)
|
|
63
75
|
end
|
|
@@ -67,10 +79,14 @@ module Teapot
|
|
|
67
79
|
Build::URI[@options[:source]]
|
|
68
80
|
end
|
|
69
81
|
|
|
82
|
+
# Construct the full URL from which this package should be cloned, combining the root path, source URI, and package URI.
|
|
83
|
+
# @parameter root_path [String | Nil] The root path.
|
|
84
|
+
# @returns [Build::URI] The external URL.
|
|
70
85
|
def external_url(root_path = nil)
|
|
71
86
|
Build::URI[root_path] + source_uri + Build::URI[@uri]
|
|
72
87
|
end
|
|
73
88
|
|
|
89
|
+
# @returns [String] The string representation.
|
|
74
90
|
def to_s
|
|
75
91
|
if self.local?
|
|
76
92
|
"links #{@name} from #{self.local}"
|
|
@@ -83,10 +99,15 @@ module Teapot
|
|
|
83
99
|
|
|
84
100
|
# Package may be used as hash key / in a set:
|
|
85
101
|
|
|
102
|
+
# Packages are hashed by path for use as hash keys and set members.
|
|
103
|
+
# @returns [Integer] The hash code.
|
|
86
104
|
def hash
|
|
87
105
|
@path.hash
|
|
88
106
|
end
|
|
89
107
|
|
|
108
|
+
# Packages are considered equal if they have the same path.
|
|
109
|
+
# @parameter other [Package] The other package.
|
|
110
|
+
# @returns [Boolean] True if equal.
|
|
90
111
|
def eql?(other)
|
|
91
112
|
@path.eql?(other.path)
|
|
92
113
|
end
|
data/lib/teapot/project.rb
CHANGED
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
require_relative "definition"
|
|
7
7
|
|
|
8
8
|
module Teapot
|
|
9
|
+
# A project definition.
|
|
9
10
|
class Project < Definition
|
|
10
11
|
Author = Struct.new(:name, :email, :website)
|
|
11
12
|
|
|
13
|
+
# Initialize a new project.
|
|
14
|
+
# @parameter context [Context] The project context.
|
|
15
|
+
# @parameter package [Package] The package.
|
|
16
|
+
# @parameter name [String] The project name.
|
|
12
17
|
def initialize(context, package, name)
|
|
13
18
|
super context, package, name
|
|
14
19
|
|
|
@@ -16,6 +21,8 @@ module Teapot
|
|
|
16
21
|
@authors = []
|
|
17
22
|
end
|
|
18
23
|
|
|
24
|
+
# Get the project name as a Build::Name object.
|
|
25
|
+
# @returns [Build::Name] The project name.
|
|
19
26
|
def name
|
|
20
27
|
if @title
|
|
21
28
|
# Prefer title, it retains case.
|
|
@@ -26,6 +33,7 @@ module Teapot
|
|
|
26
33
|
end
|
|
27
34
|
end
|
|
28
35
|
|
|
36
|
+
# Make the project immutable after all packages and configurations have been loaded.
|
|
29
37
|
def freeze
|
|
30
38
|
@title.freeze
|
|
31
39
|
@summary.freeze
|
|
@@ -46,6 +54,9 @@ module Teapot
|
|
|
46
54
|
|
|
47
55
|
attr :authors
|
|
48
56
|
|
|
57
|
+
# Add an author to the project.
|
|
58
|
+
# @parameter name [String] The author name.
|
|
59
|
+
# @parameter options [Hash] Author options (email, website).
|
|
49
60
|
def add_author(name, options = {})
|
|
50
61
|
@authors << Author.new(name, options[:email], options[:website])
|
|
51
62
|
end
|
data/lib/teapot/select.rb
CHANGED
|
@@ -11,11 +11,17 @@ require "build/text/substitutions"
|
|
|
11
11
|
require "build/text/merge"
|
|
12
12
|
|
|
13
13
|
module Teapot
|
|
14
|
+
# Raised when a definition is already defined.
|
|
14
15
|
class AlreadyDefinedError < StandardError
|
|
16
|
+
# @parameter definition [Definition] The definition.
|
|
17
|
+
# @parameter previous [Definition] The previous definition.
|
|
15
18
|
def initialize(definition, previous)
|
|
16
19
|
super "Definition #{definition.name} in #{definition.path} has already been defined in #{previous.path}!"
|
|
17
20
|
end
|
|
18
21
|
|
|
22
|
+
# Check if a definition would cause a conflict.
|
|
23
|
+
# @parameter definition [Definition] The definition to check.
|
|
24
|
+
# @parameter definitions [Hash] The existing definitions.
|
|
19
25
|
def self.check(definition, definitions)
|
|
20
26
|
previous = definitions[definition.name]
|
|
21
27
|
|
|
@@ -25,6 +31,10 @@ module Teapot
|
|
|
25
31
|
|
|
26
32
|
# A selection is a specific view of the data exposed by the context at a specific point in time.
|
|
27
33
|
class Select
|
|
34
|
+
# Initialize a new selection.
|
|
35
|
+
# @parameter context [Context] The project context.
|
|
36
|
+
# @parameter configuration [Configuration] The configuration.
|
|
37
|
+
# @parameter names [Array] The names to select.
|
|
28
38
|
def initialize(context, configuration, names = [])
|
|
29
39
|
@context = context
|
|
30
40
|
@configuration = Configuration.new(context, configuration.package, configuration.name, [], **configuration.options)
|
|
@@ -61,10 +71,15 @@ module Teapot
|
|
|
61
71
|
attr :resolved
|
|
62
72
|
attr :unresolved
|
|
63
73
|
|
|
74
|
+
# Get the dependency chain.
|
|
75
|
+
# @returns [Build::Dependency::Chain] The dependency chain.
|
|
64
76
|
def chain
|
|
65
77
|
@chain ||= Build::Dependency::Chain.expand(@dependencies, @targets.values, @selection)
|
|
66
78
|
end
|
|
67
79
|
|
|
80
|
+
# Extract the targets that directly satisfy the requested dependencies.
|
|
81
|
+
# @parameter ordered [Array] The ordered targets.
|
|
82
|
+
# @returns [Array] The direct targets.
|
|
68
83
|
def direct_targets(ordered)
|
|
69
84
|
@dependencies.collect do |dependency|
|
|
70
85
|
ordered.find{|(package, _)| package.provides? dependency}
|
data/lib/teapot/target.rb
CHANGED
|
@@ -11,18 +11,22 @@ require "build/environment"
|
|
|
11
11
|
require "build/rulebook"
|
|
12
12
|
|
|
13
13
|
module Teapot
|
|
14
|
+
# Raised during build operations.
|
|
14
15
|
class BuildError < StandardError
|
|
15
16
|
end
|
|
16
17
|
|
|
18
|
+
# A build target.
|
|
17
19
|
class Target < Definition
|
|
18
20
|
include Build::Dependency
|
|
19
21
|
|
|
22
|
+
# Initialize a new target.
|
|
20
23
|
def initialize(*)
|
|
21
24
|
super
|
|
22
25
|
|
|
23
26
|
@build = nil
|
|
24
27
|
end
|
|
25
28
|
|
|
29
|
+
# Make the target immutable after it has been completely defined with dependencies and build rules.
|
|
26
30
|
def freeze
|
|
27
31
|
return self if frozen?
|
|
28
32
|
|
|
@@ -31,6 +35,9 @@ module Teapot
|
|
|
31
35
|
super
|
|
32
36
|
end
|
|
33
37
|
|
|
38
|
+
# Define the build block for this target.
|
|
39
|
+
# @parameter block [Proc | Nil] The build block.
|
|
40
|
+
# @returns [Proc | Nil] The build block.
|
|
34
41
|
def build(&block)
|
|
35
42
|
if block_given?
|
|
36
43
|
@build = block
|
|
@@ -39,6 +46,7 @@ module Teapot
|
|
|
39
46
|
return @build
|
|
40
47
|
end
|
|
41
48
|
|
|
49
|
+
# Update environments with the build block.
|
|
42
50
|
def update_environments!
|
|
43
51
|
return unless @build
|
|
44
52
|
|
data/lib/teapot/version.rb
CHANGED
data/lib/teapot.rb
CHANGED
data/readme.md
CHANGED
|
@@ -17,127 +17,17 @@ Ensure that you already have a working install of Ruby 2.0.0+ and run the follow
|
|
|
17
17
|
|
|
18
18
|
## Usage
|
|
19
19
|
|
|
20
|
-
Please see the [project documentation](
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Firstly, create your project by running:
|
|
25
|
-
|
|
26
|
-
$ teapot create "My Project" https://github.com/kurocha generate-project
|
|
27
|
-
$ cd my-project
|
|
28
|
-
|
|
29
|
-
You will be asked to merge the project file. At present, merge tools are not very good and thus you may need to take a moment to review the changes. You want to keep most of the original file, but you would like to add the `define_target` blocks which are being added.
|
|
30
|
-
|
|
31
|
-
In the resulting project directory that has been created, you can see the list of dependencies:
|
|
32
|
-
|
|
33
|
-
$ teapot list
|
|
34
|
-
... lots of output ...
|
|
35
|
-
|
|
36
|
-
To only see things exported by your current project, you can run:
|
|
37
|
-
|
|
38
|
-
$ teapot list root
|
|
39
|
-
Package root (from /private/tmp/my-project):
|
|
40
|
-
#<Teapot::Project "my-project">
|
|
41
|
-
My Project description.
|
|
42
|
-
- Summary: A brief one line summary of the project.
|
|
43
|
-
- License: MIT License
|
|
44
|
-
- Version: 0.1.0
|
|
45
|
-
- Author: Samuel Williams <samuel.williams@oriontransfer.co.nz>
|
|
46
|
-
#<Teapot::Target "my-project-library">
|
|
47
|
-
- depends on "Build/Files"
|
|
48
|
-
- depends on "Build/Clang"
|
|
49
|
-
- depends on :platform
|
|
50
|
-
- depends on "Language/C++14" {:private=>true}
|
|
51
|
-
- provides "Library/MyProject"
|
|
52
|
-
#<Teapot::Target "my-project-test">
|
|
53
|
-
- depends on "Library/UnitTest"
|
|
54
|
-
- depends on "Library/MyProject"
|
|
55
|
-
- provides "Test/MyProject"
|
|
56
|
-
#<Teapot::Target "my-project-executable">
|
|
57
|
-
- depends on "Build/Files"
|
|
58
|
-
- depends on "Build/Clang"
|
|
59
|
-
- depends on :platform
|
|
60
|
-
- depends on "Language/C++14" {:private=>true}
|
|
61
|
-
- depends on "Library/MyProject"
|
|
62
|
-
- provides "Executable/MyProject"
|
|
63
|
-
#<Teapot::Target "my-project-run">
|
|
64
|
-
- depends on "Executable/MyProject"
|
|
65
|
-
- provides "Run/MyProject"
|
|
66
|
-
#<Teapot::Configuration "development" visibility=private>
|
|
67
|
-
- references root from /private/tmp/my-project
|
|
68
|
-
- clones platforms from https://github.com/kurocha/platforms
|
|
69
|
-
- clones unit-test from https://github.com/kurocha/unit-test
|
|
70
|
-
- clones generate-cpp-class from https://github.com/kurocha/generate-cpp-class
|
|
71
|
-
- clones generate-project from https://github.com/kurocha/generate-project
|
|
72
|
-
- clones variants from https://github.com/kurocha/variants
|
|
73
|
-
- clones platform-darwin-osx from https://github.com/kurocha/platform-darwin-osx
|
|
74
|
-
- clones platform-darwin-ios from https://github.com/kurocha/platform-darwin-ios
|
|
75
|
-
- clones build-clang from https://github.com/kurocha/build-clang
|
|
76
|
-
- clones build-darwin from https://github.com/kurocha/build-darwin
|
|
77
|
-
- clones build-files from https://github.com/kurocha/build-files
|
|
78
|
-
- clones streams from https://github.com/kurocha/streams
|
|
79
|
-
- clones generate-template from https://github.com/kurocha/generate-template
|
|
80
|
-
#<Teapot::Configuration "my-project" visibility=public>
|
|
81
|
-
- references root from /private/tmp/my-project
|
|
82
|
-
|
|
83
|
-
### Run Tests
|
|
84
|
-
|
|
85
|
-
Testing is a good idea, and teapot supports test driven development.
|
|
86
|
-
|
|
87
|
-
$ teapot Test/MyProject
|
|
88
|
-
|
|
89
|
-
#### Wildcard Targets
|
|
90
|
-
|
|
91
|
-
To run all tests:
|
|
92
|
-
|
|
93
|
-
$ teapot "Test/*"
|
|
94
|
-
|
|
95
|
-
Provided you are using an environment that supports sanitizers, you can test more thoroughly using:
|
|
96
|
-
|
|
97
|
-
$ teapot "Test/*" variant-sanitize
|
|
98
|
-
|
|
99
|
-
### Run Project
|
|
100
|
-
|
|
101
|
-
We can now build and run the project executable:
|
|
102
|
-
|
|
103
|
-
$ teapot Run/MyProject
|
|
104
|
-
I'm a little teapot,
|
|
105
|
-
Short and stout,
|
|
106
|
-
Here is my handle (one hand on hip),
|
|
107
|
-
Here is my spout (other arm out with elbow and wrist bent).
|
|
108
|
-
When I get all steamed up,
|
|
109
|
-
Hear me shout,
|
|
110
|
-
Tip me over and pour me out! (lean over toward spout)
|
|
111
|
-
|
|
112
|
-
~
|
|
113
|
-
___^___ __
|
|
114
|
-
.- / \./ /
|
|
115
|
-
/ / _/
|
|
116
|
-
\__| |
|
|
117
|
-
\_______/
|
|
118
|
-
|
|
119
|
-
The resulting executables and libraries will be framework dependent, but are typically located in:
|
|
120
|
-
|
|
121
|
-
$ cd teapot/platforms/development/$PLATFORM-debug/bin
|
|
122
|
-
$ ./$PROJECT_NAME
|
|
123
|
-
|
|
124
|
-
### Cloning Project
|
|
125
|
-
|
|
126
|
-
You can clone another project which will fetch all dependencies:
|
|
127
|
-
|
|
128
|
-
$ teapot clone https://github.com/kurocha/tagged-format
|
|
129
|
-
$ cd tagged-format
|
|
130
|
-
$ teapot build Executable/TaggedFormat
|
|
131
|
-
|
|
132
|
-
## Open Issues
|
|
133
|
-
|
|
134
|
-
- 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`?
|
|
135
|
-
- Relative include paths might fail to work correctly if headers are not installed into same directory.
|
|
136
|
-
- 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?
|
|
20
|
+
Please see the [project documentation](https://ioquatix.github.io/teapot/) for more details.
|
|
21
|
+
|
|
22
|
+
- [Getting Started](https://ioquatix.github.io/teapot/guides/getting-started/index) - This guide explains how to use `teapot` to manage cross-platform project dependencies and build systems.
|
|
137
23
|
|
|
138
24
|
## Releases
|
|
139
25
|
|
|
140
|
-
Please see the [project releases](
|
|
26
|
+
Please see the [project releases](https://ioquatix.github.io/teapot/releases/index) for all releases.
|
|
27
|
+
|
|
28
|
+
### v3.7.0
|
|
29
|
+
|
|
30
|
+
- `teapot visualize` has two new sub-commands: `packages` and `targets`. The former visualizes the dependency graph of packages, while the latter visualizes the dependency graph of targets. Both sub-commands output Mermaid diagrams, which can be rendered using Mermaid Live Editor or other Mermaid-compatible tools.
|
|
141
31
|
|
|
142
32
|
### v3.6.0
|
|
143
33
|
|
data/releases.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Releases
|
|
2
2
|
|
|
3
|
+
## v3.7.0
|
|
4
|
+
|
|
5
|
+
- `teapot visualize` has two new sub-commands: `packages` and `targets`. The former visualizes the dependency graph of packages, while the latter visualizes the dependency graph of targets. Both sub-commands output Mermaid diagrams, which can be rendered using Mermaid Live Editor or other Mermaid-compatible tools.
|
|
6
|
+
|
|
3
7
|
## v3.6.0
|
|
4
8
|
|
|
5
9
|
- Update dependencies.
|
data.tar.gz.sig
CHANGED
|
Binary file
|