Unix Script for automating building and versioning of a HaXeLib

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

Unix Script for automating building and versioning of a HaXeLib

jamesbjackson
Hi Everyone,

I would like to have build script (unix command line would be idea) that I can run and build a HaXeLib with a auto incrementing version number and zip it up ready to be deployed on HaXeLib after build. I was wondering if anyone could point me in the right direction for creating one.

Thanks

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

Re: Unix Script for automating building and versioning of a HaXeLib

Yanis Benson

zip + bash + calc(if you want, clearer than math in bash) + cat + echo. For further information use man <one of commands>.

But such questions shouldn't be asked in this mailing list.

On 25 Jul 2011 17:48, "James Jackson" <[hidden email]> wrote:

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

Re: Unix Script for automating building and versioning of a HaXeLib

jamesbjackson
Thanks Yanis,

Where should I ask these questions then, if not in the mailing list?

James

On 25 Jul 2011, at 16:38, Yanis Benson wrote:

zip + bash + calc(if you want, clearer than math in bash) + cat + echo. For further information use man <one of commands>.

But such questions shouldn't be asked in this mailing list.

On 25 Jul 2011 17:48, "James Jackson" <[hidden email]> wrote:
--
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: Unix Script for automating building and versioning of a HaXeLib

Yanis Benson
In reply to this post by jamesbjackson

This question aren't related to haXe, so you should probably ask them on some forum on linux automation. But in reality you should just Google on something like "linux bash automation".

But here is a basic script for you...
Assuming you library is named mylib, there is directory /blah/blah when you can find directory mylib with lib sources, file haxelib.xml.tpl where version and comment are replaced with #VERSION# and #COMMENT# respectively and file mylib.version with integer version number.

#!/bin/bash
SRCPATH=/blah/blah
LIBNAME=mylib
OLDLIBVERSION=`cat $SRCPATH/$LIBNAME.version`
NEWLIBVERSION=`calc OLDLIBVERSION + 1`
echo "Input version comment:"
read LIBCOMMENT
cat "$SRCPATH/haxelib.xml.tpl" | sed "s/#VERSION#/$NEWLIBVERSION/" | sed "s/#COMMENT#/$LIBCOMMENT/" > "$SRCPATH/$LIBNAME/haxelib.xml"
zip -r "$SRCPATH/$LIBNAME.zip" "$SRCPATH/$LIBNAME"
echo "$NEWLIBVERSION" > "$SRCPATH/$LIBNAME.version"

I was writing from the pnone, so I probably mistyped something, but that should be obvious to fix.

On 25 Jul 2011 19:46, "James Jackson" <[hidden email]> wrote:

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

Re: Unix Script for automating building and versioning of a HaXeLib

Gamehaxe
Another very good option is to write your script in haxe/neko.
It is good for this sort of thing - also you can use the "haxe.template"
code which is also very good for creating files and substituting in bits  
etc.

Hugh

> This question aren't related to haXe, so you should probably ask them on
> some forum on linux automation. But in reality you should just Google on
> something like "linux bash automation".
>
> But here is a basic script for you...
> Assuming you library is named mylib, there is directory /blah/blah when  
> you
> can find directory mylib with lib sources, file haxelib.xml.tpl where
> version and comment are replaced with #VERSION# and #COMMENT#  
> respectively
> and file mylib.version with integer version number.
>
> #!/bin/bash
> SRCPATH=/blah/blah
> LIBNAME=mylib
> OLDLIBVERSION=`cat $SRCPATH/$LIBNAME.version`
> NEWLIBVERSION=`calc OLDLIBVERSION + 1`
> echo "Input version comment:"
> read LIBCOMMENT
> cat "$SRCPATH/haxelib.xml.tpl" | sed "s/#VERSION#/$NEWLIBVERSION/" | sed
> "s/#COMMENT#/$LIBCOMMENT/" > "$SRCPATH/$LIBNAME/haxelib.xml"
> zip -r "$SRCPATH/$LIBNAME.zip" "$SRCPATH/$LIBNAME"
> echo "$NEWLIBVERSION" > "$SRCPATH/$LIBNAME.version"
>
> I was writing from the pnone, so I probably mistyped something, but that
> should be obvious to fix.
> On 25 Jul 2011 19:46, "James Jackson" <[hidden email]> wrote:

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

