cxxproject 0.6.0 → 0.6.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.
- data/lib/cxxproject/buildingblocks/executable.rb +5 -7
- data/lib/cxxproject/buildingblocks/has_libraries_mixin.rb +5 -5
- data/lib/cxxproject/buildingblocks/source_library.rb +5 -4
- data/lib/cxxproject/ext/rake.rb +23 -23
- data/lib/cxxproject/utils/exit_helper.rb +5 -5
- data/lib/cxxproject/version.rb +1 -1
- metadata +59 -56
@@ -71,10 +71,9 @@ module Cxxproject
|
|
71
71
|
if File.is_absolute?(v)
|
72
72
|
tmp = v
|
73
73
|
else
|
74
|
-
prefix ||= File.rel_from_to_project(@project_dir,d.project_dir)
|
74
|
+
prefix ||= File.rel_from_to_project(@project_dir, d.project_dir)
|
75
75
|
tmp = File.add_prefix(prefix, v)
|
76
76
|
end
|
77
|
-
tmp = "\"" + tmp + "\"" if tmp.include?(" ")
|
78
77
|
[tmp, prefix]
|
79
78
|
end
|
80
79
|
|
@@ -86,8 +85,7 @@ module Cxxproject
|
|
86
85
|
|
87
86
|
def calc_linker_lib_string_recursive(d)
|
88
87
|
res = []
|
89
|
-
|
90
|
-
return res if @dep_set.include?d
|
88
|
+
return res if @dep_set.include?(d)
|
91
89
|
@dep_set << d
|
92
90
|
|
93
91
|
if HasLibraries === d
|
@@ -105,12 +103,12 @@ module Cxxproject
|
|
105
103
|
res << tmp
|
106
104
|
when HasLibraries::SEARCH_PATH
|
107
105
|
tmp, prefix = adaptPath(elem[1], d, prefix)
|
108
|
-
if not @lib_path_set.include?tmp
|
106
|
+
if not @lib_path_set.include?(tmp)
|
109
107
|
@lib_path_set << tmp
|
110
108
|
res << "#{linker[:LIB_PATH_FLAG]}#{tmp}"
|
111
109
|
end
|
112
110
|
when HasLibraries::DEPENDENCY
|
113
|
-
if ALL_BUILDING_BLOCKS.include?elem[1]
|
111
|
+
if ALL_BUILDING_BLOCKS.include?(elem[1])
|
114
112
|
bb = ALL_BUILDING_BLOCKS[elem[1]]
|
115
113
|
res += calc_linker_lib_string_recursive(bb)
|
116
114
|
end
|
@@ -231,7 +229,7 @@ module Cxxproject
|
|
231
229
|
namespace 'run' do
|
232
230
|
desc "run executable #{executable}"
|
233
231
|
res = task name => executable do |t|
|
234
|
-
sh executable
|
232
|
+
sh "\"#{executable}\""
|
235
233
|
end
|
236
234
|
res.type = Rake::Task::RUN
|
237
235
|
res
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Cxxproject
|
2
2
|
module HasLibraries
|
3
|
-
LIB =
|
4
|
-
USERLIB =
|
5
|
-
LIB_WITH_PATH =
|
6
|
-
SEARCH_PATH =
|
7
|
-
DEPENDENCY =
|
3
|
+
LIB = :lib
|
4
|
+
USERLIB = :userlib
|
5
|
+
LIB_WITH_PATH = :lib_with_path
|
6
|
+
SEARCH_PATH = :search_path
|
7
|
+
DEPENDENCY = :dependency
|
8
8
|
|
9
9
|
def lib_elements
|
10
10
|
@lib_elements ||= []
|
@@ -17,8 +17,8 @@ module Cxxproject
|
|
17
17
|
|
18
18
|
def complete_init()
|
19
19
|
if @output_dir_abs
|
20
|
-
add_lib_element(HasLibraries::SEARCH_PATH, File.join(@output_dir, 'libs'), true)
|
21
20
|
add_lib_element(HasLibraries::LIB, @name, true)
|
21
|
+
add_lib_element(HasLibraries::SEARCH_PATH, File.join(@output_dir, 'libs'), true)
|
22
22
|
else
|
23
23
|
add_lib_element(HasLibraries::LIB_WITH_PATH, File.join(@output_dir,"lib#{@name}.a"), true)
|
24
24
|
end
|
@@ -78,7 +78,7 @@ module Cxxproject
|
|
78
78
|
cmd += objs
|
79
79
|
|
80
80
|
if Cxxproject::Utils.old_ruby?
|
81
|
-
cmd.map! {|c|
|
81
|
+
cmd.map! {|c| c.include?(' ') ? "\"#{c}\"" : c }
|
82
82
|
|
83
83
|
cmdLine = cmd.join(" ")
|
84
84
|
if cmdLine.length > 8000
|
@@ -89,10 +89,11 @@ module Cxxproject
|
|
89
89
|
consoleOutput = `#{cmd.join(" ")} 2>&1`
|
90
90
|
end
|
91
91
|
else
|
92
|
+
cmd.map! {|c| c.include?(' ') ? "\"#{c}\"" : c }
|
92
93
|
rd, wr = IO.pipe
|
93
94
|
cmd << {
|
94
|
-
:err=>wr,
|
95
|
-
:out=>wr
|
95
|
+
:err => wr,
|
96
|
+
:out => wr
|
96
97
|
}
|
97
98
|
sp = spawn(*cmd)
|
98
99
|
cmd.pop
|
data/lib/cxxproject/ext/rake.rb
CHANGED
@@ -26,11 +26,11 @@ module Rake
|
|
26
26
|
def max_parallel_tasks
|
27
27
|
@max_parallel_tasks ||= 8
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def addEmptyLine
|
31
31
|
@addEmptyLine ||= false
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
def check_unnecessary_includes
|
35
35
|
@check_unnecessary_includes ||= false
|
36
36
|
end
|
@@ -49,14 +49,14 @@ module Rake
|
|
49
49
|
@command_line_number += 1
|
50
50
|
res
|
51
51
|
end
|
52
|
-
|
52
|
+
|
53
53
|
def makefile_number
|
54
54
|
@makefile_number ||= 1
|
55
55
|
res = @makefile_number
|
56
56
|
@makefile_number += 1
|
57
57
|
res
|
58
58
|
end
|
59
|
-
|
59
|
+
|
60
60
|
def deriveIncludes
|
61
61
|
@deriveIncludes ||= false
|
62
62
|
end
|
@@ -68,7 +68,7 @@ module Rake
|
|
68
68
|
def consoleOutput_fullnames
|
69
69
|
@consoleOutput_fullnames ||= false
|
70
70
|
end
|
71
|
-
|
71
|
+
|
72
72
|
end
|
73
73
|
|
74
74
|
class Jobs
|
@@ -105,7 +105,7 @@ module Rake
|
|
105
105
|
def set_building_block(bb)
|
106
106
|
@bb = bb
|
107
107
|
end
|
108
|
-
|
108
|
+
|
109
109
|
def invoke_prerequisites(args, invocation_chain)
|
110
110
|
super(args, invocation_chain)
|
111
111
|
|
@@ -131,28 +131,28 @@ module Rake
|
|
131
131
|
return
|
132
132
|
end
|
133
133
|
end
|
134
|
-
|
134
|
+
|
135
135
|
file_tasks = @bb.create_object_file_tasks
|
136
|
-
|
136
|
+
|
137
137
|
if file_tasks == nil # = error
|
138
138
|
set_failed
|
139
139
|
return
|
140
140
|
end
|
141
|
-
|
141
|
+
|
142
142
|
enhance(file_tasks)
|
143
143
|
return if file_tasks.length == 0
|
144
|
-
|
144
|
+
|
145
145
|
@error_strings = {}
|
146
|
-
|
146
|
+
|
147
147
|
Jobs.new(file_tasks, application.max_parallel_tasks) do |jobs|
|
148
148
|
handle_jobs(jobs, args, invocation_chain)
|
149
149
|
end.join
|
150
|
-
|
150
|
+
|
151
151
|
# can only happen in case of bail_on_first_error.
|
152
152
|
# if not sorted, it may be confusing when builing more than once and the order of the error appearances changes from build to build
|
153
153
|
# (it is not deterministic which file compilation finishes first)
|
154
|
-
@error_strings.sort.each {|es| puts es[1]}
|
155
|
-
|
154
|
+
@error_strings.sort.each {|es| puts es[1]}
|
155
|
+
|
156
156
|
if Rake.application.check_unnecessary_includes
|
157
157
|
if not @failure # otherwise the dependency files might be incorrect or not complete
|
158
158
|
@bb.incArray.each do |i|
|
@@ -165,15 +165,15 @@ module Rake
|
|
165
165
|
res.line_number = 0
|
166
166
|
res.severity = Cxxproject::ErrorParser::SEVERITY_INFO
|
167
167
|
res.message = msg
|
168
|
-
Rake.application.idei.set_errors([res])
|
168
|
+
Rake.application.idei.set_errors([res])
|
169
169
|
end
|
170
170
|
end
|
171
171
|
end
|
172
172
|
end
|
173
|
-
|
173
|
+
|
174
174
|
end
|
175
|
-
|
176
|
-
|
175
|
+
|
176
|
+
|
177
177
|
end
|
178
178
|
|
179
179
|
def handle_jobs(jobs, args, invocation_chain)
|
@@ -302,9 +302,9 @@ module Rake
|
|
302
302
|
Cxxproject::Printer.printError "Error #{name}: #{e.message}"
|
303
303
|
if RakeFileUtils.verbose
|
304
304
|
puts e.backtrace
|
305
|
-
end
|
305
|
+
end
|
306
306
|
set_failed
|
307
|
-
if e.message.include?
|
307
|
+
if e.message.include?('Circular dependency detected')
|
308
308
|
Rake.application.idei.set_abort(true)
|
309
309
|
end
|
310
310
|
end
|
@@ -321,14 +321,14 @@ module Rake
|
|
321
321
|
end
|
322
322
|
|
323
323
|
define_method(:execute) do |arg|
|
324
|
-
|
324
|
+
|
325
325
|
if Rake::application.preproFlags
|
326
326
|
if self.type == SOURCEMULTI
|
327
327
|
@failure = true
|
328
328
|
break
|
329
329
|
end
|
330
330
|
end
|
331
|
-
|
331
|
+
|
332
332
|
break if @failure # check if a prereq has failed
|
333
333
|
break if Rake.application.idei.get_abort
|
334
334
|
new_execute(execute_org, arg)
|
@@ -352,7 +352,7 @@ module Rake
|
|
352
352
|
rescue Exception => ex1
|
353
353
|
handle_error(ex1, false)
|
354
354
|
end
|
355
|
-
|
355
|
+
|
356
356
|
if not @immediate_output
|
357
357
|
self.output_string = s.string
|
358
358
|
Thread.current[:stdout] = tmp
|
@@ -5,7 +5,7 @@ module Cxxproject
|
|
5
5
|
class ExitHelper
|
6
6
|
@@exit_code = 0
|
7
7
|
@@exit_test = false
|
8
|
-
|
8
|
+
|
9
9
|
def self.set_exit_code(val)
|
10
10
|
@@exit_code = val
|
11
11
|
end
|
@@ -16,16 +16,16 @@ module Cxxproject
|
|
16
16
|
|
17
17
|
def self.reset_exit_code()
|
18
18
|
@@exit_code = 0
|
19
|
-
end
|
19
|
+
end
|
20
20
|
|
21
21
|
def self.enable_exit_test()
|
22
22
|
@@exit_test = true
|
23
|
-
end
|
24
|
-
|
23
|
+
end
|
24
|
+
|
25
25
|
def self.disable_exit_test()
|
26
26
|
@@exit_test = false
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
def self.exit(val)
|
30
30
|
raise ExitHelperException.new if @@exit_test
|
31
31
|
@@exit_code = val
|
data/lib/cxxproject/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: cxxproject
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.6.
|
5
|
+
version: 0.6.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- oliver mueller
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-07-04 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: highline
|
@@ -54,85 +54,85 @@ extensions: []
|
|
54
54
|
extra_rdoc_files: []
|
55
55
|
|
56
56
|
files:
|
57
|
-
- lib/cxxproject.rb
|
58
|
-
- lib/tools/project_wizard.rb
|
57
|
+
- lib/cxxproject/errorparser/ti_linker_error_parser.rb
|
59
58
|
- lib/cxxproject/errorparser/diab_linker_error_parser.rb
|
60
|
-
- lib/cxxproject/errorparser/
|
59
|
+
- lib/cxxproject/errorparser/gcc_linker_error_parser.rb
|
61
60
|
- lib/cxxproject/errorparser/diab_compiler_error_parser.rb
|
61
|
+
- lib/cxxproject/errorparser/gcc_compiler_error_parser.rb
|
62
62
|
- lib/cxxproject/errorparser/ti_compiler_error_parser.rb
|
63
|
-
- lib/cxxproject/errorparser/gcc_linker_error_parser.rb
|
64
|
-
- lib/cxxproject/errorparser/ti_linker_error_parser.rb
|
65
63
|
- lib/cxxproject/errorparser/error_parser.rb
|
64
|
+
- lib/cxxproject/utils/optional.rb
|
65
|
+
- lib/cxxproject/utils/cleanup.rb
|
66
|
+
- lib/cxxproject/utils/exit_helper.rb
|
67
|
+
- lib/cxxproject/utils/rbcurse_progress.rb
|
68
|
+
- lib/cxxproject/utils/process.rb
|
69
|
+
- lib/cxxproject/utils/ubigraph.rb
|
70
|
+
- lib/cxxproject/utils/printer.rb
|
71
|
+
- lib/cxxproject/utils/stats.rb
|
72
|
+
- lib/cxxproject/utils/rbcurse.rb
|
73
|
+
- lib/cxxproject/utils/progress_helper.rb
|
74
|
+
- lib/cxxproject/utils/rbcurse_executable_ext.rb
|
75
|
+
- lib/cxxproject/utils/utils.rb
|
76
|
+
- lib/cxxproject/utils/rbcurse_tasktable.rb
|
77
|
+
- lib/cxxproject/utils/console.rb
|
78
|
+
- lib/cxxproject/utils/progress.rb
|
79
|
+
- lib/cxxproject/utils/graphstream.rb
|
80
|
+
- lib/cxxproject/toolchain/toolchain_benchmark.rb
|
81
|
+
- lib/cxxproject/toolchain/diab.rb
|
82
|
+
- lib/cxxproject/toolchain/gcc.rb
|
83
|
+
- lib/cxxproject/toolchain/provider.rb
|
84
|
+
- lib/cxxproject/toolchain/clang.rb
|
85
|
+
- lib/cxxproject/toolchain/ti.rb
|
86
|
+
- lib/cxxproject/toolchain/colorizing_formatter.rb
|
87
|
+
- lib/cxxproject/toolchain/toolchain.rb
|
66
88
|
- lib/cxxproject/version.rb
|
67
|
-
- lib/cxxproject/torake.rb
|
68
89
|
- lib/cxxproject/ide_interface.rb
|
69
|
-
- lib/cxxproject/ext/
|
70
|
-
- lib/cxxproject/ext/rake_dirty.rb
|
90
|
+
- lib/cxxproject/ext/rake_listener.rb
|
71
91
|
- lib/cxxproject/ext/filelist.rb
|
72
92
|
- lib/cxxproject/ext/string.rb
|
73
|
-
- lib/cxxproject/ext/rake_listener.rb
|
74
|
-
- lib/cxxproject/ext/stdout.rb
|
75
93
|
- lib/cxxproject/ext/rake.rb
|
76
94
|
- lib/cxxproject/ext/progressbar.rb
|
95
|
+
- lib/cxxproject/ext/stdout.rb
|
96
|
+
- lib/cxxproject/ext/rake_dirty.rb
|
97
|
+
- lib/cxxproject/ext/file.rb
|
98
|
+
- lib/cxxproject/torake.rb
|
99
|
+
- lib/cxxproject/buildingblocks/building_block.rb
|
77
100
|
- lib/cxxproject/buildingblocks/has_libraries_mixin.rb
|
78
|
-
- lib/cxxproject/buildingblocks/executable.rb
|
79
|
-
- lib/cxxproject/buildingblocks/has_includes_mixin.rb
|
80
|
-
- lib/cxxproject/buildingblocks/has_dependencies_mixin.rb
|
81
101
|
- lib/cxxproject/buildingblocks/custom_building_block.rb
|
102
|
+
- lib/cxxproject/buildingblocks/makefile.rb
|
103
|
+
- lib/cxxproject/buildingblocks/has_includes_mixin.rb
|
104
|
+
- lib/cxxproject/buildingblocks/has_sources_mixin.rb
|
82
105
|
- lib/cxxproject/buildingblocks/binary_library.rb
|
106
|
+
- lib/cxxproject/buildingblocks/executable.rb
|
83
107
|
- lib/cxxproject/buildingblocks/module.rb
|
84
|
-
- lib/cxxproject/buildingblocks/building_block.rb
|
85
|
-
- lib/cxxproject/buildingblocks/source_library.rb
|
86
108
|
- lib/cxxproject/buildingblocks/single_source.rb
|
87
|
-
- lib/cxxproject/buildingblocks/
|
109
|
+
- lib/cxxproject/buildingblocks/has_dependencies_mixin.rb
|
110
|
+
- lib/cxxproject/buildingblocks/source_library.rb
|
88
111
|
- lib/cxxproject/buildingblocks/command_line.rb
|
89
|
-
- lib/cxxproject/buildingblocks/has_sources_mixin.rb
|
90
|
-
- lib/cxxproject/utils/rbcurse_progress.rb
|
91
|
-
- lib/cxxproject/utils/ubigraph.rb
|
92
|
-
- lib/cxxproject/utils/graphstream.rb
|
93
|
-
- lib/cxxproject/utils/progress.rb
|
94
|
-
- lib/cxxproject/utils/stats.rb
|
95
|
-
- lib/cxxproject/utils/utils.rb
|
96
|
-
- lib/cxxproject/utils/optional.rb
|
97
|
-
- lib/cxxproject/utils/console.rb
|
98
|
-
- lib/cxxproject/utils/progress_helper.rb
|
99
|
-
- lib/cxxproject/utils/exit_helper.rb
|
100
|
-
- lib/cxxproject/utils/cleanup.rb
|
101
|
-
- lib/cxxproject/utils/rbcurse_tasktable.rb
|
102
|
-
- lib/cxxproject/utils/rbcurse_executable_ext.rb
|
103
|
-
- lib/cxxproject/utils/rbcurse.rb
|
104
|
-
- lib/cxxproject/utils/printer.rb
|
105
|
-
- lib/cxxproject/utils/process.rb
|
106
|
-
- lib/cxxproject/toolchain/clang.rb
|
107
|
-
- lib/cxxproject/toolchain/provider.rb
|
108
|
-
- lib/cxxproject/toolchain/toolchain.rb
|
109
|
-
- lib/cxxproject/toolchain/ti.rb
|
110
|
-
- lib/cxxproject/toolchain/colorizing_formatter.rb
|
111
|
-
- lib/cxxproject/toolchain/gcc.rb
|
112
|
-
- lib/cxxproject/toolchain/toolchain_benchmark.rb
|
113
|
-
- lib/cxxproject/toolchain/diab.rb
|
114
112
|
- lib/cxxproject/eval_context.rb
|
113
|
+
- lib/tools/project_wizard.rb
|
114
|
+
- lib/cxxproject.rb
|
115
115
|
- Rakefile.rb
|
116
|
-
- spec/
|
117
|
-
- spec/
|
116
|
+
- spec/string_spec.rb
|
117
|
+
- spec/project_path_spec.rb
|
118
|
+
- spec/ide_interface_spec.rb
|
119
|
+
- spec/spec_helper.rb
|
120
|
+
- spec/object_dependency_spec.rb
|
121
|
+
- spec/building_block_spec.rb
|
122
|
+
- spec/file_ext_spec.rb
|
123
|
+
- spec/testdata/basic/exe12/project.rb
|
118
124
|
- spec/testdata/basic/lib1/project.rb
|
119
125
|
- spec/testdata/basic/lib2/project.rb
|
120
|
-
- spec/testdata/
|
121
|
-
- spec/testdata/
|
126
|
+
- spec/testdata/onlyOneHeader/Rakefile.rb
|
127
|
+
- spec/testdata/onlyOneHeader/project.rb
|
122
128
|
- spec/testdata/multiple_levels/libs/lib1/project.rb
|
123
129
|
- spec/testdata/multiple_levels/libs/lib2/project.rb
|
124
|
-
- spec/
|
130
|
+
- spec/testdata/multiple_levels/mainproject/basic/project.rb
|
125
131
|
- spec/cxxproject_2_rake_spec.rb
|
126
|
-
- spec/project_path_spec.rb
|
127
|
-
- spec/building_block_spec.rb
|
128
|
-
- spec/file_ext_spec.rb
|
129
|
-
- spec/spec_helper.rb
|
130
|
-
- spec/ide_interface_spec.rb
|
131
|
-
- spec/object_dependency_spec.rb
|
132
|
-
- spec/rake_listener_ext_spec.rb
|
133
132
|
- spec/toolchain_spec.rb
|
134
|
-
-
|
133
|
+
- spec/rake_listener_ext_spec.rb
|
135
134
|
- lib/tools/Rakefile.rb.template
|
135
|
+
- lib/tools/project.rb.template
|
136
136
|
- bin/cxx
|
137
137
|
homepage: https://github.com/marcmo/cxxproject
|
138
138
|
licenses: []
|
@@ -147,6 +147,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
147
147
|
requirements:
|
148
148
|
- - ">="
|
149
149
|
- !ruby/object:Gem::Version
|
150
|
+
hash: -1979026599221260154
|
151
|
+
segments:
|
152
|
+
- 0
|
150
153
|
version: "0"
|
151
154
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
155
|
none: false
|