You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Alex Harui <ah...@adobe.com> on 2014/10/25 07:20:45 UTC

Re: git commit: [flex-utilities] [refs/heads/develop] - FLEX-34605 cleanup


On 10/24/14, 9:56 PM, "jmclean@apache.org" <jm...@apache.org> wrote:

>-        import AntClasses; AntClasses;
>+        import AntClasses;
This one worries me.  I should have left a comment on it, but the second
“AntClasses” force-links all of the ant task handlers into the app.  I’m
not sure I’ve listed them any other way that would link them in.  Did an
ant_on_air install actually work after this change?  I think you have to
try 4.13 or FlexJS as all older SDKs are not using ant_on_air right now.

-Alex 


RE: git commit: [flex-utilities] [refs/heads/develop] - FLEX-34605 cleanup

Posted by Neil Madsen <li...@cranialinteractive.com>.
Yes, it definitely makes sense now.
Just something I've never done. I didn't realize that by just having it like
that the compiler would pull it in. 
I always thought you had to assign it to a var or something to invoke the
compiler to pull in those files.

Learn something new every day. ;) Thanks for that.

Neil

-----Original Message-----
From: Alex Harui [mailto:aharui@adobe.com] 
Sent: October-25-14 11:17 PM
To: dev@flex.apache.org; Neil Madsen
Subject: Re: git commit: [flex-utilities] [refs/heads/develop] - FLEX-34605
cleanup



On 10/25/14, 5:47 AM, "Neil Madsen" <li...@cranialinteractive.com> wrote:

>Same error here.
>
>Alex, could you add a comment to the file explaining the reason for the 
>double "AntClasses"

OK, added a short comment.

>I've never seen it done that way before but after reading your 
>explanation it does makes sense.

As you rummage through the SDK code, you'll see this pattern in other
places.  I think just about every SWC uses this pattern to force-link
classes into the SWC that are not listed in the MXML manifest but are likely
to be used from AS.  For example [1].

It's a shorthand version of the pattern documented here [2] and saves
defining a variable in the class definition.  But it is a bit subtle so I
should have added a comment back when.

Under the hood, the MXML compiler only links in classes it finds during the
compiling of a class.  The Installer's Ant_on_AIR library currently does not
have code that causes the linking in of every ant task handler because I
wanted to make it easy for folks who might use Ant_on_AIR in other scenarios
to only have to bake in the ant tasks they need for a specific purpose.  We
can change that if we want, of course.  So that means the Installer, which
doesn't reference the tasks directly since really only the Ant script it is
executing that needs the task, needs some way to get all of those tasks
linked in.  You don't actually have to assign variables with types to link
in a class, just mentioning the class in the package is good enough.

-Alex

[1]
https://git-wip-us.apache.org/repos/asf/flex-sdk/repo?p=flex-sdk.git;a=blob
_plain;f=frameworks/projects/framework/src/FrameworkClasses.as;hb=develop

[2]
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084
-799a.html



RE: git commit: [flex-utilities] [refs/heads/develop] - FLEX-34605 cleanup

Posted by Frédéric THOMAS <we...@hotmail.com>.
As another way, what I generally do in my own code and I agree it is more verbose but more self explanatory, I use an array of those classes as a private static constant called forcedDependencies, doing so, users not knowing the trick can guess it.

Frédéric THOMAS

> From: aharui@adobe.com
> To: dev@flex.apache.org; lists@cranialinteractive.com
> Subject: Re: git commit: [flex-utilities] [refs/heads/develop] - FLEX-34605 cleanup
> Date: Sun, 26 Oct 2014 05:17:08 +0000
> 
> 
> 
> On 10/25/14, 5:47 AM, "Neil Madsen" <li...@cranialinteractive.com> wrote:
> 
> >Same error here.
> >
> >Alex, could you add a comment to the file explaining the reason for the
> >double "AntClasses"
> 
> OK, added a short comment.
> 
> >I've never seen it done that way before but after reading your explanation
> >it does makes sense.
> 
> As you rummage through the SDK code, you’ll see this pattern in other
> places.  I think just about every SWC uses this pattern to force-link
> classes into the SWC that are not listed in the MXML manifest but are
> likely to be used from AS.  For example [1].
> 
> It’s a shorthand version of the pattern documented here [2] and saves
> defining a variable in the class definition.  But it is a bit subtle so I
> should have added a comment back when.
> 
> Under the hood, the MXML compiler only links in classes it finds during
> the compiling of a class.  The Installer’s Ant_on_AIR library currently
> does not have code that causes the linking in of every ant task handler
> because I wanted to make it easy for folks who might use Ant_on_AIR in
> other scenarios to only have to bake in the ant tasks they need for a
> specific purpose.  We can change that if we want, of course.  So that
> means the Installer, which doesn’t reference the tasks directly since
> really only the Ant script it is executing that needs the task, needs some
> way to get all of those tasks linked in.  You don’t actually have to
> assign variables with types to link in a class, just mentioning the class
> in the package is good enough.
> 
> -Alex
> 
> [1] 
> https://git-wip-us.apache.org/repos/asf/flex-sdk/repo?p=flex-sdk.git;a=blob
> _plain;f=frameworks/projects/framework/src/FrameworkClasses.as;hb=develop
> 
> [2] 
> http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084
> -799a.html
> 
 		 	   		  

Re: git commit: [flex-utilities] [refs/heads/develop] - FLEX-34605 cleanup

Posted by Alex Harui <ah...@adobe.com>.

On 10/25/14, 5:47 AM, "Neil Madsen" <li...@cranialinteractive.com> wrote:

>Same error here.
>
>Alex, could you add a comment to the file explaining the reason for the
>double "AntClasses"

OK, added a short comment.

>I've never seen it done that way before but after reading your explanation
>it does makes sense.

As you rummage through the SDK code, you’ll see this pattern in other
places.  I think just about every SWC uses this pattern to force-link
classes into the SWC that are not listed in the MXML manifest but are
likely to be used from AS.  For example [1].

It’s a shorthand version of the pattern documented here [2] and saves
defining a variable in the class definition.  But it is a bit subtle so I
should have added a comment back when.

Under the hood, the MXML compiler only links in classes it finds during
the compiling of a class.  The Installer’s Ant_on_AIR library currently
does not have code that causes the linking in of every ant task handler
because I wanted to make it easy for folks who might use Ant_on_AIR in
other scenarios to only have to bake in the ant tasks they need for a
specific purpose.  We can change that if we want, of course.  So that
means the Installer, which doesn’t reference the tasks directly since
really only the Ant script it is executing that needs the task, needs some
way to get all of those tasks linked in.  You don’t actually have to
assign variables with types to link in a class, just mentioning the class
in the package is good enough.

-Alex

[1] 
https://git-wip-us.apache.org/repos/asf/flex-sdk/repo?p=flex-sdk.git;a=blob
_plain;f=frameworks/projects/framework/src/FrameworkClasses.as;hb=develop

[2] 
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084
-799a.html


RE: git commit: [flex-utilities] [refs/heads/develop] - FLEX-34605 cleanup

Posted by Neil Madsen <li...@cranialinteractive.com>.
Same error here.

Alex, could you add a comment to the file explaining the reason for the
double "AntClasses"
I've never seen it done that way before but after reading your explanation
it does makes sense. 
I think having a note there is definitely helpful just in case someone sees
it later on.
 
Neil

-----Original Message-----
From: Justin Mclean [mailto:justin@classsoftware.com] 
Sent: October-25-14 3:05 AM
To: dev@flex.apache.org
Subject: Re: git commit: [flex-utilities] [refs/heads/develop] - FLEX-34605
cleanup

Hi,

>> -        import AntClasses; AntClasses;
>> +        import AntClasses;

> This one worries me.

>  I think you have to try 4.13 or FlexJS as all older SDKs are not using
ant_on_air right now.

Yep you're right 4.13 fails to install with this error:

nullError: no processor for property
	at org.apache.flex.xml::XMLTagProcessor/processXMLTag()
	at org.apache.flex.xml::XMLTagProcessor/processChildren()
	at org.apache.flex.ant.tags.supportClasses::TaskHandler/execute()
	at org.apache.flex.ant.tags::Project/execute()
	at org.apache.flex.ant::Ant/processXMLFile()
	at InstallApacheFlex/runInstallerScript()
	at InstallApacheFlex/handleApacheFlexSDKZipFileUnzipComplete()

no processor for property

Posted just in case anyone else runs into it. Will revert.

Justin



Re: git commit: [flex-utilities] [refs/heads/develop] - FLEX-34605 cleanup

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

>> -        import AntClasses; AntClasses;
>> +        import AntClasses;

> This one worries me.

>  I think you have to try 4.13 or FlexJS as all older SDKs are not using ant_on_air right now.

Yep you're right 4.13 fails to install with this error:

nullError: no processor for property
	at org.apache.flex.xml::XMLTagProcessor/processXMLTag()
	at org.apache.flex.xml::XMLTagProcessor/processChildren()
	at org.apache.flex.ant.tags.supportClasses::TaskHandler/execute()
	at org.apache.flex.ant.tags::Project/execute()
	at org.apache.flex.ant::Ant/processXMLFile()
	at InstallApacheFlex/runInstallerScript()
	at InstallApacheFlex/handleApacheFlexSDKZipFileUnzipComplete()

no processor for property

Posted just in case anyone else runs into it. Will revert.

Justin