Skip to content

Commit

Permalink
Don't rely on cocoapods' versioning.
Browse files Browse the repository at this point in the history
This is to get around spec linting, which doesn't include the pod spec
version information, while the final pod-ed product does.
  • Loading branch information
Eric Tsiliacos and Jeff Hui committed Oct 3, 2014
1 parent 3b75eea commit 03b8d46
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Source/CDRFunctions.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ BOOL CDRClassIsOfType(Class class, const char * const className) {
NSString *CDRVersionString() {
NSString *releaseVersion = nil, *versionDetails = nil;

#if COCOAPODS
#if COCOAPODS_VERSION_MAJOR_Cedar
releaseVersion = [NSString stringWithFormat:@"%d.%d.%d", COCOAPODS_VERSION_MAJOR_Cedar, COCOAPODS_VERSION_MINOR_Cedar, COCOAPODS_VERSION_PATCH_Cedar];
#endif
#if COCOAPODS
versionDetails = @"from CocoaPods";
#endif

Expand All @@ -59,15 +61,15 @@ BOOL CDRClassIsOfType(Class class, const char * const className) {
versionDetails = [cedarFrameworkBundle objectForInfoDictionaryKey:CDRBuildVersionKey];
}

if (releaseVersion) {
NSString *versionString = releaseVersion;
if (versionDetails) {
versionString = [versionString stringByAppendingFormat:@" (%@)", versionDetails];
}
return versionString;
} else {
return @"unknown";
if (!releaseVersion) {
releaseVersion = @"unknown";
}

NSString *versionString = releaseVersion;
if (versionDetails) {
versionString = [versionString stringByAppendingFormat:@" (%@)", versionDetails];
}
return versionString;
}

#pragma mark - Globals
Expand Down

0 comments on commit 03b8d46

Please sign in to comment.