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

Detect Windows and Linux and warn if not supported #396

Merged
merged 1 commit into from
Aug 24, 2015

Conversation

brunobowden
Copy link
Contributor

  • Error on tasks when Mac OS X is required
  • Corrected link to the FAQ
  • FAQ now also mentions Linux alongside Windows
  • Fake OS name to unit test for Mac and nonMac systems
  • inTestMustFakeOS property to ensure hermetic tests

Testing:

  • Mac and nonMac command lines
  • Exception thrown when attempting unsupported tasks
    (j2objcTest, j2objcPackLibraries and j2objcXcode)

@brunobowden
Copy link
Contributor Author

PTAL

@advayDev1
Copy link
Contributor

I guess this causes unit-tests to fail:

com.github.j2objccontrib.j2objcgradle.J2objcConfigTest > testFinalConfigure FAILED
    org.gradle.api.InvalidUserDataException: Mac OS X is required for this task. Use `translateOnlyMode` on Windows or Linux:
    https://github.com/j2objc-contrib/j2objc-gradle/blob/master/FAQ.md#how-do-i-develop-on-windows-or-linux
        at com.github.j2objccontrib.j2objcgradle.tasks.Utils.requireMacOSX(Utils.groovy:71)
        at com.github.j2objccontrib.j2objcgradle.J2objcConfig.finalConfigure(J2objcConfig.groovy:565)
        at com.github.j2objccontrib.j2objcgradle.J2objcConfigTest.testFinalConfigure(J2objcConfigTest.groovy:78)

@brunobowden
Copy link
Contributor Author

@advayDev1 - it was quite a bit of work but there's now a Utils.fakeOSName static string that can be set for testing. I was tempted to add some tests that skip using fakeOSName... but I think that's likely best covered by doing some actual project builds.

@brunobowden
Copy link
Contributor Author

I've improved a number of the unsupported error messages, indicating which task is unsupported.

This also pushes us over 100 unit tests... we're now at 104 of them.

List<String> windowsOnlyArgs = new ArrayList<String>()
if (Utils.isWindows()) {
List<String> nonMacOSXArgs = new ArrayList<String>()
if (!Utils.isMacOSX()) {
cycleFinderExec = 'java'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the java binary needed on Linux (as opposed to just windows)?
the shell script should be fine no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'java' only used on Windows

- Error on tasks when Mac OS X is required
- Corrected link to the FAQ
- FAQ now also mentions Linux alongside Windows
- Fake OS name to unit test for Mac and nonMac systems
- inTestMustFakeOS property to ensure hermetic tests

Testing:
- Mac and nonMac command lines
- Exception thrown when attempting unsupported tasks
  (j2objcTest, j2objcPackLibraries and j2objcXcode)
@advayDev1
Copy link
Contributor

lgtm

brunobowden added a commit that referenced this pull request Aug 24, 2015
Detect Windows and Linux and warn if not supported
@brunobowden brunobowden merged commit d4d391e into j2objc-contrib:master Aug 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants