teapot 1.0.0.pre.rc10 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,101 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+ <svg
5
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
6
+ xmlns:cc="http://creativecommons.org/ns#"
7
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8
+ xmlns:svg="http://www.w3.org/2000/svg"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12
+ width="128pt"
13
+ height="128pt"
14
+ viewBox="0 0 160 160"
15
+ id="svg3403"
16
+ version="1.1"
17
+ inkscape:version="0.91 r13725"
18
+ sodipodi:docname="kurocha.svg">
19
+ <defs
20
+ id="defs3405" />
21
+ <sodipodi:namedview
22
+ id="base"
23
+ pagecolor="#ffffff"
24
+ bordercolor="#666666"
25
+ borderopacity="1.0"
26
+ inkscape:pageopacity="0.0"
27
+ inkscape:pageshadow="2"
28
+ inkscape:zoom="3.5"
29
+ inkscape:cx="104.53051"
30
+ inkscape:cy="99.464665"
31
+ inkscape:document-units="px"
32
+ inkscape:current-layer="g38"
33
+ showgrid="false"
34
+ units="pt"
35
+ inkscape:window-width="1920"
36
+ inkscape:window-height="1054"
37
+ inkscape:window-x="0"
38
+ inkscape:window-y="0"
39
+ inkscape:window-maximized="1" />
40
+ <metadata
41
+ id="metadata3408">
42
+ <rdf:RDF>
43
+ <cc:Work
44
+ rdf:about="">
45
+ <dc:format>image/svg+xml</dc:format>
46
+ <dc:type
47
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
48
+ <dc:title></dc:title>
49
+ </cc:Work>
50
+ </rdf:RDF>
51
+ </metadata>
52
+ <g
53
+ inkscape:label="Layer 1"
54
+ inkscape:groupmode="layer"
55
+ id="layer1"
56
+ transform="translate(0,-892.36223)">
57
+ <g
58
+ id="g36"
59
+ transform="matrix(0.7036536,0,0,0.7036536,-255.86452,913.02177)">
60
+ <g
61
+ id="g38">
62
+ <ellipse
63
+ cx="473.57303"
64
+ cy="186.68559"
65
+ rx="48.167"
66
+ ry="5.8959999"
67
+ id="ellipse40"
68
+ style="fill:#290f01" />
69
+ <g
70
+ id="g42"
71
+ transform="translate(0.40604395,23.956593)">
72
+ <path
73
+ d="m 514.888,59.404 c 5.632,-14.131 -1.051,-20.75 -0.548,-22.182 0.507,-1.437 4.245,-7.809 11.094,-13.888 -2.651,-0.44 -16.256,1.168 -16.256,1.168 l -69.283,19.57 c -1.879,0.688 -8.808,8.596 -10.686,11.355 6.521,-0.771 10.692,0.19 10.692,0.19 0,0 -0.058,1.729 0.362,4.255 0.293,0.809 37.997,0.749 37.997,0.749 l 36.628,-1.217 z"
74
+ id="path44"
75
+ inkscape:connector-curvature="0"
76
+ style="fill:#290f01" />
77
+ <path
78
+ d="m 500.681,42.508 c 0,1.934 -1.563,3.499 -3.5,3.499 -1.935,0 -3.5,-1.565 -3.5,-3.499 0,-1.932 1.565,-3.495 3.5,-3.495 1.936,0 3.5,1.563 3.5,3.495 z"
79
+ id="path46"
80
+ inkscape:connector-curvature="0"
81
+ style="fill:#ffffff" />
82
+ <path
83
+ d="m 466.14,48.982 c 0,1.932 -1.563,3.497 -3.501,3.497 -1.936,0 -3.494,-1.565 -3.494,-3.497 0,-1.933 1.559,-3.5 3.494,-3.5 1.937,0 3.501,1.568 3.501,3.5 z"
84
+ id="path48"
85
+ inkscape:connector-curvature="0"
86
+ style="fill:#ffffff" />
87
+ </g>
88
+ <path
89
+ d="m 578.24004,92.123593 c -2.75,-0.667 -11.296,3.683 -16.417,11.499997 -5.121,7.817 -8.661,13.378 -12.267,14.727 -3.607,1.352 -7.877,-1.169 -9.396,-1.414 -2.16,-9.058 -10.217,-19.941997 -17.749,-24.188997 -0.292,-8.569 -2.104,-10.259 -2.104,-10.259 l -42.226,1.968 -43.854,-1.969 c 0,0 -1.52,4.405 -1.449,8.819 -5.713,5.694 -8.769,7.372 -12.971,13.953997 -1.321,2.072 -2.312,4.176 -3.053,6.702 -2.446,-0.162 -4.192,-1.261 -4.192,-1.261 0,0 -6.231,-17.814997 -10.798,-20.278997 -4.564,-2.463 -12.027,-4.021 -18.404,-1.194 -6.377,2.827 -11.811,10.999997 -13.913,17.809997 -2.101,6.813 -3.115,18.546 2.9,29.627 6.015,11.091 13.623,21.656 29.562,25.572 15.941,3.914 25.125,4.857 25.125,4.857 0.899,1.225 1.832,2.417 2.814,3.571 4.09,3.393 7.664,3.42 10.392,5.708 0,0 -0.143,5.792 1.595,6.227 1.737,0.436 13.365,4.2 36.246,3.623 22.883,-0.583 35.345,-2.32 36.355,-4.2 1.018,-1.888 1.378,-5.438 1.378,-5.438 3.465,-2.889 8.76,-5.181 12.216,-8.028 1.313,-1.683 2.529,-3.439 3.671,-5.252 0,0 13.821,-3.313 18.965,-6.938 5.146,-3.623 9.493,-10.982 11.016,-13.913 1.522,-2.924 6.004,-19.09 9.142,-25.997 3.138,-6.907 6.533,-11.376 9.146,-12.438 2.607,-1.064 7.983,-1.758 7.646,-3.208 -5.335,-2.916997 -6.626,-8.021997 -9.376,-8.687997 z m -194.591,49.176997 c -5.287,-6.236 -10.795,-24.783 -7.099,-34.927 3.695,-10.146997 9.709,-12.752997 18.041,-11.015997 8.333,1.741 10.146,17.316997 11.304,24.707997 1.16,7.393 8.262,7.537 8.262,7.537 0,0 -3.335,5.938 3.258,26.81 -18.585,3.521 -28.475,-6.882 -33.766,-13.112 z"
90
+ id="path50"
91
+ inkscape:connector-curvature="0"
92
+ style="fill:#26992e" />
93
+ <path
94
+ d="m 440.63104,69.034593 c 0,0 -0.704,-2.043 -0.628,-2.232 0.076,-0.189 1.401,-0.243 1.97,-2.51 0.569,-2.267 4.057,-11.223 6.699,-13.617 2.642,-2.396 10.513,-7.014 10.686,-8.566 0.163,-1.551 2.747,-1.975 2.747,-1.975 0,0 0.828,-1.886 0.175,-2.607 -0.657,-0.717 -3.938,-1.681 -4.62,-4.648 -0.683,-2.972 2.656,-6.689 7.91,-8.163 5.245,-1.473 9.899,0.01 10.855,2.9 0.964,2.891 -1.351,5.384 -1.532,6.337 -0.184,0.957 1.506,2.156 1.506,2.156 0,0 2.439,-0.975 3.385,0.265 0.951,1.239 10.088,1.088 13.593,1.763 3.499,0.674 11.155,6.507 12.815,8.147 1.668,1.64 2.818,1.02 3.024,1.112 0.206,0.092 0.625,2.232 0.625,2.232 l -69.21,19.406 z"
95
+ id="path52"
96
+ inkscape:connector-curvature="0"
97
+ style="fill:#26992e" />
98
+ </g>
99
+ </g>
100
+ </g>
101
+ </svg>
Binary file
@@ -0,0 +1,82 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg version="1.1" id="TeapotLogo" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ width="596.08px" height="197.684px" viewBox="0 0 596.08 197.684" enable-background="new 0 0 596.08 197.684"
5
+ xml:space="preserve">
6
+ <g>
7
+ <path fill="#26992E" d="M44.586,59.396c3.081,0,5.729,1.074,7.939,3.216c2.211,2.145,3.316,4.724,3.316,7.739
8
+ s-1.105,5.628-3.316,7.839s-4.858,3.316-7.939,3.316h-5.025v56.079c3.081,0,5.694,1.105,7.839,3.316
9
+ c2.142,2.211,3.216,4.859,3.216,7.939c0,3.085-1.074,5.697-3.216,7.84c-2.145,2.145-4.758,3.216-7.839,3.216
10
+ c-6.165,0-11.426-2.177-15.779-6.532c-4.356-4.354-6.532-9.613-6.532-15.779V81.505h-5.829c-3.084,0-5.697-1.071-7.839-3.216
11
+ c-2.145-2.142-3.216-4.755-3.216-7.839c0-3.081,1.071-5.694,3.216-7.839c2.142-2.142,4.755-3.216,7.839-3.216h5.829V30.25
12
+ c0-3.081,1.105-5.694,3.316-7.839c2.211-2.142,4.855-3.216,7.939-3.216c3.081,0,5.694,1.074,7.839,3.216
13
+ c2.142,2.145,3.216,4.758,3.216,7.839v29.145H44.586z"/>
14
+ <path fill="#26992E" d="M169.965,107.033c0,2.948-0.974,5.326-2.915,7.135c-1.944,1.809-4.522,2.713-7.738,2.713H95.394
15
+ c1.206,5.764,3.483,10.186,6.834,13.267c4.287,4.959,10.553,7.939,18.794,8.944c8.241,1.006,15.376-0.635,21.406-4.924
16
+ c2.01-2.143,4.689-3.217,8.04-3.217c3.348,0,5.694,0.873,7.035,2.613c3.75,4.155,3.75,8.512,0,13.064
17
+ c-9.648,8.845-21.476,13.235-35.477,13.166c-14.004-0.066-25.728-4.99-35.175-14.773c-9.447-9.779-14.239-21.572-14.371-35.376
18
+ c0.132-13.8,4.924-25.627,14.371-35.477c9.447-9.849,20.87-14.773,34.271-14.773c13.398,0,24.688,4.391,33.869,13.166
19
+ c9.177,8.778,14.17,19.934,14.975,33.466V107.033z M121.524,78.491c-7.773,0.402-14.004,2.814-18.693,7.236
20
+ c-4.692,4.422-7.506,9.114-8.442,14.07h56.883c-1.206-4.689-4.457-9.247-9.749-13.668
21
+ C136.229,81.707,129.564,79.163,121.524,78.491z"/>
22
+ <path fill="#26992E" d="M198.205,145.223c-9.18-9.78-13.769-21.607-13.769-35.477s4.588-25.728,13.769-35.577
23
+ c9.177-9.849,20.533-14.773,34.069-14.773c9.513,0,18.423,2.949,26.733,8.844c0.669-2.544,1.941-4.655,3.819-6.332
24
+ c1.875-1.674,4.187-2.513,6.935-2.513c2.745,0,5.157,1.074,7.236,3.216c2.076,2.145,3.115,4.692,3.115,7.638v78.993
25
+ c0,2.949-1.04,5.462-3.115,7.537c-2.079,2.08-4.491,3.116-7.236,3.116c-2.748,0-5.06-0.804-6.935-2.412
26
+ c-1.878-1.608-3.15-3.685-3.819-6.231c-8.175,5.764-17.085,8.644-26.733,8.644C218.738,159.896,207.381,155.006,198.205,145.223z
27
+ M205.943,109.746c0,8.109,2.443,14.908,7.336,20.401c4.89,5.496,11.187,8.241,18.894,8.241c7.704,0,14.07-2.745,19.095-8.241
28
+ c5.025-5.493,7.538-12.261,7.538-20.301s-2.547-14.874-7.638-20.502c-5.094-5.628-11.426-8.442-18.995-8.442
29
+ c-7.572,0-13.837,2.783-18.793,8.342C208.421,94.806,205.943,101.641,205.943,109.746z"/>
30
+ <path fill="#562F04" d="M322.798,194.367c-2.211,2.211-4.824,3.316-7.839,3.316s-5.597-1.105-7.738-3.316
31
+ c-2.145-2.211-3.216-4.724-3.216-7.537V70.048c0-2.946,1.037-5.458,3.116-7.537c2.076-2.076,4.554-3.116,7.437-3.116
32
+ c2.88,0,5.358,0.804,7.437,2.412c2.076,1.608,3.316,3.552,3.718,5.829c8.442-5.493,17.553-8.241,27.336-8.241
33
+ c13.398,0,24.855,4.959,34.371,14.874c9.513,9.918,14.271,21.777,14.271,35.577c0,13.803-4.758,25.562-14.271,35.275
34
+ c-9.516,9.717-20.973,14.572-34.371,14.572c-10.32,0-19.296-2.745-26.934-8.241v35.377
35
+ C326.115,189.644,325.009,192.156,322.798,194.367z M371.943,89.545c-5.226-5.493-11.592-8.241-19.095-8.241
36
+ c-7.506,0-13.838,2.782-18.995,8.341c-5.16,5.562-7.738,12.497-7.738,20.803c0,8.311,2.613,14.809,7.839,19.497
37
+ c5.091,5.628,11.356,8.442,18.793,8.442s13.8-2.814,19.095-8.442c5.292-5.628,7.94-12.292,7.94-19.999
38
+ C379.782,102.243,377.169,95.444,371.943,89.545z"/>
39
+ </g>
40
+ <g>
41
+ <path fill="#562F04" d="M584.824,59.396c3.081,0,5.729,1.074,7.939,3.216c2.211,2.145,3.316,4.724,3.316,7.739
42
+ s-1.105,5.628-3.316,7.839s-4.858,3.316-7.939,3.316h-5.025v56.079c3.081,0,5.694,1.105,7.84,3.316
43
+ c2.141,2.211,3.215,4.859,3.215,7.939c0,3.085-1.074,5.697-3.215,7.84c-2.146,2.145-4.759,3.216-7.84,3.216
44
+ c-6.164,0-11.426-2.177-15.778-6.532c-4.356-4.354-6.532-9.613-6.532-15.779V81.505h-5.829c-3.084,0-5.697-1.071-7.839-3.216
45
+ c-2.145-2.142-3.217-4.755-3.217-7.839c0-3.081,1.072-5.694,3.217-7.839c2.142-2.142,4.755-3.216,7.839-3.216h5.829V30.25
46
+ c0-3.081,1.105-5.694,3.316-7.839c2.211-2.142,4.855-3.216,7.939-3.216c3.081,0,5.693,1.074,7.839,3.216
47
+ c2.142,2.145,3.216,4.758,3.216,7.839v29.145H584.824z"/>
48
+ </g>
49
+ <g>
50
+ <g>
51
+ <ellipse fill="#290F01" cx="473.167" cy="162.729" rx="48.167" ry="5.896"/>
52
+ <g>
53
+ <path fill="#290F01" d="M514.888,59.404c5.632-14.131-1.051-20.75-0.548-22.182c0.507-1.437,4.245-7.809,11.094-13.888
54
+ c-2.651-0.44-16.256,1.168-16.256,1.168l-69.283,19.57c-1.879,0.688-8.808,8.596-10.686,11.355
55
+ c6.521-0.771,10.692,0.19,10.692,0.19s-0.058,1.729,0.362,4.255c0.293,0.809,37.997,0.749,37.997,0.749L514.888,59.404z"/>
56
+ <path fill="#FFFFFF" d="M500.681,42.508c0,1.934-1.563,3.499-3.5,3.499c-1.935,0-3.5-1.565-3.5-3.499
57
+ c0-1.932,1.565-3.495,3.5-3.495C499.117,39.013,500.681,40.576,500.681,42.508z"/>
58
+ <path fill="#FFFFFF" d="M466.14,48.982c0,1.932-1.563,3.497-3.501,3.497c-1.936,0-3.494-1.565-3.494-3.497
59
+ c0-1.933,1.559-3.5,3.494-3.5C464.576,45.482,466.14,47.05,466.14,48.982z"/>
60
+ </g>
61
+ <path fill="#26992E" d="M577.834,68.167c-2.75-0.667-11.296,3.683-16.417,11.5s-8.661,13.378-12.267,14.727
62
+ c-3.607,1.352-7.877-1.169-9.396-1.414c-2.16-9.058-10.217-19.942-17.749-24.189c-0.292-8.569-2.104-10.259-2.104-10.259
63
+ L477.675,60.5l-43.854-1.969c0,0-1.52,4.405-1.449,8.819c-5.713,5.694-8.769,7.372-12.971,13.954
64
+ c-1.321,2.072-2.312,4.176-3.053,6.702c-2.446-0.162-4.192-1.261-4.192-1.261s-6.231-17.815-10.798-20.279
65
+ c-4.564-2.463-12.027-4.021-18.404-1.194s-11.811,11-13.913,17.81c-2.101,6.813-3.115,18.546,2.9,29.627
66
+ c6.015,11.091,13.623,21.656,29.562,25.572c15.941,3.914,25.125,4.857,25.125,4.857c0.899,1.225,1.832,2.417,2.814,3.571
67
+ c4.09,3.393,7.664,3.42,10.392,5.708c0,0-0.143,5.792,1.595,6.227c1.737,0.436,13.365,4.2,36.246,3.623
68
+ c22.883-0.583,35.345-2.32,36.355-4.2c1.018-1.888,1.378-5.438,1.378-5.438c3.465-2.889,8.76-5.181,12.216-8.028
69
+ c1.313-1.683,2.529-3.439,3.671-5.252c0,0,13.821-3.313,18.965-6.938c5.146-3.623,9.493-10.982,11.016-13.913
70
+ c1.522-2.924,6.004-19.09,9.142-25.997s6.533-11.376,9.146-12.438c2.607-1.064,7.983-1.758,7.646-3.208
71
+ C581.875,73.938,580.584,68.833,577.834,68.167z M383.243,117.344c-5.287-6.236-10.795-24.783-7.099-34.927
72
+ c3.695-10.147,9.709-12.753,18.041-11.016c8.333,1.741,10.146,17.317,11.304,24.708c1.16,7.393,8.262,7.537,8.262,7.537
73
+ s-3.335,5.938,3.258,26.81C398.424,133.977,388.534,123.574,383.243,117.344z"/>
74
+ <path fill="#26992E" d="M440.225,45.078c0,0-0.704-2.043-0.628-2.232s1.401-0.243,1.97-2.51s4.057-11.223,6.699-13.617
75
+ c2.642-2.396,10.513-7.014,10.686-8.566c0.163-1.551,2.747-1.975,2.747-1.975s0.828-1.886,0.175-2.607
76
+ c-0.657-0.717-3.938-1.681-4.62-4.648c-0.683-2.972,2.656-6.689,7.91-8.163c5.245-1.473,9.899,0.01,10.855,2.9
77
+ c0.964,2.891-1.351,5.384-1.532,6.337c-0.184,0.957,1.506,2.156,1.506,2.156s2.439-0.975,3.385,0.265
78
+ c0.951,1.239,10.088,1.088,13.593,1.763c3.499,0.674,11.155,6.507,12.815,8.147c1.668,1.64,2.818,1.02,3.024,1.112
79
+ s0.625,2.232,0.625,2.232L440.225,45.078z"/>
80
+ </g>
81
+ </g>
82
+ </svg>
@@ -8,7 +8,7 @@ teapot_version "1.0.0"
8
8
  define_configuration 'test' do |configuration|
