[ERROR] command line: Error: default arguments may not be interspersed with other options

171 views
Skip to first unread message

Nek

unread,
Oct 1, 2009, 4:11:46 PM10/1/09
to ProjectSprouts
Hi. I've got another problem.
My rakefile is:

require "sprout"
sprout "as3"

default_size = "930 550"
project_name= "MiniVideoPlayer"


swc :swc do |t|
t.source_path << 'VideoScreen'
classes = "com.nikitadudnik.minivideoplayer.view.VideoScreen "
classes += "com.nikitadudnik.minivideoplayer.view.IVideoScreen"
t.include_classes << classes
end

And when I rake swc it gives me:
rake aborted!
[ERROR] command line: Error: default arguments may not be interspersed
with other options

Use 'compc -help' for information about using the command line.

(See full trace by running task with --trace)

Is there any quick fix? Btw I'm on windows xp.

Luke Bayes

unread,
Oct 1, 2009, 4:49:59 PM10/1/09
to project...@googlegroups.com
Yep -

the 'swc' task is actually a TaskHelper and requires a configured
ProjectModel to work properly. You should switch and use the compc
tasks directly. Probably something more like:

compc :swc do |t|
t.input "VideoScreen"
t.source_path << 'src'
t.include_classes << "com.nikitadudnik.minivideoplayer.view.VideoScreen "
t.include_classes << "com.nikitadudnik.minivideoplayer.view.IVideoScreen"
end

This is assuming you have a folder named 'src' and a main file at:
'src/VideoScreen.as'. This main file should have references to other
classes that you want included in your library.

Here's the rdoc for the COMPCTask:
http://projectsprouts.org/rdoc/classes/Sprout/COMPCTask.html

And here are the rest of 'em:
http://projectsprouts.org/rdoc/

Thanks,

Luke

Luke Bayes

unread,
Oct 1, 2009, 4:50:39 PM10/1/09
to project...@googlegroups.com
Sorry - you'll want to get rid of the trailing space in this line:

t.include_classes << "com.nikitadudnik.minivideoplayer.view.VideoScreen "

Should be:

t.include_classes << "com.nikitadudnik.minivideoplayer.view.VideoScreen"


Thanks,

Luke

Nikita Dudnik

unread,
Oct 2, 2009, 6:41:49 AM10/2/09
to project...@googlegroups.com
I've added it deliberately. Anyway I've removed space this time. Here
goes my new rakefile. It gives me the same error:

require "sprout"
sprout "as3"

default_size = "930 550"
project_name= "MiniVideoPlayer"


compc :swc do |t|
t.source_path << 'VideoScreen'
t.include_classes <<
"com.nikitadudnik.minivideoplayer.view.VideoScreen"
t.include_classes <<
"com.nikitadudnik.minivideoplayer.view.IVideoScreen"
end

Is there some way to see the body of the command line compc call? I have
a feeling something goes wrong on that level.

Luke Bayes

unread,
Oct 2, 2009, 1:10:29 PM10/2/09
to project...@googlegroups.com
You should see the compile command printed out whenever it executes.

You may have just hit a notorious and frustrating snag - the rake
tasks don't have a file dependency on the rakefile itself. So if you
edit the rakefile, you'll want to run 'rake clean' in order to be sure
your tasks all execute from scratch.

You can also chain rake commands, so when I'm working out details in
my rakefile, I'll often run:

rake clean [taskname]

In your case, this would be:

rake clean swc

Once you get the compile task to execute, you should see it output in
the terminal exactly as if you had entered it by hand. You can
sometimes debug issues by copying this string and editing it.

Thanks,

Luke

Nikita Dudnik

unread,
Oct 2, 2009, 1:41:21 PM10/2/09
to project...@googlegroups.com
Ok. I can see it now =) Maybe was too sleepy the first time.

So running the task gives me
C:\fdt_workspace\MiniVideoPlayer>rake clean swc
(in C:/fdt_workspace/MiniVideoPlayer)
>> Execute: compc.exe -output=swc -source-path+=VideoScreen
-include-classes+=com.nikitadudnik.minivideoplayer.view.VideoScreen
-include-classes+=com.nikitadudnik.minivideoplayer.view.IVideoScreen
Adobe Compc (Flex Component Compiler)
Version 3.4.0 build 9271
Copyright (c) 2004-2007 Adobe Systems, Inc. All rights reserved.


rake aborted!
[ERROR] command line: Error: default arguments may not be interspersed
with other options

Use 'compc -help' for information about using the command line.

(See full trace by running task with --trace)

I copied the compc.exe arguments from above and after few minutes got
'em to work. The correct syntax looks absolutely different:

compc.exe -output swc -source-path VideoScreen -include-classes
com.nikitadudnik.minivideoplayer.view.VideoScreen
com.nikitadudnik.minivideoplayer.view.IVideoScreen

Notice the space between classes. That's what I was trying to achieve
adding space to the end of the class name in my first message.
I try to fix it myself waiting for answer =) Gotta learn some ruby and
that's fun.
Btw there is a great intro to rake deserving to be included into sprouts
FAQ. http://martinfowler.com/articles/rake.html
Helped me a lot.

Luke Bayes

unread,
Oct 7, 2009, 11:16:50 PM10/7/09
to project...@googlegroups.com
Hey Nek,

As it turns out, you discovered a pretty major problem with our COMPCTask.

COMPC wasn't working properly if you used any of the params that
aren't implemented by MXMLC.

I just released an update to the as3 bundle and the main sprout gem
that should support your use case as follows:

compc 'bin/SomeProject.swc' do |t|
t.include_classes << 'com.foo.SomeClass'
t.include_classes << 'com.foo.OtherClass'
t.include_classes << 'com.foo.YetAnotherClass'
... more params here
end

Basically, because COMPC extends MXMLC, the 'input' field was being
printed before any params defined by compc and throwing an error that
talked about 'interspersed default options'.

Additionally - we were to_shell-ing the include_classes param
inappropriately. The fix includes the ability to apply a proc to the
add_param field for serialization.

Thanks for finding this!

You should be able to update with:

sudo gem update sprout-as3-bundle


Thanks!

Luke Bayes

Nikita Dudnik

unread,
Oct 8, 2009, 6:55:45 AM10/8/09
to project...@googlegroups.com
Thanks for the fix!
Reply all
Reply to author
Forward
0 new messages