在命令行中创建项目时,如何使用code模板中的android? [英] How can I use code template in android when creating project from command line?

查看:193
本文介绍了在命令行中创建项目时,如何使用code模板中的android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用的Andr​​oid code模板,如空白的活动,登录活动等,我想在创建命令行项目中使用这些模板。我怎样才能做到这一点?

I have used android code templates in eclipse such as blank activity,login activity etc. I want to use these templates while creating project from command line. How can I do this?

推荐答案

您可以编写和渲染这些模板(或您要创建的任何其他模板)使用Ruby的的 ERB 宝石。

You can write and render these templates (or any other template you want to create) using Ruby's ERB gem.

http://www.ictforu.com/index.php /Ruby/erb-ruby.html

再培训局的缩写,嵌入式红宝石

ERB is an abbreviation for Embedded Ruby

再培训局的Ruby的功能,使用户可以动态生成任何   实物模板文本。模板结合纯文本   红宝石code变量替换和流量控制,这使得它们   容易编写和维护。

ERB is a feature of Ruby that enables user to dynamically generate any kind of text from templates. The templates combine plain text with Ruby code for variable substitution and flow control, which makes them easy to write and maintain.

ERB常用于滑轨平台以生成网页,它是   也可用于生成XML文件,源$ C ​​$ C等。

ERB is commonly used in Rails platform to generate the webpages, It is also used in generating XML files, Source code, etc.

尽管这是相当常见的的Ruby on Rails 你可以使用它,无论你想要的; - )

Although it's quite common in Ruby on Rails you can use it wherever you want ;-)

我建议你检查:

  • ERB文档
  • <一个href="http://stackoverflow.com/questions/980547/how-do-i-execute-ruby-template-files-erb-without-a-web-server-from-command-lin">How我执行红宝石模板文件(ERB)没有命令行的Web服务器?
  • ERB documentation
  • How do I execute ruby template files (ERB) without a web server from command line?

这篇关于在命令行中创建项目时,如何使用code模板中的android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