cxxproject 0.4.6 → 0.5.47
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile.rb +101 -54
- data/bin/cxx +4 -4
- data/lib/cxxproject/buildingblocks/binary_library.rb +32 -9
- data/lib/cxxproject/buildingblocks/building_block.rb +220 -74
- data/lib/cxxproject/buildingblocks/command_line.rb +70 -21
- data/lib/cxxproject/buildingblocks/custom_building_block.rb +33 -9
- data/lib/cxxproject/buildingblocks/executable.rb +228 -33
- data/lib/cxxproject/buildingblocks/has_dependencies_mixin.rb +69 -43
- data/lib/cxxproject/buildingblocks/has_includes_mixin.rb +20 -0
- data/lib/cxxproject/buildingblocks/has_libraries_mixin.rb +29 -30
- data/lib/cxxproject/buildingblocks/has_sources_mixin.rb +343 -64
- data/lib/cxxproject/buildingblocks/makefile.rb +142 -24
- data/lib/cxxproject/buildingblocks/module.rb +27 -6
- data/lib/cxxproject/buildingblocks/single_source.rb +26 -4
- data/lib/cxxproject/buildingblocks/source_library.rb +113 -20
- data/lib/cxxproject/errorparser/diab_compiler_error_parser.rb +40 -0
- data/lib/cxxproject/errorparser/diab_linker_error_parser.rb +33 -0
- data/lib/cxxproject/errorparser/error_parser.rb +50 -0
- data/lib/cxxproject/errorparser/gcc_compiler_error_parser.rb +30 -0
- data/lib/cxxproject/errorparser/gcc_linker_error_parser.rb +29 -0
- data/lib/cxxproject/errorparser/ti_compiler_error_parser.rb +30 -0
- data/lib/cxxproject/errorparser/ti_linker_error_parser.rb +29 -0
- data/lib/cxxproject/eval_context.rb +136 -0
- data/lib/cxxproject/ext/file.rb +71 -0
- data/lib/cxxproject/ext/filelist.rb +6 -0
- data/lib/cxxproject/ext/progressbar.rb +20 -0
- data/lib/cxxproject/ext/rake.rb +397 -0
- data/lib/cxxproject/{extensions/rake_listener_ext.rb → ext/rake_listener.rb} +18 -12
- data/lib/cxxproject/ext/stdout.rb +44 -0
- data/lib/cxxproject/ide_interface.rb +181 -0
- data/lib/cxxproject/toolchain/clang.rb +39 -0
- data/lib/cxxproject/toolchain/colorizing_formatter.rb +99 -0
- data/lib/cxxproject/toolchain/diab.rb +36 -33
- data/lib/cxxproject/toolchain/gcc.rb +16 -8
- data/lib/cxxproject/toolchain/provider.rb +112 -2
- data/lib/cxxproject/toolchain/ti.rb +50 -0
- data/lib/cxxproject/toolchain/toolchain.rb +38 -0
- data/lib/cxxproject/toolchain/toolchain_benchmark.rb +23 -0
- data/lib/cxxproject/torake.rb +181 -123
- data/lib/cxxproject/utils/cleanup.rb +20 -0
- data/lib/cxxproject/utils/console.rb +6 -0
- data/lib/cxxproject/utils/exit_helper.rb +40 -0
- data/lib/cxxproject/utils/graphstream.rb +154 -0
- data/lib/cxxproject/utils/optional.rb +16 -0
- data/lib/cxxproject/utils/printer.rb +50 -0
- data/lib/cxxproject/utils/process.rb +53 -0
- data/lib/cxxproject/utils/progress.rb +66 -0
- data/lib/cxxproject/utils/progress_helper.rb +77 -0
- data/lib/cxxproject/utils/rbcurse.rb +284 -0
- data/lib/cxxproject/utils/rbcurse_executable_ext.rb +14 -0
- data/lib/cxxproject/utils/rbcurse_progress.rb +71 -0
- data/lib/cxxproject/utils/rbcurse_tasktable.rb +51 -0
- data/lib/cxxproject/utils/stats.rb +60 -0
- data/lib/cxxproject/utils/ubigraph.rb +179 -188
- data/lib/cxxproject/utils/utils.rb +29 -25
- data/lib/cxxproject/version.rb +7 -0
- data/lib/cxxproject.rb +13 -7
- data/lib/tools/project_wizard.rb +66 -0
- data/spec/building_block_spec.rb +50 -6
- data/spec/{build_dependencies_spec.rb → cxxproject_2_rake_spec.rb} +82 -65
- data/spec/file_ext_spec.rb +30 -0
- data/spec/ide_interface_spec.rb +41 -0
- data/spec/object_dependency_spec.rb +83 -0
- data/spec/project_path_spec.rb +14 -16
- data/spec/rake_listener_ext_spec.rb +38 -5
- data/spec/spec_helper.rb +18 -0
- data/spec/testdata/basic/lib2/project.rb +1 -1
- data/spec/testdata/multiple_levels/libs/lib2/project.rb +1 -1
- data/spec/toolchain_spec.rb +29 -0
- metadata +91 -58
- data/lib/cxxproject/extensions/file_ext.rb +0 -47
- data/lib/cxxproject/extensions/rake_ext.rb +0 -158
- data/lib/cxxproject/extensions/stdout_ext.rb +0 -35
- data/lib/cxxproject/task_maker.rb +0 -418
- data/lib/cxxproject/testinstanceeval.rb +0 -65
- data/lib/cxxproject/toolchain/base.rb +0 -98
- data/lib/cxxproject/torake/compiler.rb +0 -10
- data/lib/cxxproject/torake/gcccompiler.rb +0 -7
- data/lib/cxxproject/torake/osxcompiler.rb +0 -7
- data/lib/cxxproject/utils/dot/building_block_graph_writer.rb +0 -19
- data/lib/cxxproject/utils/dot/graph_writer.rb +0 -53
- data/lib/cxxproject/utils/dot/task_graph_writer.rb +0 -34
- data/lib/tools/projectWizard.rb +0 -44
- data/spec/dir_spec.rb +0 -13
- /data/lib/cxxproject/{extensions/rake_dirty_ext.rb → ext/rake_dirty.rb} +0 -0
- /data/lib/cxxproject/{extensions/string_ext.rb → ext/string.rb} +0 -0
metadata
CHANGED
@@ -1,21 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cxxproject
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 3
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 4
|
9
|
-
- 6
|
10
|
-
version: 0.4.6
|
5
|
+
version: 0.5.47
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
|
-
-
|
8
|
+
- oliver mueller
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date: 2011-
|
13
|
+
date: 2011-12-13 00:00:00 Z
|
19
14
|
dependencies:
|
20
15
|
- !ruby/object:Gem::Dependency
|
21
16
|
name: highline
|
@@ -25,14 +20,31 @@ dependencies:
|
|
25
20
|
requirements:
|
26
21
|
- - ">="
|
27
22
|
- !ruby/object:Gem::Version
|
28
|
-
hash: 15
|
29
|
-
segments:
|
30
|
-
- 1
|
31
|
-
- 6
|
32
|
-
- 0
|
33
23
|
version: 1.6.0
|
34
24
|
type: :runtime
|
35
25
|
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: colored
|
28
|
+
prerelease: false
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "0"
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id002
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: progressbar
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: "0"
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id003
|
36
48
|
description: " Some more high level building blocks for cpp projects.\n"
|
37
49
|
email: oliver.mueller@gmail.com
|
38
50
|
executables:
|
@@ -42,58 +54,85 @@ extensions: []
|
|
42
54
|
extra_rdoc_files: []
|
43
55
|
|
44
56
|
files:
|
45
|
-
- lib/cxxproject/
|
46
|
-
- lib/cxxproject/
|
57
|
+
- lib/cxxproject/toolchain/toolchain_benchmark.rb
|
58
|
+
- lib/cxxproject/toolchain/colorizing_formatter.rb
|
59
|
+
- lib/cxxproject/toolchain/gcc.rb
|
60
|
+
- lib/cxxproject/toolchain/diab.rb
|
61
|
+
- lib/cxxproject/toolchain/toolchain.rb
|
62
|
+
- lib/cxxproject/toolchain/clang.rb
|
63
|
+
- lib/cxxproject/toolchain/ti.rb
|
64
|
+
- lib/cxxproject/toolchain/provider.rb
|
65
|
+
- lib/cxxproject/utils/ubigraph.rb
|
66
|
+
- lib/cxxproject/utils/cleanup.rb
|
67
|
+
- lib/cxxproject/utils/graphstream.rb
|
68
|
+
- lib/cxxproject/utils/progress.rb
|
69
|
+
- lib/cxxproject/utils/rbcurse_executable_ext.rb
|
70
|
+
- lib/cxxproject/utils/progress_helper.rb
|
71
|
+
- lib/cxxproject/utils/stats.rb
|
72
|
+
- lib/cxxproject/utils/optional.rb
|
73
|
+
- lib/cxxproject/utils/exit_helper.rb
|
74
|
+
- lib/cxxproject/utils/rbcurse_progress.rb
|
75
|
+
- lib/cxxproject/utils/rbcurse.rb
|
76
|
+
- lib/cxxproject/utils/process.rb
|
77
|
+
- lib/cxxproject/utils/rbcurse_tasktable.rb
|
78
|
+
- lib/cxxproject/utils/utils.rb
|
79
|
+
- lib/cxxproject/utils/console.rb
|
80
|
+
- lib/cxxproject/utils/printer.rb
|
81
|
+
- lib/cxxproject/ext/rake.rb
|
82
|
+
- lib/cxxproject/ext/string.rb
|
83
|
+
- lib/cxxproject/ext/file.rb
|
84
|
+
- lib/cxxproject/ext/rake_listener.rb
|
85
|
+
- lib/cxxproject/ext/progressbar.rb
|
86
|
+
- lib/cxxproject/ext/stdout.rb
|
87
|
+
- lib/cxxproject/ext/filelist.rb
|
88
|
+
- lib/cxxproject/ext/rake_dirty.rb
|
89
|
+
- lib/cxxproject/eval_context.rb
|
90
|
+
- lib/cxxproject/ide_interface.rb
|
91
|
+
- lib/cxxproject/torake.rb
|
92
|
+
- lib/cxxproject/version.rb
|
93
|
+
- lib/cxxproject/errorparser/ti_linker_error_parser.rb
|
94
|
+
- lib/cxxproject/errorparser/gcc_compiler_error_parser.rb
|
95
|
+
- lib/cxxproject/errorparser/diab_linker_error_parser.rb
|
96
|
+
- lib/cxxproject/errorparser/diab_compiler_error_parser.rb
|
97
|
+
- lib/cxxproject/errorparser/ti_compiler_error_parser.rb
|
98
|
+
- lib/cxxproject/errorparser/error_parser.rb
|
99
|
+
- lib/cxxproject/errorparser/gcc_linker_error_parser.rb
|
100
|
+
- lib/cxxproject/buildingblocks/module.rb
|
47
101
|
- lib/cxxproject/buildingblocks/command_line.rb
|
48
102
|
- lib/cxxproject/buildingblocks/custom_building_block.rb
|
49
|
-
- lib/cxxproject/buildingblocks/executable.rb
|
50
|
-
- lib/cxxproject/buildingblocks/has_dependencies_mixin.rb
|
51
|
-
- lib/cxxproject/buildingblocks/has_libraries_mixin.rb
|
52
103
|
- lib/cxxproject/buildingblocks/has_sources_mixin.rb
|
53
|
-
- lib/cxxproject/buildingblocks/makefile.rb
|
54
|
-
- lib/cxxproject/buildingblocks/module.rb
|
55
104
|
- lib/cxxproject/buildingblocks/single_source.rb
|
105
|
+
- lib/cxxproject/buildingblocks/executable.rb
|
106
|
+
- lib/cxxproject/buildingblocks/has_libraries_mixin.rb
|
56
107
|
- lib/cxxproject/buildingblocks/source_library.rb
|
57
|
-
- lib/cxxproject/
|
58
|
-
- lib/cxxproject/
|
59
|
-
- lib/cxxproject/
|
60
|
-
- lib/cxxproject/
|
61
|
-
- lib/cxxproject/
|
62
|
-
- lib/
|
63
|
-
- lib/cxxproject/task_maker.rb
|
64
|
-
- lib/cxxproject/testinstanceeval.rb
|
65
|
-
- lib/cxxproject/toolchain/base.rb
|
66
|
-
- lib/cxxproject/toolchain/diab.rb
|
67
|
-
- lib/cxxproject/toolchain/gcc.rb
|
68
|
-
- lib/cxxproject/toolchain/provider.rb
|
69
|
-
- lib/cxxproject/torake/compiler.rb
|
70
|
-
- lib/cxxproject/torake/gcccompiler.rb
|
71
|
-
- lib/cxxproject/torake/osxcompiler.rb
|
72
|
-
- lib/cxxproject/torake.rb
|
73
|
-
- lib/cxxproject/utils/dot/building_block_graph_writer.rb
|
74
|
-
- lib/cxxproject/utils/dot/graph_writer.rb
|
75
|
-
- lib/cxxproject/utils/dot/task_graph_writer.rb
|
76
|
-
- lib/cxxproject/utils/ubigraph.rb
|
77
|
-
- lib/cxxproject/utils/utils.rb
|
108
|
+
- lib/cxxproject/buildingblocks/has_includes_mixin.rb
|
109
|
+
- lib/cxxproject/buildingblocks/binary_library.rb
|
110
|
+
- lib/cxxproject/buildingblocks/makefile.rb
|
111
|
+
- lib/cxxproject/buildingblocks/has_dependencies_mixin.rb
|
112
|
+
- lib/cxxproject/buildingblocks/building_block.rb
|
113
|
+
- lib/tools/project_wizard.rb
|
78
114
|
- lib/cxxproject.rb
|
79
|
-
- lib/tools/projectWizard.rb
|
80
|
-
- lib/tools/project.rb.template
|
81
|
-
- lib/tools/Rakefile.rb.template
|
82
115
|
- Rakefile.rb
|
83
|
-
- spec/build_dependencies_spec.rb
|
84
|
-
- spec/building_block_spec.rb
|
85
|
-
- spec/dir_spec.rb
|
86
116
|
- spec/project_path_spec.rb
|
87
|
-
- spec/
|
88
|
-
- spec/
|
117
|
+
- spec/cxxproject_2_rake_spec.rb
|
118
|
+
- spec/object_dependency_spec.rb
|
119
|
+
- spec/ide_interface_spec.rb
|
120
|
+
- spec/building_block_spec.rb
|
89
121
|
- spec/testdata/basic/exe12/project.rb
|
90
|
-
- spec/testdata/basic/lib1/project.rb
|
91
122
|
- spec/testdata/basic/lib2/project.rb
|
92
|
-
- spec/testdata/
|
123
|
+
- spec/testdata/basic/lib1/project.rb
|
93
124
|
- spec/testdata/multiple_levels/libs/lib2/project.rb
|
125
|
+
- spec/testdata/multiple_levels/libs/lib1/project.rb
|
94
126
|
- spec/testdata/multiple_levels/mainproject/basic/project.rb
|
95
127
|
- spec/testdata/onlyOneHeader/project.rb
|
96
128
|
- spec/testdata/onlyOneHeader/Rakefile.rb
|
129
|
+
- spec/string_spec.rb
|
130
|
+
- spec/spec_helper.rb
|
131
|
+
- spec/rake_listener_ext_spec.rb
|
132
|
+
- spec/toolchain_spec.rb
|
133
|
+
- spec/file_ext_spec.rb
|
134
|
+
- lib/tools/project.rb.template
|
135
|
+
- lib/tools/Rakefile.rb.template
|
97
136
|
- bin/cxx
|
98
137
|
homepage: https://github.com/marcmo/cxxproject
|
99
138
|
licenses: []
|
@@ -108,23 +147,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
108
147
|
requirements:
|
109
148
|
- - ">="
|
110
149
|
- !ruby/object:Gem::Version
|
111
|
-
hash: 3
|
112
|
-
segments:
|
113
|
-
- 0
|
114
150
|
version: "0"
|
115
151
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
152
|
none: false
|
117
153
|
requirements:
|
118
154
|
- - ">="
|
119
155
|
- !ruby/object:Gem::Version
|
120
|
-
hash: 3
|
121
|
-
segments:
|
122
|
-
- 0
|
123
156
|
version: "0"
|
124
157
|
requirements: []
|
125
158
|
|
126
159
|
rubyforge_project:
|
127
|
-
rubygems_version: 1.8.
|
160
|
+
rubygems_version: 1.8.12
|
128
161
|
signing_key:
|
129
162
|
specification_version: 3
|
130
163
|
summary: Cpp Support for Rake.
|
@@ -1,47 +0,0 @@
|
|
1
|
-
class File
|
2
|
-
|
3
|
-
@@oldRuby = RUBY_VERSION[0..2] == "1.8"
|
4
|
-
|
5
|
-
def self.is_absolute?(filename)
|
6
|
-
if @@oldRuby
|
7
|
-
filename[0] == 47 or filename[1] == 58 # 47 = /, 58 = :
|
8
|
-
else
|
9
|
-
filename[0] == '/' or filename[1] == ':'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
# filename relative to nowRelToThisDir (if absolute, nowRelToThisDir can be nil)
|
14
|
-
# return: filename which is relative to thenRelToThisDir
|
15
|
-
def self.relFromTo(filename,nowRelToThisDir,thenRelToThisDirOrg = Dir.pwd)
|
16
|
-
|
17
|
-
absFilename = filename
|
18
|
-
thenRelToThisDir = thenRelToThisDirOrg + "/"
|
19
|
-
|
20
|
-
if not File.is_absolute?(filename)
|
21
|
-
absFilename = File.expand_path(nowRelToThisDir + "/" + filename)
|
22
|
-
end
|
23
|
-
|
24
|
-
maxLength = thenRelToThisDir.length > absFilename.length ? absFilename.length : thenRelToThisDir.length
|
25
|
-
|
26
|
-
lastEqDir = -1
|
27
|
-
for i in 0..maxLength-1
|
28
|
-
break if thenRelToThisDir[i] != absFilename[i]
|
29
|
-
end
|
30
|
-
lastEqDir = thenRelToThisDir.rindex("/",i)
|
31
|
-
|
32
|
-
if lastEqDir
|
33
|
-
dotdot = thenRelToThisDir[lastEqDir+1..-1].split("/").length
|
34
|
-
res = ""
|
35
|
-
dotdot.times { res << "../" }
|
36
|
-
res << absFilename[lastEqDir+1..-1]
|
37
|
-
return absFilename if res.length > absFilename.length # avoid something like "../../../../../../usr/local/lib"
|
38
|
-
return res
|
39
|
-
else
|
40
|
-
return absFilename
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
@@ -1,158 +0,0 @@
|
|
1
|
-
require 'cxxproject/extensions/stdout_ext'
|
2
|
-
require 'cxxproject/utils/dot/graph_writer'
|
3
|
-
|
4
|
-
require 'rake'
|
5
|
-
require 'stringio'
|
6
|
-
|
7
|
-
module Rake
|
8
|
-
|
9
|
-
class SyncStringIO < StringIO
|
10
|
-
def initialize(mutex)
|
11
|
-
super()
|
12
|
-
@mutex = mutex
|
13
|
-
end
|
14
|
-
|
15
|
-
def sync_flush
|
16
|
-
if string.length > 0
|
17
|
-
@mutex.synchronize { STDOUT.write string; truncate(0); rewind}
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
#############
|
24
|
-
# - Limit parallel tasks
|
25
|
-
#############
|
26
|
-
class MultiTask < Task
|
27
|
-
|
28
|
-
@@max_parallel_tasks = 8
|
29
|
-
|
30
|
-
def self.max_parallel_tasks
|
31
|
-
@@max_parallel_tasks
|
32
|
-
end
|
33
|
-
|
34
|
-
def self.set_max_parallel_tasks(number)
|
35
|
-
@@max_parallel_tasks = number
|
36
|
-
end
|
37
|
-
|
38
|
-
private
|
39
|
-
def invoke_prerequisites(args, invocation_chain)
|
40
|
-
return unless @prerequisites
|
41
|
-
|
42
|
-
jobqueue = @prerequisites.dup
|
43
|
-
m = Mutex.new
|
44
|
-
|
45
|
-
numThreads = jobqueue.length > @@max_parallel_tasks ? @@max_parallel_tasks : jobqueue.length
|
46
|
-
|
47
|
-
threads = []
|
48
|
-
numThreads.times {
|
49
|
-
threads << Thread.new(jobqueue) { |jq|
|
50
|
-
while true do
|
51
|
-
p = nil
|
52
|
-
m.synchronize { p = jq.shift }
|
53
|
-
break unless p
|
54
|
-
|
55
|
-
s = SyncStringIO.new(m)
|
56
|
-
Thread.current[:stdout] = s
|
57
|
-
prereq = application[p]
|
58
|
-
prereq.invoke_with_call_chain(args, invocation_chain)
|
59
|
-
if prereq.failure
|
60
|
-
@failure = true
|
61
|
-
end
|
62
|
-
s.sync_flush
|
63
|
-
end
|
64
|
-
}
|
65
|
-
}
|
66
|
-
threads.each { |t| t.join }
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
#############
|
71
|
-
# - Go on if a task fails (but to not execute the parent)
|
72
|
-
# - showInGraph is used for GraphWriter (internal tasks are not shown)
|
73
|
-
#############
|
74
|
-
class Task
|
75
|
-
attr_accessor :failure # specified if that task has failed
|
76
|
-
attr_accessor :deps # used to store deps by depfile task for the apply task (no re-read of depsfile)
|
77
|
-
attr_accessor :showInGraph
|
78
|
-
attr_accessor :transparent_timestamp
|
79
|
-
attr_accessor :dismissed_prerequisites
|
80
|
-
|
81
|
-
execute_org = self.instance_method(:execute)
|
82
|
-
initialize_org = self.instance_method(:initialize)
|
83
|
-
timestamp_org = self.instance_method(:timestamp)
|
84
|
-
invoke_prerequisites_org = self.instance_method(:invoke_prerequisites)
|
85
|
-
|
86
|
-
define_method(:initialize) do |task_name, app|
|
87
|
-
initialize_org.bind(self).call(task_name, app)
|
88
|
-
@showInGraph = GraphWriter::YES
|
89
|
-
@deps = nil
|
90
|
-
@transparent_timestamp = false
|
91
|
-
@dismissed_prerequisites = []
|
92
|
-
@neededStored = nil # cache result for performance
|
93
|
-
end
|
94
|
-
|
95
|
-
define_method(:invoke_prerequisites) do |task_args, invocation_chain|
|
96
|
-
orgLength = 0
|
97
|
-
while @prerequisites.length > orgLength do
|
98
|
-
orgLength = @prerequisites.length
|
99
|
-
@prerequisites.dup.each { |n| # dup needed when apply tasks changes that array
|
100
|
-
begin
|
101
|
-
prereq = application[n, @scope]
|
102
|
-
prereq_args = task_args.new_scope(prereq.arg_names)
|
103
|
-
prereq.invoke_with_call_chain(prereq_args, invocation_chain)
|
104
|
-
if prereq.failure
|
105
|
-
@failure = true
|
106
|
-
end
|
107
|
-
rescue
|
108
|
-
if @name.length>2 and @name[-2..-1] == ".o" # file found in dep file does not exist anymore
|
109
|
-
@prerequisites.delete(n)
|
110
|
-
def self.needed?
|
111
|
-
true
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
115
|
-
}
|
116
|
-
end
|
117
|
-
|
118
|
-
end
|
119
|
-
|
120
|
-
define_method(:execute) do |arg|
|
121
|
-
|
122
|
-
break if @failure # check if a prereq has failed
|
123
|
-
|
124
|
-
begin
|
125
|
-
execute_org.bind(self).call(arg)
|
126
|
-
@failure = false
|
127
|
-
rescue Exception => ex1 # todo: no rescue to stop on first error
|
128
|
-
# todo: debug log, no puts here!
|
129
|
-
puts "Error: #{@name} not built/cleaned correctly: #{ex1.message}"
|
130
|
-
begin
|
131
|
-
FileUtils.rm(@name) if File.exists?(@name) # todo: error parsing?
|
132
|
-
rescue Exception => ex2
|
133
|
-
# todo: debug log, no puts here!
|
134
|
-
puts "Error: Could not delete #{@name}: #{ex2.message}"
|
135
|
-
end
|
136
|
-
@failure = true
|
137
|
-
end
|
138
|
-
|
139
|
-
Thread.current[:stdout].sync_flush if Thread.current[:stdout]
|
140
|
-
|
141
|
-
end
|
142
|
-
|
143
|
-
define_method(:timestamp) do
|
144
|
-
if @transparent_timestamp
|
145
|
-
ts = Rake::EARLY
|
146
|
-
@prerequisites.each do |pre|
|
147
|
-
prereq_timestamp = Rake.application[pre].timestamp
|
148
|
-
ts = prereq_timestamp if prereq_timestamp > ts
|
149
|
-
end
|
150
|
-
else
|
151
|
-
ts = timestamp_org.bind(self).call()
|
152
|
-
end
|
153
|
-
ts
|
154
|
-
end
|
155
|
-
|
156
|
-
end
|
157
|
-
|
158
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'stringio'
|
2
|
-
|
3
|
-
module ThreadOut
|
4
|
-
|
5
|
-
def self.write(stuff)
|
6
|
-
if Thread.current[:stdout] then
|
7
|
-
Thread.current[:stdout].write stuff
|
8
|
-
else
|
9
|
-
STDOUT.write stuff
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.puts(stuff)
|
14
|
-
if Thread.current[:stdout] then
|
15
|
-
Thread.current[:stdout].puts stuff
|
16
|
-
else
|
17
|
-
STDERR.puts stuff
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.flush
|
22
|
-
if Thread.current[:stdout] then
|
23
|
-
Thread.current[:stdout].flush
|
24
|
-
else
|
25
|
-
STDOUT.flush
|
26
|
-
STDERR.flush
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
STDOUT.sync = true
|
32
|
-
STDERR.sync = true
|
33
|
-
$stdout = ThreadOut
|
34
|
-
$stderr = ThreadOut
|
35
|
-
|