hxp

Cross-platform build tools for desktop, mobile, web and consoles
https://github.com/openfl/hxp

To install, run:

haxelib install hxp 1.3.0 

See using Haxelib in Haxelib documentation for more information.

README.md

MIT License Haxelib Version Build Status

HXP

Write scripts in Haxe, and execute them on Windows, macOS or Linux.

Basic Example

// script.hx
class Script {

    public function new () {
    
        trace ("Hello from my script");
        
        var hxml = new HXML ({ cp: ["src"], main: "Main", js: "bin/index.js" });
        hxml.build ();
        PlatformTools.launchWebServer ("bin");
        
    }
    
}

Running a Script

hxp looks for a script file in the current directory, or optionally, you can pass a directory or script path

cd path/with/script && hxp
hxp script.hx
hxp path/with/script

If you prefer to use multiple script files, HXP will prefer files which match the command name you are executing.

For example:

hxp build  # prefers "build.hx"
hxp run    # prefers "run.hx"

Example with Arguments

class Script extends hxp.Script {

    public function new () {
    
        super ();
        
        trace (command);
        trace (commandArgs);
        trace (flags.keys ());
        trace (defines.keys ());
        trace (options.keys ());
        
    }
    
}

When you extend hxp.Script, default argument parsing is included for you. Arguments which begin with a single dash (such as -debug) will be treated as a "flag", starting with -D is a "define", and starting with two dashes (such as --out-dir) is an "option". All other arguments will be considered a command (first), then command arguments.

For example:

hxp command arg1 arg2 -debug -Ddefine -Ddefine2=value --option=value

Using HXP works on Haxe 4 (using eval internally) or Haxe 3 (using Neko).

HXP includes convenience methods for working with file paths, directories, executing child processes and creating quality CLI tools.

The Lime and OpenFL use HXP to develop cross-platform tools for delivering consistent content on Windows, macOS, Linux, iOS, Android, tvOS, Flash, HTML5 and other environments.

License

HXP is free, open-source software under the MIT license.

Installation

You can easily install HXP with haxelib:

haxelib install hxp

Once installed, run the following command to install the hxp command alias:

haxelib run hxp --install-hxp-alias

Development Builds

Clone the HXP repository:

git clone https://github.com/openfl/hxp

Tell haxelib where your development copy of HXP is installed:

haxelib dev hxp hxp

To return to release builds:

haxelib dev hxp
Contributors
singmajesty
bowlerhat
Dimensionscape
Version
1.3.0
Published
1 year ago
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub