Code Monkey home page Code Monkey logo

gckit's Introduction

Gckit-CLI

Gckit-CLI代码生成的命令行工具,主要针对iOS(当然也支持自定义,比如DartJava)开发过程中Swift或者Objective-C语法的文件生成,可以通过一个简单的JSON文件即可生成对应的ViewControllerModelCell等文件,生成的文件类型、文件路径都可以自定义。一键生成最大的提高了开发效率,再也不用复制粘贴操作了,开发者只需关注业务代码的开发和 UI 界面的绘制。

安装

Node.js 环境

$ brew install node

更多安装方式可以参考Node.js 官方息息

安装完成后,可以使用以下命令检测是否安装成功:

$ node -v
v10.7.0
$ npm -v
6.4.1

安装 Gckit CLI 工具

$ npm install gckit -g

然后执行命令检测是否安装成功

$ gckit --help

使用

查看命令参数

$ gckit --help
Usage: gckit [options] [command] <command>

Options:
  -h, --help            output usage information

Commands:
  generate|g [options]  生成对应语言的文件
  config|c [options]    基本参数配置

  运行 gckit <command> --help 查看详细帮助信息.

简单尝试

执行 Shell 命令

$ gckit g product vc

然后会在当前目录下生成对应文件:

001

执行命令会相对于当前目录,根据默认配置生成Swift语言ViewController类型的文件

  • vc:指定生成的文件类型为ViewController
  • product:为输入的参数name
  • ggenerate的缩写,代表生成文件

体验一键生成

001

首先保证在tempJson文件夹下存在name"product"JSON文件

然后执行 Shell 命令:

$ gckit g product

默认提供的Swift模板,需要依赖三个开源库才可以编译通过:

 s.dependency 'UtilCore', '~> 0.1.0'
 s.dependency 'NetWorkCore', '~> 0.1.0'
 s.dependency 'EmptyDataView', '~> 0.1.0'

gckit's People

Contributors

seongbrave avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.