multi target best practices

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

multi target best practices

tom rhodes
Hi all,

just wondering what people are doing to compile to multiple targets from the one project/code base. do you have multiple hxml files and compile using the command line/ double clicking the hxml file?

i'm most interested in hitting cpp, flash and JS all from the one project/code base, but would also like to know if anyone is using one project that encompasses both client and server side stuff, and how they go about it. 

any info regarding organisation is welcome too :)

cheers,

tom.

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

Re: multi target best practices

Robin Palotai
I have a similar directory structure:

src
- client
- shared
- server

And then when compiling, I use -cp src/shared -cp src/client for
client compilation for example.
I have a separate build-client and build-server.hxml, each of them
possibly having more compilation units with --next

For more complicated / lengthy builds, you may want to use Ant + AntHx
(http://code.google.com/p/anthx/), which has dependency checking and
recompiles units only if required.

Also you should consider source version control - for tightly coupled
or infrequently changing client and server, you may have this in a
single repository.
Otherwise you may use separate repositories, referencing the
dependency repos (for example via svn:external or git submodule). But
this, unless designed properly, may become a hindrance, so be careful.

Robin

On Sat, Jan 29, 2011 at 3:50 PM, tom rhodes <[hidden email]> wrote:

> Hi all,
> just wondering what people are doing to compile to multiple targets from the
> one project/code base. do you have multiple hxml files and compile using the
> command line/ double clicking the hxml file?
> i'm most interested in hitting cpp, flash and JS all from the one
> project/code base, but would also like to know if anyone is using one
> project that encompasses both client and server side stuff, and how they go
> about it.
> any info regarding organisation is welcome too :)
> cheers,
> tom.
> --
> 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: multi target best practices

tom rhodes
nice, and if you were targetting flash, JS and cpp that's where you'd be using --next?


On 29 January 2011 17:23, Robin Palotai <[hidden email]> wrote:
I have a similar directory structure:

src
- client
- shared
- server

And then when compiling, I use -cp src/shared -cp src/client for
client compilation for example.
I have a separate build-client and build-server.hxml, each of them
possibly having more compilation units with --next

For more complicated / lengthy builds, you may want to use Ant + AntHx
(http://code.google.com/p/anthx/), which has dependency checking and
recompiles units only if required.

Also you should consider source version control - for tightly coupled
or infrequently changing client and server, you may have this in a
single repository.
Otherwise you may use separate repositories, referencing the
dependency repos (for example via svn:external or git submodule). But
this, unless designed properly, may become a hindrance, so be careful.

Robin

On Sat, Jan 29, 2011 at 3:50 PM, tom rhodes <[hidden email]> wrote:
> Hi all,
> just wondering what people are doing to compile to multiple targets from the
> one project/code base. do you have multiple hxml files and compile using the
> command line/ double clicking the hxml file?
> i'm most interested in hitting cpp, flash and JS all from the one
> project/code base, but would also like to know if anyone is using one
> project that encompasses both client and server side stuff, and how they go
> about it.
> any info regarding organisation is welcome too :)
> cheers,
> tom.
> --
> 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: multi target best practices

Lars Madson
In reply to this post by Robin Palotai

src
     db //SPOD objects - neko
     handler //handlers - neko
     js
     utils //multitarget or not
     [...] //other packages multitarget or not
     App.hx


With one hxml to compile server side, js (front, admin), hss, with some
--next to separate builds.

The App.hx is only the server side part of the application, the js have
is own enter point, actually two as I needed two separate js.
The hxml file on my developpement machine looks like this:

# Web
-debug
-cp src
-D local
-neko web/index.n
-main App.hx
-lib mtwin
-lib templo
-lib radpdf
#-lib hxGD
--next
# JS
-debug
-js web/js/main.js
-cp src
-main js.Main
--next
-debug
-js web/js/front.js
-cp src
-main js.Front
-lib feffects
--next
# HSS
-cmd cd web
-cmd hss css/style.hss
--next
-cmd hss css/stylefront.hss

A not for hss, I was not able to tell hss command an output directory,
so I had to put the hss the ouput directory and just run the command there.

Hope this help.
Laurent



Le 29/01/2011 17:23, Robin Palotai a écrit :

> I have a similar directory structure:
>
> src
> - client
> - shared
> - server
>
> And then when compiling, I use -cp src/shared -cp src/client for
> client compilation for example.
> I have a separate build-client and build-server.hxml, each of them
> possibly having more compilation units with --next
>
> For more complicated / lengthy builds, you may want to use Ant + AntHx
> (http://code.google.com/p/anthx/), which has dependency checking and
> recompiles units only if required.
>
> Also you should consider source version control - for tightly coupled
> or infrequently changing client and server, you may have this in a
> single repository.
> Otherwise you may use separate repositories, referencing the
> dependency repos (for example via svn:external or git submodule). But
> this, unless designed properly, may become a hindrance, so be careful.
>
> Robin
>
> On Sat, Jan 29, 2011 at 3:50 PM, tom rhodes<[hidden email]>  wrote:
>> Hi all,
>> just wondering what people are doing to compile to multiple targets from the
>> one project/code base. do you have multiple hxml files and compile using the
>> command line/ double clicking the hxml file?
>> i'm most interested in hitting cpp, flash and JS all from the one
>> project/code base, but would also like to know if anyone is using one
>> project that encompasses both client and server side stuff, and how they go
>> about it.
>> any info regarding organisation is welcome too :)
>> cheers,
>> tom.
>> --
>> 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: multi target best practices

