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,如需转载请自行联系原作者

目录
相关文章
|
前端开发 Java 数据库
MVC项目导入
MVC项目导入
46 0
|
3月前
|
设计模式 前端开发 Java
Spring MVC——项目创建和建立请求连接
MVC是一种软件架构设计模式,将应用分为模型、视图和控制器三部分。Spring MVC是基于MVC模式的Web框架,通过`@RequestMapping`等注解实现URL路由映射,支持GET和POST请求,并可传递参数。创建Spring MVC项目与Spring Boot类似,使用`@RestController`注解标记控制器类。
51 1
Spring MVC——项目创建和建立请求连接
|
2月前
|
存储 前端开发 数据可视化
在实际项目中,如何选择使用 Flux 架构或传统的 MVC 架构
在实际项目中选择使用Flux架构或传统MVC架构时,需考虑项目复杂度、团队熟悉度和性能需求。Flux适合大型、高并发应用,MVC则适用于中小型、逻辑简单的项目。
|
3月前
|
前端开发 Java 应用服务中间件
【Spring】Spring MVC的项目准备和连接建立
【Spring】Spring MVC的项目准备和连接建立
66 2
|
5月前
|
前端开发 Java 测试技术
单元测试问题之在Spring MVC项目中添加JUnit的Maven依赖,如何操作
单元测试问题之在Spring MVC项目中添加JUnit的Maven依赖,如何操作
|
8月前
|
前端开发 JavaScript Java
springboot 出现 Cannot resolve MVC View ‘index‘ 问题解决办法,前后端不分离项目前端文件存放位置,已经如何访问
springboot 出现 Cannot resolve MVC View ‘index‘ 问题解决办法,前后端不分离项目前端文件存放位置,已经如何访问
851 1
|
消息中间件 前端开发 Java
GitHub标星30k!基于Spring MVC Mybatis分布式开发系统-zheng项目
zheng项目不仅仅是一个开发架构,而是努力打造一套从 前端模板 - 基础框架 - 分布式架构 - 开源项目 - 持续集成 - 自动化部署 - 系统监测 - 无缝升级 的全方位J2EE企业级开发解决方案。
|
消息中间件 前端开发 Java
GitHub标星30k!基于Spring MVC Mybatis分布式开发系统-zheng项目
前言 zheng项目不仅仅是一个开发架构,而是努力打造一套从 前端模板 - 基础框架 - 分布式架构 - 开源项目 - 持续集成 - 自动化部署 - 系统监测 - 无缝升级 的全方位J2EE企业级开发解决方案。
120 0
|
存储 前端开发 安全
SpringBoot项目中MVC使用--【JSB系列之010】
SpringBoot项目中MVC使用--【JSB系列之010】
|
缓存 网络协议
通过ARP协议实验,设置错误的IP和MAC地址的静态绑定项目,会使得两台主机之间无法通信,而删除该项目后可恢复通信,分析其原因。
通过ARP协议实验,设置错误的IP和MAC地址的静态绑定项目,会使得两台主机之间无法通信,而删除该项目后可恢复通信,分析其原因。
269 0