Export ASP.NET MVC Application Source Code for PhoneGap
asp.net, asp.net-mvc, code-generation, cordova, html-generation
Solution
This morning, we decided to let ASP.NET MVC render a single view containing all our application's HTML which references several JavaScript files and CSS stylesheets. We then automatically grab the rendered HTML source and copy an `index.html` into a certain export folder on our local machine. That folder is ready to be deployed because it contains only one HTML file and additional JavaScript and CSS resources – exactly what PhoneGap expects.
Problem
My team and I are currently developing an application for both Android and iOS using ASP.NET MVC 4, HTML5, and PhoneGap. The development works perfectly fine; however, one question remains unanswered: What is the recommended approach to generate the three files PhoneGap needs (one HTML page, one JavaScript file, and one CSS stylesheet) from our MVC solution? Would you recommend using a Razor template-based approach? Or would you simply automatically copy the output HTML source after each build? Or would you suggest something completely else?