tom rhodes
that's great info thanks


On 29 January 2011 18:16, Lars Madson <[hidden email]> wrote:

src
   db //SPOD objects - neko
   handler //handlers - neko
   js
   utils //multitarget or not
   [...] //other packages multitarget or not
   App.hx


With one hxml to compile server side, js (front, admin), hss, with some --next to separate builds.

The App.hx is only the server side part of the application, the js have is own enter point, actually two as I needed two separate js.
The hxml file on my developpement machine looks like this:

# Web
-debug
-cp src
-D local
-neko web/index.n
-main App.hx
-lib mtwin
-lib templo
-lib radpdf
#-lib hxGD
--next
# JS
-debug
-js web/js/main.js
-cp src
-main js.Main
--next
-debug
-js web/js/front.js
-cp src
-main js.Front
-lib feffects
--next
# HSS
-cmd cd web
-cmd hss css/style.hss
--next
-cmd hss css/stylefront.hss

A not for hss, I was not able to tell hss command an output directory, so I had to put the hss the ouput directory and just run the command there.

Hope this help.
Laurent



Le 29/01/2011 17:23, Robin Palotai a écrit :

I have a similar directory structure:

src
- client
- shared
- server

And then when compiling, I use -cp src/shared -cp src/client for
client compilation for example.
I have a separate build-client and build-server.hxml, each of them
possibly having more compilation units with --next

For more complicated / lengthy builds, you may want to use Ant + AntHx
(http://code.google.com/p/anthx/), which has dependency checking and
recompiles units only if required.

Also you should consider source version control - for tightly coupled
or infrequently changing client and server, you may have this in a
single repository.
Otherwise you may use separate repositories, referencing the
dependency repos (for example via svn:external or git submodule). But
this, unless designed properly, may become a hindrance, so be careful.

Robin

On Sat, Jan 29, 2011 at 3:50 PM, tom rhodes<[hidden email]>  wrote:
Hi all,
just wondering what people are doing to compile to multiple targets from the
one project/code base. do you have multiple hxml files and compile using the
command line/ double clicking the hxml file?
i'm most interested in hitting cpp, flash and JS all from the one
project/code base, but would also like to know if anyone is using one
project that encompasses both client and server side stuff, and how they go
about it.
any info regarding organisation is welcome too :)
cheers,
tom.
--
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: multi target best practices

Gamehaxe
In reply to this post by tom rhodes
Hi,
I may be a bit different because I'm old school and like the command line,
but I much prefer separate .hxml files to ones with --next in them.
The reason is that you can pass additional arguments if you have only
a single target per hxml. eg:

haxe my_build.hxml

and then

haxe my_build.hxml -debug

If you have multiple jobs, you can make a script (.bat, .sh, .hx) to
drive it.  Haxe is actually a very nice language for doing conditional
compiles etc. (eg, hxcpp/build-tool/BuildTool.hx).

Hugh

> Hi all,
>
> just wondering what people are doing to compile to multiple targets from  
> the
> one project/code base. do you have multiple hxml files and compile using  
> the
> command line/ double clicking the hxml file?
>
> i'm most interested in hitting cpp, flash and JS all from the one
> project/code base, but would also like to know if anyone is using one
> project that encompasses both client and server side stuff, and how they  
> go
> about it.
>
> any info regarding organisation is welcome too :)
>
> cheers,
>
> tom.

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

Re: multi target best practices

tom rhodes
just tried putting -debug in an hxml file like this...

# flash
-swf9 ../bin/swf/multi.swf
-swf-version 10
-main App
# JS
--next
-js ../bin/js/multi.js
-main App
# C
--next
-cpp ../bin/cpp
-main App
-debug

and the cpp output (thanks to your LIB tip hugh :D ) gave me App-debug.exe.

i REALLY like the idea of making a change to your code, double clicking, and seeing the change reflected across 3 platforms :)




On 30 January 2011 03:00, Hugh Sanderson <[hidden email]> wrote:
Hi,
I may be a bit different because I'm old school and like the command line,
but I much prefer separate .hxml files to ones with --next in them.
The reason is that you can pass additional arguments if you have only
a single target per hxml. eg:

haxe my_build.hxml

and then

haxe my_build.hxml -debug

If you have multiple jobs, you can make a script (.bat, .sh, .hx) to
drive it.  Haxe is actually a very nice language for doing conditional
compiles etc. (eg, hxcpp/build-tool/BuildTool.hx).

Hugh


Hi all,

just wondering what people are doing to compile to multiple targets from the
one project/code base. do you have multiple hxml files and compile using the
command line/ double clicking the hxml file?

i'm most interested in hitting cpp, flash and JS all from the one
project/code base, but would also like to know if anyone is using one
project that encompasses both client and server side stuff, and how they go
about it.

any info regarding organisation is welcome too :)

cheers,

tom.

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


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