9
9
  configuration.public!
10
10
 
11
- configuration[:source] = "../dream-framework"
11
+ configuration[:source] = "../kurocha"
12
12
 
13
13
  configuration.require "variants"
14
14
 
@@ -31,3 +31,6 @@ define_configuration 'test' do |configuration|
31
31
 
32
32
  configuration.require "opencv"
33
33
  end
34
+
35
+ define_target "context_spec" do |target|
36
+ end
@@ -21,7 +21,7 @@
21
21
  require 'teapot/context'
22
22
 
23
23
  module Teapot::ContextSpec
24
- ROOT = Build::Files::Path.new(__dir__)
24
+ ROOT = Build::Files::Path.new(__dir__) + "context_spec"
25
25
 
26
26
  describe Teapot::Context do
27
27
  it "should load teapot.rb file" do
@@ -30,8 +30,7 @@ module Teapot::ContextSpec
30
30
  # There is one configuration:
31
31
  expect(context.configurations.count).to be == 1
32
32
 
33
- # No targets were defined:
34
- expect(context.targets.count).to be == 0
33
+ expect(context.targets.count).to be == 1
35
34
 
36
35
  default_configuration = context.configuration
37
36
 
@@ -111,7 +111,10 @@ module Teapot::DependencySpec
111
111
  chain = Teapot::Dependency::chain(['apple'], ['salad'], [apple, bananna, salad])
