4 class ProjectGenerator(NamedGeneratorBase
):
5 [Property(DotNet1
), Option('net-1.1', '1', 'Set the target framework to .NET 1.1/Mono 1.0. (Default 2.0)')]
7 [Property(VSFiles
), Option('vs', 'v', 'Generates Visual Studio project files [BETA]')]
10 [Property(AppGuid
)] _appGuid
= "{${Guid.NewGuid().ToString().ToUpper()}}"
11 [Property(TestGuid
)] _testGuid
= "{${Guid.NewGuid().ToString().ToUpper()}}"
16 MkDir("${Name}/app/controllers")
17 Process("app/controllers/ApplicationController.cs", "${Name}/app/controllers/ApplicationController.cs")
18 MkDir("${Name}/app/helpers")
19 MkDir("${Name}/app/models")
20 MkDir("${Name}/app/views")
21 MkDir("${Name}/app/views/layouts")
22 MkDir("${Name}/app/views/rescues")
24 MkDir("${Name}/config")
25 Process("config/Boot.cs", "${Name}/config/Boot.cs")
26 MkDir("${Name}/config/databases")
27 Process("config/databases/development.xml", "${Name}/config/databases/development.xml")
28 Process("config/databases/test.xml", "${Name}/config/databases/test.xml")
30 Process("default.build", "${Name}/default.build")
33 Process("doc/readme.txt", "${Name}/doc/readme.txt")
35 CopyDir("lib", "${Name}/lib")
36 CopyDir("../../../bin", "${Name}/lib/generator/bin")
37 CopyDir("../../../Generators", "${Name}/lib/generator/Generators")
38 FileInfo("${Name}/lib/generator/Generators/Config.boo").Delete()
39 Process("Config.boo", "${Name}/lib/generator/Generators/Config.boo")
45 MkDir("${Name}/public/content")
46 CopyDir("public/content", "${Name}/public/content")
47 Process("public/global.asax", "${Name}/public/global.asax")
48 Process("public/index.html", "${Name}/public/index.html")
49 Process("public/web.config", "${Name}/public/web.config")
51 MkDir("${Name}/script")
52 Process("script/console.boo", "${Name}/script/console.boo")
53 Copy("script/console", "${Name}/script")
54 Copy("script/console.bat", "${Name}/script")
55 Copy("script/generate", "${Name}/script")
56 Copy("script/generate.bat", "${Name}/script")
57 Copy("script/server", "${Name}/script")
58 Copy("script/server.bat", "${Name}/script")
59 Process("script/server.boo", "${Name}/script/server.boo")
60 Copy("script/migrate", "${Name}/script")
61 Copy("script/migrate.bat", "${Name}/script")
63 MkDir("${Name}/test/controllers")
64 Process("test/controllers/ControllerTestCase.cs", "${Name}/test/controllers/ControllerTestCase.cs")
65 MkDir("${Name}/test/helpers")
66 MkDir("${Name}/test/models")
67 Process("test/models/ActiveRecordTestCase.cs", "${Name}/test/models/ActiveRecordTestCase.cs")
71 vsVersion
= '2003' if DotNet1
72 Process("vs/${vsVersion}/app.csproj", "${Name}/app/app.csproj")
73 Process("vs/${vsVersion}/test.csproj", "${Name}/test/test.csproj")
74 Process("vs/${vsVersion}/solution.sln", "${Name}/${Name}.sln")
76 print "Run 'nant setup' from the base directory to setup the environment"
79 return 'Generates a new MonoRail project'