cxxproject 0.5.63 → 0.5.64
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.
@@ -166,7 +166,7 @@ module Cxxproject
|
|
166
166
|
end
|
167
167
|
end
|
168
168
|
|
169
|
-
def
|
169
|
+
def calc_sources_to_build(quiet = false)
|
170
170
|
sources_to_build = {}
|
171
171
|
|
172
172
|
exclude_files = Set.new
|
@@ -184,8 +184,8 @@ module Cxxproject
|
|
184
184
|
|
185
185
|
source_patterns.each do |p|
|
186
186
|
globRes = Dir.glob(p)
|
187
|
-
if (globRes.length == 0)
|
188
|
-
Printer.
|
187
|
+
if (globRes.length == 0 and RakeFileUtils.verbose and not quiet)
|
188
|
+
Printer.printInfo "Info: Source file pattern '#{p}' did not match to any file"
|
189
189
|
end
|
190
190
|
globRes.each do |f|
|
191
191
|
next if exclude_files.include?(f)
|
@@ -196,6 +196,11 @@ module Cxxproject
|
|
196
196
|
sources_to_build[f] = t
|
197
197
|
end
|
198
198
|
end
|
199
|
+
sources_to_build
|
200
|
+
end
|
201
|
+
|
202
|
+
def create_object_file_tasks()
|
203
|
+
sources_to_build = calc_sources_to_build
|
199
204
|
|
200
205
|
ordered = sources_to_build.keys.sort()
|
201
206
|
dirs = []
|
@@ -50,7 +50,7 @@ module Cxxproject
|
|
50
50
|
@task_name = @project_dir + "/" + @task_name unless @output_dir_abs
|
51
51
|
@task_name
|
52
52
|
end
|
53
|
-
|
53
|
+
|
54
54
|
# task that will link the given object files to a static lib
|
55
55
|
#
|
56
56
|
def convert_to_rake()
|
@@ -60,52 +60,75 @@ module Cxxproject
|
|
60
60
|
res = typed_file_task Rake::Task::LIBRARY, get_task_name => object_multitask do
|
61
61
|
dir = @project_dir
|
62
62
|
objs = @objects
|
63
|
-
aname = get_archive_name
|
64
|
-
|
63
|
+
aname = get_archive_name
|
64
|
+
|
65
65
|
if @output_dir_abs
|
66
66
|
dir = @output_dir
|
67
67
|
prefix = File.rel_from_to_project(@project_dir, @output_dir)
|
68
68
|
objs.map! { |m| m[prefix.length..-1] }
|
69
69
|
aname = aname[prefix.length..-1]
|
70
70
|
end
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
cmd
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
71
|
+
|
72
|
+
if (objs.length != 0 or not File.exist?(get_task_name))
|
73
|
+
Dir.chdir(dir) do
|
74
|
+
if File.exists?(aname)
|
75
|
+
FileUtils.rm(aname)
|
76
|
+
else
|
77
|
+
d = File.dirname(aname)
|
78
|
+
FileUtils.mkdir_p(d)
|
79
|
+
end
|
80
|
+
|
81
|
+
cmd = [archiver[:COMMAND]] # ar
|
82
|
+
cmd += archiver[:ARCHIVE_FLAGS].split(" ")
|
83
|
+
cmd += Cxxproject::Utils::flagSplit(archiver[:FLAGS]) # --all_load
|
84
|
+
cmd << aname # -o debug/x.exe
|
85
|
+
cmd += objs
|
86
|
+
|
87
|
+
if Cxxproject::Utils.old_ruby?
|
88
|
+
cmd.map! {|c| ((c.include?" ") ? ("\""+c+"\"") : c )}
|
89
|
+
|
90
|
+
cmdLine = cmd.join(" ")
|
91
|
+
if cmdLine.length > 8000
|
92
|
+
inputName = aname+".tmp"
|
93
|
+
File.open(inputName,"wb") { |f| f.write(cmd[1..-1].join(" ")) }
|
94
|
+
success, consoleOutput = ProcessHelper.safeExecute() { `#{archiver[:COMMAND] + " @" + inputName}` }
|
95
|
+
else
|
96
|
+
success, consoleOutput = ProcessHelper.safeExecute() { `#{cmd.join(" ")} 2>&1` }
|
97
|
+
end
|
88
98
|
else
|
89
|
-
|
99
|
+
rd, wr = IO.pipe
|
100
|
+
cmd << {
|
101
|
+
:err=>wr,
|
102
|
+
:out=>wr
|
103
|
+
}
|
104
|
+
success, consoleOutput = ProcessHelper.safeExecute() { sp = spawn(*cmd); ProcessHelper.readOutput(sp, rd, wr) }
|
105
|
+
cmd.pop
|
90
106
|
end
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
:out=>wr
|
96
|
-
}
|
97
|
-
success, consoleOutput = ProcessHelper.safeExecute() { sp = spawn(*cmd); ProcessHelper.readOutput(sp, rd, wr) }
|
98
|
-
cmd.pop
|
107
|
+
|
108
|
+
process_result(cmd, consoleOutput, archiver[:ERROR_PARSER], "Creating #{aname}", success)
|
109
|
+
|
110
|
+
check_config_file()
|
99
111
|
end
|
100
|
-
|
101
|
-
process_result(cmd, consoleOutput, archiver[:ERROR_PARSER], "Creating #{aname}", success)
|
102
|
-
|
103
|
-
check_config_file()
|
104
112
|
end
|
105
113
|
end
|
106
114
|
enhance_with_additional_files(res)
|
107
|
-
|
108
|
-
|
115
|
+
|
116
|
+
if not Rake.application["clean"].prerequisites.include?(get_task_name+"Clean")
|
117
|
+
cleanTask = task get_task_name+"Clean" do
|
118
|
+
Dir.chdir(@project_dir) do
|
119
|
+
if (calc_sources_to_build(true).length != 0 or not File.exist?(get_task_name))
|
120
|
+
if (@output_dir_abs)
|
121
|
+
FileUtils.rm_rf(file)
|
122
|
+
else
|
123
|
+
FileUtils.rm_rf(complete_output_dir)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
Rake.application["clean"].enhance([cleanTask])
|
130
|
+
end
|
131
|
+
|
109
132
|
add_grouping_tasks(get_task_name)
|
110
133
|
|
111
134
|
setup_rake_dependencies(res, object_multitask)
|
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.5.
|
5
|
+
version: 0.5.64
|
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: 2013-04-
|
13
|
+
date: 2013-04-17 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: highline
|