Class: Artifacts
- Inherits:
-
Array
- Object
- Array
- Artifacts
- Defined in:
- lib/artifacts.x.rb
Instance Method Summary collapse
-
#initialize ⇒ Artifacts
constructor
A new instance of Artifacts.
- #update ⇒ Object
Constructor Details
#initialize ⇒ Artifacts
Returns a new instance of Artifacts.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/artifacts.x.rb', line 4 def initialize # gem, dev_tasks-0.0.7.gem Dir.glob('*.gemspec') {|f| spec=Gem::Specification.load(f) artifact="#{spec.name}-#{spec.version.to_s}.gem" self << artifact if(!self.include?(artifact)) } # C# dll, bin/Net4.0/QcNet.dll Dir.glob("*.csproj").each{|p| text = File.read(p) # extract AssemblyName of form: <AssemblyName>MyLibrary.Test</AssemblyName> assemblyName=text[/<AssemblyName>([\w\.]+)</,1] outputType=text[/<OutputType>([\w\.]+)</,1] outputPath=text[/Release[.\w\W]+<OutputPath>([\w\.\\]+)</,1] if(!assemblyName.nil? && !outputPath.nil? && !assemblyName.include?("Test")) extension="dll" extension="exe" if(outputType=="WinExe" || outputType=="Exe") artifact = "#{outputPath}\\#{assemblyName}.#{extension}".gsub("\\\\","\\").gsub('/','\\').gsub('\\','/') self << artifact if(!self.include?(artifact)) # add in file dependencies Dependencies.csharp_file_dependencies(text).each{|dep| cs_dll_dep=dep.gsub(File.dirname(dep),File.dirname(artifact)).gsub('\\','/') self << cs_dll_dep if(!self.include?(cs_dll_dep)) } end } update end |
Instance Method Details
#update ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/artifacts.x.rb', line 38 def update # C++ dll,lib,h,hpp if(Dir.glob("**/*.{vcproj,vcxproj}").length > 0) Dir.glob("**/*.{lib,dll,h,hpp}").each{|f| self << f } end end |