Re: Unix Script for automating building and versioning of a HaXeLib

Marcelo de Moraes Serpa
I never used haxelib (other than for installing haxe once, a good while ago), but I think we should model it to support versioning by default, like RubyGems does. Not sure if I'm being stupid here and misunderstand the current landscape (it might already support it?), but I got spoiled by RubyGems already and I think it's the best packaging/distribution system out there.

M>

On Mon, Jul 25, 2011 at 11:49 AM, Gamehaxe <[hidden email]> wrote:
Another very good option is to write your script in haxe/neko.
It is good for this sort of thing - also you can use the "haxe.template"
code which is also very good for creating files and substituting in bits etc.

Hugh


This question aren't related to haXe, so you should probably ask them on
some forum on linux automation. But in reality you should just Google on
something like "linux bash automation".

But here is a basic script for you...
Assuming you library is named mylib, there is directory /blah/blah when you
can find directory mylib with lib sources, file haxelib.xml.tpl where
version and comment are replaced with #VERSION# and #COMMENT# respectively
and file mylib.version with integer version number.

#!/bin/bash
SRCPATH=/blah/blah
LIBNAME=mylib
OLDLIBVERSION=`cat $SRCPATH/$LIBNAME.version`
NEWLIBVERSION=`calc OLDLIBVERSION + 1`
echo "Input version comment:"
read LIBCOMMENT
cat "$SRCPATH/haxelib.xml.tpl" | sed "s/#VERSION#/$NEWLIBVERSION/" | sed
"s/#COMMENT#/$LIBCOMMENT/" > "$SRCPATH/$LIBNAME/haxelib.xml"
zip -r "$SRCPATH/$LIBNAME.zip" "$SRCPATH/$LIBNAME"
echo "$NEWLIBVERSION" > "$SRCPATH/$LIBNAME.version"

I was writing from the pnone, so I probably mistyped something, but that
should be obvious to fix.
On 25 Jul 2011 19:46, "James Jackson" <[hidden email]> wrote:

--
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: Unix Script for automating building and versioning of a HaXeLib

Lee Sylvester
In reply to this post by jamesbjackson
@Yanis,

James wanted to know how to automate haxelib entries.  This is a perfect
question for the mailing list... Why don't you think he should have posted
it????  :-)

Lee



> Thanks Yanis,
>
> Where should I ask these questions then, if not in the mailing list?
>
> James
>
> On 25 Jul 2011, at 16:38, Yanis Benson wrote:
>
>> zip + bash + calc(if you want, clearer than math in bash) + cat + echo.
>> For further information use man <one of commands>.
>>
>> But such questions shouldn't be asked in this mailing list.
>>
>> On 25 Jul 2011 17:48, "James Jackson" <[hidden email]> wrote:
>> --
>> 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: Unix Script for automating building and versioning of a HaXeLib

Yanis Benson

Because it is not haXe specific in any way. The sample script I wrote can be easily adapted to make arch linux packages for example or any other type of packages.

Well, that's my personal opinion of course.

On 25 Jul 2011 21:59, <[hidden email]> wrote:
> @Yanis,
>
> James wanted to know how to automate haxelib entries. This is a perfect
> question for the mailing list... Why don't you think he should have posted
> it???? :-)
>
> Lee
>
>
>
>> Thanks Yanis,
>>
>> Where should I ask these questions then, if not in the mailing list?
>>
>> James
>>
>> On 25 Jul 2011, at 16:38, Yanis Benson wrote:
>>
>>> zip + bash + calc(if you want, clearer than math in bash) + cat + echo.
>>> For further information use man <one of commands>.
>>>
>>> But such questions shouldn't be asked in this mailing list.
>>>
>>> On 25 Jul 2011 17:48, "James Jackson" <[hidden email]> wrote:
>>> --
>>> 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

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

Re: Unix Script for automating building and versioning of a HaXeLib

Lee Sylvester
Agreed it's not haXe specific, but if someone posted asking about decent
Flash gaming libs, there'd likely be a fair number of comments from
mailing list users, and no one would mind that it's not haXe specific, as
it is relative to haXe, still.

That's my 5 cents ;-)

Lee



> Because it is not haXe specific in any way. The sample script I wrote can
> be
> easily adapted to make arch linux packages for example or any other type
> of
> packages.
>
> Well, that's my personal opinion of course.
> On 25 Jul 2011 21:59, <[hidden email]> wrote:
>> @Yanis,
>>
>> James wanted to know how to automate haxelib entries. This is a perfect
>> question for the mailing list... Why don't you think he should have
>> posted
>> it???? :-)
>>
>> Lee
>>
>>
>>
>>> Thanks Yanis,
>>>
>>> Where should I ask these questions then, if not in the mailing list?
>>>
>>> James
>>>
>>> On 25 Jul 2011, at 16:38, Yanis Benson wrote:
>>>
>>>> zip + bash + calc(if you want, clearer than math in bash) + cat +
>>>> echo.
>>>> For further information use man <one of commands>.
>>>>
>>>> But such questions shouldn't be asked in this mailing list.
>>>>
>>>> On 25 Jul 2011 17:48, "James Jackson" <[hidden email]> wrote:
>>>> --
>>>> 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
> --
> 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: Unix Script for automating building and versioning of a HaXeLib

Yanis Benson

Well, same here. I gave an answer(good one I hope) but I still think both questions about linux automation and about flash libraries would be better addressed somewhere else.

Well anyhow, I was too harsh probably, but this discussion wouldn't change anything I guess, even our opinions, so let's stop right there. =]

On 25 Jul 2011 23:08, <[hidden email]> wrote:
> Agreed it's not haXe specific, but if someone posted asking about decent
> Flash gaming libs, there'd likely be a fair number of comments from
> mailing list users, and no one would mind that it's not haXe specific, as
> it is relative to haXe, still.
>
> That's my 5 cents ;-)
>
> Lee
>
>
>
>> Because it is not haXe specific in any way. The sample script I wrote can
>> be
>> easily adapted to make arch linux packages for example or any other type
>> of
>> packages.
>>
>> Well, that's my personal opinion of course.
>> On 25 Jul 2011 21:59, <[hidden email]> wrote:
>>> @Yanis,
>>>
>>> James wanted to know how to automate haxelib entries. This is a perfect
>>> question for the mailing list... Why don't you think he should have
>>> posted
>>> it???? :-)
>>>
>>> Lee
>>>
>>>
>>>
>>>> Thanks Yanis,
>>>>
>>>> Where should I ask these questions then, if not in the mailing list?
>>>>
>>>> James
>>>>
>>>> On 25 Jul 2011, at 16:38, Yanis Benson wrote:
>>>>
>>>>> zip + bash + calc(if you want, clearer than math in bash) + cat +
>>>>> echo.
>>>>> For further information use man <one of commands>.
>>>>>
>>>>> But such questions shouldn't be asked in this mailing list.
>>>>>
>>>>> On 25 Jul 2011 17:48, "James Jackson" <[hidden email]> wrote:
>>>>> --
>>>>> 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
>> --
>> 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: Unix Script for automating building and versioning of a HaXeLib

Nicolas Cannasse
In reply to this post by jamesbjackson
Le 25/07/2011 15:45, James Jackson a écrit :
> I would like to have build script (unix command line would be idea) that I can run and build a HaXeLib with a auto incrementing version number and zip it up ready to be deployed on HaXeLib after build. I was wondering if anyone could point me in the right direction for creating one.

Write it in haXe/neko and run with  haxe -x MyScript

Nicolas

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

Re: Unix Script for automating building and versioning of a HaXeLib

alexander.konotop
In reply to this post by jamesbjackson
В Mon, 25 Jul 2011 14:45:32 +0100
James Jackson <[hidden email]> пишет:

> Hi Everyone,
>
> I would like to have build script (unix command line would be idea)
> that I can run and build a HaXeLib with a auto incrementing version
> number and zip it up ready to be deployed on HaXeLib after build. I
> was wondering if anyone could point me in the right direction for
> creating one.
>
> Thanks
>
> James

hxcurl (https://github.com/knarf-se/hxCurl) has a similar script -
the filename is "build", it's in the root directory of hxcurl. Maybe
You'll want to take smth out of there. The script automatically
increments version (it is used then in the name of directory to create)
while building few times.

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

Re: Unix Script for automating building and versioning of a HaXeLib

jamesbjackson
That sounds perfect :-)

It looks like a good way to get started with making a automated build tool for a lot of haxelibs at once :-)

Thanks loads Alexander :-)

James

On 26 Jul 2011, at 13:12, Alexander Konotop wrote:

В Mon, 25 Jul 2011 14:45:32 +0100
James Jackson <[hidden email]> пишет:

Hi Everyone,

I would like to have build script (unix command line would be idea)
that I can run and build a HaXeLib with a auto incrementing version
number and zip it up ready to be deployed on HaXeLib after build. I
was wondering if anyone could point me in the right direction for
creating one.

Thanks

James

hxcurl (https://github.com/knarf-se/hxCurl) has a similar script -
the filename is "build", it's in the root directory of hxcurl. Maybe
You'll want to take smth out of there. The script automatically
increments version (it is used then in the name of directory to create)
while building few times.

--
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: Unix Script for automating building and versioning of a HaXeLib

alexander.konotop
В Tue, 26 Jul 2011 13:20:31 +0100
James Jackson <[hidden email]> пишет:

> That sounds perfect :-)
>
> It looks like a good way to get started with making a automated build
> tool for a lot of haxelibs at once :-)
> https://github.com/knarf-se/hxCurl/blob/master/build
>
> Thanks loads Alexander :-)
>
> James
>
> On 26 Jul 2011, at 13:12, Alexander Konotop wrote:
>
> > В Mon, 25 Jul 2011 14:45:32 +0100
> > James Jackson <[hidden email]> пишет:
> >
> >> Hi Everyone,
> >>
> >> I would like to have build script (unix command line would be idea)
> >> that I can run and build a HaXeLib with a auto incrementing version
> >> number and zip it up ready to be deployed on HaXeLib after build. I
> >> was wondering if anyone could point me in the right direction for
> >> creating one.
> >>
> >> Thanks
> >>
> >> James
> >
> > hxcurl (https://github.com/knarf-se/hxCurl) has a similar script -
> > the filename is "build", it's in the root directory of hxcurl. Maybe
> > You'll want to take smth out of there. The script automatically
> > increments version (it is used then in the name of directory to
> > create) while building few times.
> >
> > --
> > haXe - an open source web programming language
> > http://haxe.org
>

You're wellcome!
BTW, it's not a best idea because it's not so crossplatform as Haxe and
Neko.

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

Re: Unix Script for automating building and versioning of a HaXeLib

jamesbjackson
@ Alexander,

I am only dealing with unix (Mac & Linux) command line :-)

James


On 26 Jul 2011, at 13:33, Alexander Konotop wrote:

> В Tue, 26 Jul 2011 13:20:31 +0100
> James Jackson <[hidden email]> пишет:
>
>> That sounds perfect :-)
>>
>> It looks like a good way to get started with making a automated build
>> tool for a lot of haxelibs at once :-)
>> https://github.com/knarf-se/hxCurl/blob/master/build
>>
>> Thanks loads Alexander :-)
>>
>> James
>>
>> On 26 Jul 2011, at 13:12, Alexander Konotop wrote:
>>
>>> В Mon, 25 Jul 2011 14:45:32 +0100
>>> James Jackson <[hidden email]> пишет:
>>>
>>>> Hi Everyone,
>>>>
>>>> I would like to have build script (unix command line would be idea)
>>>> that I can run and build a HaXeLib with a auto incrementing version
>>>> number and zip it up ready to be deployed on HaXeLib after build. I
>>>> was wondering if anyone could point me in the right direction for
>>>> creating one.
>>>>
>>>> Thanks
>>>>
>>>> James
>>>
>>> hxcurl (https://github.com/knarf-se/hxCurl) has a similar script -
>>> the filename is "build", it's in the root directory of hxcurl. Maybe
>>> You'll want to take smth out of there. The script automatically
>>> increments version (it is used then in the name of directory to
>>> create) while building few times.
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>
>
> You're wellcome!
> BTW, it's not a best idea because it's not so crossplatform as Haxe and
> Neko.
>
> --
> haXe - an open source web programming language
> http://haxe.org


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