Skip to content

Commit

Permalink
Enabled clang in support project and enabled warning for unrecognized…
Browse files Browse the repository at this point in the history
… selectors. Added clang statements to ignore warning for JMC selectors if JMC is not part of the project.
  • Loading branch information
ashtom committed Mar 22, 2012
1 parent 8e1678a commit fe4307f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Classes/CNSHockeyManager.m
Expand Up @@ -61,6 +61,8 @@ + (CNSHockeyManager *)sharedHockeyManager {
}
#endif

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
+ (id)jmcInstance {
id jmcClass = NSClassFromString(@"JMC");
if ((jmcClass) && ([jmcClass respondsToSelector:@selector(sharedInstance)])) {
Expand All @@ -74,6 +76,7 @@ + (id)jmcInstance {

return nil;
}
#pragma clang diagnostic pop

+ (BOOL)isJMCActive {
id jmcInstance = [self jmcInstance];
Expand All @@ -86,6 +89,8 @@ + (BOOL)isJMCPresent {

#pragma mark - Private Class Methods

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
+ (void)disableJMCCrashReporter {
id jmcInstance = [self jmcInstance];
id jmcOptions = [jmcInstance performSelector:@selector(options)];
Expand All @@ -99,6 +104,7 @@ + (void)disableJMCCrashReporter {
[invocation setArgument:&value atIndex:2];
[invocation invoke];
}
#pragma clang diagnostic pop

+ (BOOL)checkJMCConfiguration:(NSDictionary *)configuration {
return (([configuration isKindOfClass:[NSDictionary class]]) &&
Expand All @@ -108,6 +114,8 @@ + (BOOL)checkJMCConfiguration:(NSDictionary *)configuration {
([[configuration valueForKey:@"project"] length] > 0));
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
+ (void)applyJMCConfiguration:(NSDictionary *)configuration {
id jmcInstance = [self jmcInstance];
SEL configureSelector = @selector(configureJiraConnect:projectKey:apiKey:);
Expand All @@ -124,6 +132,7 @@ + (void)applyJMCConfiguration:(NSDictionary *)configuration {
[invocation setArgument:&key atIndex:4];
[invocation invoke];
}
#pragma clang diagnostic pop

#pragma mark - Public Instance Methods (Configuration)

Expand Down
6 changes: 6 additions & 0 deletions Support/HockeySDK.xcodeproj/project.pbxproj
Expand Up @@ -288,9 +288,12 @@
GCC_VERSION = "";
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
OTHER_CFLAGS = "";
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = iphoneos;
};
name = Debug;
Expand All @@ -309,9 +312,12 @@
GCC_VERSION = "";
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
OTHER_CFLAGS = "";
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
Expand Down

0 comments on commit fe4307f

Please sign in to comment.