PHP Target Compilation: Only update changed files

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

PHP Target Compilation: Only update changed files

Tarwin Stroh-Spijer
Is there a way, or can anyone thing of a hack, to get the PHP target to only update files that have actually changed. Currently the files are re-written even if they haven't changed.

If this would be possible it would be easy to sync between a compilation and an external FTP server using last updated times, rather than having to hash the files to see what has changed, and hence have super quick and easy compile -> server updates.

Any ideas?


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________

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

Re: PHP Target Compilation: Only update changed files

jlm@justinfront.net
Tarwin

From a different angle... I take it you can install Git/Hg/SVN and then let it decide the changed files to push to the server ( repository ).

Cheers ;j


On 6 Apr 2011, at 23:10, Tarwin Stroh-Spijer wrote:

Is there a way, or can anyone thing of a hack, to get the PHP target to only update files that have actually changed. Currently the files are re-written even if they haven't changed.

If this would be possible it would be easy to sync between a compilation and an external FTP server using last updated times, rather than having to hash the files to see what has changed, and hence have super quick and easy compile -> server updates.

Any ideas?


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________
--
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: PHP Target Compilation: Only update changed files

Tarwin Stroh-Spijer
Could do that, but really need to do it using FTP. Generally though it would be good to be able to tell haxe to only update output files that have changed, as option - this is for those targets that compile to source at least; PHP and CPP ATM. General optimization of speed as well I'd suggest even though it's already lightning fast!


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________


On Thu, Apr 7, 2011 at 9:34 AM, [hidden email] <[hidden email]> wrote:
Tarwin

From a different angle... I take it you can install Git/Hg/SVN and then let it decide the changed files to push to the server ( repository ).

Cheers ;j


On 6 Apr 2011, at 23:10, Tarwin Stroh-Spijer wrote:

Is there a way, or can anyone thing of a hack, to get the PHP target to only update files that have actually changed. Currently the files are re-written even if they haven't changed.

If this would be possible it would be easy to sync between a compilation and an external FTP server using last updated times, rather than having to hash the files to see what has changed, and hence have super quick and easy compile -> server updates.

Any ideas?


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: <a href="tel:%2B61%203%208060%205321" value="+61380605321" target="_blank">+61 3 8060 5321
_______________________
--
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: PHP Target Compilation: Only update changed files

Heinz Hölzer-2
you can try to use a macro.

- register a callback on Context.onGenerate
- for each type
    - create a signature for the type (Context.signature)
    - create a filename based on type and signature like "my_package_MyClass_signature"
    - check if a file with this name exists in your cache directory (f.e. project_root/.hxcache)
        - if yes, exclude this class from generation
        - if no, remove all files starting with "my_package_MyClass" and create a file with the new filename


Am 07.04.2011 02:04, schrieb Tarwin Stroh-Spijer:
Could do that, but really need to do it using FTP. Generally though it would be good to be able to tell haxe to only update output files that have changed, as option - this is for those targets that compile to source at least; PHP and CPP ATM. General optimization of speed as well I'd suggest even though it's already lightning fast!


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________


On Thu, Apr 7, 2011 at 9:34 AM, [hidden email] <[hidden email]> wrote:
Tarwin

From a different angle... I take it you can install Git/Hg/SVN and then let it decide the changed files to push to the server ( repository ).

Cheers ;j


On 6 Apr 2011, at 23:10, Tarwin Stroh-Spijer wrote:

Is there a way, or can anyone thing of a hack, to get the PHP target to only update files that have actually changed. Currently the files are re-written even if they haven't changed.

If this would be possible it would be easy to sync between a compilation and an external FTP server using last updated times, rather than having to hash the files to see what has changed, and hence have super quick and easy compile -> server updates.

Any ideas?


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: <a moz-do-not-send="true" href="tel:%2B61%203%208060%205321" value="+61380605321" target="_blank">+61 3 8060 5321
_______________________
--
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: PHP Target Compilation: Only update changed files

Cauê W.
that's not a good idea, since because of lazy typing, one change can affect many unchanged files!

Cheers!

2011/4/7 Heinz Hölzer <[hidden email]>
you can try to use a macro.

- register a callback on Context.onGenerate
- for each type
    - create a signature for the type (Context.signature)
    - create a filename based on type and signature like "my_package_MyClass_signature"
    - check if a file with this name exists in your cache directory (f.e. project_root/.hxcache)
        - if yes, exclude this class from generation
        - if no, remove all files starting with "my_package_MyClass" and create a file with the new filename


