ninja-gen 0.1.0 → 0.1.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/Rakefile +2 -0
- data/lib/ninja/file.rb +8 -4
- data/lib/ninja/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90aa98d1e0b536a791503112227ab3c670875780
|
4
|
+
data.tar.gz: 05098694246c85bbf066cb9c77633e8de82ca62d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc2d55c384c1449ceb34897997aee8977763ab6c6f06da9c6d768af142090be08d2ce11bc238bfe1fb597b85a26fdb59b6c229f8f37035b199dfb36805bbbb8f
|
7
|
+
data.tar.gz: d9112a125ac3355b482c0323817503a3b39f5b61e97660ec3220fcb0c99285e3fccf0bb7c28532ae7096e3051ba24fa79e5e5cfdf3f1c542c425863d003205b8
|
data/Rakefile
CHANGED
data/lib/ninja/file.rb
CHANGED
@@ -25,8 +25,9 @@ module Ninja
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
def
|
29
|
-
|
28
|
+
def defaults(outputs)
|
29
|
+
# TODO(mtwilliams): Accept variables (\$[\w]|\$\{[\w]\}).
|
30
|
+
# raise "Expected output(s) to be paths." unless [*outputs].all?{|output| /\A(?:[-\w\.]+\/?)+\z/.match(output)}
|
30
31
|
@defaults.push(*outputs)
|
31
32
|
end
|
32
33
|
|
@@ -43,6 +44,7 @@ module Ninja
|
|
43
44
|
# TODO(mtwilliams): Escape.
|
44
45
|
f.write "#{variable.name} = #{variable.value}\n"
|
45
46
|
end
|
47
|
+
f.write "\n" unless @variables.empty?
|
46
48
|
|
47
49
|
@rules.each do |rule|
|
48
50
|
f.write "rule #{rule.name}\n"
|
@@ -64,9 +66,11 @@ module Ninja
|
|
64
66
|
@builds.each do |build|
|
65
67
|
f.write "build #{build.output}: #{build.rule} #{build.inputs.join(' ')}\n"
|
66
68
|
end
|
67
|
-
f.write "\n" unless @builds.empty?
|
68
69
|
|
69
|
-
|
70
|
+
unless @defaults.empty?
|
71
|
+
f.write "\n" unless @builds.empty?
|
72
|
+
f.write "default #{@defaults.join(' ')}\n" unless @defaults.empty?
|
73
|
+
end
|
70
74
|
|
71
75
|
# TODO(mtwilliams): Aliases (via the 'phony' rule).
|
72
76
|
# TODO(mtwilliams): Execute other files (via 'subninja').
|
data/lib/ninja/version.rb
CHANGED