112
112
  expect(chain.unresolved).to be == []
113
113
  expect(chain.conflicts).to be == {}
114
- expect(chain.ordered).to be == [[apple, "apple"], [salad, "salad"]]
114
+
115
+ expect(chain.ordered.size).to be == 2
116
+ expect(chain.ordered[0]).to be == Teapot::Dependency::Resolution.new(apple, "apple")
117
+ expect(chain.ordered[1]).to be == Teapot::Dependency::Resolution.new(salad, "salad")
115
118
  end
116
119
 
117
120
  it "should select dependencies with high priority" do
@@ -129,7 +132,7 @@ module Teapot::DependencySpec
129
132
  expect(chain.conflicts).to be == {}
130
133
 
131
134
  # Should select higher priority package by default:
132
- expect(chain.ordered).to be == [[good_apple, 'apple']]
135
+ expect(chain.ordered).to be == [Teapot::Dependency::Resolution.new(good_apple, 'apple')]
133
136
  end
134
137
 
135
138
  it "should expose direct dependencies" do
@@ -154,9 +157,9 @@ module Teapot::DependencySpec
154
157
  expect(chain.unresolved).to be == []
155
158
  expect(chain.conflicts).to be == {}
156
159
  expect(chain.ordered).to be == [
157
- [system, 'clang'],
158
- [library, 'library'],
159
- [application, 'application']
160
+ Teapot::Dependency::Resolution.new(system, 'clang'),
161
+ Teapot::Dependency::Resolution.new(library, 'library'),
162
+ Teapot::Dependency::Resolution.new(application, 'application'),
160
163
  ]
161
164
  end
162
165
  end
@@ -0,0 +1,54 @@
1
+
2
+ #
3
+ # This file is part of the "Teapot" project, and is released under the MIT license.
4
+ #
5
+
6
+ teapot_version "1.0.0"
7
+
8
+ define_configuration 'test' do |configuration|
9
+ configuration.public!
10
+
11
+ configuration[:source] = "../kurocha"
12
+
13
+ configuration.require "variants"
14
+
15
+ configuration.require "platform-darwin-osx"
16
+ configuration.require "platform-darwin-ios"
17
+
18
+ configuration.require "unit-test"
19
+ configuration.require "euclid"
20
+
21
+ configuration.require "ogg"
22
+ configuration.require "vorbis"
23
+
24
+ configuration.require "jpeg"
25
+ configuration.require "png"
26
+
27
+ configuration.require "freetype"
28
+
29
+ configuration.require "dream"
30
+ configuration.require "tagged-format"
31
+
32
+ configuration.require "opencv"
33
+ end
34
+
35
+ define_generator "generator_spec" do |generator|
36
+ generator.generate do
37
+ directory = context.root + 'tmp'
38
+
39
+ directory.mkpath
40
+
41
+ substitutions = Substitutions.new
42
+
43
+ substitutions['NAME'] = 'Alice'
44
+ substitutions['VARIABLE'] = '42'
45
+
46
+ generator.copy('template', directory, substitutions)
47
+ end
48
+ end
49
+
50
+ define_target "target_spec" do |target|
51
+ target.provides "Test/TargetSpec" do
52
+ append targets 'target_spec'
53
+ end
54
+ end
@@ -0,0 +1 @@
1
+ This $VARIABLE will be substituted.
@@ -0,0 +1,46 @@
1
+ # Copyright, 2015, by Samuel G. D. Williams. <http://www.codeotaku.com>
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.
20
+
21
+ require 'teapot/context'
22
+ require 'build/files/system'
23
+
24
+ module Teapot::GeneratorSpec
25
+ ROOT = Build::Files::Path.new(__dir__) + "generator_spec"
26
+ TMP_PATH = ROOT + 'tmp'
27
+ ALICE_PATH = TMP_PATH + 'Alice.txt'
28
+
29
+ describe Teapot::Generator do
30
+ after do
31
+ TMP_PATH.delete
32
+ end
33
+
34
+ it "should rename files and expand variables" do
35
+ context = Teapot::Context.new(ROOT)
36
+
37
+ generator = context.generators["generator_spec"]
38
+
39
+ generator.generate!
40
+
41
+ expect(TMP_PATH).to be_exist
42
+ expect(ALICE_PATH).to be_exist
43
+ expect(ALICE_PATH.read).to be =~ /42/
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,94 @@
1
+ # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
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.
20
+
21
+ require 'teapot/identity_set'
22
+
23
+ module Teapot::IdentitySetSpec
24
+ describe Teapot::IdentitySet do
25
+ NamedObject = Struct.new(:name, :age)
26
+
27
+ let(:bob) {NamedObject.new('Bob', 10)}
28
+ let(:empty_identity_set) {Teapot::IdentitySet.new}
29
+ let(:bob_identity_set) {Teapot::IdentitySet.new([bob])}
30
+
31
+ it "should contain named objects" do
32
+ expect(bob_identity_set).to be_include bob
33
+ end
34
+
35
+ it "can enumerate all contained objects" do
36
+ expect(bob_identity_set.each.to_a).to be == [bob]
37
+ end
38
+
39
+ it "could contain items" do
40
+ expect(bob_identity_set).to_not be_empty
41
+ expect(bob_identity_set.size).to be == 1
42
+ end
43
+
44
+ it "could be empty" do
45
+ expect(empty_identity_set).to be_empty
46
+ end
47
+
48
+ it "could contain many items" do
49
+ identity_set = empty_identity_set
50
+
51
+ names = ["Apple", "Orange", "Banana", "Kiwifruit"]
52
+
53
+ names.each_with_index do |name, index|
54
+ identity_set << NamedObject.new(name, index)
55
+ end
56
+
57
+ expect(identity_set.size).to be == names.size
58
+ end
59
+
60
+ it "can be cleared" do
61
+ identity_set = bob_identity_set.dup
62
+
63
+ expect(identity_set).to_not be_empty
64
+
65
+ identity_set.clear
66
+
67
+ expect(identity_set).to be_empty
68
+ end
69
+
70
+ it "can delete items" do
71
+ identity_set = bob_identity_set.dup
72
+
73
+ expect(identity_set).to_not be_empty
74
+
75
+ identity_set.delete(bob)
76
+
77
+ expect(identity_set).to be_empty
78
+ end
79
+
80
+ it "can be frozen" do
81
+ empty_identity_set.freeze
82
+
83
+ expect(empty_identity_set).to be_frozen
84
+ end
85
+
86
+ it "can look up named items" do
87
+ expect(bob_identity_set[bob.name]).to be == bob
88
+ end
89
+
90
+ it "should have string representation" do
91
+ expect(bob_identity_set.to_s).to be =~ /Bob/
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,50 @@
1
+ # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
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.
20
+
21
+ require 'teapot/merge'
22
+
23
+ module Teapot::MergeSpec
24
+ describe Teapot::Merge do
25
+ TARGET_FILE = <<-EOF
26
+ class Bob {
27
+ int alice();
28
+ }
29
+ EOF
30
+
31
+ TEMPLATE = <<-EOF
32
+ class Bob {
33
+ int bob();
34
+ }
35
+ EOF
36
+
37
+ MERGED = <<-EOF
38
+ class Bob {
39
+ int alice();
40
+ int bob();
41
+ }
42
+ EOF
43
+
44
+ it "can merge two files" do
45
+ merged = Teapot::Merge.combine(TARGET_FILE.lines, TEMPLATE.lines)
46
+
47
+ expect(merged).to be == MERGED.lines
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,52 @@
1
+
2
+ teapot_version "1.0"
3
+
4
+ # Variants
5
+ define_target "variant-debug" do |target|
6
+ target.priority = 20
7
+
8
+ target.provides "Variant/debug" do
9
+ default variant "debug"
10
+
11
+ append buildflags %W{-O0 -g -Wall -Wmissing-prototypes}
12
+ append linkflags %W{-g}
13
+ end
14
+
15
+ target.provides :variant => "Variant/debug"
16
+ end
17
+
18
+ define_target "variant-release" do |target|
19
+ target.provides "Variant/release" do
20
+ default variant "release"
21
+
22
+ append buildflags %W{-O3 -DNDEBUG}
23
+ end
24
+
25
+ target.provides :variant => "Variant/release"
26
+ end
27
+
28
+ # Platforms
29
+ define_target "platform-generic" do |target|
30
+ target.provides "Platform/generic" do
31
+ default platform_name "generic"
32
+
33
+ default build_prefix {platforms_path + "cache/#{platform_name}-#{variant}"}
34
+ default install_prefix {platforms_path + "#{platform_name}-#{variant}"}
35
+ end
36
+
37
+ target.provides :platform => "Platform/generic"
38
+ end
39
+
40
+ # Test Targets
41
+ define_target "target_spec" do |target|
42
+ target.provides "Test/TargetSpec" do
43
+ append targets 'target_spec'
44
+ flags ['foo']
45
+ end
46
+
47
+ target.depends :variant
48
+ target.depends :platform
49
+ end
50
+
51
+ define_configuration "target_spec" do |configuration|
52
+ end
@@ -0,0 +1,54 @@
1
+ # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
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.
20
+
21
+ require 'teapot/context'
22
+ require 'pry'
23
+
24
+ module Teapot::TargetSpec
25
+ ROOT = Build::Files::Path.new(__dir__) + "target_spec"
26
+
27
+ describe Teapot::Target do
28
+ it "should generate environment for configuration" do
29
+ context = Teapot::Context.new(ROOT)
30
+
31
+ target = context.targets['target_spec']
32
+ expect(target).to_not be nil
33
+
34
+ chain = context.dependency_chain(["Test/TargetSpec"])
35
+ expect(chain.providers.size).to be == 4
36
+ expect(chain.providers).to include target
37
+
38
+ expect(chain.ordered.size).to be == 3
39
+ expect(chain.ordered[0].name).to be == 'Variant/debug'
40
+ expect(chain.ordered[1].name).to be == 'Platform/generic'
41
+ expect(chain.ordered[2].name).to be == 'Test/TargetSpec'
42
+ expect(chain.ordered[2].provider).to be == target
43
+
44
+ environment = target.environment(context.configuration)
45
+ # Environment#to_hash flattens the environment and evaluates all values:
46
+ hash = environment.to_hash
47
+
48
+ expect(hash[:variant]).to be == 'debug'
49
+ expect(hash[:platform_name]).to be == 'generic'
50
+
51
+ expect(hash).to include(:buildflags, :linkflags, :build_prefix, :install_prefix, :platforms_path)
52
+ end
53
+ end
54
+ end
data/teapot.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  development.
17
17
  EOF
