allegro_flare icon indicating copy to clipboard operation
allegro_flare copied to clipboard

Create "flare" Command Line Tool

Open MarkOates opened this issue 8 years ago • 1 comments

What would a flare command line tool do?

A flare command line tool would do some busy work that could otherwise be automated. Some examples:

  • Generate a new AllegroFlare project: flare new - currently this is done with flare_bootstrap
  • Generate boilerplate files in a project: flare generate factory Button - see below
  • Publish a release file: flare publish win32
  • Duplicate AllegroFlare dependency files into the local project tree - see below
  • Bundle a package for MacOS

Generators for Objects

It would be nice to easily create files or objects in the directory tree. If you wanted to create a new ButtonFactory in your project, you might create the files from the command line like this:

$> flare generate factory Button

and the flare generator would add the following files to your project tree...

include/factories/button_factory.h
src/factories/button_factory.cpp

... and these files would contain the appropriate boilerplate code.

(Note that these files could automatically be compiled with make and a obj/factories/ folder would be created if it didn't already exist - but this should be a feature in the Makefile and not the generator itself.)

Types of Generators

Generators might be made to create many different kinds of objects. Some include:

  • Factory
  • Model
  • Controller
  • Screen
  • UIWidget
  • Agent
  • Entity
  • EventEmitter
  • Helper

Simplify AllegroFlare Dependency in A Source Distribution

To simplify distribution of a project's source code, a list of dependent AllegroFlare files could be copied into the local project directory tree. A list of dependent header files can be aquired using gcc's -MM flag.

obj/%.o: src/%.cpp
	g++ -M -std=gnu++11 $< -I$(ALLEGRO_FLARE_DIR)/include -I$(ALLEGRO_DIR)/include -I./include | grep '$(ALLEGRO_FLARE_DIR)'

MarkOates avatar Jan 02 '17 20:01 MarkOates

Publish a source release - can be done with github.com/MarkOates/blast/blob/master/programs/create_source_release.cpp

MarkOates avatar Jun 26 '22 01:06 MarkOates