Skip to content

[Xcode 7] Add types to collections in GT headers #516

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

Merged
merged 14 commits into from
Oct 23, 2015
Merged
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
osx_image: xcode6.4
osx_image: xcode7
language: objective-c
install: script/bootstrap
before_install: brew update
install:
- brew uninstall xctool && brew install --HEAD xctool
- script/bootstrap
script: script/cibuild
notifications:
email: false
2 changes: 1 addition & 1 deletion Carthage/Checkouts/Nimble
Submodule Nimble updated 75 files
+1 −0 .gitignore
+9 −0 .travis.yml
+8 −8 CONTRIBUTING.md
+4 −3 Nimble.podspec
+115 −59 Nimble.xcodeproj/project.pbxproj
+2 −2 Nimble.xcodeproj/project.xcworkspace/xcshareddata/Nimble.xccheckout
+4 −1 Nimble.xcodeproj/xcshareddata/xcschemes/Nimble-OSX.xcscheme
+4 −1 Nimble.xcodeproj/xcshareddata/xcschemes/Nimble-iOS.xcscheme
+7 −2 Nimble/Adapters/AdapterProtocols.swift
+20 −0 Nimble/Adapters/AssertionDispatcher.swift
+53 −5 Nimble/Adapters/AssertionRecorder.swift
+30 −2 Nimble/Adapters/NimbleXCTestHandler.swift
+14 −7 Nimble/DSL+Wait.swift
+6 −6 Nimble/DSL.swift
+46 −21 Nimble/Expectation.swift
+53 −9 Nimble/Expression.swift
+40 −8 Nimble/FailureMessage.swift
+13 −22 Nimble/Matchers/AllPass.swift
+13 −3 Nimble/Matchers/BeAKindOf.swift
+13 −3 Nimble/Matchers/BeAnInstanceOf.swift
+16 −13 Nimble/Matchers/BeCloseTo.swift
+20 −9 Nimble/Matchers/BeEmpty.swift
+4 −4 Nimble/Matchers/BeGreaterThan.swift
+4 −4 Nimble/Matchers/BeGreaterThanOrEqualTo.swift
+3 −3 Nimble/Matchers/BeIdenticalTo.swift
+4 −4 Nimble/Matchers/BeLessThan.swift
+4 −4 Nimble/Matchers/BeLessThanOrEqual.swift
+42 −25 Nimble/Matchers/BeLogical.swift
+3 −3 Nimble/Matchers/BeNil.swift
+8 −8 Nimble/Matchers/BeginWith.swift
+34 −16 Nimble/Matchers/Contain.swift
+11 −11 Nimble/Matchers/EndWith.swift
+14 −11 Nimble/Matchers/Equal.swift
+48 −0 Nimble/Matchers/HaveCount.swift
+3 −3 Nimble/Matchers/Match.swift
+45 −38 Nimble/Matchers/MatcherProtocols.swift
+119 −177 Nimble/Matchers/RaisesException.swift
+181 −0 Nimble/Matchers/ThrowError.swift
+125 −0 Nimble/ObjCExpectation.swift
+27 −14 Nimble/Utils/Poll.swift
+3 −3 Nimble/Utils/SourceLocation.swift
+11 −4 Nimble/Utils/Stringers.swift
+52 −68 Nimble/Wrappers/AsyncMatcherWrapper.swift
+0 −28 Nimble/Wrappers/BasicMatcherWrapper.swift
+0 −18 Nimble/Wrappers/FullMatcherWrapper.swift
+68 −28 Nimble/Wrappers/MatcherFunc.swift
+0 −56 Nimble/Wrappers/NonNilMatcherWrapper.swift
+27 −95 Nimble/Wrappers/ObjCMatcher.swift
+25 −10 Nimble/objc/DSL.h
+43 −6 Nimble/objc/DSL.m
+26 −2 NimbleTests/AsynchronousTest.swift
+54 −21 NimbleTests/Helpers/utils.swift
+7 −7 NimbleTests/Matchers/AllPassTest.swift
+18 −0 NimbleTests/Matchers/BeAKindOfTest.swift
+20 −0 NimbleTests/Matchers/BeAnInstanceOfTest.swift
+10 −0 NimbleTests/Matchers/BeCloseToTest.swift
+6 −6 NimbleTests/Matchers/BeEmptyTest.swift
+23 −1 NimbleTests/Matchers/BeLogicalTest.swift
+4 −4 NimbleTests/Matchers/ContainTest.swift
+43 −0 NimbleTests/Matchers/HaveCountTest.swift
+107 −54 NimbleTests/Matchers/RaisesExceptionTest.swift
+137 −0 NimbleTests/Matchers/ThrowErrorTest.swift
+22 −8 NimbleTests/SynchronousTests.swift
+54 −0 NimbleTests/UserDescriptionTest.swift
+5 −1 NimbleTests/objc/NimbleSpecHelper.h
+4 −3 NimbleTests/objc/ObjCBeEmptyTest.m
+17 −0 NimbleTests/objc/ObjCContainTest.m
+83 −0 NimbleTests/objc/ObjCHaveCount.m
+130 −53 NimbleTests/objc/ObjCRaiseExceptionTest.m
+21 −0 NimbleTests/objc/ObjCSyncTest.m
+52 −0 NimbleTests/objc/ObjCUserDescriptionTest.m
+157 −38 README.md
+8 −0 circle.yml
+178 −0 script/release
+5 −5 test
2 changes: 1 addition & 1 deletion Carthage/Checkouts/Quick
Submodule Quick updated 50 files
+4 −0 .gitignore
+21 −1 CONTRIBUTING.md
+4 −4 Documentation/ArrangeActAssert.md
+1 −1 Documentation/ConfiguringQuick.md
+47 −11 Documentation/InstallingQuick.md
+2 −2 Documentation/NimbleAssertions.md
+26 −0 Documentation/QuickExamplesAndGroups.md
+3 −0 Documentation/SettingUpYourXcodeProject.md
+1 −1 Externals/Nimble
+6 −0 Quick Templates/Quick Configuration Class.xctemplate/Objective-C/___FILEBASENAME___.h
+10 −0 Quick Templates/Quick Configuration Class.xctemplate/Objective-C/___FILEBASENAME___.m
+8 −0 Quick Templates/Quick Configuration Class.xctemplate/Swift/___FILEBASENAME___.swift
+ Quick Templates/Quick Configuration Class.xctemplate/TemplateIcon.icns
+73 −0 Quick Templates/Quick Configuration Class.xctemplate/TemplateInfo.plist
+10 −2 Quick.podspec
+43 −9 Quick.xcodeproj/project.pbxproj
+4 −1 Quick.xcodeproj/xcshareddata/xcschemes/Quick-OSX.xcscheme
+4 −1 Quick.xcodeproj/xcshareddata/xcschemes/Quick-iOS.xcscheme
+3 −3 Quick/Callsite.swift
+5 −5 Quick/Configuration/Configuration.swift
+1 −1 Quick/Configuration/QuickConfiguration.m
+38 −38 Quick/DSL/DSL.swift
+38 −15 Quick/DSL/QCKDSL.h
+10 −1 Quick/DSL/QCKDSL.m
+20 −0 Quick/DSL/World+DSL.h
+21 −19 Quick/DSL/World+DSL.swift
+7 −3 Quick/Example.swift
+12 −8 Quick/ExampleGroup.swift
+1 −1 Quick/ExampleMetadata.swift
+0 −16 Quick/Failure.swift
+3 −1 Quick/Filter.swift
+1 −1 Quick/Info.plist
+24 −7 Quick/QuickSpec.m
+17 −0 Quick/World.h
+16 −16 Quick/World.swift
+1 −1 QuickFocusedTests/FocusedTests+ObjC.m
+1 −1 QuickFocusedTests/Info.plist
+1 −1 QuickTests/FunctionalTests/AfterSuiteTests.swift
+1 −1 QuickTests/FunctionalTests/BeforeSuiteTests.swift
+13 −17 QuickTests/FunctionalTests/FailureTests+ObjC.m
+55 −0 QuickTests/FunctionalTests/FailureUsingXCTAssertTests+ObjC.m
+2 −4 QuickTests/FunctionalTests/ItTests+ObjC.m
+1 −1 QuickTests/FunctionalTests/ItTests.swift
+29 −0 QuickTests/FunctionalTests/SharedExamplesTests+ObjC.m
+12 −4 QuickTests/Helpers/QCKSpecRunner.m
+1 −6 QuickTests/Helpers/XCTestObservationCenter+QCKSuspendObservation.h
+1 −1 QuickTests/Info.plist
+25 −3 README.md
+1 −1 Rakefile
+18 −0 circle.yml
2 changes: 1 addition & 1 deletion ObjectiveGit/GTBlame.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN
- (nullable instancetype)initWithGitBlame:(git_blame *)blame NS_DESIGNATED_INITIALIZER;