18
18
  spec.summary = %q{Teapot is a tool for managing complex cross-platform builds.}
19
- spec.homepage = "http://www.kyusu.org"
19
+ spec.homepage = "http://www.teapot.nz"
20
20
  spec.license = "MIT"
21
21
 
22
22
  spec.files = `git ls-files`.split($/)
@@ -29,21 +29,18 @@ Gem::Specification.new do |spec|
29
29
  spec.required_ruby_version = '>= 2.0'
30
30
 
31
31
  spec.add_dependency "rainbow", "~> 2.0.0"
32
- spec.add_dependency "trollop", "~> 2.0"
32
+ spec.add_dependency "trollop", "~> 2.1"
33
33
 
34
34
  spec.add_dependency "system", "~> 0.1.3"
35
35
 
36
- spec.add_dependency "graphviz", "~> 0.1.0"
36
+ spec.add_dependency "graphviz", "~> 0.2.0"
37
37
 
38
- spec.add_dependency "build", "~> 1.0.0"
39
-
40
- spec.add_dependency "process-daemon", "~> 0.5.5"
41
- spec.add_dependency "process-group", "~> 0.2.1"
38
+ spec.add_dependency "build", "~> 1.0.4"
42
39
 
43
40
  # This could be a good option in the future for teapot fetch:
44
41
  #spec.add_dependency "rugged"
45
42
 
46
43
  spec.add_development_dependency "bundler", "~> 1.3"
47
- spec.add_development_dependency "rspec", "~> 3.0.0"
44
+ spec.add_development_dependency "rspec", "~> 3.4.0"
48
45
  spec.add_development_dependency "rake"
49
46
  end