在命令行中创建项目时,如何使用code模板中的android?如何使用、命令行、模板、项目

2023-09-05 07:33:33 作者:相濡以沫"

我已经使用的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文档 How我执行红宝石模板文件(ERB)没有命令行的Web服务器? ERB documentation How do I execute ruby template files (ERB) without a web server from command line?