bake-toolkit 1.0.19 → 1.0.20

Sign up to get free protection for your applications and to get access to all the features.
data/bin/createVSProjects CHANGED
@@ -44,7 +44,7 @@ puts "Scanning for bake projects...."
44
44
 
45
45
  projects = {}
46
46
  @options.roots.each do |r|
47
- Dir.glob(r + "/*/Project.meta").each do |m|
47
+ Dir.glob(r + "/**/Project.meta").each do |m|
48
48
  projects[File.basename(File.dirname(m))] = [File.dirname(m), SecureRandom.uuid.upcase]
49
49
  end
50
50
  end
data/lib/bake/options.rb CHANGED
@@ -35,7 +35,7 @@ module Cxxproject
35
35
  @socket = 0
36
36
  @include_filter = []
37
37
  @exclude_filter = []
38
- @def_root = nil
38
+ @def_roots = []
39
39
  @eclipse_version = ""
40
40
  @alias_filename = ""
41
41
 
@@ -118,7 +118,7 @@ module Cxxproject
118
118
  parse_internal(false)
119
119
  set_main_dir(Dir.pwd) if @main_dir.nil?
120
120
  set_project(File.basename(@main_dir)) if @project.nil?
121
- @roots << @def_root if @roots.length == 0
121
+ @roots = @def_roots if @roots.length == 0
122
122
  Rake::application.max_parallel_tasks = @threads
123
123
 
124
124
  if @linkOnly
@@ -170,7 +170,7 @@ module Cxxproject
170
170
  def set_main_dir(dir)
171
171
  check_valid_dir(dir)
172
172
  @main_dir = File.expand_path(dir.gsub(/[\\]/,'/'))
173
- @def_root = File.dirname(@main_dir)
173
+ @def_roots = calc_def_roots(@main_dir)
174
174
  end
175
175
 
176
176
  def set_project(name)
data/lib/bake/util.rb CHANGED
@@ -96,3 +96,30 @@ def sanitize_filename(filename)
96
96
  end
97
97
  end
98
98
 
99
+ def searchRootsFile(dir)
100
+ rootsFile = dir+"/roots.bake"
101
+ return rootsFile if File.exist?(rootsFile)
102
+
103
+ parent = File.dirname(dir)
104
+ return searchRootsFile(parent) if parent != dir
105
+
106
+ return nil
107
+ end
108
+
109
+ def calc_def_roots(dir)
110
+ def_roots = []
111
+ rootsFile = searchRootsFile(dir)
112
+ if (rootsFile)
113
+ File.open(rootsFile).each do |line|
114
+ line.gsub!(/[\\]/,'/')
115
+ if File.is_absolute?(line)
116
+ def_roots << line
117
+ else
118
+ def_roots << File.dirname(rootsFile) + "/" + line
119
+ end
120
+ end
121
+ else
122
+ def_roots << File.dirname(dir)
123
+ end
124
+ def_roots
125
+ end
data/lib/bake/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Cxxproject
2
2
  class Version
3
3
  def self.bake
4
- "1.0.19"
4
+ "1.0.20"
5
5
  end
6
6
  end
7
7
 
@@ -19,7 +19,7 @@ module Cxxproject
19
19
  @error = false
20
20
  @roots = []
21
21
  @socket = 0
22
- @def_root = nil
22
+ @def_root = []
23
23
 
24
24
  add_option(Option.new("-b",true) { |x| set_collection_name(x) })
25
25
  add_option(Option.new("-m",true) { |x| set_collection_dir(x) })
@@ -47,8 +47,8 @@ module Cxxproject
47
47
  parse_internal(true)
48
48
  set_collection_dir(Dir.pwd) if @collection_dir.nil?
49
49
  if @roots.length == 0
50
- @roots << @def_root
51
- @roots << @collection_dir if @def_root != @collection_dir
50
+ @roots = @def_root
51
+ @roots << @collection_dir unless @def_root.include?@collection_dir
52
52
  end
53
53
  end
54
54
 
@@ -74,7 +74,7 @@ module Cxxproject
74
74
  def set_collection_dir(dir)
75
75
  check_valid_dir(dir)
76
76
  @collection_dir = File.expand_path(dir.gsub(/[\\]/,'/'))
77
- @def_root = File.dirname(@collection_dir)
77
+ @def_roots = calc_def_roots(@collection_dir)
78
78
  end
79
79
 
80
80
  def set_color(x)
data/lib/tocxx.rb CHANGED
@@ -190,7 +190,6 @@ module Cxxproject
190
190
  end
191
191
 
192
192
  def loadProjMeta(loader, filename, configname)
193
-
194
193
  @project_files << filename
195
194
  f = loader.load(filename)
196
195
 
@@ -236,19 +235,25 @@ module Cxxproject
236
235
  project2config_pending = {}
237
236
  project2config_pending[@mainProjectName] = @options.build_config
238
237
 
238
+ potentialProjs = []
239
+ @options.roots.each do |r|
240
+ potentialProjs.concat(Dir.glob(r+"/**/Project.meta"))
241
+ end
242
+
243
+ potentialProjs.uniq!
244
+
239
245
  while project2config_pending.length > 0
240
246
 
241
247
  pname_toload = project2config_pending.keys[0]
242
248
  cname_toload = project2config_pending[pname_toload]
243
249
  project2config_pending.delete(pname_toload)
244
250
 
245
-
246
251
  # check if file is in more than one root
247
252
  pmeta_filenames = []
248
- @options.roots.each do |r|
249
- f = r + "/" + pname_toload + "/Project.meta"
250
- if File.exists?(f)
251
- pmeta_filenames << f
253
+
254
+ potentialProjs.each do |pp|
255
+ if pp.include?(pname_toload + "/Project.meta")
256
+ pmeta_filenames << pp
252
257
  end
253
258
  end
254
259
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: bake-toolkit
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.19
5
+ version: 1.0.20
6
6
  platform: ruby
7
7
  authors:
8
8
  - Alexander Schaal
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2013-06-21 00:00:00 Z
13
+ date: 2013-07-25 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: cxxproject