Am 07.04.2011 02:04, schrieb Tarwin Stroh-Spijer:
Could do that, but really need to do it using FTP. Generally though it would be good to be able to tell haxe to only update output files that have changed, as option - this is for those targets that compile to source at least; PHP and CPP ATM. General optimization of speed as well I'd suggest even though it's already lightning fast!


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________


On Thu, Apr 7, 2011 at 9:34 AM, [hidden email] <[hidden email]> wrote:
Tarwin

From a different angle... I take it you can install Git/Hg/SVN and then let it decide the changed files to push to the server ( repository ).

Cheers ;j


On 6 Apr 2011, at 23:10, Tarwin Stroh-Spijer wrote:

Is there a way, or can anyone thing of a hack, to get the PHP target to only update files that have actually changed. Currently the files are re-written even if they haven't changed.

If this would be possible it would be easy to sync between a compilation and an external FTP server using last updated times, rather than having to hash the files to see what has changed, and hence have super quick and easy compile -> server updates.

Any ideas?


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: <a href="tel:%2B61%203%208060%205321" value="+61380605321" target="_blank">+61 3 8060 5321
_______________________
--
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: PHP Target Compilation: Only update changed files

Heinz Hölzer-2

That shouldnt be a problem, because i compare the old already typed signature with the new already typed signature. And the signature depends on all class expressions. Maybe i'm missing something...

Am 08.04.2011 00:44 schrieb "Cauê Waneck" <[hidden email]>:
> that's not a good idea, since because of lazy typing, one change can affect
> many unchanged files!
>
> Cheers!
>
> 2011/4/7 Heinz Hölzer <[hidden email]>
>
>> you can try to use a macro.
>>
>> - register a callback on Context.onGenerate
>> - for each type
>> - create a signature for the type (Context.signature)
>> - create a filename based on type and signature like
>> "my_package_MyClass_signature"
>> - check if a file with this name exists in your cache directory (f.e.
>> project_root/.hxcache)
>> - if yes, exclude this class from generation
>> - if no, remove all files starting with "my_package_MyClass" and
>> create a file with the new filename
>>
>>
>> Am 07.04.2011 02:04, schrieb Tarwin Stroh-Spijer:
>>
>> Could do that, but really need to do it using FTP. Generally though it
>> would be good to be able to tell haxe to only update output files that have
>> changed, as option - this is for those targets that compile to source at
>> least; PHP and CPP ATM. General optimization of speed as well I'd suggest
>> even though it's already lightning fast!
>>
>>
>> Tarwin Stroh-Spijer
>> _______________________
>>
>> Touch My Pixel
>> http://www.touchmypixel.com/
>> phone: +61 3 8060 5321
>> _______________________
>>
>>
>> On Thu, Apr 7, 2011 at 9:34 AM, [hidden email] <[hidden email]>wrote:
>>
>>> Tarwin
>>>
>>> From a different angle... I take it you can install Git/Hg/SVN and then
>>> let it decide the changed files to push to the server ( repository ).
>>>
>>> Cheers ;j
>>>
>>>
>>> On 6 Apr 2011, at 23:10, Tarwin Stroh-Spijer wrote:
>>>
>>> Is there a way, or can anyone thing of a hack, to get the PHP target to
>>> only update files that have actually changed. Currently the files are
>>> re-written even if they haven't changed.
>>>
>>> If this would be possible it would be easy to sync between a compilation
>>> and an external FTP server using last updated times, rather than having to
>>> hash the files to see what has changed, and hence have super quick and easy
>>> compile -> server updates.
>>>
>>> Any ideas?
>>>
>>>
>>> Tarwin Stroh-Spijer
>>> _______________________
>>>
>>> Touch My Pixel
>>> http://www.touchmypixel.com/
>>> phone: +61 3 8060 5321 <%2B61%203%208060%205321>
>>> _______________________
>>> --
>>> 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: PHP Target Compilation: Only update changed files

Cauê W.
no, you can have something like that:


var x = OtherClass.getArray();
trace(x[0]);

if you change getArray to return e.g. php.NativeArray, I'm almost sure that the typing for it would change, or if you change it for DYnamic. Anyway, if you change OtherClass.getArray()'s signature, typing for the above expression would change, and this could affect the generated code!

Cheers!
Cauê

2011/4/7 h hoelzer <[hidden email]>

That shouldnt be a problem, because i compare the old already typed signature with the new already typed signature. And the signature depends on all class expressions. Maybe i'm missing something...

Am 08.04.2011 00:44 schrieb "Cauê Waneck" <[hidden email]>:

> that's not a good idea, since because of lazy typing, one change can affect
> many unchanged files!
>
> Cheers!
>
> 2011/4/7 Heinz Hölzer <[hidden email]>
>
>> you can try to use a macro.
>>
>> - register a callback on Context.onGenerate
>> - for each type
>> - create a signature for the type (Context.signature)
>> - create a filename based on type and signature like
>> "my_package_MyClass_signature"
>> - check if a file with this name exists in your cache directory (f.e.
>> project_root/.hxcache)
>> - if yes, exclude this class from generation
>> - if no, remove all files starting with "my_package_MyClass" and
>> create a file with the new filename
>>
>>
>> Am 07.04.2011 02:04, schrieb Tarwin Stroh-Spijer:
>>
>> Could do that, but really need to do it using FTP. Generally though it
>> would be good to be able to tell haxe to only update output files that have
>> changed, as option - this is for those targets that compile to source at
>> least; PHP and CPP ATM. General optimization of speed as well I'd suggest
>> even though it's already lightning fast!
>>
>>
>> Tarwin Stroh-Spijer
>> _______________________
>>
>> Touch My Pixel
>> http://www.touchmypixel.com/
>> phone: +61 3 8060 5321
>> _______________________
>>
>>
>> On Thu, Apr 7, 2011 at 9:34 AM, [hidden email] <[hidden email]>wrote:
>>
>>> Tarwin
>>>
>>> From a different angle... I take it you can install Git/Hg/SVN and then
>>> let it decide the changed files to push to the server ( repository ).
>>>
>>> Cheers ;j
>>>
>>>
>>> On 6 Apr 2011, at 23:10, Tarwin Stroh-Spijer wrote:
>>>
>>> Is there a way, or can anyone thing of a hack, to get the PHP target to
>>> only update files that have actually changed. Currently the files are
>>> re-written even if they haven't changed.
>>>
>>> If this would be possible it would be easy to sync between a compilation
>>> and an external FTP server using last updated times, rather than having to
>>> hash the files to see what has changed, and hence have super quick and easy
>>> compile -> server updates.
>>>
>>> Any ideas?
>>>
>>>
>>> Tarwin Stroh-Spijer
>>> _______________________
>>>
>>> Touch My Pixel
>>> http://www.touchmypixel.com/
>>> phone: +61 3 8060 5321 <%2B61%203%208060%205321>
>>> _______________________
>>> --

>>> 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: PHP Target Compilation: Only update changed files

Heinz Hölzer-2

But your example shows the untyped expression the typed expression in onGenerate is different if the function in OtherClass have another return type.

Am 08.04.2011 01:28 schrieb "Cauê Waneck" <[hidden email]>:
> no, you can have something like that:
>
>
> var x = OtherClass.getArray();
> trace(x[0]);
>
> if you change getArray to return e.g. php.NativeArray, I'm almost sure that
> the typing for it would change, or if you change it for DYnamic. Anyway, if
> you change OtherClass.getArray()'s signature, typing for the above
> expression would change, and this could affect the generated code!
>
> Cheers!
> Cauê
>
> 2011/4/7 h hoelzer <[hidden email]>
>
>> That shouldnt be a problem, because i compare the old already typed
>> signature with the new already typed signature. And the signature depends on
>> all class expressions. Maybe i'm missing something...
>> Am 08.04.2011 00:44 schrieb "Cauê Waneck" <[hidden email]>:
>>
>> > that's not a good idea, since because of lazy typing, one change can
>> affect
>> > many unchanged files!
>> >
>> > Cheers!
>> >
>> > 2011/4/7 Heinz Hölzer <[hidden email]>
>> >
>> >> you can try to use a macro.
>> >>
>> >> - register a callback on Context.onGenerate
>> >> - for each type
>> >> - create a signature for the type (Context.signature)
>> >> - create a filename based on type and signature like
>> >> "my_package_MyClass_signature"
>> >> - check if a file with this name exists in your cache directory (f.e.
>> >> project_root/.hxcache)
>> >> - if yes, exclude this class from generation
>> >> - if no, remove all files starting with "my_package_MyClass" and
>> >> create a file with the new filename
>> >>
>> >>
>> >> Am 07.04.2011 02:04, schrieb Tarwin Stroh-Spijer:
>> >>
>> >> Could do that, but really need to do it using FTP. Generally though it
>> >> would be good to be able to tell haxe to only update output files that
>> have
>> >> changed, as option - this is for those targets that compile to source at
>> >> least; PHP and CPP ATM. General optimization of speed as well I'd
>> suggest
>> >> even though it's already lightning fast!
>> >>
>> >>
>> >> Tarwin Stroh-Spijer
>> >> _______________________
>> >>
>> >> Touch My Pixel
>> >> http://www.touchmypixel.com/
>> >> phone: +61 3 8060 5321
>> >> _______________________
>> >>
>> >>
>> >> On Thu, Apr 7, 2011 at 9:34 AM, [hidden email] <
>> [hidden email]>wrote:
>> >>
>> >>> Tarwin
>> >>>
>> >>> From a different angle... I take it you can install Git/Hg/SVN and then
>> >>> let it decide the changed files to push to the server ( repository ).
>> >>>
>> >>> Cheers ;j
>> >>>
>> >>>
>> >>> On 6 Apr 2011, at 23:10, Tarwin Stroh-Spijer wrote:
>> >>>
>> >>> Is there a way, or can anyone thing of a hack, to get the PHP target to
>> >>> only update files that have actually changed. Currently the files are
>> >>> re-written even if they haven't changed.
>> >>>
>> >>> If this would be possible it would be easy to sync between a
>> compilation
>> >>> and an external FTP server using last updated times, rather than having
>> to
>> >>> hash the files to see what has changed, and hence have super quick and
>> easy
>> >>> compile -> server updates.
>> >>>
>> >>> Any ideas?
>> >>>
>> >>>
>> >>> Tarwin Stroh-Spijer
>> >>> _______________________
>> >>>
>> >>> Touch My Pixel
>> >>> http://www.touchmypixel.com/
>> >>> phone: +61 3 8060 5321 <%2B61%203%208060%205321>
>> >>> _______________________
>> >>> --
>>
>> >>> 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: PHP Target Compilation: Only update changed files

Heinz Hölzer-2

By the way way with signature i mean the generated hash code of Context.signature

Am 08.04.2011 01:34 schrieb "h hoelzer" <[hidden email]>:
> But your example shows the untyped expression the typed expression in
> onGenerate is different if the function in OtherClass have another return
> type.
> Am 08.04.2011 01:28 schrieb "Cauê Waneck" <[hidden email]>:
>> no, you can have something like that:
>>
>>
>> var x = OtherClass.getArray();
>> trace(x[0]);
>>
>> if you change getArray to return e.g. php.NativeArray, I'm almost sure
> that
>> the typing for it would change, or if you change it for DYnamic. Anyway,
> if
>> you change OtherClass.getArray()'s signature, typing for the above
>> expression would change, and this could affect the generated code!
>>
>> Cheers!
>> Cauê
>>
>> 2011/4/7 h hoelzer <[hidden email]>
>>
>>> That shouldnt be a problem, because i compare the old already typed
>>> signature with the new already typed signature. And the signature depends
> on
>>> all class expressions. Maybe i'm missing something...
>>> Am 08.04.2011 00:44 schrieb "Cauê Waneck" <[hidden email]>:
>>>
>>> > that's not a good idea, since because of lazy typing, one change can
>>> affect
>>> > many unchanged files!
>>> >
>>> > Cheers!
>>> >
>>> > 2011/4/7 Heinz Hölzer <[hidden email]>
>>> >
>>> >> you can try to use a macro.
>>> >>
>>> >> - register a callback on Context.onGenerate
>>> >> - for each type
>>> >> - create a signature for the type (Context.signature)
>>> >> - create a filename based on type and signature like
>>> >> "my_package_MyClass_signature"
>>> >> - check if a file with this name exists in your cache directory (f.e.
>>> >> project_root/.hxcache)
>>> >> - if yes, exclude this class from generation
>>> >> - if no, remove all files starting with "my_package_MyClass" and
>>> >> create a file with the new filename
>>> >>
>>> >>
>>> >> Am 07.04.2011 02:04, schrieb Tarwin Stroh-Spijer:
>>> >>
>>> >> Could do that, but really need to do it using FTP. Generally though it
>>> >> would be good to be able to tell haxe to only update output files that
>>> have
>>> >> changed, as option - this is for those targets that compile to source
> at
>>> >> least; PHP and CPP ATM. General optimization of speed as well I'd
>>> suggest
>>> >> even though it's already lightning fast!
>>> >>
>>> >>
>>> >> Tarwin Stroh-Spijer
>>> >> _______________________
>>> >>
>>> >> Touch My Pixel
>>> >> http://www.touchmypixel.com/
>>> >> phone: +61 3 8060 5321
>>> >> _______________________
>>> >>
>>> >>
>>> >> On Thu, Apr 7, 2011 at 9:34 AM, [hidden email] <
>>> [hidden email]>wrote:
>>> >>
>>> >>> Tarwin
>>> >>>
>>> >>> From a different angle... I take it you can install Git/Hg/SVN and
> then
>>> >>> let it decide the changed files to push to the server ( repository ).
>>> >>>
>>> >>> Cheers ;j
>>> >>>
>>> >>>
>>> >>> On 6 Apr 2011, at 23:10, Tarwin Stroh-Spijer wrote:
>>> >>>
>>> >>> Is there a way, or can anyone thing of a hack, to get the PHP target
> to
>>> >>> only update files that have actually changed. Currently the files are
>>> >>> re-written even if they haven't changed.
>>> >>>
>>> >>> If this would be possible it would be easy to sync between a
>>> compilation
>>> >>> and an external FTP server using last updated times, rather than
> having
>>> to
>>> >>> hash the files to see what has changed, and hence have super quick
> and
>>> easy
>>> >>> compile -> server updates.
>>> >>>
>>> >>> Any ideas?
>>> >>>
>>> >>>
>>> >>> Tarwin Stroh-Spijer
>>> >>> _______________________
>>> >>>
>>> >>> Touch My Pixel
>>> >>> http://www.touchmypixel.com/
>>> >>> phone: +61 3 8060 5321 <%2B61%203%208060%205321>
>>> >>> _______________________
>>> >>> --
>>>
>>> >>> 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: PHP Target Compilation: Only update changed files

Baluta Cristian
What if you generate the files in a temporary location, then run a neko tool that checks each file and compare its size with the corresponding file from the final location?

On Fri, Apr 8, 2011 at 2:36 AM, h hoelzer <[hidden email]> wrote:

By the way way with signature i mean the generated hash code of Context.signature

Am 08.04.2011 01:34 schrieb "h hoelzer" <[hidden email]>:

