Automatic compile time tasks

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Automatic compile time tasks

Drakim
Greetings HaXe mailing list, my first entry here.

I've come to realize I'm doing a lot of boring repetitive work in my HaXe Flash projects. I use SamHaXe to generate my asset swf file. Whenever I want to include a new asset in my game, I have to put the asset in my asset folder, edit my asset.xml file to include this new asset file, run SamHaXe, copy the resulting asset swf file to my project folder, edit my project to include this asset in my asset collection class, and then run the HaXe compiler.

This is very tencious and boring, especially if I need tons of tons of small assets. I don't consider myself a newbie when it comes to programming, but I do know very little about the meta of programming. So I'm asking here before I waste a week reinventing the wheel, what sort of sorcery should I use to automate these actions? I realize that the easiest way out would probably be to make a shell script of some sort, but it would be nice if it could be done within HaXe so it works no matter where you compile it.
Reply | Threaded
Open this post in threaded view
|

Re: Automatic compile time tasks

Justin Donaldson-3
the hxml -cmd task is good for simple repetitive scripts and commands.  I might write a script that checks for new assets, automates all of the changes, and add it in as a command.  Makefiles are also a good approach if you have a lot of complex stage-by-stage builds that you don't want to repeat fully.

-Justin

On Sat, Apr 2, 2011 at 2:43 PM, Drakim <[hidden email]> wrote:
Greetings HaXe mailing list, my first entry here.

I've come to realize I'm doing a lot of boring repetitive work in my HaXe
Flash projects. I use SamHaXe to generate my asset swf file. Whenever I want
to include a new asset in my game, I have to put the asset in my asset
folder, edit my asset.xml file to include this new asset file, run SamHaXe,
copy the resulting asset swf file to my project folder, edit my project to
include this asset in my asset collection class, and then run the HaXe
compiler.

This is very tencious and boring, especially if I need tons of tons of small
assets. I don't consider myself a newbie when it comes to programming, but I
do know very little about the meta of programming. So I'm asking here before
I waste a week reinventing the wheel, what sort of sorcery should I use to
automate these actions? I realize that the easiest way out would probably be
to make a shell script of some sort, but it would be nice if it could be
done within HaXe so it works no matter where you compile it.

--
View this message in context: http://haxe.1354130.n2.nabble.com/Automatic-compile-time-tasks-tp6234433p6234433.html
Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Automatic compile time tasks

Jordo Odroj
I'm not exactly sure what your use case is but I've registered compile
time build actions (moving files around, analyzing resource
dependencies) at haxe.macro.Context.onGenerate time.
Look into this, and you might be able to accomplish what you want there.

On Sat, Apr 2, 2011 at 3:51 PM, Justin Donaldson <[hidden email]> wrote:

> the hxml -cmd task is good for simple repetitive scripts and commands.  I
> might write a script that checks for new assets, automates all of the
> changes, and add it in as a command.  Makefiles are also a good approach if
> you have a lot of complex stage-by-stage builds that you don't want to
> repeat fully.
>
> -Justin
>
> On Sat, Apr 2, 2011 at 2:43 PM, Drakim <[hidden email]> wrote:
>>
>> Greetings HaXe mailing list, my first entry here.
>>
>> I've come to realize I'm doing a lot of boring repetitive work in my HaXe
>> Flash projects. I use SamHaXe to generate my asset swf file. Whenever I
>> want
>> to include a new asset in my game, I have to put the asset in my asset
>> folder, edit my asset.xml file to include this new asset file, run
>> SamHaXe,
>> copy the resulting asset swf file to my project folder, edit my project to
>> include this asset in my asset collection class, and then run the HaXe
>> compiler.
>>
>> This is very tencious and boring, especially if I need tons of tons of
>> small
>> assets. I don't consider myself a newbie when it comes to programming, but
>> I
>> do know very little about the meta of programming. So I'm asking here
>> before
>> I waste a week reinventing the wheel, what sort of sorcery should I use to
>> automate these actions? I realize that the easiest way out would probably
>> be
>> to make a shell script of some sort, but it would be nice if it could be
>> done within HaXe so it works no matter where you compile it.
>>
>> --
>> View this message in context:
>> http://haxe.1354130.n2.nabble.com/Automatic-compile-time-tasks-tp6234433p6234433.html
>> Sent from the Haxe mailing list archive at Nabble.com.
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Automatic compile time tasks

James W. Hofmann
In reply to this post by Drakim
If you're on Windows and don't mind Python, try moving your project over to sambuild. It's available on haxelib, and I made it to automate exactly this kind of asset embedding task.

If you aren't on Windows, it's still worth a shot :)
Reply | Threaded
Open this post in threaded view
|

Re: Automatic compile time tasks

Drakim
Thanks, I'll look into both options.