/// Get all the hunks in the blame. A convenience wrapper around `enumerateHunksUsingBlock:`
@property (nonatomic, strong, readonly) NSArray *hunks;
@property (nonatomic, strong, readonly) NSArray<GTBlameHunk *> *hunks;

/// The number of hunks in the blame.
@property (nonatomic, readonly) NSUInteger hunkCount;
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTBranch.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ NS_ASSUME_NONNULL_BEGIN
/// error - If not NULL, set to any error that occurs.
///
/// Returns a (possibly empty) array of GTCommits, or nil if an error occurs.
- (nullable NSArray *)uniqueCommitsRelativeToBranch:(GTBranch *)otherBranch error:(NSError **)error;
- (nullable NSArray<GTCommit *> *)uniqueCommitsRelativeToBranch:(GTBranch *)otherBranch error:(NSError **)error;

/// Deletes the local branch and nils out the reference.
- (BOOL)deleteWithError:(NSError **)error;
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTCommit.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN

@property (nonatomic, readonly, strong, nullable) GTSignature *author;
@property (nonatomic, readonly, strong, nullable) GTSignature *committer;
@property (nonatomic, readonly, copy) NSArray *parents;
@property (nonatomic, readonly, copy) NSArray<GTCommit *> *parents;
@property (nonatomic, readonly, nullable) NSString *message;
@property (nonatomic, readonly) NSString *messageDetails;
@property (nonatomic, readonly) NSString *messageSummary;
Expand Down
5 changes: 3 additions & 2 deletions ObjectiveGit/GTConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#import <Foundation/Foundation.h>
#import "git2/types.h"

