teapot 1.0.0 → 1.0.1
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
- data/README.md +145 -20
- data/lib/teapot/controller/clean.rb +4 -2
- data/lib/teapot/controller/visualize.rb +9 -3
- data/lib/teapot/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ea31b9a04e7f8aa8b31fe1bb85aa765ae2c7087f
|
|
4
|
+
data.tar.gz: a800948d556c67c80f44c627fc02414b9abcddf6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: afc9d164e71e5a45f807e0ae63f318b083a728eeecc8976860f1e34d5638d9e0081031ec37fc4b70ca15bed49698ba60becf6f12d680683428dce2d7ee598290
|
|
7
|
+
data.tar.gz: f93f47ecd26ab2e4f8d8e78ea1260fe187e66358929c1cd23452fcbcd82216e93773ce48097b61147553958ac8126ab68d0802e284dcbf6e654bbac22eb95666
|
data/README.md
CHANGED
|
@@ -7,23 +7,23 @@ Teapot is a decentralised build tool for managing complex cross-platform project
|
|
|
7
7
|
- Generators can simplify the construction of new projects as well as assist with the development of existing ones.
|
|
8
8
|
- The build subsystem provides a simple set of canonical operations for building libraries and executables to minimise configuration overhead.
|
|
9
9
|
|
|
10
|
-
[](http://travis-ci.org/ioquatix/teapot)
|
|
11
|
+
[](https://codeclimate.com/github/ioquatix/teapot)
|
|
12
12
|
[](https://coveralls.io/r/ioquatix/teapot)
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
|
-
Ensure that you already have a working install of Ruby
|
|
16
|
+
Ensure that you already have a working install of Ruby 2.0.0+ and run the following to install `teapot`:
|
|
17
17
|
|
|
18
18
|
$ gem install teapot
|
|
19
19
|
|
|
20
20
|
## Usage
|
|
21
21
|
|
|
22
|
-
Teapot doesn't have a centralised package management system
|
|
22
|
+
Teapot doesn't have a default centralised package management system but there is a canonical one for developing cross-platform C++ applications. This example shows how to use this framework.
|
|
23
23
|
|
|
24
24
|
Firstly, create your project by running:
|
|
25
25
|
|
|
26
|
-
$ teapot create "My Project" https://github.com/kurocha
|
|
26
|
+
$ teapot create "My Project" https://github.com/kurocha platforms unit-test
|
|
27
27
|
$ cd my-project
|
|
28
28
|
|
|
29
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.
|
|
@@ -31,31 +31,156 @@ You will be asked to merge the project file. At present, merge tools are not ver
|
|
|
31
31
|
In the resulting project directory that has been created, you can see the list of dependencies:
|
|
32
32
|
|
|
33
33
|
$ teapot list
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
Package root (from ./my-project):
|
|
35
|
+
#<Teapot::Configuration "my-project" visibility=private>
|
|
36
|
+
- references root from ./my-project
|
|
37
|
+
- clones platforms from https://github.com/kurocha/platforms
|
|
38
|
+
- clones unit-test from https://github.com/kurocha/unit-test
|
|
39
|
+
- clones variants from https://github.com/kurocha/variants
|
|
40
|
+
- clones platform-darwin-osx from https://github.com/kurocha/platform-darwin-osx
|
|
41
|
+
- clones platform-darwin-ios from https://github.com/kurocha/platform-darwin-ios
|
|
42
|
+
- clones build-clang from https://github.com/kurocha/build-clang
|
|
43
|
+
- clones build-darwin from https://github.com/kurocha/build-darwin
|
|
44
|
+
Package platforms (from ./my-project/teapot/packages/my-project/platforms):
|
|
45
|
+
#<Teapot::Configuration "platforms" visibility=public>
|
|
46
|
+
- clones platforms from https://github.com/kurocha/platforms
|
|
47
|
+
- references variants from ./my-project/teapot/packages/platforms/variants
|
|
48
|
+
- references platform-darwin-osx from ./my-project/teapot/packages/platforms/platform-darwin-osx
|
|
49
|
+
- references platform-darwin-ios from ./my-project/teapot/packages/platforms/platform-darwin-ios
|
|
50
|
+
- references build-clang from ./my-project/teapot/packages/platforms/build-clang
|
|
51
|
+
- references build-darwin from ./my-project/teapot/packages/platforms/build-darwin
|
|
52
|
+
Package unit-test (from ./my-project/teapot/packages/my-project/unit-test):
|
|
53
|
+
#<Teapot::Project "Unit Test">
|
|
54
|
+
- License: MIT License
|
|
55
|
+
- Version: 0.1.0
|
|
56
|
+
- Author: Samuel Williams
|
|
57
|
+
#<Teapot::Target "unit-test">
|
|
58
|
+
- depends on "Build/Files"
|
|
59
|
+
- depends on "Build/Clang"
|
|
60
|
+
- depends on :platform
|
|
61
|
+
- depends on "Language/C++11"
|
|
62
|
+
- provides "Library/UnitTest"
|
|
63
|
+
#<Teapot::Target "unit-test-tests">
|
|
64
|
+
- depends on "Build/Clang"
|
|
65
|
+
- depends on :platform
|
|
66
|
+
- depends on "Language/C++11"
|
|
67
|
+
- depends on "Library/UnitTest"
|
|
68
|
+
- provides "Test/UnitTest"
|
|
69
|
+
#<Teapot::Generator "Unit/Test">
|
|
70
|
+
Generates a basic test file in the project.
|
|
71
|
+
|
|
72
|
+
usage: teapot generate Unit/Test Namespace::TestName
|
|
73
|
+
#<Teapot::Configuration "local" visibility=private>
|
|
74
|
+
- clones unit-test from https://github.com/kurocha/unit-test
|
|
75
|
+
- clones platforms from https://github.com/dream-framework/platforms
|
|
76
|
+
- clones build-files from https://github.com/dream-framework/build-files
|
|
77
|
+
- clones variants from https://github.com/dream-framework/variants
|
|
78
|
+
- clones platform-darwin-osx from https://github.com/dream-framework/platform-darwin-osx
|
|
79
|
+
- clones platform-darwin-ios from https://github.com/dream-framework/platform-darwin-ios
|
|
80
|
+
- clones build-clang from https://github.com/dream-framework/build-clang
|
|
81
|
+
- clones build-darwin from https://github.com/dream-framework/build-darwin
|
|
82
|
+
#<Teapot::Configuration "travis" visibility=private>
|
|
83
|
+
- clones unit-test from https://github.com/kurocha/unit-test
|
|
84
|
+
- clones platforms from https://github.com/dream-framework/platforms
|
|
85
|
+
- clones build-files from https://github.com/dream-framework/build-files
|
|
86
|
+
- clones variants from https://github.com/dream-framework/variants
|
|
87
|
+
- clones platform-darwin-osx from https://github.com/dream-framework/platform-darwin-osx
|
|
88
|
+
- clones platform-darwin-ios from https://github.com/dream-framework/platform-darwin-ios
|
|
89
|
+
- clones build-clang from https://github.com/dream-framework/build-clang
|
|
90
|
+
- clones build-darwin from https://github.com/dream-framework/build-darwin
|
|
91
|
+
Package variants (from ./my-project/teapot/packages/my-project/variants):
|
|
92
|
+
#<Teapot::Target "variant-generic">
|
|
93
|
+
- provides "Variant/generic"
|
|
94
|
+
#<Teapot::Target "variant-debug">
|
|
95
|
+
- depends on "Variant/generic"
|
|
96
|
+
- provides "Variant/debug"
|
|
97
|
+
- provides :variant => ["Variant/debug"]
|
|
98
|
+
#<Teapot::Target "variant-release">
|
|
99
|
+
- depends on "Variant/generic"
|
|
100
|
+
- provides "Variant/release"
|
|
101
|
+
- provides :variant => ["Variant/release"]
|
|
102
|
+
Package platform-darwin-osx (from ./my-project/teapot/packages/my-project/platform-darwin-osx):
|
|
103
|
+
#<Teapot::Target "platform-darwin-osx">
|
|
104
|
+
- depends on :variant
|
|
105
|
+
- provides "Platform/darwin-osx"
|
|
106
|
+
- provides :platform => ["Platform/darwin-osx"]
|
|
107
|
+
- provides "Language/C++11"
|
|
108
|
+
- provides "Library/OpenGL"
|
|
109
|
+
- provides "Library/OpenAL"
|
|
110
|
+
- provides "Library/z"
|
|
111
|
+
- provides "Library/bz2"
|
|
112
|
+
Package platform-darwin-ios (from ./my-project/teapot/packages/my-project/platform-darwin-ios):
|
|
113
|
+
#<Teapot::Target "platform-darwin-ios">
|
|
114
|
+
- depends on :variant
|
|
115
|
+
- provides "Platform/darwin-ios"
|
|
116
|
+
- provides :platform => ["Platform/darwin-ios"]
|
|
117
|
+
- provides "Language/C++11"
|
|
118
|
+
- provides "Library/OpenGLES"
|
|
119
|
+
- provides "Library/OpenGL" => ["Library/OpenGLES"]
|
|
120
|
+
- provides "Library/OpenAL"
|
|
121
|
+
- provides "Library/z"
|
|
122
|
+
- provides "Library/bz2"
|
|
123
|
+
- provides "Aggregate/Display"
|
|
124
|
+
#<Teapot::Target "platform-darwin-ios-simulator">
|
|
125
|
+
- depends on :variant
|
|
126
|
+
- provides "Platform/darwin-ios-simulator"
|
|
127
|
+
- provides :platform => ["Platform/darwin-ios-simulator"]
|
|
128
|
+
- provides "Language/C++11"
|
|
129
|
+
- provides "Library/OpenGLES"
|
|
130
|
+
- provides "Library/OpenGL" => ["Library/OpenGLES"]
|
|
131
|
+
- provides "Library/OpenAL"
|
|
132
|
+
- provides "Library/z"
|
|
133
|
+
- provides "Library/bz2"
|
|
134
|
+
- provides "Aggregate/Display"
|
|
135
|
+
Package build-clang (from ./my-project/teapot/packages/my-project/build-clang):
|
|
136
|
+
#<Teapot::Target "build-clang">
|
|
137
|
+
- depends on :linker
|
|
138
|
+
- provides "Build/Clang"
|
|
139
|
+
- provides "Language/C++11"
|
|
140
|
+
Package build-darwin (from ./my-project/teapot/packages/my-project/build-darwin):
|
|
141
|
+
#<Teapot::Target "build-darwin">
|
|
142
|
+
- provides :linker => ["Build/darwin"]
|
|
143
|
+
- provides "Build/darwin"
|
|
144
|
+
Elapsed Time: 0.007s
|
|
145
|
+
|
|
146
|
+
To only see things exported by your current project, you can run:
|
|
147
|
+
|
|
148
|
+
$ teapot list root
|
|
149
|
+
|
|
150
|
+
The new project doesn't define any targets so we can do that now. Add the following to `teapot.rb`:
|
|
151
|
+
|
|
152
|
+
# Build Targets
|
|
153
|
+
|
|
154
|
+
define_target "my-project-tests" do |target|
|
|
155
|
+
target.build do
|
|
156
|
+
run tests: 'UnitTest', source_files: target.package.path.glob("test/MyProject/**/*.cpp")
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
target.depends :platform
|
|
160
|
+
target.depends "Language/C++11"
|
|
161
|
+
target.depends "Library/UnitTest"
|
|
162
|
+
|
|
163
|
+
target.provides "Test/MyProject"
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
We can now build and run unit tests (althoght there aren't any yet):
|
|
167
|
+
|
|
168
|
+
$ teapot build Test/MyProject
|
|
169
|
+
... snip ...
|
|
170
|
+
[Summary] 0 passed out of 0 total
|
|
38
171
|
|
|
39
172
|
When you build, you need to specify dependencies. If you haven't specified all dependencies, they will be suggested to you.
|
|
40
173
|
|
|
41
|
-
The resulting libraries will be framework dependent, but are typically located in
|
|
174
|
+
The resulting executables and libraries will be framework dependent, but are typically located in:
|
|
42
175
|
|
|
43
176
|
$ cd teapot/$PROJECT_NAME/platforms/$PLATFORM_NAME/bin/
|
|
44
177
|
$ ./$PROJECT_NAME
|
|
45
178
|
|
|
46
179
|
### Example: Compiling TaggedFormat
|
|
47
180
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
$ teapot create "Local Tagged Format" https://github.com/kurocha platform-linux variants tagged-format
|
|
51
|
-
$ cd local-tagged-format
|
|
52
|
-
$ teapot build Library/TaggedFormat variant-debug
|
|
53
|
-
|
|
54
|
-
For Mac OS X (requires Xcode Command Line Tools):
|
|
55
|
-
|
|
56
|
-
$ teapot create "Local Tagged Format" https://github.com/kurocha platform-darwin-osx variants tagged-format
|
|
181
|
+
$ teapot create "Local Tagged Format" https://github.com/kurocha platforms tagged-format unit-test
|
|
57
182
|
$ cd local-tagged-format
|
|
58
|
-
$ teapot build
|
|
183
|
+
$ teapot build Test/TaggedFormat variant-debug
|
|
59
184
|
|
|
60
185
|
You need to make sure any basic tools, e.g. compilers, system libraries, are installed correctly before building. Consult the platform and library documentation for any dependencies.
|
|
61
186
|
|
|
@@ -23,11 +23,13 @@ require 'teapot/controller'
|
|
|
23
23
|
module Teapot
|
|
24
24
|
class Controller
|
|
25
25
|
def clean
|
|
26
|
+
configuration = context.configuration
|
|
27
|
+
|
|
26
28
|
log "Removing #{configuration.platforms_path}...".color(:cyan)
|
|
27
|
-
FileUtils.rm_rf
|
|
29
|
+
FileUtils.rm_rf configuration.platforms_path
|
|
28
30
|
|
|
29
31
|
log "Removing #{configuration.packages_path}...".color(:cyan)
|
|
30
|
-
FileUtils.rm_rf
|
|
32
|
+
FileUtils.rm_rf configuration.packages_path
|
|
31
33
|
end
|
|
32
34
|
end
|
|
33
35
|
end
|
|
@@ -44,7 +44,10 @@ module Teapot
|
|
|
44
44
|
:color => 'grey',
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
chain.ordered.each do |
|
|
47
|
+
chain.ordered.each do |resolution|
|
|
48
|
+
provider = resolution.provider
|
|
49
|
+
name = resolution.name
|
|
50
|
+
|
|
48
51
|
# Provider is the target that provides the dependency referred to by name.
|
|
49
52
|
node = g.add_node(name.to_s, base_attributes.dup)
|
|
50
53
|
|
|
@@ -80,7 +83,10 @@ module Teapot
|
|
|
80
83
|
|
|
81
84
|
# Put all dependencies at the same level so as to not make the graph too confusing.
|
|
82
85
|
done = Set.new
|
|
83
|
-
chain.ordered.each do |
|
|
86
|
+
chain.ordered.each do |resolution|
|
|
87
|
+
provider = resolution.provider
|
|
88
|
+
name = resolution.name
|
|
89
|
+
|
|
84
90
|
p = g.graphs[provider.name] || g.add_subgraph(provider.name, :rank => :same)
|
|
85
91
|
|
|
86
92
|
provider.dependencies.each do |dependency|
|
|
@@ -94,7 +100,7 @@ module Teapot
|
|
|
94
100
|
end
|
|
95
101
|
end
|
|
96
102
|
|
|
97
|
-
|
|
103
|
+
Graphviz::output(g, :path => "graph.pdf")
|
|
98
104
|
|
|
99
105
|
puts g.to_dot
|
|
100
106
|
end
|
data/lib/teapot/version.rb
CHANGED
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.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Williams
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-01-
|
|
11
|
+
date: 2016-01-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rainbow
|
|
@@ -220,4 +220,3 @@ test_files:
|
|
|
220
220
|
- spec/teapot/substitutions_spec.rb
|
|
221
221
|
- spec/teapot/target_spec.rb
|
|
222
222
|
- spec/teapot/target_spec/teapot.rb
|
|
223
|
-
has_rdoc: yard
|