Skip to content

haxed + hScript

February 24, 2010

I am dogfooding haxed on my own projects which provides impetus for bugfixing and improvements.

The latest feature is the addition of hScript (a haxe like scripting language writted by Nicholas Cannasse).

This allows the build file to call out to the haxe runtime for useful information, e.g. which system it’s running on etc. hScript has variables, looping, conditionals etc.

Here’s an example build file:



# a haxed file with embedded hScript

---
project:
    name:               myproject
    website:            https://blackdog66.wordpress.com
    version:            0.5
    comments:           blah
    description:        blah
    author:             blackdog
    author-email:       blackdog66@gmail.com
    tags:               blah
    license:            Restricted

---
shared:
        paths:      system/src/core
                    system/src/game
                    system/src/node
                    system/Std
                    sites/myproject
                           
---

pack:
    include:    ./
    exclude:    tmp-stage
                run-time
                shared
                myproject.zip

---

build: 
      name:             AccountConfig
      class-path:       :: section("shared").paths ::
      target:           js 
      target-file:      tmp-stage/sites/myproject/AccountConfig.js
      main-class:       AccountConfig
      options:          -D nodejs -D ACCOUNTSERVER
      woot:             :: if (true)
                           Os.env("HAXE_LIBRARY_PATH") ; 
                           else
                           "nice one laddie"
                        ::
                       
---

build:
      name:             GameConfig
      class-path:       :: section("shared").paths ::
      target:           js 
      target-file:      tmp-stage/sites/myproject/GameConfig.js
      main-class:       GameConfig
      post-task:        compileSite myproject local
      options:          -D nodejs -D ACCOUNTCLIENT -D GAMESERVER
      
---

task:
        name:           compileSite
        class-path:     :: section("shared").paths ::
                        
        params:         site= myproject
                        target=local
        main-class:     system.Tasks
        depends:        templo


---

task: # get node.js
        name:           getRuntime
        class-path:     :: section("shared").paths ::
        params:         tag=v0.1.30 # get this tag
        main-class:     system.Tasks
        depends:        templo

---
task:
      name:             start
      class-path:       :: section("shared").paths ::
      params:           site= :: build("AccountConfig").woot ::
                        server=:: 
                                  var s="";
                                  for (i in 0...5) 
                                  s += "blah";
                                  s;
                                  ::
      main-class:       system.Services




Advertisements

From → haxe

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: