@@ -43,7 +43,7 @@ var AspnetGenerator = yeoman.generators.Base.extend({
43
43
} , {
44
44
name : 'Class Library' ,
45
45
value : 'classlib'
46
- } //,
46
+ } //,
47
47
// {
48
48
// name: 'Unit test project',
49
49
// value: 'unittest'
@@ -94,7 +94,7 @@ var AspnetGenerator = yeoman.generators.Base.extend({
94
94
this . templatedata . applicationname = props . applicationName ;
95
95
this . applicationName = props . applicationName ;
96
96
this . templatedata . guid = guid . v4 ( ) ;
97
-
97
+ this . templatedata . grunt = this . options . grunt || false ;
98
98
done ( ) ;
99
99
} . bind ( this ) ) ;
100
100
} ,
@@ -132,70 +132,42 @@ var AspnetGenerator = yeoman.generators.Base.extend({
132
132
133
133
case 'web' :
134
134
this . sourceRoot ( path . join ( __dirname , '../templates/projects/' + this . type ) ) ;
135
- this . fs . copy ( this . sourceRoot ( ) + '/../../gitignore.txt' , this . applicationName + '/.gitignore' ) ;
136
- this . fs . copyTpl ( this . sourceRoot ( ) + '/Startup.cs' , this . applicationName + '/Startup.cs' , this . templatedata ) ;
137
- this . fs . copyTpl ( this . sourceRoot ( ) + '/bower.json' , this . applicationName + '/bower.json' , this . templatedata ) ;
138
- this . fs . copyTpl ( this . sourceRoot ( ) + '/config.json' , this . applicationName + '/config.json' , this . templatedata ) ;
139
- this . fs . copyTpl ( this . sourceRoot ( ) + '/messageservice.cs' , this . applicationName + '/MessageService.cs' , this . templatedata ) ;
135
+ // Grunt or Gulp
140
136
if ( this . options . grunt ) {
141
- this . fs . copyTpl ( this . sourceRoot ( ) + '/_grunt_project.json' , this . applicationName + '/project.json' , this . templatedata ) ;
142
- this . fs . copyTpl ( this . sourceRoot ( ) + '/_grunt_package.json' , this . applicationName + '/package.json' , this . templatedata ) ;
143
- this . fs . copy ( this . sourceRoot ( ) + '/_gruntfile.js' , this . applicationName + '/gruntfile.js' ) ;
137
+ this . fs . copyTpl ( this . templatePath ( 'gruntfile.js' ) , this . applicationName + '/gruntfile.js' , this . templatedata ) ;
144
138
} else {
145
- this . fs . copyTpl ( this . sourceRoot ( ) + '/_gulp_project.json' , this . applicationName + '/project.json' , this . templatedata ) ;
146
- this . fs . copyTpl ( this . sourceRoot ( ) + '/_gulp_package.json' , this . applicationName + '/package.json' , this . templatedata ) ;
147
- this . fs . copy ( this . sourceRoot ( ) + '/_gulpfile.js' , this . applicationName + '/gulpfile.js' ) ;
139
+ this . fs . copyTpl ( this . templatePath ( 'gulpfile.js' ) , this . applicationName + '/gulpfile.js' , this . templatedata ) ;
148
140
}
149
- // models
150
- this . fs . copyTpl ( this . sourceRoot ( ) + '/models_accountview.cs' , this . applicationName + '/Models/AccountViewModels.cs' , this . templatedata ) ;
151
- this . fs . copyTpl ( this . sourceRoot ( ) + '/models_identity.cs' , this . applicationName + '/Models/IdentityModels.cs' , this . templatedata ) ;
152
- this . fs . copyTpl ( this . sourceRoot ( ) + '/models_manageview.cs' , this . applicationName + '/Models/ManageViewModels.cs' , this . templatedata ) ;
153
- // controllers
154
- this . fs . copyTpl ( this . sourceRoot ( ) + '/controllers_account.cs' , this . applicationName + '/Controllers/AccountController.cs' , this . templatedata ) ;
155
- this . fs . copyTpl ( this . sourceRoot ( ) + '/controllers_home.cs' , this . applicationName + '/Controllers/HomeController.cs' , this . templatedata ) ;
156
- this . fs . copyTpl ( this . sourceRoot ( ) + '/controllers_manage.cs' , this . applicationName + '/Controllers/ManageController.cs' , this . templatedata ) ;
157
- // compiler
158
- this . fs . copyTpl ( this . sourceRoot ( ) + '/compiler_preprocess_razorprecompilation.cs' , this . applicationName + '/Compiler/Preprocess/RazorPreCompilation.cs' , this . templatedata ) ;
159
- //migrations
160
- this . fs . copyTpl ( this . sourceRoot ( ) + '/migrations_000000000000000_createidentityschema.cs' , this . applicationName + '/Migrations/000000000000000_CreateIdentitySchema.cs' , this . templatedata ) ;
161
- this . fs . copyTpl ( this . sourceRoot ( ) + '/migrations_applicationdbcontextmodelsnapshot.cs' , this . applicationName + '/Migrations/ApplicationDbContextModelSnapshot.cs' , this . templatedata ) ;
162
- // properties
163
- this . fs . copyTpl ( this . sourceRoot ( ) + '/properties_appsettings.cs' , this . applicationName + '/Properties/AppSettings.cs' , this . templatedata ) ;
164
- // views
165
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_account_confirmemail.cshtml' , this . applicationName + '/Views/Account/ConfirmEmail.cshtml' , this . templatedata ) ;
166
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_account_externalloginconfirmation.cshtml' , this . applicationName + '/Views/Account/ExternalLoginConfirmation.cshtml' , this . templatedata ) ;
167
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_account_externalloginfailure.cshtml' , this . applicationName + '/Views/Account/ExternalLoginFailure.cshtml' , this . templatedata ) ;
168
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_account_forgotpassword.cshtml' , this . applicationName + '/Views/Account/ForgotPassword.cshtml' , this . templatedata ) ;
169
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_account_forgotpasswordconfirmation.cshtml' , this . applicationName + '/Views/Account/ForgotPasswordConfirmation.cshtml' , this . templatedata ) ;
170
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_account_login.cshtml' , this . applicationName + '/Views/Account/Login.cshtml' , this . templatedata ) ;
171
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_account_register.cshtml' , this . applicationName + '/Views/Account/Register.cshtml' , this . templatedata ) ;
172
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_account_resetpassword.cshtml' , this . applicationName + '/Views/Account/ResetPassword.cshtml' , this . templatedata ) ;
173
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_account_resetpasswordconfirmation.cshtml' , this . applicationName + '/Views/Account/ResetPasswordConfirmation.cshtml' , this . templatedata ) ;
174
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_account_sendcode.cshtml' , this . applicationName + '/Views/Account/SendCode.cshtml' , this . templatedata ) ;
175
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_account_verifycode.cshtml' , this . applicationName + '/Views/Account/VerifyCode.cshtml' , this . templatedata ) ;
176
-
177
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_home_contact.cshtml' , this . applicationName + '/Views/Home/Contact.cshtml' , this . templatedata ) ;
178
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_home_about.cshtml' , this . applicationName + '/Views/Home/About.cshtml' , this . templatedata ) ;
179
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_home_index.cshtml' , this . applicationName + '/Views/Home/Index.cshtml' , this . templatedata ) ;
180
-
181
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_manage_addphonenumber.cshtml' , this . applicationName + '/Views/Manage/AddPhoneNumber.cshtml' , this . templatedata ) ;
182
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_manage_changepassword.cshtml' , this . applicationName + '/Views/Manage/ChangePassword.cshtml' , this . templatedata ) ;
183
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_manage_index.cshtml' , this . applicationName + '/Views/Manage/Index.cshtml' , this . templatedata ) ;
184
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_manage_managelogins.cshtml' , this . applicationName + '/Views/Manage/ManageLogins.cshtml' , this . templatedata ) ;
185
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_manage_removelogin.cshtml' , this . applicationName + '/Views/Manage/RemoveLogin.cshtml' , this . templatedata ) ;
186
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_manage_setpassword.cshtml' , this . applicationName + '/Views/Manage/SetPassword.cshtml' , this . templatedata ) ;
187
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_manage_verifyphonenumber.cshtml' , this . applicationName + '/Views/Manage/VerifyPhoneNumber.cshtml' , this . templatedata ) ;
188
-
189
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_shared_error.cshtml' , this . applicationName + '/Views/Shared/Error.cshtml' , this . templatedata ) ;
190
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_shared_layout.cshtml' , this . applicationName + '/Views/Shared/_Layout.cshtml' , this . templatedata ) ;
191
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_shared_loginpartial.cshtml' , this . applicationName + '/Views/Shared/_LoginPartial.cshtml' , this . templatedata ) ;
192
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_shared_validationscriptspartial.cshtml' , this . applicationName + '/Views/Shared/_ValidationScriptsPartial.cshtml' , this . templatedata ) ;
193
-
194
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_globalimport.cshtml' , this . applicationName + '/Views/_GlobalImport.cshtml' , this . templatedata ) ;
195
- this . fs . copyTpl ( this . sourceRoot ( ) + '/views_viewstart.cshtml' , this . applicationName + '/Views/_ViewStart.cshtml' , this . templatedata ) ;
196
-
197
- /// wwwroot
198
- this . directory ( this . templatePath ( '/wwwroot' ) , this . destinationPath ( this . applicationName + '/wwwroot' ) ) ;
141
+ // individual files (configs, etc)
142
+ this . fs . copy ( this . templatePath ( '.bowerrc' ) , this . applicationName + '/.bowerrc' ) ;
143
+ this . fs . copy ( this . sourceRoot ( ) + '/../../gitignore.txt' , this . applicationName + '/.gitignore' ) ;
144
+ this . fs . copyTpl ( this . templatePath ( 'bower.json' ) , this . applicationName + '/bower.json' , this . templatedata ) ;
145
+ this . fs . copyTpl ( this . templatePath ( 'config.json' ) , this . applicationName + '/config.json' , this . templatedata ) ;
146
+ this . fs . copy ( this . templatePath ( 'hosting.ini' ) , this . applicationName + '/hosting.ini' ) ;
147
+ this . fs . copyTpl ( this . templatePath ( 'package.json' ) , this . applicationName + '/package.json' , this . templatedata ) ;
148
+ this . fs . copyTpl ( this . templatePath ( 'project.json' ) , this . applicationName + '/project.json' , this . templatedata ) ;
149
+ this . fs . copy ( this . templatePath ( 'README.md' ) , this . applicationName + '/README.md' ) ;
150
+ this . fs . copyTpl ( this . templatePath ( 'Startup.cs' ) , this . applicationName + '/Startup.cs' , this . templatedata ) ;
151
+ // Controllers
152
+ this . fs . copyTpl ( this . templatePath ( 'Controllers/AccountController.cs' ) , this . applicationName + '/Controllers/AccountController.cs' , this . templatedata ) ;
153
+ this . fs . copyTpl ( this . templatePath ( 'Controllers/HomeController.cs' ) , this . applicationName + '/Controllers/HomeController.cs' , this . templatedata ) ;
154
+ this . fs . copyTpl ( this . templatePath ( 'Controllers/ManageController.cs' ) , this . applicationName + '/Controllers/ManageController.cs' , this . templatedata ) ;
155
+ // Migrations
156
+ this . fs . copyTpl ( this . templatePath ( 'Migrations/00000000000000_CreateIdentitySchema.Designer.cs' ) , this . applicationName + '/Migrations/00000000000000_CreateIdentitySchema.Designer.cs' , this . templatedata ) ;
157
+ this . fs . copyTpl ( this . templatePath ( 'Migrations/00000000000000_CreateIdentitySchema.cs' ) , this . applicationName + '/Migrations/00000000000000_CreateIdentitySchema.cs' , this . templatedata ) ;
158
+ this . fs . copyTpl ( this . templatePath ( 'Migrations/ApplicationDbContextModelSnapshot.cs' ) , this . applicationName + '/Migrations/ApplicationDbContextModelSnapshot.cs' , this . templatedata ) ;
159
+ // Models
160
+ this . fs . copyTpl ( this . templatePath ( 'Models/AccountViewModels.cs' ) , this . applicationName + '/Models/AccountViewModels.cs' , this . templatedata ) ;
161
+ this . fs . copyTpl ( this . templatePath ( 'Models/IdentityModels.cs' ) , this . applicationName + '/Models/IdentityModels.cs' , this . templatedata ) ;
162
+ this . fs . copyTpl ( this . templatePath ( 'Models/ManageViewModels.cs' ) , this . applicationName + '/Models/ManageViewModels.cs' , this . templatedata ) ;
163
+ // Services
164
+ this . fs . copyTpl ( this . templatePath ( 'Services/MessageServices.cs' ) , this . applicationName + '/Services/MessageServices.cs' , this . templatedata ) ;
165
+ // Views - the views does not include any direct imports, so we can just copy content 1-to-1
166
+ // but tests cover all individual files, templates and partials
167
+ this . fs . copy ( this . templatePath ( 'Views/**/*' ) , this . applicationName + '/Views' ) ;
168
+ // wwwroot - the content in the wwwroot does not include any direct references or imports
169
+ // So again it is copied 1-to-1 - but tests cover list of all files
170
+ this . fs . copy ( this . templatePath ( 'wwwroot/**/*' ) , this . applicationName + '/wwwroot' ) ;
199
171
break ;
200
172
case 'nancy' :
201
173
this . sourceRoot ( path . join ( __dirname , '../templates/projects/' + this . type ) ) ;
0 commit comments