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

Add option to use xcodebuild instead of xctool. #2

Merged
merged 1 commit into from
Apr 16, 2017
Merged

Add option to use xcodebuild instead of xctool. #2

merged 1 commit into from
Apr 16, 2017

Conversation

jmromer
Copy link
Contributor

@jmromer jmromer commented Apr 15, 2017

Hi @burtlo 👋

I came across your gem while working on the Exercism.io Objective-C track.

Unfortunately xctool doesn't support the latest version of Xcode, so I made this modification to allow using xcodebuild instead.

Let me know if you think this would be useful in the published gem.

Sample output using Xcode 8.3.1 (some noise removed):

% objc HelloWorld

Looking for all files with prefix: HelloWorld
Loading files into ExercismTestFixture (Project) at /var/folders/c1/855g8kxn12vcy4g6k97c_cc80000gn/T/ExercismTestFixture/ExercismTestFixture.xcodeproj
ERROR: Unexpected action: test
% objc HelloWorld -h
Usage: objc [options] FILE_PREFIX

    The `objc` binary requires that you provide a file prefix so that it is
    able to find the: header file; source file; and test file.

    $ objc Anagram

    This will find the following: Anagram.h; Anagram.m; and AnagramTest.m

Specific options:
    -x, --xcodebuild                 Use xcodebuild
    -h, --help                       Show this message
        --version                    Show version
% objc HelloWorld -x
▸ Building ExercismTestFixture/IgnoreThisTarget [Debug]
▸ Check Dependencies
▸ Processing IgnoreThisTarget-Info.plist
▸ Touching IgnoreThisTarget.app
▸ Building ExercismTestFixture/test-suite [Debug]
▸ Check Dependencies
▸ Test Succeeded
All tests
Test Suite test-suite.xctest started
HelloWorldTest
    ✓ testNoName (0.086 seconds)
    ✓ testOtherSampleName (0.001 seconds)
    ✓ testSampleName (0.000 seconds)


         Executed 3 tests, with 0 failures (0 unexpected) in 0.087 (0.088) seconds

Adds the ability to pass `-x` or `--xcodebuild` to `objc` to use
xcodebuild instead of xctool. In order to maintain rough parity with
xctool's prettified output, adds xcpretty as a dependency.

The option is helpful for users of up-to-date versions of Xcode because
xctool's compatibility with Xcode lags behind a few versions. Xcode is
currently at 8.3.1; xctool's compatibility extends only to 8.1.
@burtlo burtlo merged commit e19e4cb into burtlo:master Apr 16, 2017
@burtlo
Copy link
Owner

burtlo commented Apr 16, 2017

Hey thanks for keeping this up and running. Merged and pushed 0.0.4

@jmromer jmromer deleted the add-option-for-xcodebuild branch April 16, 2017 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants