Giter VIP home page Giter VIP logo

watch's Introduction

watch

Creates a completion server and rebuilds the project on source file changes.
Requires Haxe 4.2+

Usage

lix +lib watch

Append the library to the haxe build command:

haxe build.hxml -lib watch

Important: Do not add this library to any hxml or config read by your IDE, autocompletion will not function.

Alternatively, just run it:

lix watch build.hxml # (requires lix 15.11+)

Defines

All of these are optional.

Define Description
-D watch.run=(string) command to execute on successful builds
-D watch.port=(integer) use this port for the completion server
-D watch.connect connect to a running completion server (use with watch.port)
-D watch.excludeRoot exclude watching the root directory (see #3)
-D watch.exclude=(string) exclude this path from the watcher (can be repeated for multiple paths)
-D watch.include=(string) include this path in the watcher (can be repeated for multiple paths)
-D watch.verbose extra log before and after every build

Example

Compiles test.js and runs the scripts with node on successful builds.

haxe --main Main --library hxnodejs --js test.js --library watch -D watch.run="node test.js"

watch's People

Contributors

benmerckx avatar sacramentix avatar

Stargazers

Beshoy Kamel avatar Moritz Brückner avatar  avatar Michael Miriti avatar Joey avatar Anders Nissen avatar Sebastian Thomschke avatar Cédric Belin avatar Datee avatar

Watchers

James Cloos avatar  avatar  avatar

watch's Issues

It does not always work with the PHP compilation target

No matter how hard I try, I can't get this library to work properly.

On CentOS 8, only the first build is triggered, the next builds are not triggered: I successfully get the "Build completed in Xs" message when launching the command (i.e. haxe build.hxml -lib watch or lix watch build.hxml), but if I modify a file, no further build is launched.

On Windows 10, the command either exits or fails:

  • haxe build.hxml -lib watch: no "Build completed in Xs" message.
  • lix watch build.hxml: results in Failed to invoke 'haxelib run-dir watch [...]/haxe_libraries/watch/0.0.5/haxelib build.hxml' because Error: Command failed: haxelib run-dir watch [...]/haxe_libraries/watch/0.0.5/haxelib build.hxml.

Any idea how to make it work?
My environment: Haxe 4.2.4 with lix 15.11.4 and watch 0.0.5.

running hashlink after watch won't close previous hl process

Hello,

I'm using watch to start a hl process after the build:

haxe compile.hxml -lib watch -D watch.excludeRoot -D watch.run="hl hello.hl"

It works well, on file save it's built again and a new hl process is executed, but it will keep the previous hl process running (in my case a windows created with heaps.io).

Is there any solution to close the process invoked with watch.run before running it again?

If no I'm happy to contribute

Thanks

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.