jitsu 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,5 +1,6 @@
1
1
  source "http://rubygems.org"
2
2
  gem "trollop", "~> 1.16.2"
3
+ gem "kwalify", "~> 0.7.2"
3
4
 
4
5
  group :development do
5
6
  gem "rspec", "~> 2.3.0"
data/Gemfile.lock CHANGED
@@ -17,6 +17,7 @@ GEM
17
17
  git (>= 1.2.5)
18
18
  rake
19
19
  json (1.4.6)
20
+ kwalify (0.7.2)
20
21
  rake (0.8.7)
21
22
  rcov (0.9.9)
22
23
  rspec (2.3.0)
@@ -38,6 +39,7 @@ DEPENDENCIES
38
39
  bundler (~> 1.0.0)
39
40
  cucumber
40
41
  jeweler (~> 1.5.2)
42
+ kwalify (~> 0.7.2)
41
43
  rcov
42
44
  rspec (~> 2.3.0)
43
45
  trollop (~> 1.16.2)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.4.0
data/bin/jitsu CHANGED
@@ -38,5 +38,9 @@ if not Jitsu.jitsufile
38
38
  exit 2
39
39
  end
40
40
 
41
- Jitsu.output(Jitsu.read(Jitsu.jitsufile))
42
-
41
+ begin
42
+ Jitsu.work
43
+ rescue Jitsu::JitsuError
44
+ warn $!
45
+ exit 3
46
+ end
@@ -18,7 +18,7 @@ Feature: Build C++ programs
18
18
  """
19
19
  ---
20
20
  targets:
21
- target:
21
+ - name: target
22
22
  type: executable
23
23
  sources:
24
24
  - main.cpp
@@ -51,13 +51,13 @@ Feature: Build C++ programs
51
51
  """
52
52
  ---
53
53
  targets:
54
- hello:
54
+ - name: hello
55
55
  type: executable
56
56
  sources:
57
57
  - main.cpp
58
58
  dependencies:
59
59
  - lib.a
60
- lib.a:
60
+ - name: lib.a
61
61
  type: static_library
62
62
  sources:
63
63
  - lib.cpp
@@ -98,11 +98,11 @@ Feature: Build C++ programs
98
98
  """
99
99
  ---
100
100
  targets:
101
- lib.so:
101
+ - name: lib.so
102
102
  type: dynamic_library
103
103
  sources:
104
104
  - lib.cpp
105
- blah:
105
+ - name: blah
106
106
  type: executable
107
107
  sources:
108
108
  - main.cpp
@@ -145,11 +145,11 @@ Feature: Build C++ programs
145
145
  """
146
146
  ---
147
147
  targets:
148
- lib.la:
148
+ - name: lib.la
149
149
  type: libtool_library
150
150
  sources:
151
151
  - lib.cpp
152
- blah:
152
+ - name: blah
153
153
  type: executable
154
154
  sources:
155
155
  - main.cpp
@@ -161,3 +161,14 @@ Feature: Build C++ programs
161
161
  And I run "libtool --mode=execute ./blah"
162
162
  Then the output should be "Hello World" with a newline
163
163
 
164
+ Scenario: Try to run on invalid build.jitsu file
165
+ Given a directory
166
+ And a file "build.jitsu" with contents
167
+ """
168
+ ---
169
+ blah:
170
+ type: executable
171
+ sources:
172
+ - main.cpp
173
+ """
174
+ Then running jitsu should produce an error
@@ -15,7 +15,7 @@ end
15
15
 
16
16
  When /^I run jitsu$/ do
17
17
  Dir.chdir @tmpdir do |dir|
18
- Jitsu.output(Jitsu.read(Jitsu.jitsufile))
18
+ Jitsu.work
19
19
  end
20
20
  end
21
21
 
@@ -32,3 +32,9 @@ Then /^the output should be "([^"]*)" with a newline$/ do |desired|
32
32
  @output.should == desired + "\n"
33
33
  end
34
34
 
35
+ Then /^running jitsu should produce an error$/ do
36
+ Dir.chdir @tmpdir do |dir|
37
+ expect { Jitsu.work }.to raise_error(Jitsu::SyntaxError)
38
+ end
39
+ end
40
+
@@ -0,0 +1,6 @@
1
+ require 'fileutils'
2
+
3
+ After do
4
+ FileUtils.rm_rf @tmpdir if @tmpdir
5
+ end
6
+
data/jitsu.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{jitsu}
8
- s.version = "0.3.0"
8
+ s.version = "0.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ilkka Laukkanen"]
12
- s.date = %q{2011-02-16}
12
+ s.date = %q{2011-02-21}
13
13
  s.default_executable = %q{jitsu}
