Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bug in boolean params; they produce wrong shell command string #7

Open
apinstein opened this Issue · 7 comments

2 participants

Alan Pinstein Luke Bayes
Alan Pinstein
Collaborator

For my app I use "-use-network=false". It is not working as expected.

Instead of outputting "-use-network=false" it will just output "-use-network" which has no effect.

This bug probably affects all boolean-ish compile flags in all of sprout.

I did some debugging, and changing this:

sprout-1.1.15.pre/lib/sprout/executable/base.rb:948 to

add_param :use_network, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' }

Fixes the problem. I did some debugging, and even though in Param the
defaults are hidden_value=false, delimiter="=", somehow those are not
being respected. I did a dump of all instance vars in the
param.to_shell and the use_network is defaulting to hidden_value=true
which causes the problem.

Alan Pinstein
Collaborator

Flash compilers expect all boolean params to be explicitly listed like param=true|false

http://livedocs.adobe.com/flex/3/html/compilers_06.html#149503

Many command-line options, such as show-actionscript-warnings and accessible, have true and false values. You specify these values by using the following syntax:

mxmlc -accessible=true -show-actionscript-warnings=true

I am trying to figure out the right way to do this. It seems based on this fact about the flash CLI compilers that we should have a DRY way to make all Boolean params output as =true|false rather than having to specify this behavior for each one.

Is there a reasonable place/way to make https://github.com/apinstein/sprout-flashsdk/blob/master/lib/flashsdk/compiler_base.rb automatically use a BooleanParam subclass that is correctly configured as appropriate?

I am sure there's an appropriate Ruby way to do that but I have no idea how.

Luke Bayes
Owner

Their docs aren't quite correct. Where it says, "You specify these values by...", it should say, "You can specify these values by...."

As it turns out, this works just as well for any parameters that are false by default:

mxmlc --accessible --show-actionscript-warnings

This is much more convenient and much more consistent with how most other command line applications work. As far as I know, use_network is the only flag that is backwards (boolean parameter with default true value).

There are actually lots of other boolean flags in the Compiler Base class (Search this page for 'boolean', http://projectsprouts.org/docs/1.1/FlashSDK/CompilerBase.html). Do you know of any others that default to true?

Thanks,

Luke

Alan Pinstein
Collaborator
Alan Pinstein apinstein referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Alan Pinstein apinstein referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Alan Pinstein apinstein referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Alan Pinstein
Collaborator

Apparently Adobe changed the default for -static-link-runtime-shared-libraries from true to false when Flex 4 came out.

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7add.html
http://opensource.adobe.com/wiki/display/flexsdk/Linking+RSLs+by+Default

Alan Pinstein apinstein referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Alan Pinstein apinstein referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Alan Pinstein apinstein referenced this issue from a commit in apinstein/sprout-flashsdk
Alan Pinstein apinstein [gh-7] Standardize the behavior of options for the flex compilers to …
…reflect the documentation. This actually fixes bugs where certain options were *not* properly manifested to the actual compilers. For instance it was impossible to set -use-network=false prior to this fix.
9402bc4
Alan Pinstein
Collaborator

I think that this pull request is mature and ready to go... thoughts?

Luke Bayes
Owner

Hey Alan,

I'm sorry for lagging on this stuff. I really appreciate all of your help on Sprouts!

I went ahead and made you a collaborator on the flashsdk and main project.

For future work like this, please check out the writable version of the repo and go ahead and check directly into it.

If you have any major changes in mind, please let me know before you go too far.

Alan Pinstein
Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.