2 * @class Ext.generator.Application
3 * @extends Ext.generator.Base
4 * Generates a full application
6 Ext.generator.Application = Ext.extend(Ext.generator.Base, {
8 this.headline('Generating the ' + this.name + ' application');
10 this.createDirectoryStructure();
11 this.copyApplicationFiles();
17 * Copies all files required for jasmine to the lib directory
19 copyJasmine: function() {
20 Logger.log("Copying dependencies...");
22 this.mkdir('lib/jasmine', 'lib/sencha-jasmine', 'lib/sencha-jasmine/matchers');
24 this.file('lib/jasmine/jasmine.css');
25 this.file('lib/jasmine/jasmine-html.js');
26 this.file('lib/jasmine/jasmine.js');
27 this.file('lib/jasmine/MIT.LICENSE');
29 this.file('lib/sencha-jasmine/sencha-jasmine.css');
30 this.file('lib/sencha-jasmine/sencha-jasmine.js');
31 this.file('lib/sencha-jasmine/matchers/Model.js');
32 this.file('lib/sencha-jasmine/matchers/Controller.js');
36 * Copies all static application files to their destination directories
38 copyApplicationFiles: function() {
39 Logger.log("Copying files...");
41 this.file('index.html');
42 this.file('app/routes.js');
43 this.file('public/resources/css/application.css');
44 this.file('test/unit/index.html');
45 this.file('test/unit/SpecOptions.js');
46 this.file('test/unit/.htaccess');
48 this.template('Application', this, "app/app.js");
49 this.template('Viewport', this, "app/views/Viewport.js");
53 * Creates all of the necessary directories for a new app
55 createDirectoryStructure: function() {
56 Logger.log("Creating directories...");
58 'app', 'app/models', 'app/controllers', 'app/views', 'lib',
59 'public', 'public/resources/images', 'public/resources/css',
60 'test', 'test/acceptance', 'test/fixtures', 'test/unit',
61 'test/unit/models', 'test/unit/controllers', 'test/unit/views'
66 * Copies all files/folders required for JSBuilder into the lib directory
68 copyJSBuilder: function() {
69 Logger.log("Copying JSBuilder");
70 this.mkdir("lib/JSBuilder", "lib/JSBuilder/bin");
71 this.file("lib/JSBuilder/bin/Dispatch.js");
73 var builderDirs = ['bin', 'jsdb', 'src', 'tests', 'ycompressor'],
74 length = builderDirs.length,
77 for (i = 0; i < length; i++) {
78 this.copyDir(builderDirs[i], "lib/JSBuilder");
81 Logger.log(" Copying JSBuilder files");
82 this.file("sencha.sh");
85 decodeArgs: function(args) {
87 this.basePath = args[1] || this.name;
91 Ext.regGenerator('app', Ext.generator.Application);