@class GTRemote;
@class GTRepository;
@class GTSignature;

Expand All @@ -17,11 +18,11 @@ NS_ASSUME_NONNULL_BEGIN
@interface GTConfiguration : NSObject

@property (nonatomic, readonly, strong, nullable) GTRepository *repository;
@property (nonatomic, readonly, copy) NSArray *configurationKeys;
@property (nonatomic, readonly, copy) NSArray<NSString *> *configurationKeys;

/// The GTRemotes in the config. If the configuration isn't associated with any
/// repository, this will always be nil.
@property (nonatomic, readonly, copy, nullable) NSArray *remotes;
@property (nonatomic, readonly, copy, nullable) NSArray<GTRemote *> *remotes;

- (instancetype)init NS_UNAVAILABLE;

Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTEnumerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ NS_ASSUME_NONNULL_BEGIN
/// error - If not NULL, set to any error that occurs during traversal.
///
/// Returns a (possibly empty) array of GTCommits, or nil if an error occurs.
- (nullable NSArray *)allObjectsWithError:(NSError **)error;
- (nullable NSArray<GTCommit *> *)allObjectsWithError:(NSError **)error;

/// Gets the next commit.
///
Expand Down
4 changes: 2 additions & 2 deletions ObjectiveGit/GTIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, readonly) NSUInteger entryCount;

/// The GTIndexEntries in the index.
@property (nonatomic, readonly, copy) NSArray *entries;
@property (nonatomic, readonly, copy) NSArray<GTIndexEntry *> *entries;

/// Whether the index contains conflicted files.
@property (nonatomic, readonly) BOOL hasConflicts;
Expand Down Expand Up @@ -220,7 +220,7 @@ NS_ASSUME_NONNULL_BEGIN
/// error - When something goes wrong, this parameter is set. Optional.
///
/// Returns `YES` in the event that everything has gone smoothly. Otherwise, `NO`.
- (BOOL)updatePathspecs:(nullable NSArray *)pathspecs error:(NSError **)error passingTest:(nullable BOOL (^)(NSString *matchedPathspec, NSString *path, BOOL *stop))block;
- (BOOL)updatePathspecs:(nullable NSArray<NSString*> *)pathspecs error:(NSError **)error passingTest:(nullable BOOL (^)(NSString *matchedPathspec, NSString *path, BOOL *stop))block;