> But your example shows the untyped expression the typed expression in
> onGenerate is different if the function in OtherClass have another return
> type.
> Am 08.04.2011 01:28 schrieb "Cauê Waneck" <[hidden email]>:
>> no, you can have something like that:
>>
>>
>> var x = OtherClass.getArray();
>> trace(x[0]);
>>
>> if you change getArray to return e.g. php.NativeArray, I'm almost sure
> that
>> the typing for it would change, or if you change it for DYnamic. Anyway,
> if
>> you change OtherClass.getArray()'s signature, typing for the above
>> expression would change, and this could affect the generated code!
>>
>> Cheers!
>> Cauê
>>
>> 2011/4/7 h hoelzer <[hidden email]>
>>
>>> That shouldnt be a problem, because i compare the old already typed
>>> signature with the new already typed signature. And the signature depends
> on
>>> all class expressions. Maybe i'm missing something...
>>> Am 08.04.2011 00:44 schrieb "Cauê Waneck" <[hidden email]>:
>>>
>>> > that's not a good idea, since because of lazy typing, one change can
>>> affect
>>> > many unchanged files!
>>> >
>>> > Cheers!
>>> >
>>> > 2011/4/7 Heinz Hölzer <[hidden email]>
>>> >
>>> >> you can try to use a macro.
>>> >>
>>> >> - register a callback on Context.onGenerate
>>> >> - for each type
>>> >> - create a signature for the type (Context.signature)
>>> >> - create a filename based on type and signature like
>>> >> "my_package_MyClass_signature"
>>> >> - check if a file with this name exists in your cache directory (f.e.
>>> >> project_root/.hxcache)
>>> >> - if yes, exclude this class from generation
>>> >> - if no, remove all files starting with "my_package_MyClass" and
>>> >> create a file with the new filename
>>> >>
>>> >>
>>> >> Am 07.04.2011 02:04, schrieb Tarwin Stroh-Spijer:
>>> >>
>>> >> Could do that, but really need to do it using FTP. Generally though it
>>> >> would be good to be able to tell haxe to only update output files that
>>> have
>>> >> changed, as option - this is for those targets that compile to source
> at
>>> >> least; PHP and CPP ATM. General optimization of speed as well I'd
>>> suggest
>>> >> even though it's already lightning fast!
>>> >>
>>> >>
>>> >> Tarwin Stroh-Spijer
>>> >> _______________________
>>> >>
>>> >> Touch My Pixel
>>> >> http://www.touchmypixel.com/
>>> >> phone: <a href="tel:%2B61%203%208060%205321" value="+61380605321" target="_blank">+61 3 8060 5321
>>> >> _______________________
>>> >>
>>> >>
>>> >> On Thu, Apr 7, 2011 at 9:34 AM, [hidden email] <
>>> [hidden email]>wrote:
>>> >>
>>> >>> Tarwin
>>> >>>
>>> >>> From a different angle... I take it you can install Git/Hg/SVN and
> then
>>> >>> let it decide the changed files to push to the server ( repository ).
>>> >>>
>>> >>> Cheers ;j
>>> >>>
>>> >>>
>>> >>> On 6 Apr 2011, at 23:10, Tarwin Stroh-Spijer wrote:
>>> >>>
>>> >>> Is there a way, or can anyone thing of a hack, to get the PHP target
> to
>>> >>> only update files that have actually changed. Currently the files are
>>> >>> re-written even if they haven't changed.
>>> >>>
>>> >>> If this would be possible it would be easy to sync between a
>>> compilation
>>> >>> and an external FTP server using last updated times, rather than
> having
>>> to
>>> >>> hash the files to see what has changed, and hence have super quick
> and
>>> easy
>>> >>> compile -> server updates.
>>> >>>
>>> >>> Any ideas?
>>> >>>
>>> >>>
>>> >>> Tarwin Stroh-Spijer
>>> >>> _______________________
>>> >>>
>>> >>> Touch My Pixel
>>> >>> http://www.touchmypixel.com/
>>> >>> phone: <a href="tel:%2B61%203%208060%205321" value="+61380605321" target="_blank">+61 3 8060 5321 <%2B61%203%208060%205321>
>>> >>> _______________________
>>> >>> --
>>>
>>> >>> 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



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

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

Re: PHP Target Compilation: Only update changed files

Tarwin Stroh-Spijer
Baluta: Genius idea! Simple, and easy. Thanks for that. I'll make it and post it when I'm done.


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________


On Fri, Apr 8, 2011 at 3:25 PM, Baluta Cristian <[hidden email]> wrote:
What if you generate the files in a temporary location, then run a neko tool that checks each file and compare its size with the corresponding file from the final location?


On Fri, Apr 8, 2011 at 2:36 AM, h hoelzer <[hidden email]> wrote:

By the way way with signature i mean the generated hash code of Context.signature

Am 08.04.2011 01:34 schrieb "h hoelzer" <[hidden email]>:

> But your example shows the untyped expression the typed expression in
> onGenerate is different if the function in OtherClass have another return
> type.
> Am 08.04.2011 01:28 schrieb "Cauê Waneck" <[hidden email]>:
>> no, you can have something like that:
>>
>>
>> var x = OtherClass.getArray();
>> trace(x[0]);
>>
>> if you change getArray to return e.g. php.NativeArray, I'm almost sure
> that
>> the typing for it would change, or if you change it for DYnamic. Anyway,
> if
>> you change OtherClass.getArray()'s signature, typing for the above
>> expression would change, and this could affect the generated code!
>>
>> Cheers!
>> Cauê
>>
>> 2011/4/7 h hoelzer <[hidden email]>
>>
>>> That shouldnt be a problem, because i compare the old already typed
>>> signature with the new already typed signature. And the signature depends
> on
>>> all class expressions. Maybe i'm missing something...
>>> Am 08.04.2011 00:44 schrieb "Cauê Waneck" <[hidden email]>:
>>>
>>> > that's not a good idea, since because of lazy typing, one change can
>>> affect
>>> > many unchanged files!
>>> >
>>> > Cheers!
>>> >
>>> > 2011/4/7 Heinz Hölzer <[hidden email]>
>>> >
>>> >> you can try to use a macro.
>>> >>
>>> >> - register a callback on Context.onGenerate
>>> >> - for each type
>>> >> - create a signature for the type (Context.signature)
>>> >> - create a filename based on type and signature like
>>> >> "my_package_MyClass_signature"
>>> >> - check if a file with this name exists in your cache directory (f.e.
>>> >> project_root/.hxcache)
>>> >> - if yes, exclude this class from generation
>>> >> - if no, remove all files starting with "my_package_MyClass" and
>>> >> create a file with the new filename
>>> >>
>>> >>
>>> >> Am 07.04.2011 02:04, schrieb Tarwin Stroh-Spijer:
>>> >>
>>> >> Could do that, but really need to do it using FTP. Generally though it
>>> >> would be good to be able to tell haxe to only update output files that
>>> have
>>> >> changed, as option - this is for those targets that compile to source
> at
>>> >> least; PHP and CPP ATM. General optimization of speed as well I'd
>>> suggest
>>> >> even though it's already lightning fast!
>>> >>
>>> >>
>>> >> Tarwin Stroh-Spijer
>>> >> _______________________
>>> >>
>>> >> Touch My Pixel
>>> >> http://www.touchmypixel.com/
>>> >> phone: <a href="tel:%2B61%203%208060%205321" value="+61380605321" target="_blank">+61 3 8060 5321
>>> >> _______________________
>>> >>
>>> >>
>>> >> On Thu, Apr 7, 2011 at 9:34 AM, [hidden email] <
>>> [hidden email]>wrote:
>>> >>
>>> >>> Tarwin
>>> >>>
>>> >>> From a different angle... I take it you can install Git/Hg/SVN and
> then
>>> >>> let it decide the changed files to push to the server ( repository ).
>>> >>>
>>> >>> Cheers ;j
>>> >>>
>>> >>>
>>> >>> On 6 Apr 2011, at 23:10, Tarwin Stroh-Spijer wrote:
>>> >>>
>>> >>> Is there a way, or can anyone thing of a hack, to get the PHP target
> to
>>> >>> only update files that have actually changed. Currently the files are
>>> >>> re-written even if they haven't changed.
>>> >>>
>>> >>> If this would be possible it would be easy to sync between a
>>> compilation
>>> >>> and an external FTP server using last updated times, rather than
> having
>>> to
>>> >>> hash the files to see what has changed, and hence have super quick
> and
>>> easy
>>> >>> compile -> server updates.
>>> >>>
>>> >>> Any ideas?
>>> >>>
>>> >>>
>>> >>> Tarwin Stroh-Spijer
>>> >>> _______________________
>>> >>>
>>> >>> Touch My Pixel
>>> >>> http://www.touchmypixel.com/
>>> >>> phone: <a href="tel:%2B61%203%208060%205321" value="+61380605321" target="_blank">+61 3 8060 5321 <%2B61%203%208060%205321>
>>> >>> _______________________
>>> >>> --
>>>
>>> >>> 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



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

--
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: PHP Target Compilation: Only update changed files

Andreas Mokros
On Fri, 8 Apr 2011 15:29:08 +1000
Tarwin Stroh-Spijer <[hidden email]> wrote:
> > run a neko
> > tool that checks each file and compare its size
> Baluta: Genius idea! Simple, and easy.

Maybe a bit too simple. If you change x = 1 to x = 2 (or $x for
PHP...) the resulting file probably has the same size. You'd have to
create a hash or something ...

--
Mockey

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

Re: PHP Target Compilation: Only update changed files

Tarwin Stroh-Spijer
Yeah, I think hashing each file file as it goes will work file. Yay for MD5!


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________


On Fri, Apr 8, 2011 at 6:50 PM, Andreas Mokros <[hidden email]> wrote:
On Fri, 8 Apr 2011 15:29:08 +1000
Tarwin Stroh-Spijer <[hidden email]> wrote:
> > run a neko
> > tool that checks each file and compare its size
> Baluta: Genius idea! Simple, and easy.

Maybe a bit too simple. If you change x = 1 to x = 2 (or $x for
PHP...) the resulting file probably has the same size. You'd have to
create a hash or something ...

--
Mockey

--
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: PHP Target Compilation: Only update changed files

Heinz Hölzer-2
In reply to this post by Cauê W.
i guess you're right, i tested the hash codes of the main functions and they are equal, but why?

i thought that the types which are passed to the onGenerate callback are fully typed, which would mean
that a statement like:

static function main():Void
{
    var o = OtherClass.getSomething();
    trace(o);
}

is already transformed to

static function main():Void
{
    var o:Dynamic = OtherClass.getSomething(); // or whatever, based on the return type
    trace(o);
}

Does this happen after the execution of the onGenerate callbacks??


Am 08.04.2011 01:26, schrieb Cauê Waneck:
no, you can have something like that:


var x = OtherClass.getArray();
trace(x[0]);

if you change getArray to return e.g. php.NativeArray, I'm almost sure that the typing for it would change, or if you change it for DYnamic. Anyway, if you change OtherClass.getArray()'s signature, typing for the above expression would change, and this could affect the generated code!

Cheers!
Cauê

2011/4/7 h hoelzer <[hidden email]>

That shouldnt be a problem, because i compare the old already typed signature with the new already typed signature. And the signature depends on all class expressions. Maybe i'm missing something...

Am 08.04.2011 00:44 schrieb "Cauê Waneck" <[hidden email]>:

> that's not a good idea, since because of lazy typing, one change can affect
> many unchanged files!
>
> Cheers!
>
> 2011/4/7 Heinz Hölzer <[hidden email]>
>
>> you can try to use a macro.
>>
>> - register a callback on Context.onGenerate
>> - for each type
>> - create a signature for the type (Context.signature)
>> - create a filename based on type and signature like
>> "my_package_MyClass_signature"
>> - check if a file with this name exists in your cache directory (f.e.
>> project_root/.hxcache)
>> - if yes, exclude this class from generation
>> - if no, remove all files starting with "my_package_MyClass" and
>> create a file with the new filename
>>
>>
>> Am 07.04.2011 02:04, schrieb Tarwin Stroh-Spijer:
>>
>> Could do that, but really need to do it using FTP. Generally though it
>> would be good to be able to tell haxe to only update output files that have
>> changed, as option - this is for those targets that compile to source at
>> least; PHP and CPP ATM. General optimization of speed as well I'd suggest
>> even though it's already lightning fast!
>>
>>
>> Tarwin Stroh-Spijer
>> _______________________
>>
>> Touch My Pixel
>> http://www.touchmypixel.com/
>> phone: +61 3 8060 5321
>> _______________________
>>
>>
>> On Thu, Apr 7, 2011 at 9:34 AM, [hidden email] <[hidden email]>wrote:
>>
>>> Tarwin
>>>
>>> From a different angle... I take it you can install Git/Hg/SVN and then
>>> let it decide the changed files to push to the server ( repository ).
>>>
>>> Cheers ;j
>>>
>>>
>>> On 6 Apr 2011, at 23:10, Tarwin Stroh-Spijer wrote:
>>>
>>> Is there a way, or can anyone thing of a hack, to get the PHP target to
>>> only update files that have actually changed. Currently the files are
>>> re-written even if they haven't changed.
>>>
>>> If this would be possible it would be easy to sync between a compilation
>>> and an external FTP server using last updated times, rather than having to
>>> hash the files to see what has changed, and hence have super quick and easy
>>> compile -> server updates.
>>>
>>> Any ideas?
>>>
>>>
>>> Tarwin Stroh-Spijer
>>> _______________________
>>>
>>> Touch My Pixel
>>> http://www.touchmypixel.com/
>>> phone: +61 3 8060 5321 <%2B61%203%208060%205321>
>>> _______________________
>>> --

>>> 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: PHP Target Compilation: Only update changed files

MarcWeber
In reply to this post by Tarwin Stroh-Spijer
Excerpts from Tarwin Stroh-Spijer's message of Wed Apr 06 23:10:54 +0200 2011:
can't you use rsync or such to copy changed files only then sync the
copy to your ftp?

As alternative:
https://github.com/MarcWeber/git-ftp

-> git-ftp-minimal.sh does exactly what you want.
git add -A ; git commit -m updates
then run sync script should suffice.

Marc Weber

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