xqcoretools 0.1.4 → 0.1.5
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/bin/xqcoretools +60 -0
 - metadata +1 -1
 
    
        data/bin/xqcoretools
    CHANGED
    
    | 
         @@ -1,5 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            #!/usr/bin/env ruby
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
      
 3 
     | 
    
         
            +
            require 'rake'
         
     | 
| 
       3 
4 
     | 
    
         
             
            require 'rubygems'
         
     | 
| 
       4 
5 
     | 
    
         
             
            require 'thor'
         
     | 
| 
       5 
6 
     | 
    
         
             
            require 'cross_platform_csproj'
         
     | 
| 
         @@ -290,6 +291,65 @@ class XQCoreTools < Thor 
     | 
|
| 
       290 
291 
     | 
    
         
             
            				end
         
     | 
| 
       291 
292 
     | 
    
         
             
            			end
         
     | 
| 
       292 
293 
     | 
    
         
             
            		end
         
     | 
| 
      
 294 
     | 
    
         
            +
            	end 
         
     | 
| 
      
 295 
     | 
    
         
            +
             
     | 
| 
      
 296 
     | 
    
         
            +
            	def self.setBuildOutput(platform)
         
     | 
| 
      
 297 
     | 
    
         
            +
            		currentPath = Dir.pwd
         
     | 
| 
      
 298 
     | 
    
         
            +
            		
         
     | 
| 
      
 299 
     | 
    
         
            +
            		fileList = FileList.new()
         
     | 
| 
      
 300 
     | 
    
         
            +
            		
         
     | 
| 
      
 301 
     | 
    
         
            +
            		fileList.include("#{currentPath}/**/*.#{platform}.csproj")
         
     | 
| 
      
 302 
     | 
    
         
            +
             
     | 
| 
      
 303 
     | 
    
         
            +
            		fileList.each do |file|
         
     | 
| 
      
 304 
     | 
    
         
            +
            			document = CrossPlatformCSProj::openDocument(file)
         
     | 
| 
      
 305 
     | 
    
         
            +
             
     | 
| 
      
 306 
     | 
    
         
            +
            			nodes = document.css('OutputPath')
         
     | 
| 
      
 307 
     | 
    
         
            +
            			
         
     | 
| 
      
 308 
     | 
    
         
            +
            			for node in nodes do
         
     | 
| 
      
 309 
     | 
    
         
            +
            				parent = node.parent
         
     | 
| 
      
 310 
     | 
    
         
            +
             
     | 
| 
      
 311 
     | 
    
         
            +
            				if parent.has_attribute?('Condition')
         
     | 
| 
      
 312 
     | 
    
         
            +
            					condition = parent.get_attribute('Condition')
         
     | 
| 
      
 313 
     | 
    
         
            +
             
     | 
| 
      
 314 
     | 
    
         
            +
            					config = condition[/\'\$\(Configuration\)\|.*\'\s\=\=\s\'(.*)\|/, 1]
         
     | 
| 
      
 315 
     | 
    
         
            +
             
     | 
| 
      
 316 
     | 
    
         
            +
            					if config != nil
         
     | 
| 
      
 317 
     | 
    
         
            +
            						binFolder = "../Binaries/#{platform}/bin/#{config}/"
         
     | 
| 
      
 318 
     | 
    
         
            +
            						objFolder = "../Binaries/#{platform}/obj/#{config}/"
         
     | 
| 
      
 319 
     | 
    
         
            +
             
     | 
| 
      
 320 
     | 
    
         
            +
            						node.inner_html = binFolder;
         
     | 
| 
      
 321 
     | 
    
         
            +
             
     | 
| 
      
 322 
     | 
    
         
            +
            						attachNode = node
         
     | 
| 
      
 323 
     | 
    
         
            +
            						sibling = node.next_sibling();
         
     | 
| 
      
 324 
     | 
    
         
            +
            						
         
     | 
| 
      
 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
         
     | 
| 
      
 338 
     | 
    
         
            +
            					end
         
     | 
| 
      
 339 
     | 
    
         
            +
            				end
         
     | 
| 
      
 340 
     | 
    
         
            +
            			end
         
     | 
| 
      
 341 
     | 
    
         
            +
             
     | 
| 
      
 342 
     | 
    
         
            +
            			CrossPlatformCSProj::saveDocument(document, file)
         
     | 
| 
      
 343 
     | 
    
         
            +
             
     | 
| 
      
 344 
     | 
    
         
            +
            			puts Updated Project Files!
         
     | 
| 
      
 345 
     | 
    
         
            +
            		end
         
     | 
| 
      
 346 
     | 
    
         
            +
            	end
         
     | 
| 
      
 347 
     | 
    
         
            +
             
     | 
| 
      
 348 
     | 
    
         
            +
            	desc "setupbuildoutput", "Set build output to the correct directories"
         
     | 
| 
      
 349 
     | 
    
         
            +
            	def setupbuildoutput()
         
     | 
| 
      
 350 
     | 
    
         
            +
            		XQCoreTools::setBuildOutput('Android')
         
     | 
| 
      
 351 
     | 
    
         
            +
            		XQCoreTools::setBuildOutput('iOS')
         
     | 
| 
      
 352 
     | 
    
         
            +
            		XQCoreTools::setBuildOutput('Windows')
         
     | 
| 
       293 
353 
     | 
    
         
             
            	end
         
     | 
| 
       294 
354 
     | 
    
         
             
            end
         
     | 
| 
       295 
355 
     | 
    
         |