#pragma mark Deprecations
- (nullable GTIndexEntry *)entryWithName:(NSString *)name __deprecated_msg("use entryWithPath: instead.");
Expand Down
4 changes: 2 additions & 2 deletions ObjectiveGit/GTRemote.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ typedef enum {
///
/// This array will contain NSStrings of the form
/// `+refs/heads/*:refs/remotes/REMOTE/*`.
@property (nonatomic, readonly, copy, nullable) NSArray *fetchRefspecs;
@property (nonatomic, readonly, copy, nullable) NSArray<NSString *> *fetchRefspecs;

/// The push refspecs for this remote.
///
/// This array will contain NSStrings of the form
/// `+refs/heads/*:refs/remotes/REMOTE/*`.
@property (nonatomic, readonly, copy, nullable) NSArray *pushRefspecs;
@property (nonatomic, readonly, copy, nullable) NSArray<NSString *> *pushRefspecs;

/// Tests if a name is valid
+ (BOOL)isValidRemoteName:(NSString *)name;
Expand Down
4 changes: 2 additions & 2 deletions ObjectiveGit/GTRepository+Committing.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ NS_ASSUME_NONNULL_BEGIN
/// error - The error if one occurred.
///
/// Returns the newly created commit, or nil if an error occurred.
- (nullable GTCommit *)createCommitWithTree:(GTTree *)tree message:(NSString *)message author:(GTSignature *)author committer:(GTSignature *)committer parents:(nullable NSArray *)parents updatingReferenceNamed:(nullable NSString *)refName error:(NSError **)error;
- (nullable GTCommit *)createCommitWithTree:(GTTree *)tree message:(NSString *)message author:(GTSignature *)author committer:(GTSignature *)committer parents:(nullable NSArray<GTCommit *> *)parents updatingReferenceNamed:(nullable NSString *)refName error:(NSError **)error;

/// Creates a new commit using +createCommitWithTree:message:author:committer:parents:updatingReferenceNamed:error:
/// with -userSignatureForNow as both the author and committer.
- (nullable GTCommit *)createCommitWithTree:(GTTree *)tree message:(NSString *)message parents:(nullable NSArray *)parents updatingReferenceNamed:(nullable NSString *)refName error:(NSError **)error;
- (nullable GTCommit *)createCommitWithTree:(GTTree *)tree message:(NSString *)message parents:(nullable NSArray<GTCommit *> *)parents updatingReferenceNamed:(nullable NSString *)refName error:(NSError **)error;

@end

Expand Down
4 changes: 2 additions & 2 deletions ObjectiveGit/GTRepository+RemoteOperations.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern NSString *const GTRepositoryRemoteOptionsCredentialProvider;
/// error - The error if one ocurred. Can be NULL.
///
/// Retruns a (possibly empty) array with GTFetchHeadEntry objects. Will not be nil.
- (NSArray *)fetchHeadEntriesWithError:(NSError **)error;
- (NSArray<GTFetchHeadEntry *> *)fetchHeadEntriesWithError:(NSError **)error;

#pragma mark - Push

Expand Down Expand Up @@ -78,7 +78,7 @@ extern NSString *const GTRepositoryRemoteOptionsCredentialProvider;
///
/// Returns YES if the push was successful, NO otherwise (and `error`, if provided,
/// will point to an error describing what happened).
- (BOOL)pushBranches:(NSArray *)branches toRemote:(GTRemote *)remote withOptions:(nullable NSDictionary *)options error:(NSError **)error progress:(nullable void (^)(unsigned int current, unsigned int total, size_t bytes, BOOL *stop))progressBlock;
- (BOOL)pushBranches:(NSArray<GTBranch *> *)branches toRemote:(GTRemote *)remote withOptions:(nullable NSDictionary *)options error:(NSError **)error progress:(nullable void (^)(unsigned int current, unsigned int total, size_t bytes, BOOL *stop))progressBlock;

/// Delete a remote branch
///
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTRepository+Reset.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
/// error - The error if one occurred.
///
/// Returns whether the reset was successful.
- (BOOL)resetPathspecs:(NSArray *)pathspecs toCommit:(GTCommit *)commit error:(NSError **)error;
- (BOOL)resetPathspecs:(NSArray<NSString *> *)pathspecs toCommit:(GTCommit *)commit error:(NSError **)error;

@end

Expand Down
16 changes: 8 additions & 8 deletions ObjectiveGit/GTRepository.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ extern NSString * const GTRepositoryInitOptionsOriginURLString;
///
/// returns an array of NSStrings holding the names of the references
/// returns nil if an error occurred and fills the error parameter
- (nullable NSArray *)referenceNamesWithError:(NSError **)error;
- (nullable NSArray<NSString *> *)referenceNamesWithError:(NSError **)error;

/// Get the HEAD reference.
///
Expand All @@ -274,44 +274,44 @@ extern NSString * const GTRepositoryInitOptionsOriginURLString;
/// error - If not NULL, set to any error that occurs.
///
/// Returns an array of GTBranches or nil if an error occurs.
- (nullable NSArray *)localBranchesWithError:(NSError **)error;
- (nullable NSArray<GTBranch *> *)localBranchesWithError:(NSError **)error;

/// Get the remote branches.
///
/// error - If not NULL, set to any error that occurs.
///
/// Returns an array of GTBranches or nil if an error occurs.
- (nullable NSArray *)remoteBranchesWithError:(NSError **)error;
- (nullable NSArray<GTBranch *> *)remoteBranchesWithError:(NSError **)error;

/// Get branches with names sharing a given prefix.
///
/// prefix - The prefix to use for filtering. Must not be nil.
/// error - If not NULL, set to any error that occurs.
///
/// Returns an array of GTBranches or nil if an error occurs.
- (nullable NSArray *)branchesWithPrefix:(NSString *)prefix error:(NSError **)error;
- (nullable NSArray<GTBranch *> *)branchesWithPrefix:(NSString *)prefix error:(NSError **)error;

/// Get the local and remote branches and merge them together by combining local
/// branches with their remote branch, if they have one.
///
/// error - If not NULL, set to any error that occurs.
///
/// Returns an array of GTBranches or nil if an error occurs.
- (nullable NSArray *)branches:(NSError **)error;
- (nullable NSArray<GTBranch *> *)branches:(NSError **)error;

/// List all remotes in the repository
///
/// error - will be filled if an error occurs
///
/// returns an array of NSStrings holding the names of the remotes, or nil if an error occurred
- (nullable NSArray *)remoteNamesWithError:(NSError **)error;
- (nullable NSArray<NSString *> *)remoteNamesWithError:(NSError **)error;

/// Get all tags in the repository.
///
/// error - If not NULL, set to any error that occurs.
///
/// Returns an array of GTTag or nil if an error occurs.
- (nullable NSArray *)allTagsWithError:(NSError **)error;
- (nullable NSArray<GTTag *> *)allTagsWithError:(NSError **)error;

/// Count all commits in the current branch (HEAD)
///
Expand Down Expand Up @@ -367,7 +367,7 @@ extern NSString * const GTRepositoryInitOptionsOriginURLString;
/// error(out) - will be filled if an error occurs
///
/// returns the local commits, an empty array if there is no remote branch, or nil if an error occurred
- (nullable NSArray *)localCommitsRelativeToRemoteBranch:(GTBranch *)remoteBranch error:(NSError **)error;
- (nullable NSArray<GTCommit *> *)localCommitsRelativeToRemoteBranch:(GTBranch *)remoteBranch error:(NSError **)error;

/// Retrieves git's "prepared message" for the next commit, like the default
/// message pre-filled when committing after a conflicting merge.
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, readonly) NSUInteger entryCount;

/// The contents of the tree, as an array of whose objects are of type `GTTreeEntry`
@property (nonatomic, strong, readonly, nullable) NSArray *entries;
@property (nonatomic, strong, readonly, nullable) NSArray<GTTreeEntry *> *entries;

/// The underlying `git_object` as a `git_tree` object.
- (git_tree *)git_tree __attribute__((objc_returns_inner_pointer));
Expand Down
10 changes: 8 additions & 2 deletions script/cibuild
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,16 @@ run_xctool ()
{
if [ -n "$XCWORKSPACE" ]
then
xctool -workspace "$XCWORKSPACE" $XCTOOL_OPTIONS "$@" 2>&1
xctool -workspace "$XCWORKSPACE" $XCTOOL_OPTIONS "$@" \
ONLY_ACTIVE_ARCH=NO \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO 2>&1
elif [ -n "$XCODEPROJ" ]
then
xctool -project "$XCODEPROJ" $XCTOOL_OPTIONS "$@" 2>&1
xctool -project "$XCODEPROJ" $XCTOOL_OPTIONS "$@" \
ONLY_ACTIVE_ARCH=NO \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO 2>&1
else
echo "*** No workspace or project file found."
exit 1
Expand Down