Giter Club home page Giter Club logo

generator-hex's Introduction

generator-hex

Project generator for hexMachina framework

Installation

First, install Yeoman and generator-hex using npm (we assume you have pre-installed node.js).

npm install -g yo
npm install -g https://github.com/DoclerLabs/generator-hex.git

Usage

FlashDevelop plugin

The easiest way to use the generator is by installing the hexMachina FlashDevelop plugin.

Menu

Command line

To get started, open up the command line / terminal and call the hexMachina generator like this:

yo hex

Yeoman will greet you and ask what you want to generate: generator-hex

Just choose the generator you want and answer yeoman's questions.

You can also run a sub-generator directly like this:

yo hex:module

There are the following two different kinds of generators for hexMachina:

Project generator

The project generator gets you started by generating the basic project: Project generator

It can create some source files and either FlashDevelop project files or hxml files.

File generators

All the other generators are file generators. They are designed to be used on an existing project.

You should not run them from your project folder, but from your source folder or from a subfolder of your source folder instead. See the example below for more info.

Example

Generating the project

So to start a project, create a new folder first:

mkdir example
cd example

Then you just run the project generator:

yo hex:project

After that your folder structure should look similar to this one (depending on which target and project type you chose):

.
├── bin
│   └── index.html
├── src
│   └── com
│       └── test
│           └── application
│               ├── configuration
│               │   ├── context.xml
│               │   ├── ModuleConfiguration.xml
│               │   ├── ServiceConfiguration.xml
│               │   └── ViewConfiguration.xml
│               └── Main.hx
└── yeoman_test.hxproj

Generating a file

Now you want to add some files to this. Let's say you want to create a new module. You also want this module to be in the com.test.application package. To put it there, change into the package directory and run the generator:

cd src/com/test/application
yo hex:module

The first thing it will ask you is the package you are in. In this case you should enter:

com.test.application

You could also pass it as a command line option when running the generator, like this:

yo hex:module --currentPackage=com.test.application

The next thing you should enter is a list of modules you want to create. For example:

Test,stub.Example

After that, you will be asked some questions about the individual modules. For now, just answer no every time.

The generator should create four new files within your package directory:

.
├── stub
│   ├── ExampleModule.hx
│   └── IExampleModule.hx
└── test
    ├── ITestModule.hx
    └── TestModule.hx

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.