xqcoretools 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/xqcoretools +29 -19
  2. metadata +1 -1
data/bin/xqcoretools CHANGED
@@ -293,6 +293,25 @@ class XQCoreTools < Thor
293
293
  end
294
294
  end
295
295
 
296
+ def self.setChildNode(document, sibling, name, value)
297
+ children = sibling.parent.css(name)
298
+
299
+ if children.length == 0
300
+ created = Nokogiri::XML::Node.new(name, document)
301
+ created.inner_html = value
302
+
303
+ sibling.add_next_sibling(created)
304
+
305
+ return created
306
+ else
307
+ children.each do |child|
308
+ child.inner_html = value
309
+ end
310
+
311
+ return children[0]
312
+ end
313
+ end
314
+
296
315
  def self.setBuildOutput(platform)
297
316
  currentPath = Dir.pwd
298
317
 
@@ -311,37 +330,26 @@ class XQCoreTools < Thor
311
330
  if parent.has_attribute?('Condition')
312
331
  condition = parent.get_attribute('Condition')
313
332
 
314
- config = condition[/\'\$\(Configuration\)\|.*\'\s\=\=\s\'(.*)\|/, 1]
333
+ regex = /\'\$\(Configuration\)\|\$\(Platform\).*\'\s\=\=\s\'(.*)\|(.*)\'/
334
+
335
+ config = condition[regex, 1]
336
+ target = condition[regex, 2]
315
337
 
316
338
  if config != nil
317
- binFolder = "../Binaries/#{platform}/bin/#{config}/"
318
- objFolder = "../Binaries/#{platform}/obj/#{config}/"
339
+ binFolder = "..\\Binaries\\#{target}\\#{platform}\\bin\\#{config}"
340
+ objFolder = "..\\Binaries\\#{target}\\#{platform}\\obj\\#{config}"
319
341
 
320
342
  node.inner_html = binFolder;
321
343
 
322
344
  attachNode = node
323
- sibling = node.next_sibling();
324
345
 
325
- if sibling.name != "BaseIntermediateOutputPath"
326
- intermediateOutput = Nokogiri::XML::Node.new('BaseIntermediateOutputPath', document)
327
- intermediateOutput.inner_html = objFolder
328
- attachNode.add_next_sibling(intermediateOutput)
329
- attachNode = intermediateOutput
330
- end
331
-
332
- if sibling.name != "IntermediateOutputPath"
333
- intermediateOutput = Nokogiri::XML::Node.new('IntermediateOutputPath', document)
334
- intermediateOutput.inner_html = objFolder
335
- attachNode.add_next_sibling(intermediateOutput)
336
- attachNode = intermediateOutput
337
- end
346
+ attachNode = XQCoreTools::setChildNode(document, attachNode, 'BaseIntermediateOutputPath', objFolder)
347
+ attachNode = XQCoreTools::setChildNode(document, attachNode, 'IntermediateOutputPath', objFolder)
338
348
  end
339
349
  end
340
350
  end
341
351
 
342
352
  CrossPlatformCSProj::saveDocument(document, file)
343
-
344
- puts Updated Project Files!
345
353
  end
346
354
  end
347
355
 
@@ -350,6 +358,8 @@ class XQCoreTools < Thor
350
358
  XQCoreTools::setBuildOutput('Android')
351
359
  XQCoreTools::setBuildOutput('iOS')
352
360
  XQCoreTools::setBuildOutput('Windows')
361
+
362
+ puts 'Updated Project Files!'
353
363
  end
354
364
  end
355
365
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xqcoretools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: