Introducing Templify 一个mvc S#ARP项目生成工具

简介:

在这里,简单说一点注意的地方,其它的只能等有时间再翻译了。

templify安装完之后,只能是在文件夹上右键,才能看到templify的菜单。 

其它的使用就比较简单了。 

原文地址:

http://blog.endjin.com/2010/10/introducing-templify/

 

In my last post I talked about the philosophy of “Work Smarter, Not Harder”; it’s a very simple mantra that can be described in three simple steps:

DoRecogniseCodify.

This philosophy is at the very core of what we do at endjin so we decided to share the knowledge with the community by releasing, with an open source license, a series of tools and framework under the umbrella of “Work Smarter, Not Harder”.

The first tool is called Templify and it aims to solve one simple problem and solve it well:

Every project starts the same way,
You create a place to put Solution Artefacts
On one file system
On one computer

That’s it. It’s a simple problem. It’s a process that developers all over the world will do hundreds of thousands of times a day. The real issue is that it’s a wasteful process. Within the Microsoft ecosystem – it’s a problem that really hasn’t been solved because Microsoft (and in particular Visual Studio) believes that the story starts and ends within the IDE. You create a Project which automatically creates a wrapping solution – but you have no control over the solution structure. A new Visual Studio solution doesn’t take into account best practices such as a branchable folder structure or how best to organise your referenced assemblies, where your automated build process should be located, or which oft reusable frameworks and tools you use in every project.

Templify elegantly solves the problem by recognising where the process actually starts – inside Windows Explorer. Templify has two modes – Create and Deploy. In Create mode you can take a pre-existing solution and turn it into a deployable template. You do this by first installing Templify, then navigating to the parent folder of the solution you want to Templify inside Windows Explorer. In the following example we are using the default assets from Sharp Architecture 1.6:

folder-to-templify

Next, right click on the folder and display the context menu. Select the “Templify This Folder” option:

templify-this-folder

This will launch the Templify UI, which will ask you to fill in the following details:

templify-this-folder-default-screen

In the token field you should enter the repeating token (the top namespace identifier)  that will be replaced with a new value when the package will be deployed. In the sample above the repeating token is “SA169” which is the top level namespace and solution name used within Sharp Architecture 1.6. Templify UI is built using Caliburn Micro and takes advantage of the convention based databinding and validation within that framework. For example until you enter values in all the required fields the “Templify” button will be disabled:

templify-this-folder-no-version-number-screen

But once you have entered a valid version number the “Templify” button is now enabled:

templify-this-folder-filled-in-screen

The create screen also allows you to manage which files and folders you want to exclude from the template package creation process – for example you would not like StyleCop.Cache files, .User files or bin and obj folders being included in your template as these are temporary build artefacts – or Git / SVN versioning folders.

templify-this-folder-manage-exclusions

Once you have entered all your settings you can click the “Templify” button and the templification process will begin. Progress is displayed via a progress bar and a status message telling which step is occurring:

templify-this-folder-templifying

Templify has the following steps:

Build Package File Manifest, Build Package, Clone Package, Tokenise Package Contents, Tokenise Package Structure, Creating Package Archive, Clean Up Temporary Files.

When the solution has been templified and turned into a package a toast will appear notifying you that the process has been successful. Packages are created at the following location:

C:\%USER%\AppData\Roaming\Endjin\Templify\repo

Packages are created using the wonderful 7Zip format but with an extension changed to .pkg. If you want to peek inside a package simply open it with 7Zip.

templify-this-folder-package-created-and-deployed

The second mode Templify supports is Deploy mode. In Windows Explorer, select an empty folder that you want to deploy your template to. Right click on the folder and select “Templify Here”

templify-here

This will spawn a new instance of Templify that knows about the folder you just highlighted. It will ask you to select a template and to enter the new name of your solution:

templify-here-default-screen

By default Templify ships with Sharp Architecture 1.6:

templify-here-available-packages

Again using Caliburn Micro’s convention based validation – the deploy button is disabled until you complete all the fields:

templify-here-enter-name

templify-here-deploy-template

This screen also allows you to manage existing packages – by clicking on the “Manage Templates” button – which will spawn a dialog that will allow you to delete any of the packages within the repository

templify-here-manage-packages

Once you’ve clicked “Deploy Template” a progress bar will appear showing the progress of the steps Templify is going through to deploy the package (which are essentially the reverse of the Create mode):

Extract Files From Package, Tokenise Package Structure, Tokenise Package Contents, Clean Up Temporary Files.

templify-here-templifying

Once the package has been successfully deployed another toast will appear to notify you.

templifyhere-sucess-notification

And now you should be up and running with a complete customised version of your template, which contains an automated build, referenced assemblies, projects etc.

In future posts we’ll cover using Templify from the command line, how you can integrate it into your CI process to automatically create a package as a build artefact.

Hopefully Templify will help you Work Smarter, Not Harder.

@HowardvRooijen | @endjin | @templify


本文转自火地晋博客园博客,原文链接:http://www.cnblogs.com/yelaiju/archive/2013/06/04/3118050.html,如需转载请自行联系原作者

目录
相关文章
|
6月前
|
前端开发 Java 数据库
MVC项目导入
MVC项目导入
22 0
|
3月前
|
前端开发 JavaScript Java
springboot 出现 Cannot resolve MVC View ‘index‘ 问题解决办法,前后端不分离项目前端文件存放位置,已经如何访问
springboot 出现 Cannot resolve MVC View ‘index‘ 问题解决办法,前后端不分离项目前端文件存放位置,已经如何访问
122 0
|
7月前
|
消息中间件 前端开发 Java
GitHub标星30k!基于Spring MVC Mybatis分布式开发系统-zheng项目
zheng项目不仅仅是一个开发架构,而是努力打造一套从 前端模板 - 基础框架 - 分布式架构 - 开源项目 - 持续集成 - 自动化部署 - 系统监测 - 无缝升级 的全方位J2EE企业级开发解决方案。
|
8月前
|
消息中间件 前端开发 Java
GitHub标星30k!基于Spring MVC Mybatis分布式开发系统-zheng项目
前言 zheng项目不仅仅是一个开发架构,而是努力打造一套从 前端模板 - 基础框架 - 分布式架构 - 开源项目 - 持续集成 - 自动化部署 - 系统监测 - 无缝升级 的全方位J2EE企业级开发解决方案。
84 0
|
8月前
|
存储 前端开发 安全
SpringBoot项目中MVC使用--【JSB系列之010】
SpringBoot项目中MVC使用--【JSB系列之010】
|
10月前
|
存储 JSON 前端开发
【Spring MVC学习笔记 五】SpringMVC框架整合Jackson工具
【Spring MVC学习笔记 五】SpringMVC框架整合Jackson工具
311 0
|
前端开发 Java 应用服务中间件
springMvc4-第一个spring mvc项目
springMvc4-第一个spring mvc项目
70 0
|
网络协议 Linux 开发工具
kali arp-scan网络扫描工具 扫描局域网ip地址
作者主页:https://www.couragesteak.com/
kali arp-scan网络扫描工具 扫描局域网ip地址
|
开发框架 安全 前端开发
关于ASP.NET MVC 项目在本地vs运行响应时间过长无法访问时,解决方法!
关于ASP.NET MVC 项目在本地vs运行响应时间过长无法访问时,解决方法!
165 0
关于ASP.NET MVC 项目在本地vs运行响应时间过长无法访问时,解决方法!