14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/wooget/template/visual_studio.rb', line 14
def create_project options={}
raise "name not provided" unless options[:name]
@options = options @options[:guid] ||= `uuidgen`.chomp
if @options[:src]
@options[:src][:guid] ||= `uuidgen`.chomp
@options[:src][:name] ||= options[:name]
@options[:src][:files]||= []
@options[:src][:files] << "DummyClass.cs"
end
template("assemblyinfo.erb", "#{options[:name]}/src/#{options[:name]}/Properties/AssemblyInfo.cs")
template("class.erb", "#{options[:name]}/src/#{options[:name]}/DummyClass.cs")
template("csproj.erb", "#{options[:name]}/src/#{options[:name]}/#{options[:name]}.csproj")
create_file("#{options[:name]}/src/#{options[:name]}/#{options[:name]}.csproj.paket.references", "Wooga.Unity.DLLs")
template("paket.binary.template.erb", "#{options[:name]}/src/#{options[:name]}/#{options[:name]}.csproj.paket.template")
if @options[:tests]
@options[:tests][:guid] ||= `uuidgen`.chomp
@options[:tests][:files]||= []
@options[:tests][:name] ||= options[:name]
@options[:tests][:files] << "DummyTest.cs"
@options[:tests][:projects]||= []
src_project = {:guid => @options[:src][:guid], :name => @options[:src][:name], :relative_location => "../src/#{options[:name]}/#{options[:name]}.csproj"}
@options[:tests][:projects] << src_project
template("test_file.erb", "#{options[:name]}/tests/DummyTest.cs")
template("tests_csproj.erb", "#{options[:name]}/tests/#{options[:name]}.Tests.csproj")
template("tests_assemblyinfo.erb", "#{options[:name]}/tests/Properties/AssemblyInfo.cs")
template("paket.references.erb", "#{options[:name]}/tests/paket.references")
end
template("sln.erb", "#{options[:name]}/src/#{options[:name]}.sln")
end
|