12 Commits
Author SHA1 Message Date
giuseppenuc 145ed8a338 Commit automatico: Aggiornamento dei file 2023-12-17 10:30:17 +01:00
giuseppenuc 9d4eb9cb88 no message 2016-03-15 20:09:57 +01:00
giuseppenuc a105bbb0cd Merge branch 'develop'
* develop:
  - Update Pod
  no message
2016-03-15 20:03:19 +01:00
giuseppenuc 29704c7514 - Update Pod 2016-03-15 20:02:39 +01:00
giuseppenuc c240fe6257 no message 2016-01-18 15:48:39 +01:00
giuseppenuc 255805a2d9 Release 0.1.2 2015-10-29 02:45:51 +01:00
giuseppenuc 6564db5718 no message 2015-10-29 02:42:09 +01:00
giuseppenuc 540a8620e1 no message 2015-09-01 10:12:44 +02:00
giuseppenuc 7b2d0e8670 - Fix Pod Link 2015-07-09 12:57:45 +02:00
giuseppenuc 91f3cc6159 - Add Usage 2015-07-09 12:20:47 +02:00
giuseppenuc 6f13070a1d no message 2015-07-09 12:19:01 +02:00
giuseppenuc 5fd8e46da9 no message 2015-07-09 12:16:18 +02:00
92 changed files with 1587 additions and 1716 deletions

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
*.framework filter=lfs diff=lfs merge=lfs -text
libavcodec.a filter=lfs diff=lfs merge=lfs -text
GoogleMapsBase filter=lfs diff=lfs merge=lfs -text
GoogleMapsCore filter=lfs diff=lfs merge=lfs -text
+1 -4
View File
@@ -9,7 +9,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = "CodFis-Helper" s.name = "CodFis-Helper"
s.version = "0.1.0" s.version = "0.1.3"
s.summary = "CodFis-Helper help you to validate Tax Code" s.summary = "CodFis-Helper help you to validate Tax Code"
s.homepage = "https://github.com/giuseppenucifora/CodFis-Helper" s.homepage = "https://github.com/giuseppenucifora/CodFis-Helper"
s.license = 'MIT' s.license = 'MIT'
@@ -21,7 +21,4 @@ Pod::Spec.new do |s|
s.requires_arc = true s.requires_arc = true
s.source_files = 'CodFis-Helper/*.{h,m}' s.source_files = 'CodFis-Helper/*.{h,m}'
s.resource_bundles = {
'CodFis-Helper' => ['Pod/Assets/*.png']
}
end end
-5
View File
@@ -42,9 +42,4 @@ typedef enum {
- (BOOL) check:(NSString*) codFis; - (BOOL) check:(NSString*) codFis;
@end @end
+53 -10
View File
@@ -61,14 +61,14 @@
- (CodFisResponse*) calculate { - (CodFisResponse*) calculate {
NSError *error; NSMutableArray *errors = [[NSMutableArray alloc] init];
NSMutableString *resposeString = [[NSMutableString alloc] init]; NSMutableString *resposeString = [[NSMutableString alloc] init];
NSString *tempResponse = [self getCodFisSurname]; NSString *tempResponse = [self getCodFisSurname];
if (!tempResponse) { if (!tempResponse) {
error = [NSError errorWithDomain:NSLocalizedString(@"Bad Request in Surname", @"") code:ResponseStatusBadRequest userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:ResponseStatusBadRequest],@"Code",NSLocalizedString(@"Bad Request in Surname", @""),@"Message", nil],@"Meta", nil]]; [errors addObject:[NSError errorWithDomain:NSLocalizedString(@"Bad Request in Surname", @"") code:ResponseStatusBadRequest userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:ResponseStatusBadRequest],@"Code",NSLocalizedString(@"Bad Request in Surname", @""),@"Message", nil],@"Meta", nil]]];
} }
else { else {
[resposeString appendString:tempResponse]; [resposeString appendString:tempResponse];
@@ -77,7 +77,7 @@
tempResponse = [self getCodFisName]; tempResponse = [self getCodFisName];
if (!tempResponse) { if (!tempResponse) {
error = [NSError errorWithDomain:NSLocalizedString(@"Bad Request in Name", @"") code:ResponseStatusBadRequest userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:ResponseStatusBadRequest],@"Code",NSLocalizedString(@"Bad Request in Name", @""),@"Message", nil],@"Meta", nil]]; [errors addObject:[NSError errorWithDomain:NSLocalizedString(@"Bad Request in Surname", @"") code:ResponseStatusBadRequest userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:ResponseStatusBadRequest],@"Code",NSLocalizedString(@"Bad Request in Surname", @""),@"Message", nil],@"Meta", nil]]];
} }
else { else {
[resposeString appendString:tempResponse]; [resposeString appendString:tempResponse];
@@ -86,7 +86,7 @@
tempResponse = [self getCodFisYear]; tempResponse = [self getCodFisYear];
if (!tempResponse) { if (!tempResponse) {
error = [NSError errorWithDomain:NSLocalizedString(@"Bad Request in Year", @"") code:ResponseStatusBadRequest userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:ResponseStatusBadRequest],@"Code",NSLocalizedString(@"Bad Request in Year", @""),@"Message", nil],@"Meta", nil]]; [errors addObject:[NSError errorWithDomain:NSLocalizedString(@"Bad Request in Surname", @"") code:ResponseStatusBadRequest userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:ResponseStatusBadRequest],@"Code",NSLocalizedString(@"Bad Request in Surname", @""),@"Message", nil],@"Meta", nil]]];
} }
else { else {
[resposeString appendString:tempResponse]; [resposeString appendString:tempResponse];
@@ -95,7 +95,7 @@
tempResponse = [self getCodFisMonth]; tempResponse = [self getCodFisMonth];
if (!tempResponse) { if (!tempResponse) {
error = [NSError errorWithDomain:NSLocalizedString(@"Bad Request in Month", @"") code:ResponseStatusBadRequest userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:ResponseStatusBadRequest],@"Code",NSLocalizedString(@"Bad Request in Month", @""),@"Message", nil],@"Meta", nil]]; [errors addObject:[NSError errorWithDomain:NSLocalizedString(@"Bad Request in Surname", @"") code:ResponseStatusBadRequest userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:ResponseStatusBadRequest],@"Code",NSLocalizedString(@"Bad Request in Surname", @""),@"Message", nil],@"Meta", nil]]];
} }
else { else {
[resposeString appendString:tempResponse]; [resposeString appendString:tempResponse];
@@ -104,7 +104,7 @@
tempResponse = [self getCodFisDay]; tempResponse = [self getCodFisDay];
if (!tempResponse) { if (!tempResponse) {
error = [NSError errorWithDomain:NSLocalizedString(@"Bad Request in Day", @"") code:ResponseStatusBadRequest userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:ResponseStatusBadRequest],@"Code",NSLocalizedString(@"Bad Request in Day", @""),@"Message", nil],@"Meta", nil]]; [errors addObject:[NSError errorWithDomain:NSLocalizedString(@"Bad Request in Surname", @"") code:ResponseStatusBadRequest userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:ResponseStatusBadRequest],@"Code",NSLocalizedString(@"Bad Request in Surname", @""),@"Message", nil],@"Meta", nil]]];
} }
else { else {
[resposeString appendString:tempResponse]; [resposeString appendString:tempResponse];
@@ -113,19 +113,24 @@
tempResponse = [self getCodFisPlace]; tempResponse = [self getCodFisPlace];
if (!tempResponse) { if (!tempResponse) {
error = [NSError errorWithDomain:NSLocalizedString(@"Bad Request in Place", @"") code:ResponseStatusBadRequest userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:ResponseStatusBadRequest],@"Code",NSLocalizedString(@"Bad Request in Place", @""),@"Message", nil],@"Meta", nil]]; [errors addObject:[NSError errorWithDomain:NSLocalizedString(@"Bad Request in Surname", @"") code:ResponseStatusBadRequest userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:ResponseStatusBadRequest],@"Code",NSLocalizedString(@"Bad Request in Surname", @""),@"Message", nil],@"Meta", nil]]];
} }
else { else {
[resposeString appendString:tempResponse]; [resposeString appendString:tempResponse];
} }
_codFis = [resposeString stringByReplacingOccurrencesOfString:@" " withString:@""];; _codFis = [resposeString stringByReplacingOccurrencesOfString:@" " withString:@""];;
[resposeString appendString:[self getCodFisControlCode]]; [resposeString appendString:[self getCodFisControlCode]];
return [[CodFisResponse alloc] initWithResponse:resposeString andError:error]; NSString *checkString = [self ControllaCF:[resposeString UTF8String]];
if ([checkString isEqualToString:@""]) {
}
else {
[errors addObject:[NSError errorWithDomain:checkString code:ResponseStatusBadRequest userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:ResponseStatusBadRequest],@"Code",checkString,@"Message", nil],@"Meta", nil]]];
}
return [[CodFisResponse alloc] initWithResponse:resposeString andErrors:errors];
} }
- (BOOL) check:(NSString*) codFis { - (BOOL) check:(NSString*) codFis {
@@ -134,6 +139,7 @@
} }
- (NSString *) getCodFisSurname { - (NSString *) getCodFisSurname {
NSMutableString *resultString = [[NSMutableString alloc] init]; NSMutableString *resultString = [[NSMutableString alloc] init];
NSMutableArray *consonantsArray = [NSMutableArray arrayWithArray:[self getConsonantArray:_surname]]; NSMutableArray *consonantsArray = [NSMutableArray arrayWithArray:[self getConsonantArray:_surname]];
@@ -412,4 +418,41 @@
return false; return false;
} }
- (NSString *) ControllaCF:(const char *) cf {
int s, i, c;
int setdisp[] = { 1, 0, 5, 7, 9, 13, 15, 17, 19, 21, 2, 4, 18, 20,
11, 3, 6, 8, 12, 14, 16, 10, 22, 25, 24, 23 };
if( cf[0] == 0 ) return @"";
if( strlen(cf) != 16 )
return NSLocalizedString(@"La lunghezza del codice fiscale non è\n"
"corretta: il codice fiscale dovrebbe essere lungo\n"
"esattamente 16 caratteri.", @"");
for( i=0; i<16; i++ ){
c = toupper( cf[i] );
if( ! isdigit(c) && !( 'A'<=c && c<='Z' ) )
return NSLocalizedString(@"Il codice fiscale contiene dei caratteri non validi:\n"
"i soli caratteri validi sono le lettere e le cifre.",@"");
}
s = 0;
for( i=1; i<=13; i+=2 ){
c = toupper( cf[i] );
if( isdigit(c) )
s += c - '0';
else
s += c - 'A';
}
for( i=0; i<=14; i+=2 ){
c = toupper( cf[i] );
if( isdigit(c) ) c = c - '0' + 'A';
s += setdisp[c - 'A'];
}
if( s%26 + 'A' != toupper( cf[15] ) )
return NSLocalizedString(@"Il codice fiscale non &egrave; corretto:\n"
"il codice di controllo non corrisponde.",@"");
return @"";
}
@end @end
+2 -2
View File
@@ -11,9 +11,9 @@
@interface CodFisResponse : NSObject @interface CodFisResponse : NSObject
@property (nonatomic, strong, readonly) NSError *responseError; @property (nonatomic, strong, readonly) NSArray *responseErrors;
@property (nonatomic, strong, readonly) NSString *response; @property (nonatomic, strong, readonly) NSString *response;
- (instancetype) initWithResponse:(NSString*) response andError:(NSError*) responseError; - (instancetype) initWithResponse:(NSString*) response andErrors:(NSArray*) responseErrors;
@end @end
+2 -2
View File
@@ -10,10 +10,10 @@
@implementation CodFisResponse @implementation CodFisResponse
- (instancetype) initWithResponse:(NSString*) response andError:(NSError*) responseError { - (instancetype) initWithResponse:(NSString*) response andErrors:(NSArray*) responseErrors {
self = [super init]; self = [super init];
if (self) { if (self) {
_responseError = responseError; _responseErrors = [NSArray arrayWithArray:responseErrors];
_response = response; _response = response;
} }
return self; return self;
+15
View File
@@ -0,0 +1,15 @@
//
// VatNumber+Helper.h
// Pods
//
// Created by Giuseppe Nucifora on 13/07/15.
//
//
#import <Foundation/Foundation.h>
@interface VatNumber_Helper : NSObject
+ (NSString *) evaluate:(NSString*) vatNum;
@end
+44
View File
@@ -0,0 +1,44 @@
//
// VatNumber+Helper.m
// Pods
//
// Created by Giuseppe Nucifora on 13/07/15.
//
//
#import "VatNumber+Helper.h"
@implementation VatNumber_Helper
+ (NSString *) evaluate:(NSString*) vatNum {
vatNum = [vatNum stringByReplacingOccurrencesOfString:@" " withString:@""];
const char * vatNumC = [vatNum UTF8String];
int i, c, s;
if( vatNumC[0] == 0 ) return @"";
if( strlen(vatNumC) != 11 )
return @"La lunghezza della partita IVA non &egrave;\n"
"corretta: la partita IVA dovrebbe essere lunga\n"
"esattamente 11 caratteri.\n";
for( i=0; i<11; i++ ){
if( ! isdigit(vatNumC[i]) )
return @"La partita IVA contiene dei caratteri non ammessi:\n"
"la partita IVA dovrebbe contenere solo cifre.\n";
}
s = 0;
for( i=0; i<=9; i+=2 )
s += vatNumC[i] - '0';
for( i=1; i<=9; i+=2 ){
c = 2*( vatNumC[i] - '0' );
if( c > 9 ) c = c - 9;
s += c;
}
if( ( 10 - s%10 )%10 != vatNumC[10] - '0' )
return @"La partita IVA non &egrave; valida:\n"
"il codice di controllo non corrisponde.";
return @"";
}
@end
+81 -71
View File
@@ -7,7 +7,6 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
02420A3BAD7D56CBD9608A80 /* Pods_CodFis_Helper_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED75084BBB7A339D5827B501 /* Pods_CodFis_Helper_Tests.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
@@ -22,10 +21,12 @@
6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; };
6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; };
682E62E61B4DD3BA00CD5476 /* codFisCodes.json in Resources */ = {isa = PBXBuildFile; fileRef = 682ECFD31B4DCE9C005659B6 /* codFisCodes.json */; }; 682E62E61B4DD3BA00CD5476 /* codFisCodes.json in Resources */ = {isa = PBXBuildFile; fileRef = 682ECFD31B4DCE9C005659B6 /* codFisCodes.json */; };
682E62E91B4E78E500CD5476 /* CodFisResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 682E62E81B4E78E500CD5476 /* CodFisResponse.m */; }; 68CB324F1B53BC5300A2C5E9 /* CodFis+Helper.m in Sources */ = {isa = PBXBuildFile; fileRef = 68CB324C1B53BC5300A2C5E9 /* CodFis+Helper.m */; };
682ECFD41B4DCE9C005659B6 /* CodFis+Helper.m in Sources */ = {isa = PBXBuildFile; fileRef = 682ECFD21B4DCE9C005659B6 /* CodFis+Helper.m */; }; 68CB32501B53BC5300A2C5E9 /* CodFisResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 68CB324D1B53BC5300A2C5E9 /* CodFisResponse.m */; };
68CB32511B53BC5300A2C5E9 /* VatNumber+Helper.m in Sources */ = {isa = PBXBuildFile; fileRef = 68CB324E1B53BC5300A2C5E9 /* VatNumber+Helper.m */; };
7C1E403C4E6EC177D32A986E /* Pods_CodFis_Helper_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E383139C0E63664B8AE74F7E /* Pods_CodFis_Helper_Example.framework */; };
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
91AC20C3FDDAB28D136716A5 /* Pods_CodFis_Helper_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 522AA81E364FC60CEA095D19 /* Pods_CodFis_Helper_Example.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; B6C6E9A3B2FD43BC6ED946D1 /* Pods_CodFis_Helper_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2682307FC5DE245B03A6D22 /* Pods_CodFis_Helper_Tests.framework */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
@@ -39,10 +40,8 @@
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
0FF540E8B32373B53024B477 /* Pods-CodFis-Helper_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CodFis-Helper_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CodFis-Helper_Example/Pods-CodFis-Helper_Example.debug.xcconfig"; sourceTree = "<group>"; }; 0BB4A80C77573D5B9442B004 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1594F5810C36498D7A9E1614 /* Pods-CodFis-Helper_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CodFis-Helper_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-CodFis-Helper_Example/Pods-CodFis-Helper_Example.release.xcconfig"; sourceTree = "<group>"; }; 34B6398434BA625914AFD534 /* Pods-CodFis-Helper_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CodFis-Helper_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-CodFis-Helper_Example/Pods-CodFis-Helper_Example.release.xcconfig"; sourceTree = "<group>"; };
3EAAC1157191A3E29BFE13F9 /* Pods-CodFis-Helper_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CodFis-Helper_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CodFis-Helper_Tests/Pods-CodFis-Helper_Tests.release.xcconfig"; sourceTree = "<group>"; };
522AA81E364FC60CEA095D19 /* Pods_CodFis_Helper_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CodFis_Helper_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6003F58A195388D20070C39A /* CodFis-Helper_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "CodFis-Helper_Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 6003F58A195388D20070C39A /* CodFis-Helper_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "CodFis-Helper_Example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
@@ -70,12 +69,18 @@
682ECFD31B4DCE9C005659B6 /* codFisCodes.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = codFisCodes.json; sourceTree = "<group>"; }; 682ECFD31B4DCE9C005659B6 /* codFisCodes.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = codFisCodes.json; sourceTree = "<group>"; };
6840FB021B4D78B5009724FE /* CodFisResources.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CodFisResources.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 6840FB021B4D78B5009724FE /* CodFisResources.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CodFisResources.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
6840FB051B4D78B5009724FE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 6840FB051B4D78B5009724FE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
68CB324C1B53BC5300A2C5E9 /* CodFis+Helper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "CodFis+Helper.m"; sourceTree = "<group>"; };
68CB324D1B53BC5300A2C5E9 /* CodFisResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CodFisResponse.m; sourceTree = "<group>"; };
68CB324E1B53BC5300A2C5E9 /* VatNumber+Helper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "VatNumber+Helper.m"; sourceTree = "<group>"; };
69D594011BE85121E72B1E7C /* CodFis-Helper.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = "CodFis-Helper.podspec"; path = "../CodFis-Helper.podspec"; sourceTree = "<group>"; }; 69D594011BE85121E72B1E7C /* CodFis-Helper.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = "CodFis-Helper.podspec"; path = "../CodFis-Helper.podspec"; sourceTree = "<group>"; };
72426C36BAE7F3E98B267A8F /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; }; 72426C36BAE7F3E98B267A8F /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; }; 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
8E0FB7BBED01BCFA4ADE6AA3 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; }; 8E0FB7BBED01BCFA4ADE6AA3 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
CB10D64702D4C71012816202 /* Pods-CodFis-Helper_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CodFis-Helper_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CodFis-Helper_Tests/Pods-CodFis-Helper_Tests.debug.xcconfig"; sourceTree = "<group>"; }; D2682307FC5DE245B03A6D22 /* Pods_CodFis_Helper_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CodFis_Helper_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
ED75084BBB7A339D5827B501 /* Pods_CodFis_Helper_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CodFis_Helper_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D5C50C13F78919A6F1296882 /* Pods-CodFis-Helper_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CodFis-Helper_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CodFis-Helper_Tests/Pods-CodFis-Helper_Tests.release.xcconfig"; sourceTree = "<group>"; };
E383139C0E63664B8AE74F7E /* Pods_CodFis_Helper_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CodFis_Helper_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E5A87AE903FA6027B4283B28 /* Pods-CodFis-Helper_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CodFis-Helper_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CodFis-Helper_Tests/Pods-CodFis-Helper_Tests.debug.xcconfig"; sourceTree = "<group>"; };
FCC3DFA59D1E26AB69F81836 /* Pods-CodFis-Helper_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CodFis-Helper_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CodFis-Helper_Example/Pods-CodFis-Helper_Example.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@@ -86,7 +91,7 @@
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */,
6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 6003F592195388D20070C39A /* UIKit.framework in Frameworks */,
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */,
91AC20C3FDDAB28D136716A5 /* Pods_CodFis_Helper_Example.framework in Frameworks */, 7C1E403C4E6EC177D32A986E /* Pods_CodFis_Helper_Example.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@@ -97,7 +102,7 @@
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */,
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */,
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */,
02420A3BAD7D56CBD9608A80 /* Pods_CodFis_Helper_Tests.framework in Frameworks */, B6C6E9A3B2FD43BC6ED946D1 /* Pods_CodFis_Helper_Tests.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@@ -120,7 +125,7 @@
6840FB031B4D78B5009724FE /* CodFisResources */, 6840FB031B4D78B5009724FE /* CodFisResources */,
6003F58C195388D20070C39A /* Frameworks */, 6003F58C195388D20070C39A /* Frameworks */,
6003F58B195388D20070C39A /* Products */, 6003F58B195388D20070C39A /* Products */,
83535D2711874F2FBE325BE0 /* Pods */, FDB01890C5BDD5609F36F739 /* Pods */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
}; };
@@ -141,8 +146,9 @@
6003F58F195388D20070C39A /* CoreGraphics.framework */, 6003F58F195388D20070C39A /* CoreGraphics.framework */,
6003F591195388D20070C39A /* UIKit.framework */, 6003F591195388D20070C39A /* UIKit.framework */,
6003F5AF195388D20070C39A /* XCTest.framework */, 6003F5AF195388D20070C39A /* XCTest.framework */,
522AA81E364FC60CEA095D19 /* Pods_CodFis_Helper_Example.framework */, 0BB4A80C77573D5B9442B004 /* Pods.framework */,
ED75084BBB7A339D5827B501 /* Pods_CodFis_Helper_Tests.framework */, E383139C0E63664B8AE74F7E /* Pods_CodFis_Helper_Example.framework */,
D2682307FC5DE245B03A6D22 /* Pods_CodFis_Helper_Tests.framework */,
); );
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -206,6 +212,9 @@
682ECFD01B4DCE9C005659B6 /* CodFis-Helper */ = { 682ECFD01B4DCE9C005659B6 /* CodFis-Helper */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
68CB324C1B53BC5300A2C5E9 /* CodFis+Helper.m */,
68CB324D1B53BC5300A2C5E9 /* CodFisResponse.m */,
68CB324E1B53BC5300A2C5E9 /* VatNumber+Helper.m */,
682ECFD11B4DCE9C005659B6 /* CodFis+Helper.h */, 682ECFD11B4DCE9C005659B6 /* CodFis+Helper.h */,
682ECFD21B4DCE9C005659B6 /* CodFis+Helper.m */, 682ECFD21B4DCE9C005659B6 /* CodFis+Helper.m */,
682E62E71B4E78E500CD5476 /* CodFisResponse.h */, 682E62E71B4E78E500CD5476 /* CodFisResponse.h */,
@@ -233,13 +242,13 @@
name = "Supporting Files"; name = "Supporting Files";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
83535D2711874F2FBE325BE0 /* Pods */ = { FDB01890C5BDD5609F36F739 /* Pods */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
0FF540E8B32373B53024B477 /* Pods-CodFis-Helper_Example.debug.xcconfig */, FCC3DFA59D1E26AB69F81836 /* Pods-CodFis-Helper_Example.debug.xcconfig */,
1594F5810C36498D7A9E1614 /* Pods-CodFis-Helper_Example.release.xcconfig */, 34B6398434BA625914AFD534 /* Pods-CodFis-Helper_Example.release.xcconfig */,
CB10D64702D4C71012816202 /* Pods-CodFis-Helper_Tests.debug.xcconfig */, E5A87AE903FA6027B4283B28 /* Pods-CodFis-Helper_Tests.debug.xcconfig */,
3EAAC1157191A3E29BFE13F9 /* Pods-CodFis-Helper_Tests.release.xcconfig */, D5C50C13F78919A6F1296882 /* Pods-CodFis-Helper_Tests.release.xcconfig */,
); );
name = Pods; name = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -251,12 +260,12 @@
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "CodFis-Helper_Example" */; buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "CodFis-Helper_Example" */;
buildPhases = ( buildPhases = (
7B046350124575419879D5CA /* Check Pods Manifest.lock */, CDC0BF831834E30A219F8F34 /* 📦 Check Pods Manifest.lock */,
6003F586195388D20070C39A /* Sources */, 6003F586195388D20070C39A /* Sources */,
6003F587195388D20070C39A /* Frameworks */, 6003F587195388D20070C39A /* Frameworks */,
6003F588195388D20070C39A /* Resources */, 6003F588195388D20070C39A /* Resources */,
BE266EF6E2FD05E835103718 /* Embed Pods Frameworks */, DBBC998B1B07CE12C9AC9BEE /* 📦 Embed Pods Frameworks */,
2FF68F2C4942782BE5713A17 /* Copy Pods Resources */, 77899D562C25F0EF3D9BC9E4 /* 📦 Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
@@ -271,12 +280,12 @@
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CodFis-Helper_Tests" */; buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CodFis-Helper_Tests" */;
buildPhases = ( buildPhases = (
219252F992BA5E4EE3CCEEF8 /* Check Pods Manifest.lock */, D59FE387186AA011B4B40EA5 /* 📦 Check Pods Manifest.lock */,
6003F5AA195388D20070C39A /* Sources */, 6003F5AA195388D20070C39A /* Sources */,
6003F5AB195388D20070C39A /* Frameworks */, 6003F5AB195388D20070C39A /* Frameworks */,
6003F5AC195388D20070C39A /* Resources */, 6003F5AC195388D20070C39A /* Resources */,
BFB571F90ED180AAC20C7457 /* Embed Pods Frameworks */, 6E4B7DA29C9A0C70CEF8A80E /* 📦 Embed Pods Frameworks */,
1A3511C276C6DC8F45AE94F5 /* Copy Pods Resources */, 98E33489BAC389DBD7D608EF /* 📦 Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
@@ -373,44 +382,29 @@
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
1A3511C276C6DC8F45AE94F5 /* Copy Pods Resources */ = { 6E4B7DA29C9A0C70CEF8A80E /* 📦 Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputPaths = ( inputPaths = (
); );
name = "Copy Pods Resources"; name = "📦 Embed Pods Frameworks";
outputPaths = ( outputPaths = (
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CodFis-Helper_Tests/Pods-CodFis-Helper_Tests-resources.sh\"\n"; shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CodFis-Helper_Tests/Pods-CodFis-Helper_Tests-frameworks.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
219252F992BA5E4EE3CCEEF8 /* Check Pods Manifest.lock */ = { 77899D562C25F0EF3D9BC9E4 /* 📦 Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputPaths = ( inputPaths = (
); );
name = "Check Pods Manifest.lock"; name = "📦 Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
2FF68F2C4942782BE5713A17 /* Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
outputPaths = ( outputPaths = (
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@@ -418,14 +412,29 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CodFis-Helper_Example/Pods-CodFis-Helper_Example-resources.sh\"\n"; shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CodFis-Helper_Example/Pods-CodFis-Helper_Example-resources.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
7B046350124575419879D5CA /* Check Pods Manifest.lock */ = { 98E33489BAC389DBD7D608EF /* 📦 Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputPaths = ( inputPaths = (
); );
name = "Check Pods Manifest.lock"; name = "📦 Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CodFis-Helper_Tests/Pods-CodFis-Helper_Tests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
CDC0BF831834E30A219F8F34 /* 📦 Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "📦 Check Pods Manifest.lock";
outputPaths = ( outputPaths = (
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@@ -433,14 +442,29 @@
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
BE266EF6E2FD05E835103718 /* Embed Pods Frameworks */ = { D59FE387186AA011B4B40EA5 /* 📦 Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputPaths = ( inputPaths = (
); );
name = "Embed Pods Frameworks"; name = "📦 Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
DBBC998B1B07CE12C9AC9BEE /* 📦 Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "📦 Embed Pods Frameworks";
outputPaths = ( outputPaths = (
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@@ -448,21 +472,6 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CodFis-Helper_Example/Pods-CodFis-Helper_Example-frameworks.sh\"\n"; shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CodFis-Helper_Example/Pods-CodFis-Helper_Example-frameworks.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
BFB571F90ED180AAC20C7457 /* Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CodFis-Helper_Tests/Pods-CodFis-Helper_Tests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */
@@ -470,11 +479,12 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
682E62E91B4E78E500CD5476 /* CodFisResponse.m in Sources */,
6003F59E195388D20070C39A /* CodFisHelperAppDelegate.m in Sources */, 6003F59E195388D20070C39A /* CodFisHelperAppDelegate.m in Sources */,
682ECFD41B4DCE9C005659B6 /* CodFis+Helper.m in Sources */,
6003F5A7195388D20070C39A /* CodFisHelperViewController.m in Sources */, 6003F5A7195388D20070C39A /* CodFisHelperViewController.m in Sources */,
6003F59A195388D20070C39A /* main.m in Sources */, 6003F59A195388D20070C39A /* main.m in Sources */,
68CB324F1B53BC5300A2C5E9 /* CodFis+Helper.m in Sources */,
68CB32501B53BC5300A2C5E9 /* CodFisResponse.m in Sources */,
68CB32511B53BC5300A2C5E9 /* VatNumber+Helper.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@@ -597,7 +607,7 @@
}; };
6003F5C0195388D20070C39A /* Debug */ = { 6003F5C0195388D20070C39A /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 0FF540E8B32373B53024B477 /* Pods-CodFis-Helper_Example.debug.xcconfig */; baseConfigurationReference = FCC3DFA59D1E26AB69F81836 /* Pods-CodFis-Helper_Example.debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
@@ -613,7 +623,7 @@
}; };
6003F5C1195388D20070C39A /* Release */ = { 6003F5C1195388D20070C39A /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 1594F5810C36498D7A9E1614 /* Pods-CodFis-Helper_Example.release.xcconfig */; baseConfigurationReference = 34B6398434BA625914AFD534 /* Pods-CodFis-Helper_Example.release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
@@ -629,7 +639,7 @@
}; };
6003F5C3195388D20070C39A /* Debug */ = { 6003F5C3195388D20070C39A /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = CB10D64702D4C71012816202 /* Pods-CodFis-Helper_Tests.debug.xcconfig */; baseConfigurationReference = E5A87AE903FA6027B4283B28 /* Pods-CodFis-Helper_Tests.debug.xcconfig */;
buildSettings = { buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)"; BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@@ -652,7 +662,7 @@
}; };
6003F5C4195388D20070C39A /* Release */ = { 6003F5C4195388D20070C39A /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 3EAAC1157191A3E29BFE13F9 /* Pods-CodFis-Helper_Tests.release.xcconfig */; baseConfigurationReference = D5C50C13F78919A6F1296882 /* Pods-CodFis-Helper_Tests.release.xcconfig */;
buildSettings = { buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)"; BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@@ -8,6 +8,7 @@
#import "CodFisHelperAppDelegate.h" #import "CodFisHelperAppDelegate.h"
#import "CodFis+Helper.h" #import "CodFis+Helper.h"
#import "VatNumber+Helper.h"
@implementation CodFisHelperAppDelegate @implementation CodFisHelperAppDelegate
@@ -17,27 +18,31 @@
CodFis_Helper *helper = [[CodFis_Helper alloc] init]; CodFis_Helper *helper = [[CodFis_Helper alloc] init];
[helper setSurname:@"Rose"]; [helper setSurname:@"Rossi"];
[helper setName:@"Jean Christophe Domi"]; [helper setName:@"Mario"];
[helper setBirthDay:12]; [helper setBirthDay:15];
[helper setBirthMonth:3]; [helper setBirthMonth:11];
[helper setBirthYear:87]; [helper setBirthYear:83];
[helper setGender:Gender_Man]; [helper setGender:Gender_Man];
[helper setState:OtherCountries]; [helper setState:Italy];
[helper setPlace:@"Maurizio"]; [helper setPlace:@"Milano"];
NSLog(@"%@",[[helper calculate] responseError]); CodFisResponse *response = [helper calculate];
NSLog(@"%@",[[helper calculate] response]);
NSLog(@"%@",[response responseErrors]);
NSLog(@"%@",[response response]);
NSLog(@"%@",[NSNumber numberWithBool:[helper check:@"TESTCFASDASDASD"]]); NSLog(@"%@",[NSNumber numberWithBool:[helper check:@"TESTCFASDASDASD"]]);
NSLog(@"%@",[VatNumber_Helper evaluate:@"050 27300879"]);
return YES; return YES;
} }
@@ -15,6 +15,11 @@
"size" : "60x60", "size" : "60x60",
"scale" : "2x" "scale" : "2x"
}, },
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{ {
"idiom" : "ipad", "idiom" : "ipad",
"size" : "29x29", "size" : "29x29",
+3 -2
View File
@@ -1,12 +1,13 @@
source 'https://github.com/CocoaPods/Specs.git' source 'https://github.com/CocoaPods/Specs.git'
use_frameworks! use_frameworks!
target 'CodFis-Helper_Example', :exclusive => true do target 'CodFis-Helper_Example'do
pod "CodFis-Helper", :path => "../" pod "CodFis-Helper", :path => "../"
end end
target 'CodFis-Helper_Tests', :exclusive => true do target 'CodFis-Helper_Tests' do
pod "CodFis-Helper", :path => "../" pod "CodFis-Helper", :path => "../"
pod 'FBSnapshotTestCase' pod 'FBSnapshotTestCase'
end end
+11 -9
View File
@@ -1,9 +1,9 @@
PODS: PODS:
- CodFis-Helper (0.1.0) - CodFis-Helper (0.1.3)
- FBSnapshotTestCase (2.0.2): - FBSnapshotTestCase (2.0.7):
- FBSnapshotTestCase/SwiftSupport (= 2.0.2) - FBSnapshotTestCase/SwiftSupport (= 2.0.7)
- FBSnapshotTestCase/Core (2.0.2) - FBSnapshotTestCase/Core (2.0.7)
- FBSnapshotTestCase/SwiftSupport (2.0.2): - FBSnapshotTestCase/SwiftSupport (2.0.7):
- FBSnapshotTestCase/Core - FBSnapshotTestCase/Core
DEPENDENCIES: DEPENDENCIES:
@@ -12,10 +12,12 @@ DEPENDENCIES:
EXTERNAL SOURCES: EXTERNAL SOURCES:
CodFis-Helper: CodFis-Helper:
:path: ../ :path: "../"
SPEC CHECKSUMS: SPEC CHECKSUMS:
CodFis-Helper: 16b94c06d9483db0c57582a4b699691e33c8cb0f CodFis-Helper: 28be4c74d7202542459d72354f59b1215871de87
FBSnapshotTestCase: fd500d5b282c4ec60215d26d0b58b0cf271dd0d6 FBSnapshotTestCase: 7e85180d0d141a0cf472352edda7e80d7eaeb547
COCOAPODS: 0.37.2 PODFILE CHECKSUM: 46115fa8956df1348d7a67adf2eadceee1024a14
COCOAPODS: 1.0.0.beta.6
@@ -0,0 +1,15 @@
framework module FBSnapshotTestCase {
umbrella header "FBSnapshotTestCase.h"
export *
module * { export * }
header "FBSnapshotTestCase.h"
header "FBSnapshotTestCasePlatform.h"
header "FBSnapshotTestController.h"
private header "UIImage+Compare.h"
private header "UIImage+Diff.h"
private header "UIImage+Snapshot.h"
}
@@ -32,6 +32,6 @@
@interface UIImage (Compare) @interface UIImage (Compare)
- (BOOL)compareWithImage:(UIImage *)image tolerance:(CGFloat)tolerance; - (BOOL)fb_compareWithImage:(UIImage *)image tolerance:(CGFloat)tolerance;
@end @end
@@ -28,7 +28,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
// //
#import "UIImage+Compare.h" #import <FBSnapshotTestCase/UIImage+Compare.h>
// This makes debugging much more fun // This makes debugging much more fun
typedef union { typedef union {
@@ -44,7 +44,7 @@ typedef union {
@implementation UIImage (Compare) @implementation UIImage (Compare)
- (BOOL)compareWithImage:(UIImage *)image tolerance:(CGFloat)tolerance - (BOOL)fb_compareWithImage:(UIImage *)image tolerance:(CGFloat)tolerance
{ {
NSAssert(CGSizeEqualToSize(self.size, image.size), @"Images must be same size."); NSAssert(CGSizeEqualToSize(self.size, image.size), @"Images must be same size.");
@@ -101,7 +101,7 @@ typedef union {
imageEqual = (memcmp(referenceImagePixels, imagePixels, referenceImageSizeBytes) == 0); imageEqual = (memcmp(referenceImagePixels, imagePixels, referenceImageSizeBytes) == 0);
} else { } else {
// Go through each pixel in turn and see if it is different // Go through each pixel in turn and see if it is different
const NSInteger pixelCount = self.size.width * self.size.height; const NSInteger pixelCount = referenceImageSize.width * referenceImageSize.height;
FBComparePixel *p1 = referenceImagePixels; FBComparePixel *p1 = referenceImagePixels;
FBComparePixel *p2 = imagePixels; FBComparePixel *p2 = imagePixels;
@@ -32,6 +32,6 @@
@interface UIImage (Diff) @interface UIImage (Diff)
- (UIImage *)diffWithImage:(UIImage *)image; - (UIImage *)fb_diffWithImage:(UIImage *)image;
@end @end
@@ -28,11 +28,11 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
// //
#import "UIImage+Diff.h" #import <FBSnapshotTestCase/UIImage+Diff.h>
@implementation UIImage (Diff) @implementation UIImage (Diff)
- (UIImage *)diffWithImage:(UIImage *)image - (UIImage *)fb_diffWithImage:(UIImage *)image
{ {
if (!image) { if (!image) {
return nil; return nil;
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#import <UIKit/UIKit.h>
@interface UIImage (Snapshot)
/// Uses renderInContext: to get a snapshot of the layer.
+ (UIImage *)fb_imageForLayer:(CALayer *)layer;
/// Uses renderInContext: to get a snapshot of the view layer.
+ (UIImage *)fb_imageForViewLayer:(UIView *)view;
/// Uses drawViewHierarchyInRect: to get a snapshot of the view and adds the view into a window if needed.
+ (UIImage *)fb_imageForView:(UIView *)view;
@end
@@ -0,0 +1,62 @@
/*
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#import <FBSnapshotTestCase/UIImage+Snapshot.h>
@implementation UIImage (Snapshot)
+ (UIImage *)fb_imageForLayer:(CALayer *)layer
{
CGRect bounds = layer.bounds;
NSAssert1(CGRectGetWidth(bounds), @"Zero width for layer %@", layer);
NSAssert1(CGRectGetHeight(bounds), @"Zero height for layer %@", layer);
UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0);
CGContextRef context = UIGraphicsGetCurrentContext();
NSAssert1(context, @"Could not generate context for layer %@", layer);
CGContextSaveGState(context);
[layer layoutIfNeeded];
[layer renderInContext:context];
CGContextRestoreGState(context);
UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return snapshot;
}
+ (UIImage *)fb_imageForViewLayer:(UIView *)view
{
[view layoutIfNeeded];
return [self fb_imageForLayer:view.layer];
}
+ (UIImage *)fb_imageForView:(UIView *)view
{
CGRect bounds = view.bounds;
NSAssert1(CGRectGetWidth(bounds), @"Zero width for view %@", view);
NSAssert1(CGRectGetHeight(bounds), @"Zero height for view %@", view);
UIWindow *window = view.window;
if (window == nil) {
window = [[UIWindow alloc] initWithFrame:bounds];
[window addSubview:view];
[window makeKeyAndVisible];
}
UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0);
[view layoutIfNeeded];
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];
UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return snapshot;
}
@end
@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, Facebook, Inc. * Copyright (c) 2015, Facebook, Inc.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under the BSD-style license found in the * This source code is licensed under the BSD-style license found in the
@@ -16,6 +16,21 @@
#import <XCTest/XCTest.h> #import <XCTest/XCTest.h>
/*
There are three ways of setting reference image directories.
1. Set the preprocessor macro FB_REFERENCE_IMAGE_DIR to a double quoted
c-string with the path.
2. Set an environment variable named FB_REFERENCE_IMAGE_DIR with the path. This
takes precedence over the preprocessor macro to allow for run-time override.
3. Keep everything unset, which will cause the reference images to be looked up
inside the bundle holding the current test, in the
Resources/ReferenceImages_* directories.
*/
#ifndef FB_REFERENCE_IMAGE_DIR
#define FB_REFERENCE_IMAGE_DIR ""
#endif
/** /**
Similar to our much-loved XCTAssert() macros. Use this to perform your test. No need to write an explanation, though. Similar to our much-loved XCTAssert() macros. Use this to perform your test. No need to write an explanation, though.
@param view The view to snapshot @param view The view to snapshot
@@ -24,25 +39,11 @@
@param tolerance The percentage of pixels that can differ and still count as an 'identical' view @param tolerance The percentage of pixels that can differ and still count as an 'identical' view
*/ */
#define FBSnapshotVerifyViewWithOptions(view__, identifier__, suffixes__, tolerance__) \ #define FBSnapshotVerifyViewWithOptions(view__, identifier__, suffixes__, tolerance__) \
{ \ FBSnapshotVerifyViewOrLayerWithOptions(View, view__, identifier__, suffixes__, tolerance__)
NSString *envReferenceImageDirectory = [NSProcessInfo processInfo].environment[@"FB_REFERENCE_IMAGE_DIR"]; \
NSError *error__ = nil; \
BOOL comparisonSuccess__; \
XCTAssertTrue((suffixes__.count > 0), @"Suffixes set cannot be empty %@", suffixes__); \
XCTAssertNotNil(envReferenceImageDirectory, @"Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.");\
for (NSString *suffix__ in suffixes__) { \
NSString *referenceImagesDirectory__ = [NSString stringWithFormat:@"%@%@", envReferenceImageDirectory, suffix__]; \
comparisonSuccess__ = [self compareSnapshotOfView:(view__) referenceImagesDirectory:referenceImagesDirectory__ identifier:(identifier__) tolerance:(tolerance__) error:&error__]; \
if (comparisonSuccess__ || self.recordMode) break; \
} \
XCTAssertTrue(comparisonSuccess__, @"Snapshot comparison failed: %@", error__); \
XCTAssertFalse(self.recordMode, @"Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!"); \
}
#define FBSnapshotVerifyView(view__, identifier__) \ #define FBSnapshotVerifyView(view__, identifier__) \
{ \ FBSnapshotVerifyViewWithOptions(view__, identifier__, FBSnapshotTestCaseDefaultSuffixes(), 0)
FBSnapshotVerifyViewWithOptions(view__, identifier__, FBSnapshotTestCaseDefaultSuffixes(), 0); \
}
/** /**
Similar to our much-loved XCTAssert() macros. Use this to perform your test. No need to write an explanation, though. Similar to our much-loved XCTAssert() macros. Use this to perform your test. No need to write an explanation, though.
@@ -52,25 +53,53 @@ FBSnapshotVerifyViewWithOptions(view__, identifier__, FBSnapshotTestCaseDefaultS
@param tolerance The percentage of pixels that can differ and still count as an 'identical' layer @param tolerance The percentage of pixels that can differ and still count as an 'identical' layer
*/ */
#define FBSnapshotVerifyLayerWithOptions(layer__, identifier__, suffixes__, tolerance__) \ #define FBSnapshotVerifyLayerWithOptions(layer__, identifier__, suffixes__, tolerance__) \
FBSnapshotVerifyViewOrLayerWithOptions(Layer, layer__, identifier__, suffixes__, tolerance__)
#define FBSnapshotVerifyLayer(layer__, identifier__) \
FBSnapshotVerifyLayerWithOptions(layer__, identifier__, FBSnapshotTestCaseDefaultSuffixes(), 0)
#define FBSnapshotVerifyViewOrLayerWithOptions(what__, viewOrLayer__, identifier__, suffixes__, tolerance__) \
{ \ { \
NSString *envReferenceImageDirectory = [NSProcessInfo processInfo].environment[@"FB_REFERENCE_IMAGE_DIR"]; \ NSString *referenceImageDirectory = [self getReferenceImageDirectoryWithDefault:(@ FB_REFERENCE_IMAGE_DIR)]; \
NSError *error__ = nil; \ XCTAssertNotNil(referenceImageDirectory, @"Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.");\
BOOL comparisonSuccess__; \
XCTAssertTrue((suffixes__.count > 0), @"Suffixes set cannot be empty %@", suffixes__); \ XCTAssertTrue((suffixes__.count > 0), @"Suffixes set cannot be empty %@", suffixes__); \
XCTAssertNotNil(envReferenceImageDirectory, @"Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.");\ \
for (NSString *suffix__ in suffixes__) { \ BOOL testSuccess__ = NO; \
NSString *referenceImagesDirectory__ = [NSString stringWithFormat:@"%@%@", envReferenceImageDirectory, suffix__]; \ NSError *error__ = nil; \
comparisonSuccess__ = [self compareSnapshotOfLayer:(layer__) referenceImagesDirectory:referenceImagesDirectory__ identifier:(identifier__) tolerance:(tolerance__) error:&error__]; \ NSMutableArray *errors__ = [NSMutableArray array]; \
if (comparisonSuccess__ || self.recordMode) break; \ \
if (self.recordMode) { \
\
NSString *referenceImagesDirectory__ = [NSString stringWithFormat:@"%@%@", referenceImageDirectory, suffixes__.firstObject]; \
BOOL referenceImageSaved__ = [self compareSnapshotOf ## what__ :(viewOrLayer__) referenceImagesDirectory:referenceImagesDirectory__ identifier:(identifier__) tolerance:(tolerance__) error:&error__]; \
if (!referenceImageSaved__) { \
[errors__ addObject:error__]; \
} \ } \
XCTAssertTrue(comparisonSuccess__, @"Snapshot comparison failed: %@", error__); \ } else { \
\
for (NSString *suffix__ in suffixes__) { \
NSString *referenceImagesDirectory__ = [NSString stringWithFormat:@"%@%@", referenceImageDirectory, suffix__]; \
BOOL referenceImageAvailable = [self referenceImageRecordedInDirectory:referenceImagesDirectory__ identifier:(identifier__) error:&error__]; \
\
if (referenceImageAvailable) { \
BOOL comparisonSuccess__ = [self compareSnapshotOf ## what__ :(viewOrLayer__) referenceImagesDirectory:referenceImagesDirectory__ identifier:(identifier__) tolerance:(tolerance__) error:&error__]; \
[errors__ removeAllObjects]; \
if (comparisonSuccess__) { \
testSuccess__ = YES; \
break; \
} else { \
[errors__ addObject:error__]; \
} \
} else { \
[errors__ addObject:error__]; \
} \
} \
} \
XCTAssertTrue(testSuccess__, @"Snapshot comparison failed: %@", errors__.firstObject); \
XCTAssertFalse(self.recordMode, @"Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!"); \ XCTAssertFalse(self.recordMode, @"Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!"); \
} }
#define FBSnapshotVerifyLayer(layer__, identifier__) \
{ \
FBSnapshotVerifyLayerWithOptions(layer__, identifier__, FBSnapshotTestCaseDefaultSuffixes(), 0); \
}
/** /**
The base class of view snapshotting tests. If you have small UI component, it's often easier to configure it in a test The base class of view snapshotting tests. If you have small UI component, it's often easier to configure it in a test
@@ -78,6 +107,10 @@ FBSnapshotVerifyLayerWithOptions(layer__, identifier__, FBSnapshotTestCaseDefaul
In order to flip the tests in your subclass to record the reference images set @c recordMode to @c YES. In order to flip the tests in your subclass to record the reference images set @c recordMode to @c YES.
@attention When recording, the reference image directory should be explicitly
set, otherwise the images may be written to somewhere inside the
simulator directory.
For example: For example:
@code @code
- (void)setUp - (void)setUp
@@ -94,6 +127,26 @@ FBSnapshotVerifyLayerWithOptions(layer__, identifier__, FBSnapshotTestCaseDefaul
*/ */
@property (readwrite, nonatomic, assign) BOOL recordMode; @property (readwrite, nonatomic, assign) BOOL recordMode;
/**
When @c YES appends the name of the device model and OS to the snapshot file name.
The default value is @c NO.
*/
@property (readwrite, nonatomic, assign, getter=isDeviceAgnostic) BOOL deviceAgnostic;
/**
When YES, renders a snapshot of the complete view hierarchy as visible onscreen.
There are several things that do not work if renderInContext: is used.
- UIVisualEffect #70
- UIAppearance #91
- Size Classes #92
@attention If the view does't belong to a UIWindow, it will create one and add the view as a subview.
*/
@property (readwrite, nonatomic, assign) BOOL usesDrawViewHierarchyInRect;
- (void)setUp NS_REQUIRES_SUPER;
- (void)tearDown NS_REQUIRES_SUPER;
/** /**
Performs the comparison or records a snapshot of the layer if recordMode is YES. Performs the comparison or records a snapshot of the layer if recordMode is YES.
@param layer The Layer to snapshot @param layer The Layer to snapshot
@@ -124,4 +177,24 @@ FBSnapshotVerifyLayerWithOptions(layer__, identifier__, FBSnapshotTestCaseDefaul
tolerance:(CGFloat)tolerance tolerance:(CGFloat)tolerance
error:(NSError **)errorPtr; error:(NSError **)errorPtr;
/**
Checks if reference image with identifier based name exists in the reference images directory.
@param referenceImagesDirectory The directory in which reference images are stored.
@param identifier An optional identifier, used if there are multiple snapshot tests in a given -test method.
@param errorPtr An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc).
@returns YES if reference image exists.
*/
- (BOOL)referenceImageRecordedInDirectory:(NSString *)referenceImagesDirectory
identifier:(NSString *)identifier
error:(NSError **)errorPtr;
/**
Returns the reference image directory.
Helper function used to implement the assert macros.
@param dir directory to use if environment variable not specified. Ignored if null or empty.
*/
- (NSString *)getReferenceImageDirectoryWithDefault:(NSString *)dir;
@end @end
@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, Facebook, Inc. * Copyright (c) 2015, Facebook, Inc.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under the BSD-style license found in the * This source code is licensed under the BSD-style license found in the
@@ -8,15 +8,16 @@
* *
*/ */
#import "FBSnapshotTestCase.h" #import <FBSnapshotTestCase/FBSnapshotTestCase.h>
#import <FBSnapshotTestCase/FBSnapshotTestController.h>
#import "FBSnapshotTestController.h"
@implementation FBSnapshotTestCase @implementation FBSnapshotTestCase
{ {
FBSnapshotTestController *_snapshotController; FBSnapshotTestController *_snapshotController;
} }
#pragma mark - Overrides
- (void)setUp - (void)setUp
{ {
[super setUp]; [super setUp];
@@ -40,6 +41,30 @@
_snapshotController.recordMode = recordMode; _snapshotController.recordMode = recordMode;
} }
- (BOOL)isDeviceAgnostic
{
return _snapshotController.deviceAgnostic;
}
- (void)setDeviceAgnostic:(BOOL)deviceAgnostic
{
NSAssert1(_snapshotController, @"%s cannot be called before [super setUp]", __FUNCTION__);
_snapshotController.deviceAgnostic = deviceAgnostic;
}
- (BOOL)usesDrawViewHierarchyInRect
{
return _snapshotController.usesDrawViewHierarchyInRect;
}
- (void)setUsesDrawViewHierarchyInRect:(BOOL)usesDrawViewHierarchyInRect
{
NSAssert1(_snapshotController, @"%s cannot be called before [super setUp]", __FUNCTION__);
_snapshotController.usesDrawViewHierarchyInRect = usesDrawViewHierarchyInRect;
}
#pragma mark - Public API
- (BOOL)compareSnapshotOfLayer:(CALayer *)layer - (BOOL)compareSnapshotOfLayer:(CALayer *)layer
referenceImagesDirectory:(NSString *)referenceImagesDirectory referenceImagesDirectory:(NSString *)referenceImagesDirectory
identifier:(NSString *)identifier identifier:(NSString *)identifier
@@ -66,8 +91,33 @@
error:errorPtr]; error:errorPtr];
} }
#pragma mark - - (BOOL)referenceImageRecordedInDirectory:(NSString *)referenceImagesDirectory
#pragma mark Private API identifier:(NSString *)identifier
error:(NSError **)errorPtr
{
NSAssert1(_snapshotController, @"%s cannot be called before [super setUp]", __FUNCTION__);
_snapshotController.referenceImagesDirectory = referenceImagesDirectory;
UIImage *referenceImage = [_snapshotController referenceImageForSelector:self.invocation.selector
identifier:identifier
error:errorPtr];
return (referenceImage != nil);
}
- (NSString *)getReferenceImageDirectoryWithDefault:(NSString *)dir
{
NSString *envReferenceImageDirectory = [NSProcessInfo processInfo].environment[@"FB_REFERENCE_IMAGE_DIR"];
if (envReferenceImageDirectory) {
return envReferenceImageDirectory;
}
if (dir && dir.length > 0) {
return dir;
}
return [[NSBundle bundleForClass:self.class].resourcePath stringByAppendingPathComponent:@"ReferenceImages"];
}
#pragma mark - Private API
- (BOOL)_compareSnapshotOfViewOrLayer:(id)viewOrLayer - (BOOL)_compareSnapshotOfViewOrLayer:(id)viewOrLayer
referenceImagesDirectory:(NSString *)referenceImagesDirectory referenceImagesDirectory:(NSString *)referenceImagesDirectory
@@ -31,6 +31,14 @@ BOOL FBSnapshotTestCaseIs64Bit(void);
*/ */
NSOrderedSet *FBSnapshotTestCaseDefaultSuffixes(void); NSOrderedSet *FBSnapshotTestCaseDefaultSuffixes(void);
/**
Returns a fully «normalized» file name.
Strips punctuation and spaces and replaces them with @c _. Also appends the device model, running OS and screen size to the file name.
@returns An @c NSString object containing the passed @c fileName with the device model, OS and screen size appended at the end.
*/
NSString *FBDeviceAgnosticNormalizedFileName(NSString *fileName);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
@@ -9,6 +9,7 @@
*/ */
#import <FBSnapshotTestCase/FBSnapshotTestCasePlatform.h> #import <FBSnapshotTestCase/FBSnapshotTestCasePlatform.h>
#import <UIKit/UIKit.h>
BOOL FBSnapshotTestCaseIs64Bit(void) BOOL FBSnapshotTestCaseIs64Bit(void)
{ {
@@ -29,3 +30,20 @@ NSOrderedSet *FBSnapshotTestCaseDefaultSuffixes(void)
} }
return [suffixesSet copy]; return [suffixesSet copy];
} }
NSString *FBDeviceAgnosticNormalizedFileName(NSString *fileName)
{
UIDevice *device = [UIDevice currentDevice];
CGSize screenSize = [[UIApplication sharedApplication] keyWindow].bounds.size;
NSString *os = device.systemVersion;
fileName = [NSString stringWithFormat:@"%@_%@%@_%.0fx%.0f", fileName, device.model, os, screenSize.width, screenSize.height];
NSMutableCharacterSet *invalidCharacters = [NSMutableCharacterSet new];
[invalidCharacters formUnionWithCharacterSet:[NSCharacterSet whitespaceCharacterSet]];
[invalidCharacters formUnionWithCharacterSet:[NSCharacterSet punctuationCharacterSet]];
NSArray *validComponents = [fileName componentsSeparatedByCharactersInSet:invalidCharacters];
fileName = [validComponents componentsJoinedByString:@"_"];
return fileName;
}
@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, Facebook, Inc. * Copyright (c) 2015, Facebook, Inc.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under the BSD-style license found in the * This source code is licensed under the BSD-style license found in the
@@ -37,9 +37,25 @@ extern NSString *const FBReferenceImageFilePathKey;
/** /**
Record snapshots. Record snapshots.
**/ */
@property (readwrite, nonatomic, assign) BOOL recordMode; @property (readwrite, nonatomic, assign) BOOL recordMode;
/**
When @c YES appends the name of the device model and OS to the snapshot file name.
The default value is @c NO.
*/
@property (readwrite, nonatomic, assign, getter=isDeviceAgnostic) BOOL deviceAgnostic;
/**
Uses drawViewHierarchyInRect:afterScreenUpdates: to draw the image instead of renderInContext:
*/
@property (readwrite, nonatomic, assign) BOOL usesDrawViewHierarchyInRect;
/**
The directory in which referfence images are stored.
*/
@property (readwrite, nonatomic, copy) NSString *referenceImagesDirectory;
/** /**
@param testClass The subclass of FBSnapshotTestCase that is using this controller. @param testClass The subclass of FBSnapshotTestCase that is using this controller.
@returns An instance of FBSnapshotTestController. @returns An instance of FBSnapshotTestController.
@@ -53,7 +69,6 @@ extern NSString *const FBReferenceImageFilePathKey;
*/ */
- (instancetype)initWithTestName:(NSString *)testName; - (instancetype)initWithTestName:(NSString *)testName;
/** /**
Performs the comparison of the layer. Performs the comparison of the layer.
@param layer The Layer to snapshot. @param layer The Layer to snapshot.
@@ -95,12 +110,6 @@ extern NSString *const FBReferenceImageFilePathKey;
tolerance:(CGFloat)tolerance tolerance:(CGFloat)tolerance
error:(NSError **)errorPtr; error:(NSError **)errorPtr;
/**
The directory in which referfence images are stored.
*/
@property (readwrite, nonatomic, copy) NSString *referenceImagesDirectory;
/** /**
Loads a reference image. Loads a reference image.
@param selector The test method being run. @param selector The test method being run.
@@ -112,18 +121,6 @@ extern NSString *const FBReferenceImageFilePathKey;
identifier:(NSString *)identifier identifier:(NSString *)identifier
error:(NSError **)errorPtr; error:(NSError **)errorPtr;
/**
Saves a reference image.
@param selector The test method being run.
@param identifier The optional identifier, used when multiple images are tested in a single -test method.
@param errorPtr An error, if this methods returns NO, the error will be something useful.
@returns An image.
*/
- (BOOL)saveReferenceImage:(UIImage *)image
selector:(SEL)selector
identifier:(NSString *)identifier
error:(NSError **)errorPtr;
/** /**
Performs a pixel-by-pixel comparison of the two images with an allowable margin of error. Performs a pixel-by-pixel comparison of the two images with an allowable margin of error.
@param referenceImage The reference (correct) image. @param referenceImage The reference (correct) image.
@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, Facebook, Inc. * Copyright (c) 2015, Facebook, Inc.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under the BSD-style license found in the * This source code is licensed under the BSD-style license found in the
@@ -8,25 +8,31 @@
* *
*/ */
#import "FBSnapshotTestController.h" #import <FBSnapshotTestCase/FBSnapshotTestController.h>
#import <FBSnapshotTestCase/FBSnapshotTestCasePlatform.h>
#import "UIImage+Compare.h" #import <FBSnapshotTestCase/UIImage+Compare.h>
#import "UIImage+Diff.h" #import <FBSnapshotTestCase/UIImage+Diff.h>
#import <FBSnapshotTestCase/UIImage+Snapshot.h>
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
NSString *const FBSnapshotTestControllerErrorDomain = @"FBSnapshotTestControllerErrorDomain"; NSString *const FBSnapshotTestControllerErrorDomain = @"FBSnapshotTestControllerErrorDomain";
NSString *const FBReferenceImageFilePathKey = @"FBReferenceImageFilePathKey"; NSString *const FBReferenceImageFilePathKey = @"FBReferenceImageFilePathKey";
typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
FBTestSnapshotFileNameTypeReference,
FBTestSnapshotFileNameTypeFailedReference,
FBTestSnapshotFileNameTypeFailedTest,
FBTestSnapshotFileNameTypeFailedTestDiff,
};
@implementation FBSnapshotTestController @implementation FBSnapshotTestController
{ {
NSString *_testName; NSString *_testName;
NSFileManager *_fileManager; NSFileManager *_fileManager;
} }
#pragma mark - #pragma mark - Initializers
#pragma mark Lifecycle
- (instancetype)initWithTestClass:(Class)testClass; - (instancetype)initWithTestClass:(Class)testClass;
{ {
@@ -35,23 +41,60 @@ NSString *const FBReferenceImageFilePathKey = @"FBReferenceImageFilePathKey";
- (instancetype)initWithTestName:(NSString *)testName - (instancetype)initWithTestName:(NSString *)testName
{ {
if ((self = [super init])) { if (self = [super init]) {
_testName = [testName copy]; _testName = [testName copy];
_deviceAgnostic = NO;
_fileManager = [[NSFileManager alloc] init]; _fileManager = [[NSFileManager alloc] init];
} }
return self; return self;
} }
#pragma mark - #pragma mark - Overrides
#pragma mark Properties
- (NSString *)description - (NSString *)description
{ {
return [NSString stringWithFormat:@"%@ %@", [super description], _referenceImagesDirectory]; return [NSString stringWithFormat:@"%@ %@", [super description], _referenceImagesDirectory];
} }
#pragma mark - #pragma mark - Public API
#pragma mark Public API
- (BOOL)compareSnapshotOfLayer:(CALayer *)layer
selector:(SEL)selector
identifier:(NSString *)identifier
error:(NSError **)errorPtr
{
return [self compareSnapshotOfViewOrLayer:layer
selector:selector
identifier:identifier
tolerance:0
error:errorPtr];
}
- (BOOL)compareSnapshotOfView:(UIView *)view
selector:(SEL)selector
identifier:(NSString *)identifier
error:(NSError **)errorPtr
{
return [self compareSnapshotOfViewOrLayer:view
selector:selector
identifier:identifier
tolerance:0
error:errorPtr];
}
- (BOOL)compareSnapshotOfViewOrLayer:(id)viewOrLayer
selector:(SEL)selector
identifier:(NSString *)identifier
tolerance:(CGFloat)tolerance
error:(NSError **)errorPtr
{
if (self.recordMode) {
return [self _recordSnapshotOfViewOrLayer:viewOrLayer selector:selector identifier:identifier error:errorPtr];
} else {
return [self _performPixelComparisonWithViewOrLayer:viewOrLayer selector:selector identifier:identifier tolerance:tolerance error:errorPtr];
}
}
- (UIImage *)referenceImageForSelector:(SEL)selector - (UIImage *)referenceImageForSelector:(SEL)selector
identifier:(NSString *)identifier identifier:(NSString *)identifier
@@ -78,42 +121,33 @@ NSString *const FBReferenceImageFilePathKey = @"FBReferenceImageFilePathKey";
return image; return image;
} }
- (BOOL)saveReferenceImage:(UIImage *)image - (BOOL)compareReferenceImage:(UIImage *)referenceImage
selector:(SEL)selector toImage:(UIImage *)image
identifier:(NSString *)identifier tolerance:(CGFloat)tolerance
error:(NSError **)errorPtr error:(NSError **)errorPtr
{ {
BOOL didWrite = NO; if (CGSizeEqualToSize(referenceImage.size, image.size)) {
if (nil != image) { BOOL imagesEqual = [referenceImage fb_compareWithImage:image tolerance:tolerance];
NSString *filePath = [self _referenceFilePathForSelector:selector identifier:identifier];
NSData *pngData = UIImagePNGRepresentation(image);
if (nil != pngData) {
NSError *creationError = nil;
BOOL didCreateDir = [_fileManager createDirectoryAtPath:[filePath stringByDeletingLastPathComponent]
withIntermediateDirectories:YES
attributes:nil
error:&creationError];
if (!didCreateDir) {
if (NULL != errorPtr) { if (NULL != errorPtr) {
*errorPtr = creationError;
}
return NO;
}
didWrite = [pngData writeToFile:filePath options:NSDataWritingAtomic error:errorPtr];
if (didWrite) {
NSLog(@"Reference image save at: %@", filePath);
}
} else {
if (nil != errorPtr) {
*errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain *errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain
code:FBSnapshotTestControllerErrorCodePNGCreationFailed code:FBSnapshotTestControllerErrorCodeImagesDifferent
userInfo:@{ userInfo:@{
FBReferenceImageFilePathKey: filePath, NSLocalizedDescriptionKey: @"Images different",
}]; }];
} }
return imagesEqual;
} }
if (NULL != errorPtr) {
*errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain
code:FBSnapshotTestControllerErrorCodeImagesDifferentSizes
userInfo:@{
NSLocalizedDescriptionKey: @"Images different sizes",
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"referenceImage:%@, image:%@",
NSStringFromCGSize(referenceImage.size),
NSStringFromCGSize(image.size)],
}];
} }
return didWrite; return NO;
} }
- (BOOL)saveFailedReferenceImage:(UIImage *)referenceImage - (BOOL)saveFailedReferenceImage:(UIImage *)referenceImage
@@ -157,7 +191,7 @@ NSString *const FBReferenceImageFilePathKey = @"FBReferenceImageFilePathKey";
identifier:identifier identifier:identifier
fileNameType:FBTestSnapshotFileNameTypeFailedTestDiff]; fileNameType:FBTestSnapshotFileNameTypeFailedTestDiff];
UIImage *diffImage = [referenceImage diffWithImage:testImage]; UIImage *diffImage = [referenceImage fb_diffWithImage:testImage];
NSData *diffImageData = UIImagePNGRepresentation(diffImage); NSData *diffImageData = UIImagePNGRepresentation(diffImage);
if (![diffImageData writeToFile:diffPath options:NSDataWritingAtomic error:errorPtr]) { if (![diffImageData writeToFile:diffPath options:NSDataWritingAtomic error:errorPtr]) {
@@ -170,44 +204,7 @@ NSString *const FBReferenceImageFilePathKey = @"FBReferenceImageFilePathKey";
return YES; return YES;
} }
- (BOOL)compareReferenceImage:(UIImage *)referenceImage #pragma mark - Private API
toImage:(UIImage *)image
tolerance:(CGFloat)tolerance
error:(NSError **)errorPtr {
if (CGSizeEqualToSize(referenceImage.size, image.size)) {
BOOL imagesEqual = [referenceImage compareWithImage:image tolerance:tolerance];
if (NULL != errorPtr) {
*errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain
code:FBSnapshotTestControllerErrorCodeImagesDifferent
userInfo:@{
NSLocalizedDescriptionKey: @"Images different",
}];
}
return imagesEqual;
}
if (NULL != errorPtr) {
*errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain
code:FBSnapshotTestControllerErrorCodeImagesDifferentSizes
userInfo:@{
NSLocalizedDescriptionKey: @"Images different sizes",
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"referenceImage:%@, image:%@",
NSStringFromCGSize(referenceImage.size),
NSStringFromCGSize(image.size)],
}];
}
return NO;
}
#pragma mark -
#pragma mark Private API
typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
FBTestSnapshotFileNameTypeReference,
FBTestSnapshotFileNameTypeFailedReference,
FBTestSnapshotFileNameTypeFailedTest,
FBTestSnapshotFileNameTypeFailedTestDiff,
};
- (NSString *)_fileNameForSelector:(SEL)selector - (NSString *)_fileNameForSelector:(SEL)selector
identifier:(NSString *)identifier identifier:(NSString *)identifier
@@ -232,6 +229,11 @@ typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
if (0 < identifier.length) { if (0 < identifier.length) {
fileName = [fileName stringByAppendingFormat:@"_%@", identifier]; fileName = [fileName stringByAppendingFormat:@"_%@", identifier];
} }
if (self.isDeviceAgnostic) {
fileName = FBDeviceAgnosticNormalizedFileName(fileName);
}
if ([[UIScreen mainScreen] scale] > 1) { if ([[UIScreen mainScreen] scale] > 1) {
fileName = [fileName stringByAppendingFormat:@"@%.fx", [[UIScreen mainScreen] scale]]; fileName = [fileName stringByAppendingFormat:@"@%.fx", [[UIScreen mainScreen] scale]];
} }
@@ -239,7 +241,8 @@ typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
return fileName; return fileName;
} }
- (NSString *)_referenceFilePathForSelector:(SEL)selector identifier:(NSString *)identifier - (NSString *)_referenceFilePathForSelector:(SEL)selector
identifier:(NSString *)identifier
{ {
NSString *fileName = [self _fileNameForSelector:selector NSString *fileName = [self _fileNameForSelector:selector
identifier:identifier identifier:identifier
@@ -265,46 +268,6 @@ typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
return filePath; return filePath;
} }
- (BOOL)compareSnapshotOfLayer:(CALayer *)layer
selector:(SEL)selector
identifier:(NSString *)identifier
error:(NSError **)errorPtr
{
return [self compareSnapshotOfViewOrLayer:layer
selector:selector
identifier:identifier
tolerance:0
error:errorPtr];
}
- (BOOL)compareSnapshotOfView:(UIView *)view
selector:(SEL)selector
identifier:(NSString *)identifier
error:(NSError **)errorPtr
{
return [self compareSnapshotOfViewOrLayer:view
selector:selector
identifier:identifier
tolerance:0
error:errorPtr];
}
- (BOOL)compareSnapshotOfViewOrLayer:(id)viewOrLayer
selector:(SEL)selector
identifier:(NSString *)identifier
tolerance:(CGFloat)tolerance
error:(NSError **)errorPtr
{
if (self.recordMode) {
return [self _recordSnapshotOfViewOrLayer:viewOrLayer selector:selector identifier:identifier error:errorPtr];
} else {
return [self _performPixelComparisonWithViewOrLayer:viewOrLayer selector:selector identifier:identifier tolerance:tolerance error:errorPtr];
}
}
#pragma mark -
#pragma mark Private API
- (BOOL)_performPixelComparisonWithViewOrLayer:(id)viewOrLayer - (BOOL)_performPixelComparisonWithViewOrLayer:(id)viewOrLayer
selector:(SEL)selector selector:(SEL)selector
identifier:(NSString *)identifier identifier:(NSString *)identifier
@@ -313,7 +276,7 @@ typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
{ {
UIImage *referenceImage = [self referenceImageForSelector:selector identifier:identifier error:errorPtr]; UIImage *referenceImage = [self referenceImageForSelector:selector identifier:identifier error:errorPtr];
if (nil != referenceImage) { if (nil != referenceImage) {
UIImage *snapshot = [self _snapshotViewOrLayer:viewOrLayer]; UIImage *snapshot = [self _imageForViewOrLayer:viewOrLayer];
BOOL imagesSame = [self compareReferenceImage:referenceImage toImage:snapshot tolerance:tolerance error:errorPtr]; BOOL imagesSame = [self compareReferenceImage:referenceImage toImage:snapshot tolerance:tolerance error:errorPtr];
if (!imagesSame) { if (!imagesSame) {
[self saveFailedReferenceImage:referenceImage [self saveFailedReferenceImage:referenceImage
@@ -332,53 +295,62 @@ typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
identifier:(NSString *)identifier identifier:(NSString *)identifier
error:(NSError **)errorPtr error:(NSError **)errorPtr
{ {
UIImage *snapshot = [self _snapshotViewOrLayer:viewOrLayer]; UIImage *snapshot = [self _imageForViewOrLayer:viewOrLayer];
return [self saveReferenceImage:snapshot selector:selector identifier:identifier error:errorPtr]; return [self _saveReferenceImage:snapshot selector:selector identifier:identifier error:errorPtr];
} }
- (UIImage *)_snapshotViewOrLayer:(id)viewOrLayer - (BOOL)_saveReferenceImage:(UIImage *)image
selector:(SEL)selector
identifier:(NSString *)identifier
error:(NSError **)errorPtr
{ {
CALayer *layer = nil; BOOL didWrite = NO;
if (nil != image) {
NSString *filePath = [self _referenceFilePathForSelector:selector identifier:identifier];
NSData *pngData = UIImagePNGRepresentation(image);
if (nil != pngData) {
NSError *creationError = nil;
BOOL didCreateDir = [_fileManager createDirectoryAtPath:[filePath stringByDeletingLastPathComponent]
withIntermediateDirectories:YES
attributes:nil
error:&creationError];
if (!didCreateDir) {
if (NULL != errorPtr) {
*errorPtr = creationError;
}
return NO;
}
didWrite = [pngData writeToFile:filePath options:NSDataWritingAtomic error:errorPtr];
if (didWrite) {
NSLog(@"Reference image save at: %@", filePath);
}
} else {
if (nil != errorPtr) {
*errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain
code:FBSnapshotTestControllerErrorCodePNGCreationFailed
userInfo:@{
FBReferenceImageFilePathKey: filePath,
}];
}
}
}
return didWrite;
}
- (UIImage *)_imageForViewOrLayer:(id)viewOrLayer
{
if ([viewOrLayer isKindOfClass:[UIView class]]) { if ([viewOrLayer isKindOfClass:[UIView class]]) {
return [self _renderView:viewOrLayer]; if (_usesDrawViewHierarchyInRect) {
return [UIImage fb_imageForView:viewOrLayer];
} else {
return [UIImage fb_imageForViewLayer:viewOrLayer];
}
} else if ([viewOrLayer isKindOfClass:[CALayer class]]) { } else if ([viewOrLayer isKindOfClass:[CALayer class]]) {
layer = (CALayer *)viewOrLayer; return [UIImage fb_imageForLayer:viewOrLayer];
[layer layoutIfNeeded];
return [self _renderLayer:layer];
} else { } else {
[NSException raise:@"Only UIView and CALayer classes can be snapshotted" format:@"%@", viewOrLayer]; [NSException raise:@"Only UIView and CALayer classes can be snapshotted" format:@"%@", viewOrLayer];
} }
return nil; return nil;
} }
- (UIImage *)_renderLayer:(CALayer *)layer
{
CGRect bounds = layer.bounds;
NSAssert1(CGRectGetWidth(bounds), @"Zero width for layer %@", layer);
NSAssert1(CGRectGetHeight(bounds), @"Zero height for layer %@", layer);
UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0);
CGContextRef context = UIGraphicsGetCurrentContext();
NSAssert1(context, @"Could not generate context for layer %@", layer);
CGContextSaveGState(context);
{
[layer renderInContext:context];
}
CGContextRestoreGState(context);
UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return snapshot;
}
- (UIImage *)_renderView:(UIView *)view
{
[view layoutIfNeeded];
return [self _renderLayer:view.layer];
}
@end @end
@@ -10,40 +10,48 @@
public extension FBSnapshotTestCase { public extension FBSnapshotTestCase {
public func FBSnapshotVerifyView(view: UIView, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), file: String = __FILE__, line: UInt = __LINE__) { public func FBSnapshotVerifyView(view: UIView, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), file: String = __FILE__, line: UInt = __LINE__) {
let envReferenceImageDirectory = NSProcessInfo.processInfo().environment["FB_REFERENCE_IMAGE_DIR"] as? String FBSnapshotVerifyViewOrLayer(view, identifier: identifier, suffixes: suffixes)
var error: NSError?
if let envReferenceImageDirectory = envReferenceImageDirectory {
for suffix in suffixes {
let referenceImagesDirectory = "\(envReferenceImageDirectory)\(suffix)"
let comparisonSuccess = compareSnapshotOfView(view, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: 0, error: &error)
if comparisonSuccess || recordMode {
break
}
assert(comparisonSuccess, message: "Snapshot comparison failed: \(error)", file: file, line: line)
assert(recordMode == false, message: "Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!", file: file, line: line)
}
} else {
assert(false, message: "Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.", file: file, line: line)
}
} }
public func FBSnapshotVerifyLayer(layer: CALayer, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), file: String = __FILE__, line: UInt = __LINE__) { public func FBSnapshotVerifyLayer(layer: CALayer, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), file: String = __FILE__, line: UInt = __LINE__) {
let envReferenceImageDirectory = NSProcessInfo.processInfo().environment["FB_REFERENCE_IMAGE_DIR"] as? String FBSnapshotVerifyViewOrLayer(layer, identifier: identifier, suffixes: suffixes)
}
private func FBSnapshotVerifyViewOrLayer(viewOrLayer: AnyObject, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), file: String = __FILE__, line: UInt = __LINE__) {
let envReferenceImageDirectory = self.getReferenceImageDirectoryWithDefault(FB_REFERENCE_IMAGE_DIR)
var error: NSError? var error: NSError?
var comparisonSuccess = false var comparisonSuccess = false
if let envReferenceImageDirectory = envReferenceImageDirectory { if let envReferenceImageDirectory = envReferenceImageDirectory {
for suffix in suffixes { for suffix in suffixes {
let referenceImagesDirectory = "\(envReferenceImageDirectory)\(suffix)" let referenceImagesDirectory = "\(envReferenceImageDirectory)\(suffix)"
comparisonSuccess = compareSnapshotOfLayer(layer, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: 0, error: &error) if viewOrLayer.isKindOfClass(UIView) {
do {
try compareSnapshotOfView(viewOrLayer as! UIView, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: 0)
comparisonSuccess = true
} catch let error1 as NSError {
error = error1
comparisonSuccess = false
}
} else if viewOrLayer.isKindOfClass(CALayer) {
do {
try compareSnapshotOfLayer(viewOrLayer as! CALayer, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: 0)
comparisonSuccess = true
} catch let error1 as NSError {
error = error1
comparisonSuccess = false
}
} else {
assertionFailure("Only UIView and CALayer classes can be snapshotted")
}
assert(recordMode == false, message: "Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!", file: file, line: line)
if comparisonSuccess || recordMode { if comparisonSuccess || recordMode {
break break
} }
assert(comparisonSuccess, message: "Snapshot comparison failed: \(error)", file: file, line: line) assert(comparisonSuccess, message: "Snapshot comparison failed: \(error)", file: file, line: line)
assert(recordMode == false, message: "Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!", file: file, line: line)
} }
} else { } else {
XCTFail("Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.") XCTFail("Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.")
+3 -3
View File
@@ -44,9 +44,7 @@ Installation with CocoaPods
Replace "Tests" with the name of your test project. Replace "Tests" with the name of your test project.
2. Define `FB_REFERENCE_IMAGE_DIR` in your scheme. This should 2. There are [three ways](https://github.com/facebook/ios-snapshot-test-case/blob/master/FBSnapshotTestCase/FBSnapshotTestCase.h#L19-L29) of setting reference image directories, the recommended one is to define `FB_REFERENCE_IMAGE_DIR` in your scheme. This should point to the directory where you want reference images to be stored. At Facebook, we normally use this:
point to the directory where you want reference images to be stored. At Facebook,
we normally use this:
|Name|Value| |Name|Value|
|:---|:----| |:---|:----|
@@ -75,6 +73,8 @@ Features
- Supply an optional "identifier" if you want to perform multiple snapshots - Supply an optional "identifier" if you want to perform multiple snapshots
in a single test method. in a single test method.
- Support for `CALayer` via `FBSnapshotVerifyLayer`. - Support for `CALayer` via `FBSnapshotVerifyLayer`.
- `usesDrawViewHierarchyInRect` to handle cases like `UIVisualEffect`, `UIAppearance` and Size Classes.
- `isDeviceAgnostic` to allow appending the device model (`iPhone`, `iPad`, `iPod Touch`, etc), OS version and screen size to the images (allowing to have multiple tests for the same «snapshot» for different `OS`s and devices).
Notes Notes
----- -----
@@ -1 +0,0 @@
../../../../../CodFis-Helper/CodFis+Helper.h
@@ -1 +0,0 @@
../../../FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCase.h
@@ -1 +0,0 @@
../../../FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCasePlatform.h
@@ -1 +0,0 @@
../../../FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestController.h
@@ -1 +0,0 @@
../../../FBSnapshotTestCase/FBSnapshotTestCase/UIImage+Compare.h
@@ -1 +0,0 @@
../../../FBSnapshotTestCase/FBSnapshotTestCase/UIImage+Diff.h
@@ -1 +0,0 @@
../../../../../CodFis-Helper/CodFis+Helper.h
@@ -1 +0,0 @@
../../../FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCase.h
@@ -1 +0,0 @@
../../../FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCasePlatform.h
@@ -1 +0,0 @@
../../../FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestController.h
@@ -1 +0,0 @@
../../../FBSnapshotTestCase/FBSnapshotTestCase/UIImage+Compare.h
@@ -1 +0,0 @@
../../../FBSnapshotTestCase/FBSnapshotTestCase/UIImage+Diff.h
+3 -8
View File
@@ -1,6 +1,6 @@
{ {
"name": "CodFis-Helper", "name": "CodFis-Helper",
"version": "0.1.0", "version": "0.1.3",
"summary": "CodFis-Helper help you to validate Tax Code", "summary": "CodFis-Helper help you to validate Tax Code",
"homepage": "https://github.com/giuseppenucifora/CodFis-Helper", "homepage": "https://github.com/giuseppenucifora/CodFis-Helper",
"license": "MIT", "license": "MIT",
@@ -9,16 +9,11 @@
}, },
"source": { "source": {
"git": "https://github.com/giuseppenucifora/CodFis-Helper.git", "git": "https://github.com/giuseppenucifora/CodFis-Helper.git",
"tag": "0.1.0" "tag": "0.1.3"
}, },
"platforms": { "platforms": {
"ios": "7.0" "ios": "7.0"
}, },
"requires_arc": true, "requires_arc": true,
"source_files": "CodFis-Helper/*.{h,m}", "source_files": "CodFis-Helper/*.{h,m}"
"resource_bundles": {
"CodFis-Helper": [
"Pod/Assets/*.png"
]
}
} }
+11 -9
View File
@@ -1,9 +1,9 @@
PODS: PODS:
- CodFis-Helper (0.1.0) - CodFis-Helper (0.1.3)
- FBSnapshotTestCase (2.0.2): - FBSnapshotTestCase (2.0.7):
- FBSnapshotTestCase/SwiftSupport (= 2.0.2) - FBSnapshotTestCase/SwiftSupport (= 2.0.7)
- FBSnapshotTestCase/Core (2.0.2) - FBSnapshotTestCase/Core (2.0.7)
- FBSnapshotTestCase/SwiftSupport (2.0.2): - FBSnapshotTestCase/SwiftSupport (2.0.7):
- FBSnapshotTestCase/Core - FBSnapshotTestCase/Core
DEPENDENCIES: DEPENDENCIES:
@@ -12,10 +12,12 @@ DEPENDENCIES:
EXTERNAL SOURCES: EXTERNAL SOURCES:
CodFis-Helper: CodFis-Helper:
:path: ../ :path: "../"
SPEC CHECKSUMS: SPEC CHECKSUMS:
CodFis-Helper: 16b94c06d9483db0c57582a4b699691e33c8cb0f CodFis-Helper: 28be4c74d7202542459d72354f59b1215871de87
FBSnapshotTestCase: fd500d5b282c4ec60215d26d0b58b0cf271dd0d6 FBSnapshotTestCase: 7e85180d0d141a0cf472352edda7e80d7eaeb547
COCOAPODS: 0.37.2 PODFILE CHECKSUM: 46115fa8956df1348d7a67adf2eadceee1024a14
COCOAPODS: 1.0.0.beta.6
File diff suppressed because it is too large. Load diff
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "0640" LastUpgradeVersion = "0700"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
@@ -14,39 +14,51 @@
buildForAnalyzing = "YES"> buildForAnalyzing = "YES">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "9E17CB4EA20D4DB70300B8AF" BlueprintIdentifier = "B1C26CF5D7BC4752BFC1F8EAEE738DEE"
BuildableName = "CodFis_Helper.framework" BuildableName = "CodFis_Helper.framework"
BlueprintName = "Pods-CodFis-Helper_Tests-CodFis-Helper" BlueprintName = "CodFis-Helper"
ReferencedContainer = "container:Pods.xcodeproj"> ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
</BuildActionEntries> </BuildActionEntries>
</BuildAction> </BuildAction>
<TestAction <TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES" shouldUseLaunchSchemeArgsEnv = "YES">
buildConfiguration = "Debug">
<Testables> <Testables>
</Testables> </Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0" launchStyle = "0"
useCustomWorkingDirectory = "NO" useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO" ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES" debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"> allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B1C26CF5D7BC4752BFC1F8EAEE738DEE"
BuildableName = "CodFis_Helper.framework"
BlueprintName = "CodFis-Helper"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions> <AdditionalOptions>
</AdditionalOptions> </AdditionalOptions>
</LaunchAction> </LaunchAction>
<ProfileAction <ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES" shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = "" savedToolIdentifier = ""
useCustomWorkingDirectory = "NO" useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES"> debugDocumentVersioning = "YES">
</ProfileAction> </ProfileAction>
<AnalyzeAction <AnalyzeAction
@@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "ADB261BDD4DF67A60AAD892E"
BuildableName = "CodFis-Helper.bundle"
BlueprintName = "Pods-CodFis-Helper_Example-CodFis-Helper-CodFis-Helper"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FD508D06D3936BDA8CAF7646"
BuildableName = "CodFis_Helper.framework"
BlueprintName = "Pods-CodFis-Helper_Example-CodFis-Helper"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A985A3E0A157915C3311A610"
BuildableName = "CodFis-Helper.bundle"
BlueprintName = "Pods-CodFis-Helper_Tests-CodFis-Helper-CodFis-Helper"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_CodFis_Helper : NSObject
@end
@implementation PodsDummy_CodFis_Helper
@end
@@ -0,0 +1,4 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
@@ -1,6 +1,9 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "CodFis+Helper.h" #import "CodFis+Helper.h"
#import "CodFisResponse.h"
#import "ResponseConstants.h"
#import "VatNumber+Helper.h"
FOUNDATION_EXPORT double CodFis_HelperVersionNumber; FOUNDATION_EXPORT double CodFis_HelperVersionNumber;
FOUNDATION_EXPORT const unsigned char CodFis_HelperVersionString[]; FOUNDATION_EXPORT const unsigned char CodFis_HelperVersionString[];
@@ -1,5 +1,5 @@
framework module CodFis_Helper { framework module CodFis_Helper {
umbrella header "Pods-CodFis-Helper_Tests-CodFis-Helper-umbrella.h" umbrella header "CodFis-Helper-umbrella.h"
export * export *
module * { export * } module * { export * }
@@ -0,0 +1,7 @@
CONFIGURATION_BUILD_DIR = $PODS_SHARED_BUILD_DIR/CodFis-Helper
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
PODS_ROOT = ${SRCROOT}
PODS_SHARED_BUILD_DIR = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.1.0</string> <string>0.1.3</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
@@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_FBSnapshotTestCase : NSObject
@end
@implementation PodsDummy_FBSnapshotTestCase
@end
@@ -0,0 +1,4 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
@@ -0,0 +1,15 @@
framework module FBSnapshotTestCase {
umbrella header "FBSnapshotTestCase.h"
export *
module * { export * }
header "FBSnapshotTestCase.h"
header "FBSnapshotTestCasePlatform.h"
header "FBSnapshotTestController.h"
private header "UIImage+Compare.h"
private header "UIImage+Diff.h"
private header "UIImage+Snapshot.h"
}
@@ -0,0 +1,11 @@
CONFIGURATION_BUILD_DIR = $PODS_SHARED_BUILD_DIR/FBSnapshotTestCase
ENABLE_BITCODE = NO
FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
OTHER_LDFLAGS = -framework "Foundation" -framework "QuartzCore" -framework "UIKit" -framework "XCTest"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_ROOT = ${SRCROOT}
PODS_SHARED_BUILD_DIR = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.1.0</string> <string>2.0.7</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
@@ -1,9 +0,0 @@
#include "Pods-CodFis-Helper_Example-CodFis-Helper.xcconfig"
CONFIGURATION_BUILD_DIR = $PODS_FRAMEWORK_BUILD_PATH
FRAMEWORK_SEARCH_PATHS = "$PODS_FRAMEWORK_BUILD_PATH"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/CodFis-Helper" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CodFis-Helper" "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase"
OTHER_LDFLAGS = -ObjC
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-CodFis-Helper_Example
PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES
@@ -1,5 +0,0 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_Pods_CodFis_Helper_Example_CodFis_Helper : NSObject
@end
@implementation PodsDummy_Pods_CodFis_Helper_Example_CodFis_Helper
@end
@@ -1,5 +0,0 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
#import "Pods-CodFis-Helper_Example-environment.h"
@@ -1,6 +0,0 @@
framework module CodFis_Helper {
umbrella header "Pods-CodFis-Helper_Example-CodFis-Helper-umbrella.h"
export *
module * { export * }
}
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
@@ -23,4 +23,4 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
Generated by CocoaPods - http://cocoapods.org Generated by CocoaPods - https://cocoapods.org
@@ -41,7 +41,7 @@ THE SOFTWARE.
</dict> </dict>
<dict> <dict>
<key>FooterText</key> <key>FooterText</key>
<string>Generated by CocoaPods - http://cocoapods.org</string> <string>Generated by CocoaPods - https://cocoapods.org</string>
<key>Title</key> <key>Title</key>
<string></string> <string></string>
<key>Type</key> <key>Type</key>
@@ -1,14 +0,0 @@
// To check if a library is compiled with CocoaPods you
// can use the `COCOAPODS` macro definition which is
// defined in the xcconfigs so it is available in
// headers also when they are imported in the client
// project.
// CodFis-Helper
#define COCOAPODS_POD_AVAILABLE_CodFis_Helper
#define COCOAPODS_VERSION_MAJOR_CodFis_Helper 0
#define COCOAPODS_VERSION_MINOR_CodFis_Helper 1
#define COCOAPODS_VERSION_PATCH_CodFis_Helper 0
@@ -8,48 +8,84 @@ SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
install_framework() install_framework()
{ {
local source="${BUILT_PRODUCTS_DIR}/Pods-CodFis-Helper_Example/$1" if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" local source="${BUILT_PRODUCTS_DIR}/$1"
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
elif [ -r "$1" ]; then
local source="$1"
fi
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then if [ -L "${source}" ]; then
echo "Symlinked..." echo "Symlinked..."
source=$(readlink "${source}") source="$(readlink "${source}")"
fi fi
# use filter instead of exclude so missing patterns dont' throw errors # use filter instead of exclude so missing patterns dont' throw errors
echo "rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" ${source} ${destination}" echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" "${source}" "${destination}" rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
# Resign the code if required by the build settings to avoid unstable apps
if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then local basename
code_sign "${destination}/$1" basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
fi fi
# Embed linked Swift runtime libraries # Strip invalid architectures so "fat" simulator / device frameworks work on device
local basename if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
basename=$(echo $1 | sed -E s/\\..+// && exit ${PIPESTATUS[0]}) strip_invalid_archs "$binary"
fi
# Resign the code if required by the build settings to avoid unstable apps
code_sign_if_enabled "${destination}/$(basename "$1")"
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/$1/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
for lib in $swift_runtime_libs; do for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then code_sign_if_enabled "${destination}/${lib}"
code_sign "${destination}/${lib}"
fi
done done
fi
} }
# Signs a framework with the provided identity # Signs a framework with the provided identity
code_sign() { code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identitiy # Use the current code_sign_identitiy
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1" echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\""
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
fi
}
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $archs; do
if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
stripped="$stripped $arch"
fi
done
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
} }
if [[ "$CONFIGURATION" == "Debug" ]]; then if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework 'CodFis_Helper.framework' install_framework "$BUILT_PRODUCTS_DIR/CodFis-Helper/CodFis_Helper.framework"
fi fi
if [[ "$CONFIGURATION" == "Release" ]]; then if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework 'CodFis_Helper.framework' install_framework "$BUILT_PRODUCTS_DIR/CodFis-Helper/CodFis_Helper.framework"
fi fi
@@ -8,64 +8,6 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
XCASSET_FILES=() XCASSET_FILES=()
realpath() {
DIRECTORY=$(cd "${1%/*}" && pwd)
FILENAME="${1##*/}"
echo "$DIRECTORY/$FILENAME"
}
install_resource()
{
case $1 in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
;;
*.framework)
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
/*)
echo "$1"
echo "$1" >> "$RESOURCES_TO_COPY"
;;
*)
echo "${PODS_ROOT}/$1"
echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
;;
esac
}
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]]; then
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
case "${TARGETED_DEVICE_FAMILY}" in case "${TARGETED_DEVICE_FAMILY}" in
1,2) 1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
@@ -81,6 +23,73 @@ then
;; ;;
esac esac
realpath() {
DIRECTORY="$(cd "${1%/*}" && pwd)"
FILENAME="${1##*/}"
echo "$DIRECTORY/$FILENAME"
}
install_resource()
{
if [[ "$1" = /* ]] ; then
RESOURCE_PATH="$1"
else
RESOURCE_PATH="${PODS_ROOT}/$1"
fi
if [[ ! -e "$RESOURCE_PATH" ]] ; then
cat << EOM
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
EOM
exit 1
fi
case $RESOURCE_PATH in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}"
;;
*.framework)
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av $RESOURCE_PATH ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
xcrun momc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
xcrun momc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
xcrun mapc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH")
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
*)
echo "$RESOURCE_PATH"
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
;;
esac
}
mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
# Find all other xcassets (this unfortunately includes those of path pods and other targets). # Find all other xcassets (this unfortunately includes those of path pods and other targets).
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
while read line; do while read line; do
@@ -89,5 +98,5 @@ then
fi fi
done <<<"$OTHER_XCASSETS" done <<<"$OTHER_XCASSETS"
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi fi
@@ -1,8 +1,6 @@
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH" FRAMEWORK_SEARCH_PATHS = $(inherited) "$CONFIGURATION_BUILD_DIR/CodFis-Helper"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/CodFis_Helper.framework/Headers" OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/CodFis-Helper/CodFis_Helper.framework/Headers"
OTHER_LDFLAGS = $(inherited) -ObjC -framework "CodFis_Helper" OTHER_LDFLAGS = $(inherited) -framework "CodFis_Helper"
OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-CodFis-Helper_Example
PODS_ROOT = ${SRCROOT}/Pods PODS_ROOT = ${SRCROOT}/Pods
@@ -1,8 +1,6 @@
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH" FRAMEWORK_SEARCH_PATHS = $(inherited) "$CONFIGURATION_BUILD_DIR/CodFis-Helper"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/CodFis_Helper.framework/Headers" OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/CodFis-Helper/CodFis_Helper.framework/Headers"
OTHER_LDFLAGS = $(inherited) -ObjC -framework "CodFis_Helper" OTHER_LDFLAGS = $(inherited) -framework "CodFis_Helper"
OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-CodFis-Helper_Example
PODS_ROOT = ${SRCROOT}/Pods PODS_ROOT = ${SRCROOT}/Pods
@@ -1,9 +0,0 @@
#include "Pods-CodFis-Helper_Tests-CodFis-Helper.xcconfig"
CONFIGURATION_BUILD_DIR = $PODS_FRAMEWORK_BUILD_PATH
FRAMEWORK_SEARCH_PATHS = "$PODS_FRAMEWORK_BUILD_PATH"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/CodFis-Helper" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CodFis-Helper" "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase"
OTHER_LDFLAGS = -ObjC
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-CodFis-Helper_Tests
PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES
@@ -1,5 +0,0 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_Pods_CodFis_Helper_Tests_CodFis_Helper : NSObject
@end
@implementation PodsDummy_Pods_CodFis_Helper_Tests_CodFis_Helper
@end
@@ -1,5 +0,0 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
#import "Pods-CodFis-Helper_Tests-environment.h"
@@ -1,7 +0,0 @@
#import <UIKit/UIKit.h>
#import "CodFis+Helper.h"
FOUNDATION_EXPORT double CodFis_HelperVersionNumber;
FOUNDATION_EXPORT const unsigned char CodFis_HelperVersionString[];
@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.0.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
@@ -1,10 +0,0 @@
#include "Pods-CodFis-Helper_Tests-FBSnapshotTestCase.xcconfig"
CONFIGURATION_BUILD_DIR = $PODS_FRAMEWORK_BUILD_PATH
FRAMEWORK_SEARCH_PATHS = "$PODS_FRAMEWORK_BUILD_PATH" ${PODS_CODFIS_HELPER_TESTS_FBSNAPSHOTTESTCASE_FRAMEWORK_SEARCH_PATHS}
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/FBSnapshotTestCase" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CodFis-Helper" "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase"
OTHER_LDFLAGS = ${PODS_CODFIS_HELPER_TESTS_FBSNAPSHOTTESTCASE_OTHER_LDFLAGS} -ObjC
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-CodFis-Helper_Tests
PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES
@@ -1,5 +0,0 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_Pods_CodFis_Helper_Tests_FBSnapshotTestCase : NSObject
@end
@implementation PodsDummy_Pods_CodFis_Helper_Tests_FBSnapshotTestCase
@end
@@ -1,5 +0,0 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
#import "Pods-CodFis-Helper_Tests-environment.h"
@@ -1,13 +0,0 @@
#import <UIKit/UIKit.h>
#import "FBSnapshotTestCase.h"
#import "FBSnapshotTestCasePlatform.h"
#import "FBSnapshotTestCase.h"
#import "FBSnapshotTestCasePlatform.h"
#import "FBSnapshotTestController.h"
#import "UIImage+Compare.h"
#import "UIImage+Diff.h"
FOUNDATION_EXPORT double FBSnapshotTestCaseVersionNumber;
FOUNDATION_EXPORT const unsigned char FBSnapshotTestCaseVersionString[];
@@ -1,10 +0,0 @@
framework module FBSnapshotTestCase {
umbrella header "Pods-CodFis-Helper_Tests-FBSnapshotTestCase-umbrella.h"
export *
module * { export * }
private header "FBSnapshotTestController.h"
private header "UIImage+Compare.h"
private header "UIImage+Diff.h"
}
@@ -1,2 +0,0 @@
PODS_CODFIS_HELPER_TESTS_FBSNAPSHOTTESTCASE_FRAMEWORK_SEARCH_PATHS = $(inherited) "$(SDKROOT)/Developer/Library/Frameworks" "$(PLATFORM_DIR)/Developer/Library/Frameworks"
PODS_CODFIS_HELPER_TESTS_FBSNAPSHOTTESTCASE_OTHER_LDFLAGS = -framework "XCTest"
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
@@ -56,4 +56,4 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Generated by CocoaPods - http://cocoapods.org Generated by CocoaPods - https://cocoapods.org
@@ -78,7 +78,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</dict> </dict>
<dict> <dict>
<key>FooterText</key> <key>FooterText</key>
<string>Generated by CocoaPods - http://cocoapods.org</string> <string>Generated by CocoaPods - https://cocoapods.org</string>
<key>Title</key> <key>Title</key>
<string></string> <string></string>
<key>Type</key> <key>Type</key>
@@ -1,32 +0,0 @@
// To check if a library is compiled with CocoaPods you
// can use the `COCOAPODS` macro definition which is
// defined in the xcconfigs so it is available in
// headers also when they are imported in the client
// project.
// CodFis-Helper
#define COCOAPODS_POD_AVAILABLE_CodFis_Helper
#define COCOAPODS_VERSION_MAJOR_CodFis_Helper 0
#define COCOAPODS_VERSION_MINOR_CodFis_Helper 1
#define COCOAPODS_VERSION_PATCH_CodFis_Helper 0
// FBSnapshotTestCase
#define COCOAPODS_POD_AVAILABLE_FBSnapshotTestCase
#define COCOAPODS_VERSION_MAJOR_FBSnapshotTestCase 2
#define COCOAPODS_VERSION_MINOR_FBSnapshotTestCase 0
#define COCOAPODS_VERSION_PATCH_FBSnapshotTestCase 2
// FBSnapshotTestCase/Core
#define COCOAPODS_POD_AVAILABLE_FBSnapshotTestCase_Core
#define COCOAPODS_VERSION_MAJOR_FBSnapshotTestCase_Core 2
#define COCOAPODS_VERSION_MINOR_FBSnapshotTestCase_Core 0
#define COCOAPODS_VERSION_PATCH_FBSnapshotTestCase_Core 2
// FBSnapshotTestCase/SwiftSupport
#define COCOAPODS_POD_AVAILABLE_FBSnapshotTestCase_SwiftSupport
#define COCOAPODS_VERSION_MAJOR_FBSnapshotTestCase_SwiftSupport 2
#define COCOAPODS_VERSION_MINOR_FBSnapshotTestCase_SwiftSupport 0
#define COCOAPODS_VERSION_PATCH_FBSnapshotTestCase_SwiftSupport 2
@@ -8,50 +8,86 @@ SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
install_framework() install_framework()
{ {
local source="${BUILT_PRODUCTS_DIR}/Pods-CodFis-Helper_Tests/$1" if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" local source="${BUILT_PRODUCTS_DIR}/$1"
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
elif [ -r "$1" ]; then
local source="$1"
fi
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then if [ -L "${source}" ]; then
echo "Symlinked..." echo "Symlinked..."
source=$(readlink "${source}") source="$(readlink "${source}")"
fi fi
# use filter instead of exclude so missing patterns dont' throw errors # use filter instead of exclude so missing patterns dont' throw errors
echo "rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" ${source} ${destination}" echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" "${source}" "${destination}" rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
# Resign the code if required by the build settings to avoid unstable apps
if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then local basename
code_sign "${destination}/$1" basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
fi fi
# Embed linked Swift runtime libraries # Strip invalid architectures so "fat" simulator / device frameworks work on device
local basename if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
basename=$(echo $1 | sed -E s/\\..+// && exit ${PIPESTATUS[0]}) strip_invalid_archs "$binary"
fi
# Resign the code if required by the build settings to avoid unstable apps
code_sign_if_enabled "${destination}/$(basename "$1")"
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/$1/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
for lib in $swift_runtime_libs; do for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then code_sign_if_enabled "${destination}/${lib}"
code_sign "${destination}/${lib}"
fi
done done
fi
} }
# Signs a framework with the provided identity # Signs a framework with the provided identity
code_sign() { code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identitiy # Use the current code_sign_identitiy
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1" echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\""
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
fi
}
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $archs; do
if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
stripped="$stripped $arch"
fi
done
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
} }
if [[ "$CONFIGURATION" == "Debug" ]]; then if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework 'CodFis_Helper.framework' install_framework "$BUILT_PRODUCTS_DIR/CodFis-Helper/CodFis_Helper.framework"
install_framework 'FBSnapshotTestCase.framework' install_framework "$BUILT_PRODUCTS_DIR/FBSnapshotTestCase/FBSnapshotTestCase.framework"
fi fi
if [[ "$CONFIGURATION" == "Release" ]]; then if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework 'CodFis_Helper.framework' install_framework "$BUILT_PRODUCTS_DIR/CodFis-Helper/CodFis_Helper.framework"
install_framework 'FBSnapshotTestCase.framework' install_framework "$BUILT_PRODUCTS_DIR/FBSnapshotTestCase/FBSnapshotTestCase.framework"
fi fi
@@ -8,64 +8,6 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
XCASSET_FILES=() XCASSET_FILES=()
realpath() {
DIRECTORY=$(cd "${1%/*}" && pwd)
FILENAME="${1##*/}"
echo "$DIRECTORY/$FILENAME"
}
install_resource()
{
case $1 in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
;;
*.framework)
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
/*)
echo "$1"
echo "$1" >> "$RESOURCES_TO_COPY"
;;
*)
echo "${PODS_ROOT}/$1"
echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
;;
esac
}
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]]; then
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
case "${TARGETED_DEVICE_FAMILY}" in case "${TARGETED_DEVICE_FAMILY}" in
1,2) 1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
@@ -81,6 +23,73 @@ then
;; ;;
esac esac
realpath() {
DIRECTORY="$(cd "${1%/*}" && pwd)"
FILENAME="${1##*/}"
echo "$DIRECTORY/$FILENAME"
}
install_resource()
{
if [[ "$1" = /* ]] ; then
RESOURCE_PATH="$1"
else
RESOURCE_PATH="${PODS_ROOT}/$1"
fi
if [[ ! -e "$RESOURCE_PATH" ]] ; then
cat << EOM
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
EOM
exit 1
fi
case $RESOURCE_PATH in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}"
;;
*.framework)
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av $RESOURCE_PATH ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
xcrun momc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
xcrun momc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
xcrun mapc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH")
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
*)
echo "$RESOURCE_PATH"
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
;;
esac
}
mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
# Find all other xcassets (this unfortunately includes those of path pods and other targets). # Find all other xcassets (this unfortunately includes those of path pods and other targets).
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
while read line; do while read line; do
@@ -89,5 +98,5 @@ then
fi fi
done <<<"$OTHER_XCASSETS" done <<<"$OTHER_XCASSETS"
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi fi
@@ -1,9 +1,8 @@
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH" EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "$CONFIGURATION_BUILD_DIR/CodFis-Helper" "$CONFIGURATION_BUILD_DIR/FBSnapshotTestCase"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/CodFis_Helper.framework/Headers" -iquote "$PODS_FRAMEWORK_BUILD_PATH/FBSnapshotTestCase.framework/Headers" OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/CodFis-Helper/CodFis_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FBSnapshotTestCase/FBSnapshotTestCase.framework/Headers"
OTHER_LDFLAGS = $(inherited) -ObjC -framework "CodFis_Helper" -framework "FBSnapshotTestCase" OTHER_LDFLAGS = $(inherited) -framework "CodFis_Helper" -framework "FBSnapshotTestCase"
OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-CodFis-Helper_Tests
PODS_ROOT = ${SRCROOT}/Pods PODS_ROOT = ${SRCROOT}/Pods
@@ -1,9 +1,8 @@
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH" EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "$CONFIGURATION_BUILD_DIR/CodFis-Helper" "$CONFIGURATION_BUILD_DIR/FBSnapshotTestCase"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/CodFis_Helper.framework/Headers" -iquote "$PODS_FRAMEWORK_BUILD_PATH/FBSnapshotTestCase.framework/Headers" OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/CodFis-Helper/CodFis_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FBSnapshotTestCase/FBSnapshotTestCase.framework/Headers"
OTHER_LDFLAGS = $(inherited) -ObjC -framework "CodFis_Helper" -framework "FBSnapshotTestCase" OTHER_LDFLAGS = $(inherited) -framework "CodFis_Helper" -framework "FBSnapshotTestCase"
OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-CodFis-Helper_Tests
PODS_ROOT = ${SRCROOT}/Pods PODS_ROOT = ${SRCROOT}/Pods
+33 -1
View File
@@ -17,7 +17,39 @@ CodFis-Helper is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile: it, simply add the following line to your Podfile:
```ruby ```ruby
pod "CodFis-Helper" pod 'CodFis-Helper' , :git => 'https://github.com/giuseppenucifora/CodFis-Helper.git'
OR
pod 'CodFis-Helper'
```
##Usage
```ruby
CodFis_Helper *helper = [[CodFis_Helper alloc] init];
[helper setSurname:@"Rossi"];
[helper setName:@"Mario"];
[helper setBirthDay:15];
[helper setBirthMonth:11];
[helper setBirthYear:83];
[helper setGender:Gender_Man];
[helper setState:Italy];
[helper setPlace:@"Milano"];
CodFisResponse *response = [helper calculate];
NSLog(@"%@",[response responseError]);
NSLog(@"%@",[response response]);
``` ```
## Author ## Author