serafim/haxe-watcher

此包已被废弃且不再维护。未建议替代包。

Haxe 语言监视器

安装: 0

依赖: 0

建议者: 0

安全: 0

星标: 3

监视者: 2

分支: 0

开放问题: 0

类型:composer-plugin

dev-master 2020-02-14 21:15 UTC

This package is auto-updated.

Last update: 2020-08-14 22:24:32 UTC


README

需求

  1. PHP >= 7.4
  2. Haxe 编译器(仅限本地开发使用)
  3. Composer

安装

  • composer require serafim/haxe-watcher

配置

使用 composer.json 文件中的 extra 部分进行配置

{
    "extra": {
        "haxe": {
            // Path to Haxe Compiler.
            //  - Information from the PATH environment variable 
            //    is read by default ("haxe" binary).
            "compiler": "/usr/bin/haxe",

            // Path to source files.
            //  - Information from the "autoload" (psr-0, psr-4, classmap) 
            //    section is read by default.
            "src": [
                "path/to/sources"
            ],
    
            // Number of milliseconds to check file updates.
            //  - 60000 by default
            "watch": 60000,
    
            // The name of the configuration file generated for 
            // the Haxe Compiler.
            //  - "build.hxml" by default
            "config": "test.hxml"
        }
    }
}

使用

Haxe 编译器版本

$ composer haxe:version

运行 Haxe 监视器

$ composer haxe:watch

示例

项目结构

- app/
    - Main.hx
- composer.json

说明

  1. 使用以下代码创建 composer.json
{
    "require": {
        "serafim/haxe-watcher": "*"
    },
    "autoload": {
        "psr-4": {
            "app": "app"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}
  1. 使用以下代码创建 app/Main.hx

Main.hx 文件

module app;

class Main {
    static function main() {
        Sys.println("test");
    }
}
  1. 运行监视器: composer haxe:watch