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

Using AsyncRun? #80

Closed
sgoodwin opened this Issue Sep 13, 2016 · 10 comments

Comments

Projects
None yet
2 participants
@sgoodwin

sgoodwin commented Sep 13, 2016

I should be able to use AsyncRun as my runner right? (yay vim8.0!) I tried replacing the runner variable, but that made vim freeze up. Is there anything that would prevent this from happening you think?

@gfontenot

This comment has been minimized.

Show comment
Hide comment
@gfontenot

gfontenot Sep 13, 2016

Owner

Not that I know of? I'm not super familiar with how AsyncRun works. Is is just a normal command? As in can you do :AsyncRun xcodebuild manually and have it work?

Owner

gfontenot commented Sep 13, 2016

Not that I know of? I'm not super familiar with how AsyncRun works. Is is just a normal command? As in can you do :AsyncRun xcodebuild manually and have it work?

@sgoodwin

This comment has been minimized.

Show comment
Hide comment
@sgoodwin

sgoodwin Sep 13, 2016

Right. That would start xcodebuild running in the background.

sgoodwin commented Sep 13, 2016

Right. That would start xcodebuild running in the background.

@gfontenot

This comment has been minimized.

Show comment
Hide comment
@gfontenot

gfontenot Sep 13, 2016

Owner

I'm not sure why that would cause any problems then. Mind posting your runner variable?

Owner

gfontenot commented Sep 13, 2016

I'm not sure why that would cause any problems then. Mind posting your runner variable?

@sgoodwin

This comment has been minimized.

Show comment
Hide comment
@sgoodwin

sgoodwin Sep 13, 2016

let g:xcode_runner_command = 'AsyncRun {cmd}'
Where typing :AsyncRun xcodebuild runs xcodebuild in the background.

sgoodwin commented Sep 13, 2016

let g:xcode_runner_command = 'AsyncRun {cmd}'
Where typing :AsyncRun xcodebuild runs xcodebuild in the background.

@gfontenot

This comment has been minimized.

Show comment
Hide comment
@gfontenot

gfontenot Sep 13, 2016

Owner

Yeah that should work fine. I'll look into this soon, unless you find a solution before me.

Owner

gfontenot commented Sep 13, 2016

Yeah that should work fine. I'll look into this soon, unless you find a solution before me.

@sgoodwin

This comment has been minimized.

Show comment
Hide comment
@sgoodwin

sgoodwin Sep 13, 2016

I'm digging into vimscript/plugins stuff in general so I might. Will post if I do.

sgoodwin commented Sep 13, 2016

I'm digging into vimscript/plugins stuff in general so I might. Will post if I do.

@gfontenot

This comment has been minimized.

Show comment
Hide comment
@gfontenot

gfontenot Sep 13, 2016

Owner

For reference, this is the only place we're actually interacting with the runner template. And we're pulling from the user-defined config here

Owner

gfontenot commented Sep 13, 2016

For reference, this is the only place we're actually interacting with the runner template. And we're pulling from the user-defined config here

@sgoodwin

This comment has been minimized.

Show comment
Hide comment
@sgoodwin

sgoodwin Sep 17, 2016

Turns out it was a difference in how things need to be escaped for AsyncRun compared to the runners you list in your docs. I'll have to work something else out, oh well!

sgoodwin commented Sep 17, 2016

Turns out it was a difference in how things need to be escaped for AsyncRun compared to the runners you list in your docs. I'll have to work something else out, oh well!

@sgoodwin sgoodwin closed this Sep 17, 2016

@gfontenot

This comment has been minimized.

Show comment
Hide comment
@gfontenot

gfontenot Sep 17, 2016

Owner

Oh, I'd love to know more about this. Do you mind elaborating?

Owner

gfontenot commented Sep 17, 2016

Oh, I'd love to know more about this. Do you mind elaborating?

@sgoodwin

This comment has been minimized.

Show comment
Hide comment
@sgoodwin

sgoodwin Sep 18, 2016

So vim-xcode builds a string like this to execute:

'AsyncRun! set -o pipefail; NSUnbufferedIO=YES xcrun xcodebuild build -project '\''./TheoryDrills.xcodeproj'\'' -scheme '\''TheoryDrills'\'' -destination "platform=iOS Simulator,name=iPhone SE" | xcpretty --color'

The one that works with AsyncRun is like this:

nnoremap <leader>b :AsyncRun xcodebuild -scheme TheoryDrils -destination name=iPhone\ SE,platform=iOS\ Simulator \| xcpretty<cr>

the spaces in destination need to be escaped and basically nothing else. It splits the command on spaces for some reason before executing it, thus the need for escapes on the spaces in destination. Escapes anywhere else gives "command not found" errors because "xcodebuild" with quotes around it isn't a valid thing.

sgoodwin commented Sep 18, 2016

So vim-xcode builds a string like this to execute:

'AsyncRun! set -o pipefail; NSUnbufferedIO=YES xcrun xcodebuild build -project '\''./TheoryDrills.xcodeproj'\'' -scheme '\''TheoryDrills'\'' -destination "platform=iOS Simulator,name=iPhone SE" | xcpretty --color'

The one that works with AsyncRun is like this:

nnoremap <leader>b :AsyncRun xcodebuild -scheme TheoryDrils -destination name=iPhone\ SE,platform=iOS\ Simulator \| xcpretty<cr>

the spaces in destination need to be escaped and basically nothing else. It splits the command on spaces for some reason before executing it, thus the need for escapes on the spaces in destination. Escapes anywhere else gives "command not found" errors because "xcodebuild" with quotes around it isn't a valid thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment