Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot pass dashed script options on windows #409

Closed
lespea opened this issue Nov 13, 2014 · 10 comments
Closed

Cannot pass dashed script options on windows #409

lespea opened this issue Nov 13, 2014 · 10 comments
Labels

Comments

@lespea
Copy link

lespea commented Nov 13, 2014

I have a script that I'm generating with universal:packageBin and I need to pass dashed options as arguments to my script (ie run_script.bat --in a --out b). This works fine in linux but on windows it's appending the dashed args into java_opts. So basically what happens is I get this:

java %java_opts% --in --out -cp "%cp%" %mainClass% --in a --out b

instead of this:

java %java_opts% -cp "%cp%" %mainClass% --in a --out b
@lespea
Copy link
Author

lespea commented Nov 13, 2014

I forgot to mention I'm using 0.8.0-RC1

@muuki88
Copy link
Contributor

muuki88 commented Nov 13, 2014

Can you try out this #393 pull request? It might solve your problem.

@lespea
Copy link
Author

lespea commented Nov 13, 2014

Just tried using the bat template from that commit and it worked. Thanks!

@lespea lespea closed this as completed Nov 13, 2014
@muuki88
Copy link
Contributor

muuki88 commented Nov 13, 2014

Awesome! Could you do us one favor? Can you try running the scripted tests with

sbt "scripted windows/*"

and tell us what windows system you are using?

cc @nazoking

@lespea
Copy link
Author

lespea commented Nov 14, 2014

I ran that for the forked version listed above (#393) and it errored with this:

[error] C:\Users\.\AppData\Local\Temp\sbt_451a5df4\java-app-archetype\build.sbt:9: error: reference to maintainer is ambiguous;
[error] it is imported twice in the same scope by
[error] import NativePackagerKeys._
[error] and import _root_.com.typesafe.sbt.SbtNativePackager.autoImport._
[error] maintainer := "Josh Suereth <[email protected]>"
[error] ^
[info] [error] Type error in expression
[info] Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
[error] x windows / java-app-archetype
[error]    {line 2}  Command failed: Remote sbt initialization failed
[trace] Stack trace suppressed: run 'last *:scripted' for the full output.
[error] (*:scripted) Failed tests:
[error]         windows / java-app-archetype

This is using Windows 7 & jdk8. Do you need the full output and/or for me to run it on master?

Also to be clear to get it to work before I just manually went into that commit, copied the relevant sections of the bat template, and altered the one that was auto-generated.

@lespea
Copy link
Author

lespea commented Nov 14, 2014

That was with a fresh ~/.sbt dir so none of my global settings were used.

@muuki88
Copy link
Contributor

muuki88 commented Nov 15, 2014

No, this is actually fine. This is a small error in the tests (import NativePackagerKeys._ creates the ambigious reference).

The important test is the second one windows/test-bat-template. If this ran fine, everything is okay.
Thanks a lot for your effort :) Only one last question, what locale do you have? Point is, the tests don't run on my machine (Windows 7, jdk 8). The only main difference I can think of is maybe the locale.

@lespea
Copy link
Author

lespea commented Nov 17, 2014

I'm on the English locale. What error are you getting out of curiosity?

@muuki88
Copy link
Contributor

muuki88 commented Nov 17, 2014

See #393 comments of me :( If you have a better guess I'm happy for any advice :)

@eed3si9n
Copy link
Member

Locale is a pair of region and language, by "English locale" do you mean tea-sipping English or English-as-in-America?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants