2
if ENV.keys.include?('CC_BUILD_ARTIFACTS')
3
dir = ENV['CC_BUILD_ARTIFACTS']
7
Dir.mkdir dir unless File.exists?(dir)
12
def create(filename, root, installerBatchFile, excludes=/^$/)
13
root = root + "/" if root[root.length - 1].chr != "/"
14
Zip::ZipFile.open(filename, Zip::ZipFile::CREATE) do |zip|
15
Find.find(root) do |path|
16
next if path =~ excludes
17
zip_path = path.gsub(root, '')
18
zip.add(zip_path, path)
20
zip.add(installerBatchFile, File.join(Dir.pwd, installerBatchFile))
25
class AssemblyInfoBuilder
26
attr_accessor :assemblyAttributes
27
def initialize(sourcePath, assemblyAttributes = {})
28
@sourcePath = sourcePath
29
@assemblyAttributes = assemblyAttributes
33
assemblyInfoFiles = FileList["#{@sourcePath}/**/AssemblyInfo.cs"]
34
assemblyInfoFiles.each do |filePath|
35
puts "AssemblyInfo file found at: #{filePath}"
36
assemblyTitleLine = IO.readlines(filePath).grep /AssemblyTitle/
37
AssemblyFile.process(filePath, "w+") do |file|
38
file.puts "using System.Reflection;"
39
file.puts "using System.Runtime.InteropServices;"
41
file.puts assemblyTitleLine
42
file.puts "[assembly: AssemblyDescription(\"#{@assemblyAttributes[:description]}\")]"
43
file.puts "[assembly: AssemblyConfiguration(\"\")]"
44
file.puts "[assembly: AssemblyCompany(\"#{@assemblyAttributes[:company]}\")]"
45
file.puts "[assembly: AssemblyProduct(\"#{@assemblyAttributes[:product]}\")]"
46
file.puts "[assembly: AssemblyCopyright(\"#{@assemblyAttributes[:copyright]}\")]"
47
file.puts "[assembly: AssemblyTrademark(\"\")]"
48
file.puts "[assembly: AssemblyCulture(\"\")]"
49
file.puts "[assembly: ComVisible(false)]"
50
file.puts "[assembly: AssemblyVersion(\"#{@assemblyAttributes[:version]}.#{@assemblyAttributes[:buildNumber]}\")]"
51
file.puts "[assembly: AssemblyFileVersion(\"#{@assemblyAttributes[:version]}.#{@assemblyAttributes[:buildNumber]}\")]"
58
def AssemblyFile.process(*args)