14
14
  s.description = %q{Jitsu is a frontend or meta build system for Ninja
15
15
  (http://github.com/martine/ninja), a lightning-fast but
@@ -39,8 +39,11 @@ buildfiles.
39
39
  "features/jitsu.feature",
40
40
  "features/step_definitions/jitsu_steps.rb",
41
41
  "features/support/env.rb",
42
+ "features/support/hooks.rb",
42
43
  "jitsu.gemspec",
43
44
  "lib/jitsu.rb",
45
+ "lib/jitsu/errors.rb",
46
+ "lib/schema.yaml",
44
47
  "spec/jitsu_spec.rb",
45
48
  "spec/spec_helper.rb",
46
49
  "watchr_srcipt.rb"
@@ -60,6 +63,7 @@ buildfiles.
60
63
 
61
64
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
62
65
  s.add_runtime_dependency(%q<trollop>, ["~> 1.16.2"])
66
+ s.add_runtime_dependency(%q<kwalify>, ["~> 0.7.2"])
63
67
  s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
64
68
  s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
65
69
  s.add_development_dependency(%q<cucumber>, [">= 0"])
@@ -68,6 +72,7 @@ buildfiles.
68
72
  s.add_development_dependency(%q<rcov>, [">= 0"])
69
73
  else
70
74
  s.add_dependency(%q<trollop>, ["~> 1.16.2"])
75
+ s.add_dependency(%q<kwalify>, ["~> 0.7.2"])
71
76
  s.add_dependency(%q<rspec>, ["~> 2.3.0"])
72
77
  s.add_dependency(%q<yard>, ["~> 0.6.0"])
73
78
  s.add_dependency(%q<cucumber>, [">= 0"])
@@ -77,6 +82,7 @@ buildfiles.
77
82
  end
78
83
  else
79
84
  s.add_dependency(%q<trollop>, ["~> 1.16.2"])
85
+ s.add_dependency(%q<kwalify>, ["~> 0.7.2"])
80
86
  s.add_dependency(%q<rspec>, ["~> 2.3.0"])
81
87
  s.add_dependency(%q<yard>, ["~> 0.6.0"])
82
88
  s.add_dependency(%q<cucumber>, [">= 0"])
@@ -0,0 +1,34 @@
1
+ # Exception classes for Jitsu module
2
+ #
3
+ module Jitsu
4
+
5
+ # Base class for Jitsu errors.
6
+ #
7
+ class JitsuError < StandardError
8
+ end
9
+
10
+ # Jitsufile syntax error.
11
+ #
12
+ class SyntaxError < JitsuError
13
+
14
+ # Construct a new SyntaxError.
15
+ #
16
+ # @param jitsufile [String] path to file where error happened.
17
+ # @param msg [String] error message.
18
+ # @param errors [Enumerable] list of errors from Kwalify, or nil.
19
+ def initialize(jitsufile, msg, errors=nil)
20
+ message = msg
21
+ if errors and errors.is_a?(Enumerable)and not errors.empty?
22
+ message << ":"
23
+ errors.each do |err|
24
+ message << "\n"
25
+ message << (err.filename ? err.filename : jitsufile) << ":"
26
+ message << (err.linenum ? "#{err.linenum}" : "0") << ":"
27
+ message << err.path << " -- " << err.message
28
+ end
29
+ end
30
+ super(message)
31
+ end
32
+ end
33
+
34
+ end
data/lib/jitsu.rb CHANGED
@@ -1,9 +1,24 @@
1
1
  require 'yaml'
2
+ require 'kwalify'
2
3
 
4
+ require 'jitsu/errors'
5
+
6
+ # Main Jitsu module.
7
+ #
8
+ # Usage:
9
+ #
10
+ # Dir.chdir 'directory-with-jitsufiles'
11
+ # Jitsu.work
3
12
  module Jitsu
4
13
  JITSU_FILE_NAME = 'build.jitsu'
5
14
  NINJA_FILE_NAME = 'build.ninja'
6
15
 
16
+ # Process jitsufiles in current directory.
17
+ #
18
+ def self.work
19
+ Jitsu.output(Jitsu.read(Jitsu.jitsufile))
20
+ end
21
+
7
22
  # Get path to ninja.
8
23
  #
9
24
  # @return [String] path to `ninja` or nil if ninja was not found.
@@ -32,7 +47,14 @@ module Jitsu
32
47
  # @param jitsufile [String] path to jitsu file from e.g. Jitsu::jitsufile.
33
48
  # @return [Hash] a hash of the build specification.
34
49
  def self.read(jitsufile)
35
- YAML.load(File.open(jitsufile, 'r').read)
50
+ schema = YAML.load_file(File.join(File.dirname(__FILE__), 'schema.yaml'))
51
+ validator = Kwalify::Validator.new(schema)
52
+ parser = Kwalify::Yaml::Parser.new(validator)
53
+ doc = parser.parse(File.read(jitsufile))
54
+ if parser.errors and not parser.errors.empty?
55
+ raise Jitsu::SyntaxError.new(jitsufile, "Syntax errors in Jitsufile", parser.errors)
56
+ end
57
+ doc
36
58
  end
37
59
 
38
60
  # Check if any of the targets needs libtool.
@@ -40,7 +62,7 @@ module Jitsu
40
62
  # @param targets [Enum] the targets from a build specification hash.
41
63
  # @return [Boolean] true if libtool required, nil otherwise.
42
64
  def self.libtool_needed_for(targets)
43
- not targets.select { |key,val| val['type'] == 'libtool_library' }.empty?
65
+ not targets.select { |target| target['type'] == 'libtool_library' }.empty?
44
66
  end
45
67
 
46
68
  # Output jitsu build specification as build.ninja file(s).
@@ -88,12 +110,12 @@ rule ltlink
88
110
  command = ${libtool} --quiet --mode=link ${ld} ${ldflags} -o ${out} ${in}
89
111
  EOS
90
112
  end
91
- data['targets'].each do |target,conf|
113
+ data['targets'].each do |target|
92
114
  f.write "\n"
93
- sources = conf['sources']
94
- Jitsu.send "handle_#{conf['type']}".to_sym, f, target, sources, conf, data['targets']
115
+ sources = target['sources']
116
+ Jitsu.send "handle_#{target['type']}".to_sym, f, target, sources, data['targets']
95
117
  end
96
- f.write("\nbuild all: phony || #{data['targets'].keys.join(' ')}\n")
118
+ f.write("\nbuild all: phony || #{data['targets'].map { |t| t['name'] }.join(' ')}\n")
97
119
  end
98
120
  end
99
121
 
@@ -102,10 +124,10 @@ EOS
102
124
  # @param out [IO] the output stream where output is written.
103
125
  # @param sources [Enumerable] a list of sourcefile names to output rules
104
126
  # for.
105
- # @param conf [Hash] the entire build spec hash for this target.
106
- def self.output_sources(out, sources, conf)
107
- cxxflags = conf['cxxflags']
108
- libtool = conf['type'] == 'libtool_library'
127
+ # @param target [Hash] the entire build spec hash for this target.
128
+ def self.output_sources(out, sources, target)
129
+ cxxflags = target['cxxflags']
130
+ libtool = target['type'] == 'libtool_library'
109
131
  rule = (libtool ? "ltcxx" : "cxx")
110
132
  sources.each do |src|
111
133
  object = (libtool ? source_to_ltobject(src) : source_to_object(src))
@@ -117,74 +139,70 @@ EOS
117
139
  # Output build rules for one executable target.
118
140
  #
119
141
  # @param out [IO] the output stream where output is written.
120
- # @param target [String] the filename of the target.
142
+ # @param target [Hash] the entire build spec hash for this target.
121
143
  # @param sources [Enumerable] a list of sourcefile names to output rules
122
144
  # for.
123
- # @param conf [Hash] the entire build spec hash for this target.
124
145
  # @param targets [Hash] all targets for the build
125
- def self.handle_executable(out, target, sources, conf, targets)
126
- output_sources(out, sources, conf)
127
- libtool = libtool_needed_for targets.select { |key,val|
128
- conf['dependencies'] and conf['dependencies'].include? key
146
+ def self.handle_executable(out, target, sources, targets)
147
+ output_sources(out, sources, target)
148
+ libtool = libtool_needed_for targets.select { |tgt|
149
+ target['dependencies'] and target['dependencies'].include? tgt['name']
129
150
  }
130
151
  rule = libtool ? "ltlink" : "link"
131
- out.write "build #{target}: #{rule} #{sources_to_objects(sources).join ' '}"
132
- out.write " #{conf['dependencies'].join(' ')}" if conf['dependencies']
152
+ out.write "build #{target['name']}: #{rule} #{sources_to_objects(sources).join ' '}"
153
+ out.write " #{target['dependencies'].join(' ')}" if target['dependencies']
133
154
  out.write "\n"
134
- out.write " ldflags = #{conf['ldflags']}\n" if conf['ldflags']
155
+ out.write " ldflags = #{target['ldflags']}\n" if target['ldflags']
135
156
  end
136
157
 
137
158
  # Output build rules for one static library target.
138
159
  #
139
160
  # @param out [IO] the output stream where output is written.
140
- # @param target [String] the filename of the target.
161
+ # @param target [Hash] the entire build spec hash for this target.
141
162
  # @param sources [Enumerable] a list of sourcefile names to output rules
142
163
  # for.
143
- # @param conf [Hash] the entire build spec hash for this target.
144
164
  # @param targets [Hash] all targets for the build
145
- def self.handle_static_library(out, target, sources, conf, targets)
146
- output_sources(out, sources, conf)
147
- out.write "build #{target}: archive #{sources_to_objects(sources).join ' '}"
148
- out.write " #{conf['dependencies'].join(' ')}" if conf['dependencies']
165
+ def self.handle_static_library(out, target, sources, targets)
166
+ output_sources(out, sources, target)
167
+ out.write "build #{target['name']}: archive #{sources_to_objects(sources).join ' '}"
168
+ out.write " #{target['dependencies'].join(' ')}" if target['dependencies']
149
169
  out.write "\n"
150
170
  end
151
171
 
152
172
  # Output build rules for one dynamic library target.
153
173
  #
154
174
  # @param out [IO] the output stream where output is written.
155
- # @param target [String] the filename of the target.
175
+ # @param target [Hash] the entire build spec hash for this target.
156
176
  # @param sources [Enumerable] a list of sourcefile names to output rules
157
177
  # for.
158
- # @param conf [Hash] the entire build spec hash for this target.
159
178
  # @param targets [Hash] all targets for the build
160
- def self.handle_dynamic_library(out, target, sources, conf, targets)
161
- conf['cxxflags'] ||= '${cxxflags}'
162
- conf['cxxflags'] += ' -fPIC'
163
- output_sources(out, sources, conf)
164
- out.write "build #{target}: link #{sources_to_objects(sources).join ' '}"
165
- out.write " #{conf['dependencies'].join(' ')}" if conf['dependencies']
179
+ def self.handle_dynamic_library(out, target, sources, targets)
180
+ target['cxxflags'] ||= '${cxxflags}'
181
+ target['cxxflags'] += ' -fPIC'
182
+ output_sources(out, sources, target)
183
+ out.write "build #{target['name']}: link #{sources_to_objects(sources).join ' '}"
184
+ out.write " #{target['dependencies'].join(' ')}" if target['dependencies']
166
185
  out.write "\n"
167
- conf['ldflags'] ||= '${ldflags}'
168
- conf['ldflags'] += " -shared -Wl,-soname,#{target}"
169
- out.write " ldflags = #{conf['ldflags']}\n"
186
+ target['ldflags'] ||= '${ldflags}'
187
+ target['ldflags'] += " -shared -Wl,-soname,#{target['name']}"
188
+ out.write " ldflags = #{target['ldflags']}\n"
170
189
  end
171
190
 
172
191
  # Output build rules for one libtool library target.
173
192
  #
174
193
  # @param out [IO] the output stream where output is written.
175
- # @param target [String] the filename of the target.
194
+ # @param target [Hash] the entire build spec hash for this target.
176
195
  # @param sources [Enumerable] a list of sourcefile names to output rules
177
196
  # for.
178
- # @param conf [Hash] the entire build spec hash for this target.
179
197
  # @param targets [Hash] all targets for the build
180
- def self.handle_libtool_library(out, target, sources, conf, targets)
181
- output_sources(out, sources, conf)
182
- out.write "build #{target}: ltlink #{sources_to_ltobjects(sources).join ' '}"
183
- out.write " #{conf['dependencies'].join(' ')}" if conf['dependencies']
198
+ def self.handle_libtool_library(out, target, sources, targets)
199
+ output_sources(out, sources, target)
200
+ out.write "build #{target['name']}: ltlink #{sources_to_ltobjects(sources).join ' '}"
201
+ out.write " #{target['dependencies'].join(' ')}" if target['dependencies']
184
202
  out.write "\n"
185
- conf['ldflags'] ||= '${ldflags}'
186
- conf['ldflags'] += " -rpath /usr/local/lib"
187
- out.write " ldflags = #{conf['ldflags']}\n"
203
+ target['ldflags'] ||= '${ldflags}'
204
+ target['ldflags'] += " -rpath /usr/local/lib"
205
+ out.write " ldflags = #{target['ldflags']}\n"
188
206
  end
189
207
 
190
208
  # Convert sourcefile name to corresponding object file name.
data/lib/schema.yaml ADDED
@@ -0,0 +1,29 @@
1
+ type: map
2
+ mapping:
3
+ "targets":
4
+ type: seq
5
+ required: yes
6
+ sequence:
7
+ - type: map
8
+ mapping:
9
+ "name":
10
+ type: str
11
+ required: yes
12
+ unique: yes
13
+ "type":
14
+ type: str
15
+ required: yes
16
+ "sources":
17
+ type: seq
18
+ sequence:
19
+ - type: str
20
+ unique: yes
21
+ "dependencies":
22
+ type: seq
23
+ sequence:
24
+ - type: str
25
+ unique: yes
26
+ "cxxflags":
27
+ type: str
28
+ "ldflags":
29
+ type: str
data/spec/jitsu_spec.rb CHANGED
@@ -52,13 +52,14 @@ describe "Jitsu" do
52
52
  f.write <<-EOS
53
53
  ---
54
54
  targets:
55
- test1:
55
+ - name: test1
56
56
  type: executable
57
- sources: test1.cpp
57
+ sources:
58
+ - test1.cpp
58
59
  cxxflags: -g -Wall
59
60
  dependencies:
60
61
  - test2
61
- test2:
62
+ - name: test2
62
63
  type: static_library
63
64
  sources:
64
65
  - test2.cpp
@@ -66,7 +67,7 @@ targets:
66
67
  EOS
67
68
  end
68
69
  data = Jitsu.read Jitsu.jitsufile
69
- data['targets'].keys.should == ['test1', 'test2']
70
+ data['targets'].map { |x| x['name'] }.should == ['test1', 'test2']
70
71
  end
71
72
  end
72
73
  Dir.mktmpdir do |dir|
@@ -75,7 +76,7 @@ EOS
75
76
  f.write <<-EOS
76
77
  ---
77
78
  targets:
78
- aaa1:
79
+ - name: aaa1
79
80
  type: executable
80
81
  sources:
81
82
  - aaa1a.cpp
@@ -83,7 +84,7 @@ targets:
83
84
  cxxflags: -g -Wall
84
85
  dependencies:
85
86
  - aaa2
86
- aaa2:
87
+ - name: aaa2
87
88
  type: dynamic_library
88
89
  sources:
89
90
  - aaa2.cpp
@@ -91,7 +92,7 @@ targets:
91
92
  EOS
92
93
  end
93
94
  data = Jitsu.read Jitsu.jitsufile
94
- data['targets'].keys.should == ['aaa1', 'aaa2']
95
+ data['targets'].map { |x| x['name'] }.should == ['aaa1', 'aaa2']
95
96
  end
96
97
  end
97
98
  end
@@ -103,7 +104,7 @@ EOS
103
104
  f.write <<-EOS
104
105
  ---
105
106
  targets:
106
- aaa1:
107
+ - name: aaa1
107
108
  type: executable
108
109
  sources:
109
110
  - aaa1a.cpp
@@ -111,12 +112,12 @@ targets:
111
112
  dependencies:
112
113
  - aaa2.a
113
114
  - aaa3.so
114
- aaa2.a:
115
+ - name: aaa2.a
115
116
  type: static_library
116
117
  sources:
117
118
  - aaa2.cpp
118
119
  cxxflags: -ansi -pedantic
119
- aaa3.so:
120
+ - name: aaa3.so
120
121
  type: dynamic_library
121
122
  sources:
122
123
  - aaa3.cpp
@@ -145,27 +146,6 @@ rule archive
145
146
  description = AR ${out}
146
147
  command = ${ar} rT ${out} ${in}
147
148
 
148
- EOS
149
- # the targets are reversed on 1.8.7 :p
150
- if RUBY_VERSION.start_with? '1.8'
151
- ninjafile += <<-EOS
152
- build aaa3.o: cxx aaa3.cpp
153
- cxxflags = ${cxxflags} -fPIC
154
- build aaa3.so: link aaa3.o
155
- ldflags = ${ldflags} -shared -Wl,-soname,aaa3.so
156
-
157
- build aaa2.o: cxx aaa2.cpp
158
- cxxflags = -ansi -pedantic
159
- build aaa2.a: archive aaa2.o
160
-
161
- build aaa1a.o: cxx aaa1a.cpp
162
- build aaa1b.o: cxx aaa1b.cpp
163
- build aaa1: link aaa1a.o aaa1b.o aaa2.a aaa3.so
164
-
165
- build all: phony || aaa3.so aaa2.a aaa1
166
- EOS
167
- else
168
- ninjafile += <<-EOS
169
149
  build aaa1a.o: cxx aaa1a.cpp
170
150
  build aaa1b.o: cxx aaa1b.cpp
171
151
  build aaa1: link aaa1a.o aaa1b.o aaa2.a aaa3.so
@@ -181,7 +161,6 @@ build aaa3.so: link aaa3.o
181
161
 
182
162
  build all: phony || aaa1 aaa2.a aaa3.so
183
163
  EOS
184
- end
185
164
  File.open('build.ninja', 'r').read.should == ninjafile
186
165
  end
187
166
  end
@@ -194,7 +173,7 @@ EOS
194
173
  f.write <<-EOS
195
174
  ---
196
175
  targets:
197
- aaa1:
176
+ - name: aaa1
198
177
  type: executable
199
178
  sources:
200
179
  - aaa1a.cpp
@@ -202,12 +181,12 @@ targets:
202
181
  dependencies:
203
182
  - aaa2.a
204
183
  - aaa3.la
205
- aaa2.a:
184
+ - name: aaa2.a
206
185
  type: static_library
207
186
  sources:
208
187
  - aaa2.cpp
209
188
  cxxflags: -ansi -pedantic
210
- aaa3.la:
189
+ - name: aaa3.la
211
190
  type: libtool_library
212
191
  sources:
213
192
  - aaa3.cpp
@@ -246,26 +225,6 @@ rule ltlink
246
225
  description = LD ${out}
247
226
  command = ${libtool} --quiet --mode=link ${ld} ${ldflags} -o ${out} ${in}
248
227
 
249
- EOS
250
- # the targets are reversed on 1.8.7 :p
251
- if RUBY_VERSION.start_with? '1.8'
252
- ninjafile += <<-EOS
253
- build aaa3.lo: ltcxx aaa3.cpp
254
- build aaa3.la: ltlink aaa3.lo
255
- ldflags = ${ldflags} -rpath /usr/local/lib
256
-
257
- build aaa2.o: cxx aaa2.cpp
258
- cxxflags = -ansi -pedantic
259
- build aaa2.a: archive aaa2.o
260
-
261
- build aaa1a.o: cxx aaa1a.cpp
262
- build aaa1b.o: cxx aaa1b.cpp
263
- build aaa1: ltlink aaa1a.o aaa1b.o aaa2.a aaa3.la
264
-
265
- build all: phony || aaa3.la aaa2.a aaa1
266
- EOS
267
- else
268
- ninjafile += <<-EOS
269
228
  build aaa1a.o: cxx aaa1a.cpp
270
229
  build aaa1b.o: cxx aaa1b.cpp
271
230
  build aaa1: ltlink aaa1a.o aaa1b.o aaa2.a aaa3.la
@@ -280,7 +239,6 @@ build aaa3.la: ltlink aaa3.lo
280
239
 
281
240
  build all: phony || aaa1 aaa2.a aaa3.la
282
241
  EOS
283
- end
284
242
  File.open('build.ninja', 'r').read.should == ninjafile
285
243
  end
286
244
  end
data/watchr_srcipt.rb CHANGED
@@ -6,7 +6,7 @@ def run_features
6
6
  system("rake features")
7
7
  end
8
8
 
9
- watch('(lib|bin|spec|features)/(.*\.rb|[^.])') do |md|
10
- run_specs && run_features
11
- end
9
+ watch('spec/.*\.rb$') {|md| run_specs}
10
+ watch('features/.*\.(feature|rb)$') {|md| run_features}
11
+ watch('(bin/jitsu|lib/.*\.(rb|yaml)$)') {|md| run_specs && run_features}
12
12
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jitsu
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.0
5
+ version: 0.4.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ilkka Laukkanen
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-02-16 00:00:00 +02:00
13
+ date: 2011-02-21 00:00:00 +02:00
14
14
  default_executable: jitsu
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -25,8 +25,19 @@ dependencies:
25
25
  prerelease: false
26
26
  version_requirements: *id001
27
27
  - !ruby/object:Gem::Dependency
28
- name: rspec
28
+ name: kwalify
29
29
  requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: 0.7.2
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: rspec
40
+ requirement: &id003 !ruby/object:Gem::Requirement
30
41
  none: false
31
42
  requirements:
32
43
  - - ~>
@@ -34,10 +45,10 @@ dependencies:
34
45
  version: 2.3.0
35
46
  type: :development
36
47
  prerelease: false
37
- version_requirements: *id002
48
+ version_requirements: *id003
38
49
  - !ruby/object:Gem::Dependency
39
50
  name: yard
40
- requirement: &id003 !ruby/object:Gem::Requirement
51
+ requirement: &id004 !ruby/object:Gem::Requirement
41
52
  none: false
42
53
  requirements:
43
54
  - - ~>
@@ -45,10 +56,10 @@ dependencies:
45
56
  version: 0.6.0
46
57
  type: :development
47
58
  prerelease: false
48
- version_requirements: *id003
59
+ version_requirements: *id004
49
60
  - !ruby/object:Gem::Dependency
50
61
  name: cucumber
51
- requirement: &id004 !ruby/object:Gem::Requirement
62
+ requirement: &id005 !ruby/object:Gem::Requirement
52
63
  none: false
53
64
  requirements:
54
65
  - - ">="
@@ -56,10 +67,10 @@ dependencies:
56
67
  version: "0"
57
68
  type: :development
58
69
  prerelease: false
59
- version_requirements: *id004
70
+ version_requirements: *id005
60
71
  - !ruby/object:Gem::Dependency
61
72
  name: bundler
62
- requirement: &id005 !ruby/object:Gem::Requirement
73
+ requirement: &id006 !ruby/object:Gem::Requirement
63
74
  none: false
64
75
  requirements:
65
76
  - - ~>
@@ -67,10 +78,10 @@ dependencies:
67
78
  version: 1.0.0
68
79
  type: :development
69
80
  prerelease: false
70
- version_requirements: *id005
81
+ version_requirements: *id006
71
82
  - !ruby/object:Gem::Dependency
72
83
  name: jeweler
73
- requirement: &id006 !ruby/object:Gem::Requirement
84
+ requirement: &id007 !ruby/object:Gem::Requirement
74
85
  none: false
75
86
  requirements:
76
87
  - - ~>
@@ -78,10 +89,10 @@ dependencies:
78
89
  version: 1.5.2
79
90
  type: :development
80
91
  prerelease: false
81
- version_requirements: *id006
92
+ version_requirements: *id007
82
93
  - !ruby/object:Gem::Dependency
83
94
  name: rcov
84
- requirement: &id007 !ruby/object:Gem::Requirement
95
+ requirement: &id008 !ruby/object:Gem::Requirement
85
96
  none: false
86
97
  requirements:
87
98
  - - ">="
@@ -89,7 +100,7 @@ dependencies:
89
100
  version: "0"
90
101
  type: :development
91
102
  prerelease: false
92
- version_requirements: *id007
103
+ version_requirements: *id008
93
104
  description: |
94
105
  Jitsu is a frontend or meta build system for Ninja
95
106
  (http://github.com/martine/ninja), a lightning-fast but
@@ -121,8 +132,11 @@ files:
121
132
  - features/jitsu.feature
122
133
  - features/step_definitions/jitsu_steps.rb
123
134
  - features/support/env.rb
135
+ - features/support/hooks.rb
124
136
  - jitsu.gemspec
125
137
  - lib/jitsu.rb
138
+ - lib/jitsu/errors.rb
139
+ - lib/schema.yaml
126
140
  - spec/jitsu_spec.rb
127
141
  - spec/spec_helper.rb
128
142
  - watchr_srcipt.rb
@@ -140,7 +154,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
154
  requirements:
141
155
  - - ">="
142
156
  - !ruby/object:Gem::Version
143
- hash: 994791855
157
+ hash: 10677997
144
158
  segments:
145
159
  - 0
146
160
  version: "0"