Skip to content
New issue

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

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

Already on GitHub? # to your account

Multiplatform and mono support #2

Open
gerosalesc opened this issue Oct 7, 2015 · 10 comments
Open

Multiplatform and mono support #2

gerosalesc opened this issue Oct 7, 2015 · 10 comments

Comments

@gerosalesc
Copy link

The library is looking for .exe java executables running on Mac and Mono

@christianrondeau
Copy link
Owner

True, it should be simple (even though in software, nothing ever ends up being as simple as it should have been!)

Are you running on a Mac or Linux? And did you try it? I'd have to setup a VM with Mono on that, and I don't have much time for that right now. If you let me know what errors you have, I can start from there.

Or even better if you can provide a pull request :)

@gerosalesc
Copy link
Author

Yes, I am running on MAC and i did it, unfortunately it tried to find the java.exe and crashed as the executable on MAC doesn't have that extension. We have been discussing this on our team and we will be forking today to start working on this to solve this and #3. And about the comment on the difficulty of this task, it is just me being optimistic :). We will keep you and the community in the loop here.

@gerosalesc
Copy link
Author

Hello again @christianrondeau, we are having issues migrating TestApplication because WPF is not supported by Xamarin(Mono), do you or anyone have any suggestions? migrating to QT for instance?

@christianrondeau
Copy link
Owner

For Java, there is a function called SikuliScriptProcessFactory.GuessJavaPath() - it checks if java.exe exists, and if it doesn't, it throws. It could instead fallback to checking if the Mac version of the executable exists before throwing. That part should be simple :)

As for the test application, I chose WPF because it was simple, and I have no expertise with QT, but in the end the app is simply a simple container for buttons and timers; whether it's QT or WinForms really makes no difference. If you wanted to try replacing the test app, the only thing you must do is replace the assets in SikuliSharp.Tests/Data.sikuli with the new app's assets.

I will not have a lot of time in the very next days, but if you want ideas or feedback, I'll do my best to help!

@christianrondeau
Copy link
Owner

I looked quickly at QT, and there is this project here that looks interesting: https://github.com/ddobrev/QtSharp - but for the purposes of the test app, we only want very basic interactions (a button that changes color), so WinForms might be a simpler since it looks natively supported in Mono: http://www.mono-project.com/docs/gui/winforms/

I worked with WinForms in the past, so I could probably whip up something quickly, but I won't be able to do it in the very next days, so if you feel like trying it, feel free :)

This being said, this is only required for automated tests; if you provide a pull request with your changes for making the Java runtime path work, and you can make SikuliSharp work for your own app, then worst case the tests still won't run on Mac, but at least you'll be able to use SikuliSharp!

@gerosalesc
Copy link
Author

@christianrondeau Thanks for your answers and suggestions.

  • Fixed the "java.exe" literal for a simple "java" executable call which also works for Windows as a command.
  • Will definitely try WinForms to replace WPF but also will check Perspex to see if we can reuse some of the XAML code you already provided.
  • We are also including some logic to get the JAVA home path from /usr/libexec/java_home for OSX operating systems as a fallback scenario to the JAVA_HOME variable.
  • We still feel we want to make sure the tests pass before the PR, that's why we want to migrate this application too.

@christianrondeau
Copy link
Owner

I'm fully open to whatever UI framework you want to use, as long as it's simple :) Perspex seems to fit the bill too, and since it's only for testing, the fact that it's alpha is okay with me.

Thanks for contributing, and again, feel free to ask for help!

@christianrondeau
Copy link
Owner

Hi @gerosalesc - I'm following up on this, were you able to move forward with this? If you have trouble with moving away from WinForms, I suggest you simply break down into two PRs; one with the changes to support Mac, and the other could come later; it won't break tests on Windows anyway, and maybe I can help on that second PR.

Let me know :)

@gerosalesc
Copy link
Author

hello @christianrondeau, sorry for not keep in touch with this for a while. The project took another direction and the task related to this is in the backlog for the time being, Next week we may be able to resurrect it, tough I am not completely sure.

@christianrondeau
Copy link
Owner

No problem - The Mono support would be great to merge back at some point, if it did indeed work (even though the tests still won't run)

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants