[swift 4] improve test suite (#4561)

* [swift] improve testing in sample projects

* [swift] update run tests script

* [swift] regenerate samples

* [swift] fix tests with PromiseKit

* [swift4] compile every project with swift package manager
This commit is contained in:
Bruno Coelho
2019-11-21 14:40:49 +00:00
committed by William Cheng
parent f434b5fa13
commit 51aeb6c833
430 changed files with 2876 additions and 5146 deletions

View File

@@ -1 +1 @@
4.2.0-SNAPSHOT
4.2.2-SNAPSHOT

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,16 @@
{
"object": {
"pins": [
{
"package": "Alamofire",
"repositoryURL": "https://github.com/Alamofire/Alamofire.git",
"state": {
"branch": null,
"revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4",
"version": "4.9.1"
}
}
]
},
"version": 1
}

View File

@@ -8,27 +8,16 @@
/* Begin PBXBuildFile section */
0061472DD11FF6D7742349C7 /* PersonCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30CDB0CB291617B59C7E29CB /* PersonCard.swift */; };
01E212C311902B864527BF13 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 191E19C2F89B8663BCF4FBEA /* Extensions.swift */; };
05AA5B59607A30F18E94292F /* ModelWithStringAdditionalPropertiesOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BFF565190B02C5B55C36C5E /* ModelWithStringAdditionalPropertiesOnly.swift */; };
1150C15C863519A092B65692 /* PersonCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = E29C3BC88FEAF94FECA67A42 /* PersonCard.swift */; };
1415101700773F07D9E14327 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F6F3F378FFC3FC0AC42268D /* APIs.swift */; };
17FBC6CF6E8BFE71D33C9BFC /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EAA1DBBB82C7F083B98595F /* CodableHelper.swift */; };
19E70FF1DDE7B0282F400F45 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6AD136503821775A39AEEEA /* APIHelper.swift */; };
2002BB13501E9D1F5952C760 /* SampleSubClassAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6555C6E30D09EAE39142D186 /* SampleSubClassAllOf.swift */; };
2435C89448D0A9FCF8DB1C3B /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EF84FF97BA833181D55A51A /* APIHelper.swift */; };
27F628F6D077CE2DCC6CC337 /* ModelWithIntAdditionalPropertiesOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68FA5194EA643821CA1085C3 /* ModelWithIntAdditionalPropertiesOnly.swift */; };
2DBEE65DD1A3C3495B6F8FD5 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CAA5D350129277E17583C27 /* Models.swift */; };
30E7100C057CCFA6402D4070 /* PlaceCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF65F76D52F973768497A243 /* PlaceCard.swift */; };
37BEC223016795E28157F751 /* ModelWithStringAdditionalPropertiesOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 023CA47DA7B8EA5E67414676 /* ModelWithStringAdditionalPropertiesOnly.swift */; };
3DC6743F3ECD7005940DED98 /* GetAllModelsResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACAEAEEB934E57798AED0602 /* GetAllModelsResult.swift */; };
3E32C71C3B2C7D5E0197E6E2 /* Swift4TestAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 398F88885A50B33451FCFDF1 /* Swift4TestAPI.swift */; };
3F20DE4CB1AD4F3A2ED05326 /* SampleSubClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA9C1F9551FB619240EC0F70 /* SampleSubClass.swift */; };
4209C8951507A706227F2A85 /* SampleBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAB9BE4C49A34C2D3AE2D4E3 /* SampleBase.swift */; };
4223F35C2545E77A378B1869 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = A14BAA0CFCF5210DF11F06D3 /* JSONEncodableEncoding.swift */; };
493DB82F57B410C3C40CDD6B /* ModelWithPropertiesAndAdditionalProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17B59E56BC42D7F70BBC0D08 /* ModelWithPropertiesAndAdditionalProperties.swift */; };
4C923639A934AF070072D16E /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69A98ECBBBE9667D9847EEAB /* Configuration.swift */; };
4D1CD48EC9034A49C536DF05 /* BaseCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = C209BA7D3B7026133ACB6149 /* BaseCard.swift */; };
5472D271BD16329929A7360D /* ErrorInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 671A11EAF02ED88CFFDAFBC5 /* ErrorInfo.swift */; };
561FBF0BA4127AAA4B2EB66D /* AllPrimitives.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE13D018B8E8F7283534E94 /* AllPrimitives.swift */; };
5C7477A5CDC76B3293CBBC53 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = A140137667E350EAFDE010EA /* Models.swift */; };
633435C240C960AFE29EEF3A /* StringEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BD76CE1B85046CF575F42B /* StringEnum.swift */; };
@@ -37,89 +26,48 @@
7C22E572E92D490CC366F0C2 /* ErrorInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A813A17AF964F26FB864212 /* ErrorInfo.swift */; };
7D51DA4415EEB4A0D2CECC95 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7DCE280D9FD953B91C0F18E /* JSONEncodableEncoding.swift */; };
7F99AF29003DAFA2AFC85FEC /* ModelDoubleArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE5A2A8F47EC101841093D2C /* ModelDoubleArray.swift */; };
8D769292CC09E9192775468F /* SampleSubClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5626F1C9CCDE265EB25BBD47 /* SampleSubClass.swift */; };
8DE1F6D479506F95717AC3FB /* VariableNameTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54860017185201A4C2A2F544 /* VariableNameTest.swift */; };
8F02FB3DCBA785F15F6BA602 /* PlaceCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13DD01D5ABD4BE352CB6FCBF /* PlaceCard.swift */; };
9193BA83FEDAFA9788D03ACF /* PlaceCardAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 889ABCD292051498ACCC66E8 /* PlaceCardAllOf.swift */; };
97B334B37666146CCE9B075D /* AllPrimitives.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2A122B51B1736ACC859570A /* AllPrimitives.swift */; };
99E414E731F93EBD6AAA571A /* ModelWithIntAdditionalPropertiesOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14100F82AA0E6E697613420A /* ModelWithIntAdditionalPropertiesOnly.swift */; };
A250E9B7B89D1826DB3868C4 /* ModelStringArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE1507AFE9907AC803C06093 /* ModelStringArray.swift */; };
A4E70E34B9EABA6E7C911B37 /* ModelErrorInfoArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = C244E3993E5EAFE0E4DEF9C9 /* ModelErrorInfoArray.swift */; };
AC78737EC4A34F22FC3D5E8C /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93BA682C97038055435A32D0 /* CodableHelper.swift */; };
AFB1FE9D61B4F2B80E1C7AB8 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F082FE9586189859619C91E5 /* Alamofire.framework */; };
C1C0C8C0718BCDC9A5E315CD /* GetAllModelsResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD4DAE449BCB032587594847 /* GetAllModelsResult.swift */; };
C599397B4A6A1B5A403E4C4C /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E7F1C8F69E25D093E56B114 /* AlamofireImplementations.swift */; };
CC3D7983035E4A5A8FAACFCD /* ModelWithPropertiesAndAdditionalProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05A0A03CD4A9113B9D91606F /* ModelWithPropertiesAndAdditionalProperties.swift */; };
D341F989C214B55970D91FD7 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 282DC97E6B31E9729E891D97 /* JSONEncodingHelper.swift */; };
D43D0FC46CD094545F0284F3 /* PersonCardAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C4F016421122219AE4DCDF9 /* PersonCardAllOf.swift */; };
D992379A047FFAD1AA619461 /* ModelDoubleArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CB11DB8C924DADEC4055271 /* ModelDoubleArray.swift */; };
DA5E97FF7C2D9E6F45FEE7BA /* SampleBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDF35F63D7105D55BA0D3FD9 /* SampleBase.swift */; };
E29D4269C5947A5CFCE3A810 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE6DF5346C62BDE2DAFA3B4E /* Configuration.swift */; };
E32B8F685CB25522E611ED1D /* ModelStringArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DEC406D4B97E9127B278F6B /* ModelStringArray.swift */; };
E6AA92100A56C799A2FCDA59 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1E452EBA4D5D6D227089137 /* AlamofireImplementations.swift */; };
EE4618E339B918E17DB26094 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F5B983EDA0E1D0C2C8FEDA7 /* APIs.swift */; };
EE6955D55C741CF1BAD5476C /* ModelErrorInfoArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B74ECB05DB9BEC1D5ECEBF8 /* ModelErrorInfoArray.swift */; };
F44925519D4D408AE4C7CBB2 /* StringEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EAE0680C3163069E97D7699 /* StringEnum.swift */; };
F5FFDB445C4731238EA8AFC5 /* BaseCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = C418DE3632EC3A053E7379ED /* BaseCard.swift */; };
FB58DEE4F76D0111D3218BDF /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042A701F1D826A4F68808DE6 /* JSONEncodingHelper.swift */; };
FD7D9D3454F9C64656CDCB8B /* VariableNameTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C09C1DB6708AB2D8997BEE2 /* VariableNameTest.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
023CA47DA7B8EA5E67414676 /* ModelWithStringAdditionalPropertiesOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithStringAdditionalPropertiesOnly.swift; sourceTree = "<group>"; };
042A701F1D826A4F68808DE6 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = "<group>"; };
05A0A03CD4A9113B9D91606F /* ModelWithPropertiesAndAdditionalProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithPropertiesAndAdditionalProperties.swift; sourceTree = "<group>"; };
13DD01D5ABD4BE352CB6FCBF /* PlaceCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaceCard.swift; sourceTree = "<group>"; };
14100F82AA0E6E697613420A /* ModelWithIntAdditionalPropertiesOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithIntAdditionalPropertiesOnly.swift; sourceTree = "<group>"; };
17B59E56BC42D7F70BBC0D08 /* ModelWithPropertiesAndAdditionalProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithPropertiesAndAdditionalProperties.swift; sourceTree = "<group>"; };
191E19C2F89B8663BCF4FBEA /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
1A813A17AF964F26FB864212 /* ErrorInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorInfo.swift; sourceTree = "<group>"; };
1E7F1C8F69E25D093E56B114 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = "<group>"; };
282DC97E6B31E9729E891D97 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = "<group>"; };
2C4F016421122219AE4DCDF9 /* PersonCardAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonCardAllOf.swift; sourceTree = "<group>"; };
2EAE0680C3163069E97D7699 /* StringEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringEnum.swift; sourceTree = "<group>"; };
2F5B983EDA0E1D0C2C8FEDA7 /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = "<group>"; };
30CDB0CB291617B59C7E29CB /* PersonCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonCard.swift; sourceTree = "<group>"; };
398F88885A50B33451FCFDF1 /* Swift4TestAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Swift4TestAPI.swift; sourceTree = "<group>"; };
3CAA5D350129277E17583C27 /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = "<group>"; };
3CB11DB8C924DADEC4055271 /* ModelDoubleArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelDoubleArray.swift; sourceTree = "<group>"; };
4B74ECB05DB9BEC1D5ECEBF8 /* ModelErrorInfoArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelErrorInfoArray.swift; sourceTree = "<group>"; };
4F6F3F378FFC3FC0AC42268D /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = "<group>"; };
54860017185201A4C2A2F544 /* VariableNameTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VariableNameTest.swift; sourceTree = "<group>"; };
5626F1C9CCDE265EB25BBD47 /* SampleSubClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleSubClass.swift; sourceTree = "<group>"; };
5DEC406D4B97E9127B278F6B /* ModelStringArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelStringArray.swift; sourceTree = "<group>"; };
5EF84FF97BA833181D55A51A /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = "<group>"; };
6555C6E30D09EAE39142D186 /* SampleSubClassAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleSubClassAllOf.swift; sourceTree = "<group>"; };
671A11EAF02ED88CFFDAFBC5 /* ErrorInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorInfo.swift; sourceTree = "<group>"; };
68FA5194EA643821CA1085C3 /* ModelWithIntAdditionalPropertiesOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithIntAdditionalPropertiesOnly.swift; sourceTree = "<group>"; };
69A98ECBBBE9667D9847EEAB /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = "<group>"; };
6BFF565190B02C5B55C36C5E /* ModelWithStringAdditionalPropertiesOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithStringAdditionalPropertiesOnly.swift; sourceTree = "<group>"; };
7C09C1DB6708AB2D8997BEE2 /* VariableNameTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VariableNameTest.swift; sourceTree = "<group>"; };
7EE13D018B8E8F7283534E94 /* AllPrimitives.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllPrimitives.swift; sourceTree = "<group>"; };
889ABCD292051498ACCC66E8 /* PlaceCardAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaceCardAllOf.swift; sourceTree = "<group>"; };
93BA682C97038055435A32D0 /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = "<group>"; };
9EAA1DBBB82C7F083B98595F /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = "<group>"; };
9FD147676BF8F2DD7E471810 /* TestClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TestClient.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A140137667E350EAFDE010EA /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = "<group>"; };
A14BAA0CFCF5210DF11F06D3 /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = "<group>"; };
A3BD76CE1B85046CF575F42B /* StringEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringEnum.swift; sourceTree = "<group>"; };
ACAEAEEB934E57798AED0602 /* GetAllModelsResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetAllModelsResult.swift; sourceTree = "<group>"; };
B1E452EBA4D5D6D227089137 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = "<group>"; };
B2A122B51B1736ACC859570A /* AllPrimitives.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllPrimitives.swift; sourceTree = "<group>"; };
BDF35F63D7105D55BA0D3FD9 /* SampleBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleBase.swift; sourceTree = "<group>"; };
BF65F76D52F973768497A243 /* PlaceCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaceCard.swift; sourceTree = "<group>"; };
C209BA7D3B7026133ACB6149 /* BaseCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseCard.swift; sourceTree = "<group>"; };
C244E3993E5EAFE0E4DEF9C9 /* ModelErrorInfoArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelErrorInfoArray.swift; sourceTree = "<group>"; };
C418DE3632EC3A053E7379ED /* BaseCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseCard.swift; sourceTree = "<group>"; };
C6AD136503821775A39AEEEA /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = "<group>"; };
CAB9BE4C49A34C2D3AE2D4E3 /* SampleBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleBase.swift; sourceTree = "<group>"; };
CD4DAE449BCB032587594847 /* GetAllModelsResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetAllModelsResult.swift; sourceTree = "<group>"; };
CE6DF5346C62BDE2DAFA3B4E /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = "<group>"; };
CF9E03057B35B32AC59ADC1B /* Swift4TestAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Swift4TestAPI.swift; sourceTree = "<group>"; };
D3D0164E2EEC228143968A2D /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
D7DCE280D9FD953B91C0F18E /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = "<group>"; };
DE1507AFE9907AC803C06093 /* ModelStringArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelStringArray.swift; sourceTree = "<group>"; };
E29C3BC88FEAF94FECA67A42 /* PersonCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonCard.swift; sourceTree = "<group>"; };
EA9C1F9551FB619240EC0F70 /* SampleSubClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleSubClass.swift; sourceTree = "<group>"; };
EE5A2A8F47EC101841093D2C /* ModelDoubleArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelDoubleArray.swift; sourceTree = "<group>"; };
F082FE9586189859619C91E5 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = "<group>"; };
@@ -137,47 +85,6 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
2539B43B44954BFCB19E44BE /* Models */ = {
isa = PBXGroup;
children = (
B2A122B51B1736ACC859570A /* AllPrimitives.swift */,
C418DE3632EC3A053E7379ED /* BaseCard.swift */,
671A11EAF02ED88CFFDAFBC5 /* ErrorInfo.swift */,
CD4DAE449BCB032587594847 /* GetAllModelsResult.swift */,
3CB11DB8C924DADEC4055271 /* ModelDoubleArray.swift */,
4B74ECB05DB9BEC1D5ECEBF8 /* ModelErrorInfoArray.swift */,
DE1507AFE9907AC803C06093 /* ModelStringArray.swift */,
14100F82AA0E6E697613420A /* ModelWithIntAdditionalPropertiesOnly.swift */,
05A0A03CD4A9113B9D91606F /* ModelWithPropertiesAndAdditionalProperties.swift */,
023CA47DA7B8EA5E67414676 /* ModelWithStringAdditionalPropertiesOnly.swift */,
E29C3BC88FEAF94FECA67A42 /* PersonCard.swift */,
BF65F76D52F973768497A243 /* PlaceCard.swift */,
BDF35F63D7105D55BA0D3FD9 /* SampleBase.swift */,
5626F1C9CCDE265EB25BBD47 /* SampleSubClass.swift */,
2EAE0680C3163069E97D7699 /* StringEnum.swift */,
54860017185201A4C2A2F544 /* VariableNameTest.swift */,
);
path = Models;
sourceTree = "<group>";
};
26F3607B28A0AD360F5100F5 /* Swaggers */ = {
isa = PBXGroup;
children = (
1E7F1C8F69E25D093E56B114 /* AlamofireImplementations.swift */,
5EF84FF97BA833181D55A51A /* APIHelper.swift */,
2F5B983EDA0E1D0C2C8FEDA7 /* APIs.swift */,
9EAA1DBBB82C7F083B98595F /* CodableHelper.swift */,
69A98ECBBBE9667D9847EEAB /* Configuration.swift */,
191E19C2F89B8663BCF4FBEA /* Extensions.swift */,
A14BAA0CFCF5210DF11F06D3 /* JSONEncodableEncoding.swift */,
282DC97E6B31E9729E891D97 /* JSONEncodingHelper.swift */,
3CAA5D350129277E17583C27 /* Models.swift */,
357449309E73CA39C8813961 /* APIs */,
2539B43B44954BFCB19E44BE /* Models */,
);
path = Swaggers;
sourceTree = "<group>";
};
3049D31996790CF8E31B6F01 = {
isa = PBXGroup;
children = (
@@ -187,14 +94,6 @@
);
sourceTree = "<group>";
};
357449309E73CA39C8813961 /* APIs */ = {
isa = PBXGroup;
children = (
398F88885A50B33451FCFDF1 /* Swift4TestAPI.swift */,
);
path = APIs;
sourceTree = "<group>";
};
3A1CFAB4CC75547815260F88 /* OpenAPIs */ = {
isa = PBXGroup;
children = (
@@ -217,7 +116,6 @@
isa = PBXGroup;
children = (
3A1CFAB4CC75547815260F88 /* OpenAPIs */,
26F3607B28A0AD360F5100F5 /* Swaggers */,
);
path = Classes;
sourceTree = "<group>";
@@ -329,6 +227,7 @@
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Base,
en,
);
mainGroup = 3049D31996790CF8E31B6F01;
@@ -345,60 +244,34 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2435C89448D0A9FCF8DB1C3B /* APIHelper.swift in Sources */,
19E70FF1DDE7B0282F400F45 /* APIHelper.swift in Sources */,
EE4618E339B918E17DB26094 /* APIs.swift in Sources */,
1415101700773F07D9E14327 /* APIs.swift in Sources */,
C599397B4A6A1B5A403E4C4C /* AlamofireImplementations.swift in Sources */,
E6AA92100A56C799A2FCDA59 /* AlamofireImplementations.swift in Sources */,
97B334B37666146CCE9B075D /* AllPrimitives.swift in Sources */,
561FBF0BA4127AAA4B2EB66D /* AllPrimitives.swift in Sources */,
F5FFDB445C4731238EA8AFC5 /* BaseCard.swift in Sources */,
4D1CD48EC9034A49C536DF05 /* BaseCard.swift in Sources */,
17FBC6CF6E8BFE71D33C9BFC /* CodableHelper.swift in Sources */,
AC78737EC4A34F22FC3D5E8C /* CodableHelper.swift in Sources */,
4C923639A934AF070072D16E /* Configuration.swift in Sources */,
E29D4269C5947A5CFCE3A810 /* Configuration.swift in Sources */,
5472D271BD16329929A7360D /* ErrorInfo.swift in Sources */,
7C22E572E92D490CC366F0C2 /* ErrorInfo.swift in Sources */,
01E212C311902B864527BF13 /* Extensions.swift in Sources */,
6B1961ED41DFDFDB3029BE6F /* Extensions.swift in Sources */,
C1C0C8C0718BCDC9A5E315CD /* GetAllModelsResult.swift in Sources */,
3DC6743F3ECD7005940DED98 /* GetAllModelsResult.swift in Sources */,
4223F35C2545E77A378B1869 /* JSONEncodableEncoding.swift in Sources */,
7D51DA4415EEB4A0D2CECC95 /* JSONEncodableEncoding.swift in Sources */,
D341F989C214B55970D91FD7 /* JSONEncodingHelper.swift in Sources */,
FB58DEE4F76D0111D3218BDF /* JSONEncodingHelper.swift in Sources */,
D992379A047FFAD1AA619461 /* ModelDoubleArray.swift in Sources */,
7F99AF29003DAFA2AFC85FEC /* ModelDoubleArray.swift in Sources */,
EE6955D55C741CF1BAD5476C /* ModelErrorInfoArray.swift in Sources */,
A4E70E34B9EABA6E7C911B37 /* ModelErrorInfoArray.swift in Sources */,
A250E9B7B89D1826DB3868C4 /* ModelStringArray.swift in Sources */,
E32B8F685CB25522E611ED1D /* ModelStringArray.swift in Sources */,
99E414E731F93EBD6AAA571A /* ModelWithIntAdditionalPropertiesOnly.swift in Sources */,
27F628F6D077CE2DCC6CC337 /* ModelWithIntAdditionalPropertiesOnly.swift in Sources */,
CC3D7983035E4A5A8FAACFCD /* ModelWithPropertiesAndAdditionalProperties.swift in Sources */,
493DB82F57B410C3C40CDD6B /* ModelWithPropertiesAndAdditionalProperties.swift in Sources */,
37BEC223016795E28157F751 /* ModelWithStringAdditionalPropertiesOnly.swift in Sources */,
05AA5B59607A30F18E94292F /* ModelWithStringAdditionalPropertiesOnly.swift in Sources */,
2DBEE65DD1A3C3495B6F8FD5 /* Models.swift in Sources */,
5C7477A5CDC76B3293CBBC53 /* Models.swift in Sources */,
1150C15C863519A092B65692 /* PersonCard.swift in Sources */,
0061472DD11FF6D7742349C7 /* PersonCard.swift in Sources */,
D43D0FC46CD094545F0284F3 /* PersonCardAllOf.swift in Sources */,
30E7100C057CCFA6402D4070 /* PlaceCard.swift in Sources */,
8F02FB3DCBA785F15F6BA602 /* PlaceCard.swift in Sources */,
9193BA83FEDAFA9788D03ACF /* PlaceCardAllOf.swift in Sources */,
DA5E97FF7C2D9E6F45FEE7BA /* SampleBase.swift in Sources */,
4209C8951507A706227F2A85 /* SampleBase.swift in Sources */,
8D769292CC09E9192775468F /* SampleSubClass.swift in Sources */,
3F20DE4CB1AD4F3A2ED05326 /* SampleSubClass.swift in Sources */,
2002BB13501E9D1F5952C760 /* SampleSubClassAllOf.swift in Sources */,
F44925519D4D408AE4C7CBB2 /* StringEnum.swift in Sources */,
633435C240C960AFE29EEF3A /* StringEnum.swift in Sources */,
3E32C71C3B2C7D5E0197E6E2 /* Swift4TestAPI.swift in Sources */,
6CADD5CF7C8834F9ACA88E4F /* Swift4TestAPI.swift in Sources */,
8DE1F6D479506F95717AC3FB /* VariableNameTest.swift in Sources */,
FD7D9D3454F9C64656CDCB8B /* VariableNameTest.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;

View File

@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
onlyGenerateCoverageForSpecifiedTargets = "NO"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>

View File

@@ -22,7 +22,7 @@ public struct APIHelper {
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
return source.reduce(into: [String: String]()) { (result, item) in
if let collection = item.value as? Array<Any?> {
if let collection = item.value as? [Any?] {
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
} else if let value: Any = item.value {
result[item.key] = "\(value)"
@@ -46,7 +46,7 @@ public struct APIHelper {
}
public static func mapValueToPathItem(_ source: Any) -> Any {
if let collection = source as? Array<Any?> {
if let collection = source as? [Any?] {
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
}
return source
@@ -54,7 +54,7 @@ public struct APIHelper {
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
if let collection = item.value as? Array<Any?> {
if let collection = item.value as? [Any?] {
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
result.append(URLQueryItem(name: item.key, value: value))
} else if let value = item.value {

View File

@@ -1,61 +0,0 @@
// APIs.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
open class TestClientAPI {
open static var basePath = "http://api.example.com/basePath"
open static var credential: URLCredential?
open static var customHeaders: [String: String] = [:]
open static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory()
}
open class RequestBuilder<T> {
var credential: URLCredential?
var headers: [String: String]
public let parameters: [String: Any]?
public let isBody: Bool
public let method: String
public let URLString: String
/// Optional block to obtain a reference to the request's progress instance when available.
public var onProgressReady: ((Progress) -> Void)?
required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) {
self.method = method
self.URLString = URLString
self.parameters = parameters
self.isBody = isBody
self.headers = headers
addHeaders(TestClientAPI.customHeaders)
}
open func addHeaders(_ aHeaders: [String: String]) {
for (header, value) in aHeaders {
headers[header] = value
}
}
open func execute(_ completion: @escaping (_ response: Response<T>?, _ error: Error?) -> Void) { }
public func addHeader(name: String, value: String) -> Self {
if !value.isEmpty {
headers[name] = value
}
return self
}
open func addCredential() -> Self {
self.credential = TestClientAPI.credential
return self
}
}
public protocol RequestBuilderFactory {
func getNonDecodableBuilder<T>() -> RequestBuilder<T>.Type
func getBuilder<T: Decodable>() -> RequestBuilder<T>.Type
}

View File

@@ -1,130 +0,0 @@
//
// Swift4TestAPI.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
import Alamofire
open class Swift4TestAPI {
/**
Get all of the models
- parameter clientId: (query) id that represent the Api client
- parameter completion: completion handler to receive the data and the error objects
*/
open class func getAllModels(clientId: String, completion: @escaping ((_ data: GetAllModelsResult?, _ error: Error?) -> Void)) {
getAllModelsWithRequestBuilder(clientId: clientId).execute { (response, error) -> Void in
completion(response?.body, error)
}
}
/**
Get all of the models
- GET /allModels
- This endpoint tests get a dictionary which contains examples of all of the models.
- examples: [{contentType=application/json, example={
"myPrimitive" : {
"myDateTimeArray" : [ "2000-01-23T04:56:07.000+00:00", "2000-01-23T04:56:07.000+00:00" ],
"myStringArray" : [ "myStringArray", "myStringArray" ],
"myFile" : "",
"myBytes" : "myBytes",
"myLong" : 1,
"myBooleanArray" : [ true, true ],
"myInteger" : 0,
"myBytesArray" : [ "myBytesArray", "myBytesArray" ],
"myDouble" : 7.061401241503109105224211816675961017608642578125,
"myIntegerArray" : [ 6, 6 ],
"myInlineStringEnum" : "inlineStringEnumValue1",
"myFileArray" : [ "", "" ],
"myFloat" : 5.637377,
"myStringEnumArray" : [ null, null ],
"myFloatArray" : [ 2.302136, 2.302136 ],
"myDoubleArray" : [ 9.301444243932575517419536481611430644989013671875, 9.301444243932575517419536481611430644989013671875 ],
"myString" : "myString",
"myDate" : "2000-01-23",
"myDateArray" : [ "2000-01-23", "2000-01-23" ],
"myDateTime" : "2000-01-23T04:56:07.000+00:00",
"myLongArray" : [ 5, 5 ],
"myUUID" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"myBoolean" : true,
"myUUIDArray" : [ "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "046b6c7f-0b8a-43b9-b35d-6489e6daee91" ]
},
"myVariableNameTest" : {
"normalName" : "normalName",
"for" : "for",
"example_name" : "example_name"
},
"myPrimitiveArray" : [ {
"myDateTimeArray" : [ "2000-01-23T04:56:07.000+00:00", "2000-01-23T04:56:07.000+00:00" ],
"myStringArray" : [ "myStringArray", "myStringArray" ],
"myFile" : "",
"myBytes" : "myBytes",
"myLong" : 1,
"myBooleanArray" : [ true, true ],
"myInteger" : 0,
"myBytesArray" : [ "myBytesArray", "myBytesArray" ],
"myDouble" : 7.061401241503109105224211816675961017608642578125,
"myIntegerArray" : [ 6, 6 ],
"myInlineStringEnum" : "inlineStringEnumValue1",
"myFileArray" : [ "", "" ],
"myFloat" : 5.637377,
"myStringEnumArray" : [ null, null ],
"myFloatArray" : [ 2.302136, 2.302136 ],
"myDoubleArray" : [ 9.301444243932575517419536481611430644989013671875, 9.301444243932575517419536481611430644989013671875 ],
"myString" : "myString",
"myDate" : "2000-01-23",
"myDateArray" : [ "2000-01-23", "2000-01-23" ],
"myDateTime" : "2000-01-23T04:56:07.000+00:00",
"myLongArray" : [ 5, 5 ],
"myUUID" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"myBoolean" : true,
"myUUIDArray" : [ "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "046b6c7f-0b8a-43b9-b35d-6489e6daee91" ]
}, {
"myDateTimeArray" : [ "2000-01-23T04:56:07.000+00:00", "2000-01-23T04:56:07.000+00:00" ],
"myStringArray" : [ "myStringArray", "myStringArray" ],
"myFile" : "",
"myBytes" : "myBytes",
"myLong" : 1,
"myBooleanArray" : [ true, true ],
"myInteger" : 0,
"myBytesArray" : [ "myBytesArray", "myBytesArray" ],
"myDouble" : 7.061401241503109105224211816675961017608642578125,
"myIntegerArray" : [ 6, 6 ],
"myInlineStringEnum" : "inlineStringEnumValue1",
"myFileArray" : [ "", "" ],
"myFloat" : 5.637377,
"myStringEnumArray" : [ null, null ],
"myFloatArray" : [ 2.302136, 2.302136 ],
"myDoubleArray" : [ 9.301444243932575517419536481611430644989013671875, 9.301444243932575517419536481611430644989013671875 ],
"myString" : "myString",
"myDate" : "2000-01-23",
"myDateArray" : [ "2000-01-23", "2000-01-23" ],
"myDateTime" : "2000-01-23T04:56:07.000+00:00",
"myLongArray" : [ 5, 5 ],
"myUUID" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"myBoolean" : true,
"myUUIDArray" : [ "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "046b6c7f-0b8a-43b9-b35d-6489e6daee91" ]
} ]
}}]
- parameter clientId: (query) id that represent the Api client
- returns: RequestBuilder<GetAllModelsResult>
*/
open class func getAllModelsWithRequestBuilder(clientId: String) -> RequestBuilder<GetAllModelsResult> {
let path = "/allModels"
let URLString = TestClientAPI.basePath + path
let parameters: [String: Any]? = nil
var url = URLComponents(string: URLString)
url?.queryItems = APIHelper.mapValuesToQueryItems([
"client_id": clientId
])
let requestBuilder: RequestBuilder<GetAllModelsResult>.Type = TestClientAPI.requestBuilderFactory.getBuilder()
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
}
}

View File

@@ -1,54 +0,0 @@
//
// JSONDataEncoding.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
import Alamofire
public struct JSONDataEncoding: ParameterEncoding {
// MARK: Properties
private static let jsonDataKey = "jsonData"
// MARK: Encoding
/// Creates a URL request by encoding parameters and applying them onto an existing request.
///
/// - parameter urlRequest: The request to have parameters applied.
/// - parameter parameters: The parameters to apply. This should have a single key/value
/// pair with "jsonData" as the key and a Data object as the value.
///
/// - throws: An `Error` if the encoding process encounters an error.
///
/// - returns: The encoded request.
public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest {
var urlRequest = try urlRequest.asURLRequest()
guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else {
return urlRequest
}
if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil {
urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type")
}
urlRequest.httpBody = jsonData
return urlRequest
}
public static func encodingParameters(jsonData: Data?) -> Parameters? {
var returnedParams: Parameters?
if let jsonData = jsonData, !jsonData.isEmpty {
var params = Parameters()
params[jsonDataKey] = jsonData
returnedParams = params
}
return returnedParams
}
}

View File

@@ -1,43 +0,0 @@
//
// JSONEncodingHelper.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
import Alamofire
open class JSONEncodingHelper {
open class func encodingParameters<T: Encodable>(forEncodableObject encodableObj: T?) -> Parameters? {
var params: Parameters?
// Encode the Encodable object
if let encodableObj = encodableObj {
let encodeResult = CodableHelper.encode(encodableObj, prettyPrint: true)
if encodeResult.error == nil {
params = JSONDataEncoding.encodingParameters(jsonData: encodeResult.data)
}
}
return params
}
open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? {
var params: Parameters?
if let encodableObj = encodableObj {
do {
let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted)
params = JSONDataEncoding.encodingParameters(jsonData: data)
} catch {
print(error)
return nil
}
}
return params
}
}

View File

@@ -1,73 +0,0 @@
//
// AllPrimitives.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
/** Object which contains lots of different primitive Swagger types */
public struct AllPrimitives: Codable {
public enum MyInlineStringEnum: String, Codable {
case inlinestringenumvalue1 = "inlineStringEnumValue1"
case inlinestringenumvalue2 = "inlineStringEnumValue2"
case inlinestringenumvalue3 = "inlineStringEnumValue3"
}
public var myInteger: Int?
public var myIntegerArray: [Int]?
public var myLong: Int64?
public var myLongArray: [Int64]?
public var myFloat: Float?
public var myFloatArray: [Float]?
public var myDouble: Double?
public var myDoubleArray: [Double]?
public var myString: String?
public var myStringArray: [String]?
public var myBytes: Data?
public var myBytesArray: [Data]?
public var myBoolean: Bool?
public var myBooleanArray: [Bool]?
public var myDate: Date?
public var myDateArray: [Date]?
public var myDateTime: Date?
public var myDateTimeArray: [Date]?
public var myFile: URL?
public var myFileArray: [URL]?
public var myUUID: UUID?
public var myUUIDArray: [UUID]?
public var myStringEnum: StringEnum?
public var myStringEnumArray: [StringEnum]?
public var myInlineStringEnum: MyInlineStringEnum?
public init(myInteger: Int?, myIntegerArray: [Int]?, myLong: Int64?, myLongArray: [Int64]?, myFloat: Float?, myFloatArray: [Float]?, myDouble: Double?, myDoubleArray: [Double]?, myString: String?, myStringArray: [String]?, myBytes: Data?, myBytesArray: [Data]?, myBoolean: Bool?, myBooleanArray: [Bool]?, myDate: Date?, myDateArray: [Date]?, myDateTime: Date?, myDateTimeArray: [Date]?, myFile: URL?, myFileArray: [URL]?, myUUID: UUID?, myUUIDArray: [UUID]?, myStringEnum: StringEnum?, myStringEnumArray: [StringEnum]?, myInlineStringEnum: MyInlineStringEnum?) {
self.myInteger = myInteger
self.myIntegerArray = myIntegerArray
self.myLong = myLong
self.myLongArray = myLongArray
self.myFloat = myFloat
self.myFloatArray = myFloatArray
self.myDouble = myDouble
self.myDoubleArray = myDoubleArray
self.myString = myString
self.myStringArray = myStringArray
self.myBytes = myBytes
self.myBytesArray = myBytesArray
self.myBoolean = myBoolean
self.myBooleanArray = myBooleanArray
self.myDate = myDate
self.myDateArray = myDateArray
self.myDateTime = myDateTime
self.myDateTimeArray = myDateTimeArray
self.myFile = myFile
self.myFileArray = myFileArray
self.myUUID = myUUID
self.myUUIDArray = myUUIDArray
self.myStringEnum = myStringEnum
self.myStringEnumArray = myStringEnumArray
self.myInlineStringEnum = myInlineStringEnum
}
}

View File

@@ -1,20 +0,0 @@
//
// BaseCard.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
/** This is a base card object which uses a &#39;cardType&#39; discriminator. */
public struct BaseCard: Codable {
public var cardType: String
public init(cardType: String) {
self.cardType = cardType
}
}

View File

@@ -1,24 +0,0 @@
//
// ErrorInfo.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
/** Example Error object */
public struct ErrorInfo: Codable {
public var code: Int?
public var message: String?
public var details: [String]?
public init(code: Int?, message: String?, details: [String]?) {
self.code = code
self.message = message
self.details = details
}
}

View File

@@ -1,24 +0,0 @@
//
// GetAllModelsResult.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
/** Response object containing AllPrimitives object */
public struct GetAllModelsResult: Codable {
public var myPrimitiveArray: [AllPrimitives]?
public var myPrimitive: AllPrimitives?
public var myVariableNameTest: VariableNameTest?
public init(myPrimitiveArray: [AllPrimitives]?, myPrimitive: AllPrimitives?, myVariableNameTest: VariableNameTest?) {
self.myPrimitiveArray = myPrimitiveArray
self.myPrimitive = myPrimitive
self.myVariableNameTest = myVariableNameTest
}
}

View File

@@ -1,11 +0,0 @@
//
// ModelDoubleArray.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
/** This defines an array of doubles. */
public typealias ModelDoubleArray = [Double]

View File

@@ -1,11 +0,0 @@
//
// ModelErrorInfoArray.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
/** This defines an array of ErrorInfo objects. */
public typealias ModelErrorInfoArray = [ErrorInfo]

View File

@@ -1,11 +0,0 @@
//
// ModelStringArray.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
/** This defines an array of strings. */
public typealias ModelStringArray = [String]

View File

@@ -1,47 +0,0 @@
//
// ModelWithIntAdditionalPropertiesOnly.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
//
import Foundation
/** This is an empty model with no properties and only additionalProperties of type int32 */
public struct ModelWithIntAdditionalPropertiesOnly: Codable {
public var additionalProperties: [String: Int] = [:]
public subscript(key: String) -> Int? {
get {
if let value = additionalProperties[key] {
return value
}
return nil
}
set {
additionalProperties[key] = newValue
}
}
// Encodable protocol methods
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: String.self)
try container.encodeMap(additionalProperties)
}
// Decodable protocol methods
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: String.self)
var nonAdditionalPropertyKeys = Set<String>()
additionalProperties = try container.decodeMap(Int.self, excludedKeys: nonAdditionalPropertyKeys)
}
}

View File

@@ -1,90 +0,0 @@
//
// ModelWithPropertiesAndAdditionalProperties.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
//
import Foundation
/** This is an empty model with no properties and only additionalProperties of type int32 */
public struct ModelWithPropertiesAndAdditionalProperties: Codable {
public var myIntegerReq: Int
public var myIntegerOpt: Int?
public var myPrimitiveReq: AllPrimitives
public var myPrimitiveOpt: AllPrimitives?
public var myStringArrayReq: [String]
public var myStringArrayOpt: [String]?
public var myPrimitiveArrayReq: [AllPrimitives]
public var myPrimitiveArrayOpt: [AllPrimitives]?
public init(myIntegerReq: Int, myIntegerOpt: Int?, myPrimitiveReq: AllPrimitives, myPrimitiveOpt: AllPrimitives?, myStringArrayReq: [String], myStringArrayOpt: [String]?, myPrimitiveArrayReq: [AllPrimitives], myPrimitiveArrayOpt: [AllPrimitives]?) {
self.myIntegerReq = myIntegerReq
self.myIntegerOpt = myIntegerOpt
self.myPrimitiveReq = myPrimitiveReq
self.myPrimitiveOpt = myPrimitiveOpt
self.myStringArrayReq = myStringArrayReq
self.myStringArrayOpt = myStringArrayOpt
self.myPrimitiveArrayReq = myPrimitiveArrayReq
self.myPrimitiveArrayOpt = myPrimitiveArrayOpt
}
public var additionalProperties: [String: String] = [:]
public subscript(key: String) -> String? {
get {
if let value = additionalProperties[key] {
return value
}
return nil
}
set {
additionalProperties[key] = newValue
}
}
// Encodable protocol methods
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: String.self)
try container.encode(myIntegerReq, forKey: "myIntegerReq")
try container.encodeIfPresent(myIntegerOpt, forKey: "myIntegerOpt")
try container.encode(myPrimitiveReq, forKey: "myPrimitiveReq")
try container.encodeIfPresent(myPrimitiveOpt, forKey: "myPrimitiveOpt")
try container.encode(myStringArrayReq, forKey: "myStringArrayReq")
try container.encodeIfPresent(myStringArrayOpt, forKey: "myStringArrayOpt")
try container.encode(myPrimitiveArrayReq, forKey: "myPrimitiveArrayReq")
try container.encodeIfPresent(myPrimitiveArrayOpt, forKey: "myPrimitiveArrayOpt")
try container.encodeMap(additionalProperties)
}
// Decodable protocol methods
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: String.self)
myIntegerReq = try container.decode(Int.self, forKey: "myIntegerReq")
myIntegerOpt = try container.decodeIfPresent(Int.self, forKey: "myIntegerOpt")
myPrimitiveReq = try container.decode(AllPrimitives.self, forKey: "myPrimitiveReq")
myPrimitiveOpt = try container.decodeIfPresent(AllPrimitives.self, forKey: "myPrimitiveOpt")
myStringArrayReq = try container.decode([String].self, forKey: "myStringArrayReq")
myStringArrayOpt = try container.decodeIfPresent([String].self, forKey: "myStringArrayOpt")
myPrimitiveArrayReq = try container.decode([AllPrimitives].self, forKey: "myPrimitiveArrayReq")
myPrimitiveArrayOpt = try container.decodeIfPresent([AllPrimitives].self, forKey: "myPrimitiveArrayOpt")
var nonAdditionalPropertyKeys = Set<String>()
nonAdditionalPropertyKeys.insert("myIntegerReq")
nonAdditionalPropertyKeys.insert("myIntegerOpt")
nonAdditionalPropertyKeys.insert("myPrimitiveReq")
nonAdditionalPropertyKeys.insert("myPrimitiveOpt")
nonAdditionalPropertyKeys.insert("myStringArrayReq")
nonAdditionalPropertyKeys.insert("myStringArrayOpt")
nonAdditionalPropertyKeys.insert("myPrimitiveArrayReq")
nonAdditionalPropertyKeys.insert("myPrimitiveArrayOpt")
additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys)
}
}

View File

@@ -1,47 +0,0 @@
//
// ModelWithStringAdditionalPropertiesOnly.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
//
import Foundation
/** This is an empty model with no properties and only additionalProperties of type string */
public struct ModelWithStringAdditionalPropertiesOnly: Codable {
public var additionalProperties: [String: String] = [:]
public subscript(key: String) -> String? {
get {
if let value = additionalProperties[key] {
return value
}
return nil
}
set {
additionalProperties[key] = newValue
}
}
// Encodable protocol methods
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: String.self)
try container.encodeMap(additionalProperties)
}
// Decodable protocol methods
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: String.self)
var nonAdditionalPropertyKeys = Set<String>()
additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys)
}
}

View File

@@ -1,24 +0,0 @@
//
// PersonCard.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
/** This is an card object for a Person derived from BaseCard. */
public struct PersonCard: Codable {
public var cardType: String
public var firstName: String?
public var lastName: String?
public init(cardType: String, firstName: String?, lastName: String?) {
self.cardType = cardType
self.firstName = firstName
self.lastName = lastName
}
}

View File

@@ -1,24 +0,0 @@
//
// PlaceCard.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
/** This is an card object for a Person derived from BaseCard. */
public struct PlaceCard: Codable {
public var cardType: String
public var placeName: String?
public var placeAddress: String?
public init(cardType: String, placeName: String?, placeAddress: String?) {
self.cardType = cardType
self.placeName = placeName
self.placeAddress = placeAddress
}
}

View File

@@ -1,22 +0,0 @@
//
// SampleBase.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
/** This is an base class object from which other classes will derive. */
public struct SampleBase: Codable {
public var baseClassStringProp: String?
public var baseClassIntegerProp: Int?
public init(baseClassStringProp: String?, baseClassIntegerProp: Int?) {
self.baseClassStringProp = baseClassStringProp
self.baseClassIntegerProp = baseClassIntegerProp
}
}

View File

@@ -1,26 +0,0 @@
//
// SampleSubClass.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
/** This is an subclass defived from the SampleBase class. */
public struct SampleSubClass: Codable {
public var baseClassStringProp: String?
public var baseClassIntegerProp: Int?
public var subClassStringProp: String?
public var subClassIntegerProp: Int?
public init(baseClassStringProp: String?, baseClassIntegerProp: Int?, subClassStringProp: String?, subClassIntegerProp: Int?) {
self.baseClassStringProp = baseClassStringProp
self.baseClassIntegerProp = baseClassIntegerProp
self.subClassStringProp = subClassStringProp
self.subClassIntegerProp = subClassIntegerProp
}
}

View File

@@ -1,14 +0,0 @@
//
// StringEnum.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
public enum StringEnum: String, Codable {
case stringenumvalue1 = "stringEnumValue1"
case stringenumvalue2 = "stringEnumValue2"
case stringenumvalue3 = "stringEnumValue3"
}

View File

@@ -1,33 +0,0 @@
//
// VariableNameTest.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
/** This object contains property names which we know will be different from their variable name. Examples of this include snake case property names and property names which are Swift 4 reserved words. */
public struct VariableNameTest: Codable {
/** This snake-case examle_name property name should be converted to a camelCase variable name like exampleName */
public var exampleName: String?
/** This property name is a reserved word in most languages, including Swift 4. */
public var _for: String?
/** This model object property name should be unchanged from the JSON property name. */
public var normalName: String?
public init(exampleName: String?, _for: String?, normalName: String?) {
self.exampleName = exampleName
self._for = _for
self.normalName = normalName
}
public enum CodingKeys: String, CodingKey {
case exampleName = "example_name"
case _for = "for"
case normalName
}
}

View File

@@ -1,19 +1,13 @@
platform :ios, '9.0'
source 'https://cdn.cocoapods.org/'
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
target 'TestClientApp' do
pod "TestClient", :path => "../"
pod 'Alamofire', '~> 4.5'
target 'TestClientAppTests' do
inherit! :search_paths
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |configuration|
configuration.build_settings['SWIFT_VERSION'] = "4.0"
end
end
end

View File

@@ -1,20 +1,23 @@
PODS:
- Alamofire (4.5.1)
- TestClient (0.0.1):
- Alamofire (~> 4.5.0)
- Alamofire (4.9.0)
- TestClient (1.0):
- Alamofire (~> 4.9.0)
DEPENDENCIES:
- Alamofire (~> 4.5)
- TestClient (from `../`)
SPEC REPOS:
trunk:
- Alamofire
EXTERNAL SOURCES:
TestClient:
:path: ../
:path: "../"
SPEC CHECKSUMS:
Alamofire: 2d95912bf4c34f164fdfc335872e8c312acaea4a
TestClient: 410e69b600d7aa37590bc4077dc148d7f314ac84
Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321
TestClient: 4923530f672e09a8d020c93372c5ecc195a00ff2
PODFILE CHECKSUM: a4351ac5e001fd96f35ed7e647981803864100b5
PODFILE CHECKSUM: 837b06bfc9f93ccd7664fd918d113c8e3824bde3
COCOAPODS: 1.4.0.beta.2
COCOAPODS: 1.8.4

View File

@@ -1,4 +1,4 @@
Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
//
// AFError.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,7 +1,7 @@
//
// Alamofire.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -135,7 +135,8 @@ public func request(
parameters: Parameters? = nil,
encoding: ParameterEncoding = URLEncoding.default,
headers: HTTPHeaders? = nil)
-> DataRequest {
-> DataRequest
{
return SessionManager.default.request(
url,
method: method,
@@ -182,7 +183,8 @@ public func download(
encoding: ParameterEncoding = URLEncoding.default,
headers: HTTPHeaders? = nil,
to destination: DownloadRequest.DownloadFileDestination? = nil)
-> DownloadRequest {
-> DownloadRequest
{
return SessionManager.default.download(
url,
method: method,
@@ -207,7 +209,8 @@ public func download(
public func download(
_ urlRequest: URLRequestConvertible,
to destination: DownloadRequest.DownloadFileDestination? = nil)
-> DownloadRequest {
-> DownloadRequest
{
return SessionManager.default.download(urlRequest, to: destination)
}
@@ -236,7 +239,8 @@ public func download(
public func download(
resumingWith resumeData: Data,
to destination: DownloadRequest.DownloadFileDestination? = nil)
-> DownloadRequest {
-> DownloadRequest
{
return SessionManager.default.download(resumingWith: resumeData, to: destination)
}
@@ -259,7 +263,8 @@ public func upload(
to url: URLConvertible,
method: HTTPMethod = .post,
headers: HTTPHeaders? = nil)
-> UploadRequest {
-> UploadRequest
{
return SessionManager.default.upload(fileURL, to: url, method: method, headers: headers)
}
@@ -292,7 +297,8 @@ public func upload(
to url: URLConvertible,
method: HTTPMethod = .post,
headers: HTTPHeaders? = nil)
-> UploadRequest {
-> UploadRequest
{
return SessionManager.default.upload(data, to: url, method: method, headers: headers)
}
@@ -325,7 +331,8 @@ public func upload(
to url: URLConvertible,
method: HTTPMethod = .post,
headers: HTTPHeaders? = nil)
-> UploadRequest {
-> UploadRequest
{
return SessionManager.default.upload(stream, to: url, method: method, headers: headers)
}
@@ -372,7 +379,8 @@ public func upload(
to url: URLConvertible,
method: HTTPMethod = .post,
headers: HTTPHeaders? = nil,
encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) {
encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?)
{
return SessionManager.default.upload(
multipartFormData: multipartFormData,
usingThreshold: encodingMemoryThreshold,
@@ -408,7 +416,8 @@ public func upload(
multipartFormData: @escaping (MultipartFormData) -> Void,
usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold,
with urlRequest: URLRequestConvertible,
encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) {
encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?)
{
return SessionManager.default.upload(
multipartFormData: multipartFormData,
usingThreshold: encodingMemoryThreshold,

View File

@@ -1,7 +1,7 @@
//
// DispatchQueue+Alamofire.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,7 +1,7 @@
//
// MultipartFormData.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -98,7 +98,7 @@ open class MultipartFormData {
public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } }
/// The boundary used to separate the body parts in the encoded form data.
public let boundary: String
public var boundary: String
private var bodyParts: [BodyPart]
private var bodyPartError: AFError?
@@ -275,7 +275,8 @@ open class MultipartFormData {
}
bodyContentLength = fileSize.uint64Value
} catch {
}
catch {
setBodyPartError(withReason: .bodyPartFileSizeQueryFailedWithError(forURL: fileURL, error: error))
return
}
@@ -311,7 +312,8 @@ open class MultipartFormData {
withLength length: UInt64,
name: String,
fileName: String,
mimeType: String) {
mimeType: String)
{
let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType)
append(stream, withLength: length, headers: headers)
}

View File

@@ -1,7 +1,7 @@
//
// NetworkReachabilityManager.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -33,7 +33,7 @@ import SystemConfiguration
/// Reachability can be used to determine background information about why a network operation failed, or to retry
/// network requests when a connection is established. It should not be used to prevent a user from initiating a network
/// request, as it's possible that an initial request may be required to establish reachability.
public class NetworkReachabilityManager {
open class NetworkReachabilityManager {
/// Defines the various states of network reachability.
///
/// - unknown: It is unknown whether the network is reachable.
@@ -61,27 +61,27 @@ public class NetworkReachabilityManager {
// MARK: - Properties
/// Whether the network is currently reachable.
public var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi }
open var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi }
/// Whether the network is currently reachable over the WWAN interface.
public var isReachableOnWWAN: Bool { return networkReachabilityStatus == .reachable(.wwan) }
open var isReachableOnWWAN: Bool { return networkReachabilityStatus == .reachable(.wwan) }
/// Whether the network is currently reachable over Ethernet or WiFi interface.
public var isReachableOnEthernetOrWiFi: Bool { return networkReachabilityStatus == .reachable(.ethernetOrWiFi) }
open var isReachableOnEthernetOrWiFi: Bool { return networkReachabilityStatus == .reachable(.ethernetOrWiFi) }
/// The current network reachability status.
public var networkReachabilityStatus: NetworkReachabilityStatus {
open var networkReachabilityStatus: NetworkReachabilityStatus {
guard let flags = self.flags else { return .unknown }
return networkReachabilityStatusForFlags(flags)
}
/// The dispatch queue to execute the `listener` closure on.
public var listenerQueue: DispatchQueue = DispatchQueue.main
open var listenerQueue: DispatchQueue = DispatchQueue.main
/// A closure executed when the network reachability status changes.
public var listener: Listener?
open var listener: Listener?
private var flags: SCNetworkReachabilityFlags? {
open var flags: SCNetworkReachabilityFlags? {
var flags = SCNetworkReachabilityFlags()
if SCNetworkReachabilityGetFlags(reachability, &flags) {
@@ -92,7 +92,7 @@ public class NetworkReachabilityManager {
}
private let reachability: SCNetworkReachability
private var previousFlags: SCNetworkReachabilityFlags
open var previousFlags: SCNetworkReachabilityFlags
// MARK: - Initialization
@@ -128,7 +128,9 @@ public class NetworkReachabilityManager {
private init(reachability: SCNetworkReachability) {
self.reachability = reachability
self.previousFlags = SCNetworkReachabilityFlags()
// Set the previous flags to an unreserved value to represent unknown status
self.previousFlags = SCNetworkReachabilityFlags(rawValue: 1 << 30)
}
deinit {
@@ -141,12 +143,13 @@ public class NetworkReachabilityManager {
///
/// - returns: `true` if listening was started successfully, `false` otherwise.
@discardableResult
public func startListening() -> Bool {
open func startListening() -> Bool {
var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil)
context.info = Unmanaged.passUnretained(self).toOpaque()
let callbackEnabled = SCNetworkReachabilitySetCallback(
reachability, { (_, flags, info) in
reachability,
{ (_, flags, info) in
let reachability = Unmanaged<NetworkReachabilityManager>.fromOpaque(info!).takeUnretainedValue()
reachability.notifyListener(flags)
},
@@ -156,15 +159,18 @@ public class NetworkReachabilityManager {
let queueEnabled = SCNetworkReachabilitySetDispatchQueue(reachability, listenerQueue)
listenerQueue.async {
self.previousFlags = SCNetworkReachabilityFlags()
self.notifyListener(self.flags ?? SCNetworkReachabilityFlags())
self.previousFlags = SCNetworkReachabilityFlags(rawValue: 1 << 30)
guard let flags = self.flags else { return }
self.notifyListener(flags)
}
return callbackEnabled && queueEnabled
}
/// Stops listening for changes in network reachability status.
public func stopListening() {
open func stopListening() {
SCNetworkReachabilitySetCallback(reachability, nil, nil)
SCNetworkReachabilitySetDispatchQueue(reachability, nil)
}
@@ -215,7 +221,8 @@ extension NetworkReachabilityManager.NetworkReachabilityStatus: Equatable {}
public func ==(
lhs: NetworkReachabilityManager.NetworkReachabilityStatus,
rhs: NetworkReachabilityManager.NetworkReachabilityStatus)
-> Bool {
-> Bool
{
switch (lhs, rhs) {
case (.unknown, .unknown):
return true

View File

@@ -1,7 +1,7 @@
//
// Notifications.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -48,5 +48,8 @@ extension Notification {
public struct Key {
/// User info dictionary key representing the `URLSessionTask` associated with the notification.
public static let Task = "org.alamofire.notification.key.task"
/// User info dictionary key representing the responseData associated with the notification.
public static let ResponseData = "org.alamofire.notification.key.responseData"
}
}

View File

@@ -1,7 +1,7 @@
//
// ParameterEncoding.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -64,9 +64,15 @@ public protocol ParameterEncoding {
/// the HTTP body depends on the destination of the encoding.
///
/// The `Content-Type` HTTP header field of an encoded request with HTTP body is set to
/// `application/x-www-form-urlencoded; charset=utf-8`. Since there is no published specification for how to encode
/// collection types, the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending
/// the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`).
/// `application/x-www-form-urlencoded; charset=utf-8`.
///
/// There is no published specification for how to encode collection types. By default the convention of appending
/// `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for
/// nested dictionary values (`foo[bar]=baz`) is used. Optionally, `ArrayEncoding` can be used to omit the
/// square brackets appended to array keys.
///
/// `BoolEncoding` can be used to configure how boolean values are encoded. The default behavior is to encode
/// `true` as 1 and `false` as 0.
public struct URLEncoding: ParameterEncoding {
// MARK: Helper Types
@@ -82,6 +88,41 @@ public struct URLEncoding: ParameterEncoding {
case methodDependent, queryString, httpBody
}
/// Configures how `Array` parameters are encoded.
///
/// - brackets: An empty set of square brackets is appended to the key for every value.
/// This is the default behavior.
/// - noBrackets: No brackets are appended. The key is encoded as is.
public enum ArrayEncoding {
case brackets, noBrackets
func encode(key: String) -> String {
switch self {
case .brackets:
return "\(key)[]"
case .noBrackets:
return key
}
}
}
/// Configures how `Bool` parameters are encoded.
///
/// - numeric: Encode `true` as `1` and `false` as `0`. This is the default behavior.
/// - literal: Encode `true` and `false` as string literals.
public enum BoolEncoding {
case numeric, literal
func encode(value: Bool) -> String {
switch self {
case .numeric:
return value ? "1" : "0"
case .literal:
return value ? "true" : "false"
}
}
}
// MARK: Properties
/// Returns a default `URLEncoding` instance.
@@ -99,15 +140,25 @@ public struct URLEncoding: ParameterEncoding {
/// The destination defining where the encoded query string is to be applied to the URL request.
public let destination: Destination
/// The encoding to use for `Array` parameters.
public let arrayEncoding: ArrayEncoding
/// The encoding to use for `Bool` parameters.
public let boolEncoding: BoolEncoding
// MARK: Initialization
/// Creates a `URLEncoding` instance using the specified destination.
///
/// - parameter destination: The destination defining where the encoded query string is to be applied.
/// - parameter arrayEncoding: The encoding to use for `Array` parameters.
/// - parameter boolEncoding: The encoding to use for `Bool` parameters.
///
/// - returns: The new `URLEncoding` instance.
public init(destination: Destination = .methodDependent) {
public init(destination: Destination = .methodDependent, arrayEncoding: ArrayEncoding = .brackets, boolEncoding: BoolEncoding = .numeric) {
self.destination = destination
self.arrayEncoding = arrayEncoding
self.boolEncoding = boolEncoding
}
// MARK: Encoding
@@ -161,16 +212,16 @@ public struct URLEncoding: ParameterEncoding {
}
} else if let array = value as? [Any] {
for value in array {
components += queryComponents(fromKey: "\(key)[]", value: value)
components += queryComponents(fromKey: arrayEncoding.encode(key: key), value: value)
}
} else if let value = value as? NSNumber {
if value.isBool {
components.append((escape(key), escape((value.boolValue ? "1" : "0"))))
components.append((escape(key), escape(boolEncoding.encode(value: value.boolValue))))
} else {
components.append((escape(key), escape("\(value)")))
}
} else if let bool = value as? Bool {
components.append((escape(key), escape((bool ? "1" : "0"))))
components.append((escape(key), escape(boolEncoding.encode(value: bool))))
} else {
components.append((escape(key), escape("\(value)")))
}
@@ -384,7 +435,8 @@ public struct PropertyListEncoding: ParameterEncoding {
/// - returns: The new `PropertyListEncoding` instance.
public init(
format: PropertyListSerialization.PropertyListFormat = .xml,
options: PropertyListSerialization.WriteOptions = 0) {
options: PropertyListSerialization.WriteOptions = 0)
{
self.format = format
self.options = options
}

View File

@@ -1,7 +1,7 @@
//
// Request.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -102,7 +102,7 @@ open class Request {
open var task: URLSessionTask? { return delegate.task }
/// The session belonging to the underlying task.
open let session: URLSession
public let session: URLSession
/// The request sent or to be sent to the server.
open var request: URLRequest? { return task?.originalRequest }
@@ -161,7 +161,8 @@ open class Request {
user: String,
password: String,
persistence: URLCredential.Persistence = .forSession)
-> Self {
-> Self
{
let credential = URLCredential(user: user, password: password, persistence: persistence)
return authenticate(usingCredential: credential)
}
@@ -183,7 +184,7 @@ open class Request {
/// - parameter password: The password.
///
/// - returns: A tuple with Authorization header and credential value if encoding succeeds, `nil` otherwise.
open static func authorizationHeader(user: String, password: String) -> (key: String, value: String)? {
open class func authorizationHeader(user: String, password: String) -> (key: String, value: String)? {
guard let data = "\(user):\(password)".data(using: .utf8) else { return nil }
let credential = data.base64EncodedString(options: [])
@@ -319,20 +320,16 @@ extension Request: CustomDebugStringConvertible {
var headers: [AnyHashable: Any] = [:]
if let additionalHeaders = session.configuration.httpAdditionalHeaders {
for (field, value) in additionalHeaders where field != AnyHashable("Cookie") {
headers[field] = value
}
}
session.configuration.httpAdditionalHeaders?.filter { $0.0 != AnyHashable("Cookie") }
.forEach { headers[$0.0] = $0.1 }
if let headerFields = request.allHTTPHeaderFields {
for (field, value) in headerFields where field != "Cookie" {
headers[field] = value
}
}
request.allHTTPHeaderFields?.filter { $0.0 != "Cookie" }
.forEach { headers[$0.0] = $0.1 }
for (field, value) in headers {
components.append("-H \"\(field): \(value)\"")
components += headers.map {
let escapedValue = String(describing: $0.value).replacingOccurrences(of: "\"", with: "\\\"")
return "-H \"\($0.key): \(escapedValue)\""
}
if let httpBodyData = request.httpBody, let httpBody = String(data: httpBodyData, encoding: .utf8) {
@@ -500,8 +497,19 @@ open class DownloadRequest: Request {
// MARK: State
/// Cancels the request.
open override func cancel() {
downloadDelegate.downloadTask.cancel { self.downloadDelegate.resumeData = $0 }
override open func cancel() {
cancel(createResumeData: true)
}
/// Cancels the request.
///
/// - parameter createResumeData: Determines whether resume data is created via the underlying download task or not.
open func cancel(createResumeData: Bool) {
if createResumeData {
downloadDelegate.downloadTask.cancel { self.downloadDelegate.resumeData = $0 }
} else {
downloadDelegate.downloadTask.cancel()
}
NotificationCenter.default.post(
name: Notification.Name.Task.DidCancel,
@@ -536,7 +544,8 @@ open class DownloadRequest: Request {
open class func suggestedDownloadDestination(
for directory: FileManager.SearchPathDirectory = .documentDirectory,
in domain: FileManager.SearchPathDomainMask = .userDomainMask)
-> DownloadFileDestination {
-> DownloadFileDestination
{
return { temporaryURL, response in
let directoryURLs = FileManager.default.urls(for: directory, in: domain)

View File

@@ -1,7 +1,7 @@
//
// Response.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -58,7 +58,8 @@ public struct DefaultDataResponse {
data: Data?,
error: Error?,
timeline: Timeline = Timeline(),
metrics: AnyObject? = nil) {
metrics: AnyObject? = nil)
{
self.request = request
self.response = response
self.data = data
@@ -108,7 +109,8 @@ public struct DataResponse<Value> {
response: HTTPURLResponse?,
data: Data?,
result: Result<Value>,
timeline: Timeline = Timeline()) {
timeline: Timeline = Timeline())
{
self.request = request
self.response = response
self.data = data
@@ -197,6 +199,55 @@ extension DataResponse {
return response
}
/// Evaluates the specified closure when the `DataResponse` is a failure, passing the unwrapped error as a parameter.
///
/// Use the `mapError` function with a closure that does not throw. For example:
///
/// let possibleData: DataResponse<Data> = ...
/// let withMyError = possibleData.mapError { MyError.error($0) }
///
/// - Parameter transform: A closure that takes the error of the instance.
/// - Returns: A `DataResponse` instance containing the result of the transform.
public func mapError<E: Error>(_ transform: (Error) -> E) -> DataResponse {
var response = DataResponse(
request: request,
response: self.response,
data: data,
result: result.mapError(transform),
timeline: timeline
)
response._metrics = _metrics
return response
}
/// Evaluates the specified closure when the `DataResponse` is a failure, passing the unwrapped error as a parameter.
///
/// Use the `flatMapError` function with a closure that may throw an error. For example:
///
/// let possibleData: DataResponse<Data> = ...
/// let possibleObject = possibleData.flatMapError {
/// try someFailableFunction(taking: $0)
/// }
///
/// - Parameter transform: A throwing closure that takes the error of the instance.
///
/// - Returns: A `DataResponse` instance containing the result of the transform.
public func flatMapError<E: Error>(_ transform: (Error) throws -> E) -> DataResponse {
var response = DataResponse(
request: request,
response: self.response,
data: data,
result: result.flatMapError(transform),
timeline: timeline
)
response._metrics = _metrics
return response
}
}
// MARK: -
@@ -245,7 +296,8 @@ public struct DefaultDownloadResponse {
resumeData: Data?,
error: Error?,
timeline: Timeline = Timeline(),
metrics: AnyObject? = nil) {
metrics: AnyObject? = nil)
{
self.request = request
self.response = response
self.temporaryURL = temporaryURL
@@ -307,7 +359,8 @@ public struct DownloadResponse<Value> {
destinationURL: URL?,
resumeData: Data?,
result: Result<Value>,
timeline: Timeline = Timeline()) {
timeline: Timeline = Timeline())
{
self.request = request
self.response = response
self.temporaryURL = temporaryURL
@@ -405,6 +458,59 @@ extension DownloadResponse {
return response
}
/// Evaluates the specified closure when the `DownloadResponse` is a failure, passing the unwrapped error as a parameter.
///
/// Use the `mapError` function with a closure that does not throw. For example:
///
/// let possibleData: DownloadResponse<Data> = ...
/// let withMyError = possibleData.mapError { MyError.error($0) }
///
/// - Parameter transform: A closure that takes the error of the instance.
/// - Returns: A `DownloadResponse` instance containing the result of the transform.
public func mapError<E: Error>(_ transform: (Error) -> E) -> DownloadResponse {
var response = DownloadResponse(
request: request,
response: self.response,
temporaryURL: temporaryURL,
destinationURL: destinationURL,
resumeData: resumeData,
result: result.mapError(transform),
timeline: timeline
)
response._metrics = _metrics
return response
}
/// Evaluates the specified closure when the `DownloadResponse` is a failure, passing the unwrapped error as a parameter.
///
/// Use the `flatMapError` function with a closure that may throw an error. For example:
///
/// let possibleData: DownloadResponse<Data> = ...
/// let possibleObject = possibleData.flatMapError {
/// try someFailableFunction(taking: $0)
/// }
///
/// - Parameter transform: A throwing closure that takes the error of the instance.
///
/// - Returns: A `DownloadResponse` instance containing the result of the transform.
public func flatMapError<E: Error>(_ transform: (Error) throws -> E) -> DownloadResponse {
var response = DownloadResponse(
request: request,
response: self.response,
temporaryURL: temporaryURL,
destinationURL: destinationURL,
resumeData: resumeData,
result: result.flatMapError(transform),
timeline: timeline
)
response._metrics = _metrics
return response
}
}
// MARK: -

View File

@@ -1,7 +1,7 @@
//
// ResponseSerialization.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -144,7 +144,8 @@ extension DataRequest {
queue: DispatchQueue? = nil,
responseSerializer: T,
completionHandler: @escaping (DataResponse<T.SerializedObject>) -> Void)
-> Self {
-> Self
{
delegate.queue.addOperation {
let result = responseSerializer.serializeResponse(
self.request,
@@ -181,7 +182,8 @@ extension DownloadRequest {
public func response(
queue: DispatchQueue? = nil,
completionHandler: @escaping (DefaultDownloadResponse) -> Void)
-> Self {
-> Self
{
delegate.queue.addOperation {
(queue ?? DispatchQueue.main).async {
var downloadResponse = DefaultDownloadResponse(
@@ -216,7 +218,8 @@ extension DownloadRequest {
queue: DispatchQueue? = nil,
responseSerializer: T,
completionHandler: @escaping (DownloadResponse<T.SerializedObject>) -> Void)
-> Self {
-> Self
{
delegate.queue.addOperation {
let result = responseSerializer.serializeResponse(
self.request,
@@ -286,7 +289,8 @@ extension DataRequest {
public func responseData(
queue: DispatchQueue? = nil,
completionHandler: @escaping (DataResponse<Data>) -> Void)
-> Self {
-> Self
{
return response(
queue: queue,
responseSerializer: DataRequest.dataResponseSerializer(),
@@ -325,7 +329,8 @@ extension DownloadRequest {
public func responseData(
queue: DispatchQueue? = nil,
completionHandler: @escaping (DownloadResponse<Data>) -> Void)
-> Self {
-> Self
{
return response(
queue: queue,
responseSerializer: DownloadRequest.dataResponseSerializer(),
@@ -351,7 +356,8 @@ extension Request {
response: HTTPURLResponse?,
data: Data?,
error: Error?)
-> Result<String> {
-> Result<String>
{
guard error == nil else { return .failure(error!) }
if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success("") }
@@ -362,13 +368,13 @@ extension Request {
var convertedEncoding = encoding
if let encodingName = response?.textEncodingName as CFString!, convertedEncoding == nil {
if let encodingName = response?.textEncodingName as CFString?, convertedEncoding == nil {
convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(
CFStringConvertIANACharSetNameToEncoding(encodingName))
)
}
let actualEncoding = convertedEncoding ?? String.Encoding.isoLatin1
let actualEncoding = convertedEncoding ?? .isoLatin1
if let string = String(data: validData, encoding: actualEncoding) {
return .success(string)
@@ -405,7 +411,8 @@ extension DataRequest {
queue: DispatchQueue? = nil,
encoding: String.Encoding? = nil,
completionHandler: @escaping (DataResponse<String>) -> Void)
-> Self {
-> Self
{
return response(
queue: queue,
responseSerializer: DataRequest.stringResponseSerializer(encoding: encoding),
@@ -452,7 +459,8 @@ extension DownloadRequest {
queue: DispatchQueue? = nil,
encoding: String.Encoding? = nil,
completionHandler: @escaping (DownloadResponse<String>) -> Void)
-> Self {
-> Self
{
return response(
queue: queue,
responseSerializer: DownloadRequest.stringResponseSerializer(encoding: encoding),
@@ -478,7 +486,8 @@ extension Request {
response: HTTPURLResponse?,
data: Data?,
error: Error?)
-> Result<Any> {
-> Result<Any>
{
guard error == nil else { return .failure(error!) }
if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) }
@@ -505,7 +514,8 @@ extension DataRequest {
/// - returns: A JSON object response serializer.
public static func jsonResponseSerializer(
options: JSONSerialization.ReadingOptions = .allowFragments)
-> DataResponseSerializer<Any> {
-> DataResponseSerializer<Any>
{
return DataResponseSerializer { _, response, data, error in
return Request.serializeResponseJSON(options: options, response: response, data: data, error: error)
}
@@ -522,7 +532,8 @@ extension DataRequest {
queue: DispatchQueue? = nil,
options: JSONSerialization.ReadingOptions = .allowFragments,
completionHandler: @escaping (DataResponse<Any>) -> Void)
-> Self {
-> Self
{
return response(
queue: queue,
responseSerializer: DataRequest.jsonResponseSerializer(options: options),
@@ -540,7 +551,8 @@ extension DownloadRequest {
/// - returns: A JSON object response serializer.
public static func jsonResponseSerializer(
options: JSONSerialization.ReadingOptions = .allowFragments)
-> DownloadResponseSerializer<Any> {
-> DownloadResponseSerializer<Any>
{
return DownloadResponseSerializer { _, response, fileURL, error in
guard error == nil else { return .failure(error!) }
@@ -568,7 +580,8 @@ extension DownloadRequest {
queue: DispatchQueue? = nil,
options: JSONSerialization.ReadingOptions = .allowFragments,
completionHandler: @escaping (DownloadResponse<Any>) -> Void)
-> Self {
-> Self
{
return response(
queue: queue,
responseSerializer: DownloadRequest.jsonResponseSerializer(options: options),
@@ -594,7 +607,8 @@ extension Request {
response: HTTPURLResponse?,
data: Data?,
error: Error?)
-> Result<Any> {
-> Result<Any>
{
guard error == nil else { return .failure(error!) }
if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) }
@@ -621,7 +635,8 @@ extension DataRequest {
/// - returns: A property list object response serializer.
public static func propertyListResponseSerializer(
options: PropertyListSerialization.ReadOptions = [])
-> DataResponseSerializer<Any> {
-> DataResponseSerializer<Any>
{
return DataResponseSerializer { _, response, data, error in
return Request.serializeResponsePropertyList(options: options, response: response, data: data, error: error)
}
@@ -638,7 +653,8 @@ extension DataRequest {
queue: DispatchQueue? = nil,
options: PropertyListSerialization.ReadOptions = [],
completionHandler: @escaping (DataResponse<Any>) -> Void)
-> Self {
-> Self
{
return response(
queue: queue,
responseSerializer: DataRequest.propertyListResponseSerializer(options: options),
@@ -656,7 +672,8 @@ extension DownloadRequest {
/// - returns: A property list object response serializer.
public static func propertyListResponseSerializer(
options: PropertyListSerialization.ReadOptions = [])
-> DownloadResponseSerializer<Any> {
-> DownloadResponseSerializer<Any>
{
return DownloadResponseSerializer { _, response, fileURL, error in
guard error == nil else { return .failure(error!) }
@@ -684,7 +701,8 @@ extension DownloadRequest {
queue: DispatchQueue? = nil,
options: PropertyListSerialization.ReadOptions = [],
completionHandler: @escaping (DownloadResponse<Any>) -> Void)
-> Self {
-> Self
{
return response(
queue: queue,
responseSerializer: DownloadRequest.propertyListResponseSerializer(options: options),

View File

@@ -1,7 +1,7 @@
//
// Result.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -253,8 +253,8 @@ extension Result {
/// - Parameter closure: A closure that takes the success value of this instance.
/// - Returns: This `Result` instance, unmodified.
@discardableResult
public func withValue(_ closure: (Value) -> Void) -> Result {
if case let .success(value) = self { closure(value) }
public func withValue(_ closure: (Value) throws -> Void) rethrows -> Result {
if case let .success(value) = self { try closure(value) }
return self
}
@@ -266,8 +266,8 @@ extension Result {
/// - Parameter closure: A closure that takes the success value of this instance.
/// - Returns: This `Result` instance, unmodified.
@discardableResult
public func withError(_ closure: (Error) -> Void) -> Result {
if case let .failure(error) = self { closure(error) }
public func withError(_ closure: (Error) throws -> Void) rethrows -> Result {
if case let .failure(error) = self { try closure(error) }
return self
}
@@ -279,8 +279,8 @@ extension Result {
/// - Parameter closure: A `Void` closure.
/// - Returns: This `Result` instance, unmodified.
@discardableResult
public func ifSuccess(_ closure: () -> Void) -> Result {
if isSuccess { closure() }
public func ifSuccess(_ closure: () throws -> Void) rethrows -> Result {
if isSuccess { try closure() }
return self
}
@@ -292,8 +292,8 @@ extension Result {
/// - Parameter closure: A `Void` closure.
/// - Returns: This `Result` instance, unmodified.
@discardableResult
public func ifFailure(_ closure: () -> Void) -> Result {
if isFailure { closure() }
public func ifFailure(_ closure: () throws -> Void) rethrows -> Result {
if isFailure { try closure() }
return self
}

View File

@@ -1,7 +1,7 @@
//
// ServerTrustPolicy.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -27,7 +27,7 @@ import Foundation
/// Responsible for managing the mapping of `ServerTrustPolicy` objects to a given host.
open class ServerTrustPolicyManager {
/// The dictionary of policies mapped to a particular host.
open let policies: [String: ServerTrustPolicy]
public let policies: [String: ServerTrustPolicy]
/// Initializes the `ServerTrustPolicyManager` instance with the given policies.
///
@@ -249,6 +249,7 @@ public enum ServerTrustPolicy {
let unspecified = SecTrustResultType.unspecified
let proceed = SecTrustResultType.proceed
isValid = result == unspecified || result == proceed
}

View File

@@ -1,7 +1,7 @@
//
// SessionDelegate.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -163,7 +163,7 @@ open class SessionDelegate: NSObject {
var retrier: RequestRetrier?
weak var sessionManager: SessionManager?
private var requests: [Int: Request] = [:]
var requests: [Int: Request] = [:]
private let lock = NSLock()
/// Access the task delegate for the specified task in a thread-safe manner.
@@ -255,7 +255,8 @@ extension SessionDelegate: URLSessionDelegate {
open func urlSession(
_ session: URLSession,
didReceive challenge: URLAuthenticationChallenge,
completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void)
{
guard sessionDidReceiveChallengeWithCompletion == nil else {
sessionDidReceiveChallengeWithCompletion?(session, challenge, completionHandler)
return
@@ -314,7 +315,8 @@ extension SessionDelegate: URLSessionTaskDelegate {
task: URLSessionTask,
willPerformHTTPRedirection response: HTTPURLResponse,
newRequest request: URLRequest,
completionHandler: @escaping (URLRequest?) -> Void) {
completionHandler: @escaping (URLRequest?) -> Void)
{
guard taskWillPerformHTTPRedirectionWithCompletion == nil else {
taskWillPerformHTTPRedirectionWithCompletion?(session, task, response, request, completionHandler)
return
@@ -340,7 +342,8 @@ extension SessionDelegate: URLSessionTaskDelegate {
_ session: URLSession,
task: URLSessionTask,
didReceive challenge: URLAuthenticationChallenge,
completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void)
{
guard taskDidReceiveChallengeWithCompletion == nil else {
taskDidReceiveChallengeWithCompletion?(session, task, challenge, completionHandler)
return
@@ -369,7 +372,8 @@ extension SessionDelegate: URLSessionTaskDelegate {
open func urlSession(
_ session: URLSession,
task: URLSessionTask,
needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) {
needNewBodyStream completionHandler: @escaping (InputStream?) -> Void)
{
guard taskNeedNewBodyStreamWithCompletion == nil else {
taskNeedNewBodyStreamWithCompletion?(session, task, completionHandler)
return
@@ -394,7 +398,8 @@ extension SessionDelegate: URLSessionTaskDelegate {
task: URLSessionTask,
didSendBodyData bytesSent: Int64,
totalBytesSent: Int64,
totalBytesExpectedToSend: Int64) {
totalBytesExpectedToSend: Int64)
{
if let taskDidSendBodyData = taskDidSendBodyData {
taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend)
} else if let delegate = self[task]?.delegate as? UploadTaskDelegate {
@@ -437,10 +442,16 @@ extension SessionDelegate: URLSessionTaskDelegate {
strongSelf[task]?.delegate.urlSession(session, task: task, didCompleteWithError: error)
var userInfo: [String: Any] = [Notification.Key.Task: task]
if let data = (strongSelf[task]?.delegate as? DataTaskDelegate)?.data {
userInfo[Notification.Key.ResponseData] = data
}
NotificationCenter.default.post(
name: Notification.Name.Task.DidComplete,
object: strongSelf,
userInfo: [Notification.Key.Task: task]
userInfo: userInfo
)
strongSelf[task] = nil
@@ -501,7 +512,8 @@ extension SessionDelegate: URLSessionDataDelegate {
_ session: URLSession,
dataTask: URLSessionDataTask,
didReceive response: URLResponse,
completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
{
guard dataTaskDidReceiveResponseWithCompletion == nil else {
dataTaskDidReceiveResponseWithCompletion?(session, dataTask, response, completionHandler)
return
@@ -524,7 +536,8 @@ extension SessionDelegate: URLSessionDataDelegate {
open func urlSession(
_ session: URLSession,
dataTask: URLSessionDataTask,
didBecome downloadTask: URLSessionDownloadTask) {
didBecome downloadTask: URLSessionDownloadTask)
{
if let dataTaskDidBecomeDownloadTask = dataTaskDidBecomeDownloadTask {
dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask)
} else {
@@ -560,7 +573,8 @@ extension SessionDelegate: URLSessionDataDelegate {
_ session: URLSession,
dataTask: URLSessionDataTask,
willCacheResponse proposedResponse: CachedURLResponse,
completionHandler: @escaping (CachedURLResponse?) -> Void) {
completionHandler: @escaping (CachedURLResponse?) -> Void)
{
guard dataTaskWillCacheResponseWithCompletion == nil else {
dataTaskWillCacheResponseWithCompletion?(session, dataTask, proposedResponse, completionHandler)
return
@@ -594,7 +608,8 @@ extension SessionDelegate: URLSessionDownloadDelegate {
open func urlSession(
_ session: URLSession,
downloadTask: URLSessionDownloadTask,
didFinishDownloadingTo location: URL) {
didFinishDownloadingTo location: URL)
{
if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL {
downloadTaskDidFinishDownloadingToURL(session, downloadTask, location)
} else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate {
@@ -617,7 +632,8 @@ extension SessionDelegate: URLSessionDownloadDelegate {
downloadTask: URLSessionDownloadTask,
didWriteData bytesWritten: Int64,
totalBytesWritten: Int64,
totalBytesExpectedToWrite: Int64) {
totalBytesExpectedToWrite: Int64)
{
if let downloadTaskDidWriteData = downloadTaskDidWriteData {
downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite)
} else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate {
@@ -645,7 +661,8 @@ extension SessionDelegate: URLSessionDownloadDelegate {
_ session: URLSession,
downloadTask: URLSessionDownloadTask,
didResumeAtOffset fileOffset: Int64,
expectedTotalBytes: Int64) {
expectedTotalBytes: Int64)
{
if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset {
downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes)
} else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate {
@@ -699,7 +716,8 @@ extension SessionDelegate: URLSessionStreamDelegate {
_ session: URLSession,
streamTask: URLSessionStreamTask,
didBecome inputStream: InputStream,
outputStream: OutputStream) {
outputStream: OutputStream)
{
streamTaskDidBecomeInputAndOutputStreams?(session, streamTask, inputStream, outputStream)
}
}

View File

@@ -1,7 +1,7 @@
//
// SessionManager.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -45,7 +45,7 @@ open class SessionManager {
/// A default instance of `SessionManager`, used by top-level Alamofire request methods, and suitable for use
/// directly for any ad hoc requests.
open static let `default`: SessionManager = {
public static let `default`: SessionManager = {
let configuration = URLSessionConfiguration.default
configuration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders
@@ -53,7 +53,7 @@ open class SessionManager {
}()
/// Creates default values for the "Accept-Encoding", "Accept-Language" and "User-Agent" headers.
open static let defaultHTTPHeaders: HTTPHeaders = {
public static let defaultHTTPHeaders: HTTPHeaders = {
// Accept-Encoding HTTP Header; see https://tools.ietf.org/html/rfc7230#section-4.2.3
let acceptEncoding: String = "gzip;q=1.0, compress;q=0.5"
@@ -118,13 +118,13 @@ open class SessionManager {
}()
/// Default memory threshold used when encoding `MultipartFormData` in bytes.
open static let multipartFormDataEncodingMemoryThreshold: UInt64 = 10_000_000
public static let multipartFormDataEncodingMemoryThreshold: UInt64 = 10_000_000
/// The underlying session.
open let session: URLSession
public let session: URLSession
/// The session delegate handling all the task and session delegate callbacks.
open let delegate: SessionDelegate
public let delegate: SessionDelegate
/// Whether to start requests immediately after being constructed. `true` by default.
open var startRequestsImmediately: Bool = true
@@ -166,7 +166,8 @@ open class SessionManager {
public init(
configuration: URLSessionConfiguration = URLSessionConfiguration.default,
delegate: SessionDelegate = SessionDelegate(),
serverTrustPolicyManager: ServerTrustPolicyManager? = nil) {
serverTrustPolicyManager: ServerTrustPolicyManager? = nil)
{
self.delegate = delegate
self.session = URLSession(configuration: configuration, delegate: delegate, delegateQueue: nil)
@@ -184,7 +185,8 @@ open class SessionManager {
public init?(
session: URLSession,
delegate: SessionDelegate,
serverTrustPolicyManager: ServerTrustPolicyManager? = nil) {
serverTrustPolicyManager: ServerTrustPolicyManager? = nil)
{
guard delegate === session.delegate else { return nil }
self.delegate = delegate
@@ -227,7 +229,8 @@ open class SessionManager {
parameters: Parameters? = nil,
encoding: ParameterEncoding = URLEncoding.default,
headers: HTTPHeaders? = nil)
-> DataRequest {
-> DataRequest
{
var originalRequest: URLRequest?
do {
@@ -246,6 +249,7 @@ open class SessionManager {
/// - parameter urlRequest: The URL request.
///
/// - returns: The created `DataRequest`.
@discardableResult
open func request(_ urlRequest: URLRequestConvertible) -> DataRequest {
var originalRequest: URLRequest?
@@ -316,7 +320,8 @@ open class SessionManager {
encoding: ParameterEncoding = URLEncoding.default,
headers: HTTPHeaders? = nil,
to destination: DownloadRequest.DownloadFileDestination? = nil)
-> DownloadRequest {
-> DownloadRequest
{
do {
let urlRequest = try URLRequest(url: url, method: method, headers: headers)
let encodedURLRequest = try encoding.encode(urlRequest, with: parameters)
@@ -342,7 +347,8 @@ open class SessionManager {
open func download(
_ urlRequest: URLRequestConvertible,
to destination: DownloadRequest.DownloadFileDestination? = nil)
-> DownloadRequest {
-> DownloadRequest
{
do {
let urlRequest = try urlRequest.asURLRequest()
return download(.request(urlRequest), to: destination)
@@ -378,7 +384,8 @@ open class SessionManager {
open func download(
resumingWith resumeData: Data,
to destination: DownloadRequest.DownloadFileDestination? = nil)
-> DownloadRequest {
-> DownloadRequest
{
return download(.resumeData(resumeData), to: destination)
}
@@ -387,7 +394,8 @@ open class SessionManager {
private func download(
_ downloadable: DownloadRequest.Downloadable,
to destination: DownloadRequest.DownloadFileDestination?)
-> DownloadRequest {
-> DownloadRequest
{
do {
let task = try downloadable.task(session: session, adapter: adapter, queue: queue)
let download = DownloadRequest(session: session, requestTask: .download(downloadable, task))
@@ -408,7 +416,8 @@ open class SessionManager {
_ downloadable: DownloadRequest.Downloadable?,
to destination: DownloadRequest.DownloadFileDestination?,
failedWith error: Error)
-> DownloadRequest {
-> DownloadRequest
{
var downloadTask: Request.RequestTask = .download(nil, nil)
if let downloadable = downloadable {
@@ -449,7 +458,8 @@ open class SessionManager {
to url: URLConvertible,
method: HTTPMethod = .post,
headers: HTTPHeaders? = nil)
-> UploadRequest {
-> UploadRequest
{
do {
let urlRequest = try URLRequest(url: url, method: method, headers: headers)
return upload(fileURL, with: urlRequest)
@@ -494,7 +504,8 @@ open class SessionManager {
to url: URLConvertible,
method: HTTPMethod = .post,
headers: HTTPHeaders? = nil)
-> UploadRequest {
-> UploadRequest
{
do {
let urlRequest = try URLRequest(url: url, method: method, headers: headers)
return upload(data, with: urlRequest)
@@ -539,7 +550,8 @@ open class SessionManager {
to url: URLConvertible,
method: HTTPMethod = .post,
headers: HTTPHeaders? = nil)
-> UploadRequest {
-> UploadRequest
{
do {
let urlRequest = try URLRequest(url: url, method: method, headers: headers)
return upload(stream, with: urlRequest)
@@ -599,7 +611,9 @@ open class SessionManager {
to url: URLConvertible,
method: HTTPMethod = .post,
headers: HTTPHeaders? = nil,
encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?) {
queue: DispatchQueue? = nil,
encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?)
{
do {
let urlRequest = try URLRequest(url: url, method: method, headers: headers)
@@ -607,10 +621,11 @@ open class SessionManager {
multipartFormData: multipartFormData,
usingThreshold: encodingMemoryThreshold,
with: urlRequest,
queue: queue,
encodingCompletion: encodingCompletion
)
} catch {
DispatchQueue.main.async { encodingCompletion?(.failure(error)) }
(queue ?? DispatchQueue.main).async { encodingCompletion?(.failure(error)) }
}
}
@@ -641,7 +656,9 @@ open class SessionManager {
multipartFormData: @escaping (MultipartFormData) -> Void,
usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold,
with urlRequest: URLRequestConvertible,
encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?) {
queue: DispatchQueue? = nil,
encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?)
{
DispatchQueue.global(qos: .utility).async {
let formData = MultipartFormData()
multipartFormData(formData)
@@ -663,7 +680,7 @@ open class SessionManager {
streamFileURL: nil
)
DispatchQueue.main.async { encodingCompletion?(encodingResult) }
(queue ?? DispatchQueue.main).async { encodingCompletion?(encodingResult) }
} else {
let fileManager = FileManager.default
let tempDirectoryURL = URL(fileURLWithPath: NSTemporaryDirectory())
@@ -699,7 +716,7 @@ open class SessionManager {
}
}
DispatchQueue.main.async {
(queue ?? DispatchQueue.main).async {
let encodingResult = MultipartFormDataEncodingResult.success(
request: upload,
streamingFromDisk: true,
@@ -719,7 +736,7 @@ open class SessionManager {
}
}
DispatchQueue.main.async { encodingCompletion?(.failure(error)) }
(queue ?? DispatchQueue.main).async { encodingCompletion?(.failure(error)) }
}
}
}
@@ -834,6 +851,10 @@ open class SessionManager {
do {
let task = try originalTask.task(session: session, adapter: adapter, queue: queue)
if let originalTask = request.task {
delegate[originalTask] = nil // removes the old request to avoid endless growth
}
request.delegate.task = task // resets all task delegate data
request.retryCount += 1

View File

@@ -1,7 +1,7 @@
//
// TaskDelegate.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -31,7 +31,7 @@ open class TaskDelegate: NSObject {
// MARK: Properties
/// The serial operation queue used to execute all operations after the task completes.
open let queue: OperationQueue
public let queue: OperationQueue
/// The data returned by the server.
public var data: Data? { return nil }
@@ -94,7 +94,8 @@ open class TaskDelegate: NSObject {
task: URLSessionTask,
willPerformHTTPRedirection response: HTTPURLResponse,
newRequest request: URLRequest,
completionHandler: @escaping (URLRequest?) -> Void) {
completionHandler: @escaping (URLRequest?) -> Void)
{
var redirectRequest: URLRequest? = request
if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection {
@@ -109,7 +110,8 @@ open class TaskDelegate: NSObject {
_ session: URLSession,
task: URLSessionTask,
didReceive challenge: URLAuthenticationChallenge,
completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void)
{
var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling
var credential: URLCredential?
@@ -148,7 +150,8 @@ open class TaskDelegate: NSObject {
func urlSession(
_ session: URLSession,
task: URLSessionTask,
needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) {
needNewBodyStream completionHandler: @escaping (InputStream?) -> Void)
{
var bodyStream: InputStream?
if let taskNeedNewBodyStream = taskNeedNewBodyStream {
@@ -234,7 +237,8 @@ class DataTaskDelegate: TaskDelegate, URLSessionDataDelegate {
_ session: URLSession,
dataTask: URLSessionDataTask,
didReceive response: URLResponse,
completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
{
var disposition: URLSession.ResponseDisposition = .allow
expectedContentLength = response.expectedContentLength
@@ -249,7 +253,8 @@ class DataTaskDelegate: TaskDelegate, URLSessionDataDelegate {
func urlSession(
_ session: URLSession,
dataTask: URLSessionDataTask,
didBecome downloadTask: URLSessionDownloadTask) {
didBecome downloadTask: URLSessionDownloadTask)
{
dataTaskDidBecomeDownloadTask?(session, dataTask, downloadTask)
}
@@ -282,7 +287,8 @@ class DataTaskDelegate: TaskDelegate, URLSessionDataDelegate {
_ session: URLSession,
dataTask: URLSessionDataTask,
willCacheResponse proposedResponse: CachedURLResponse,
completionHandler: @escaping (CachedURLResponse?) -> Void) {
completionHandler: @escaping (CachedURLResponse?) -> Void)
{
var cachedResponse: CachedURLResponse? = proposedResponse
if let dataTaskWillCacheResponse = dataTaskWillCacheResponse {
@@ -337,7 +343,8 @@ class DownloadTaskDelegate: TaskDelegate, URLSessionDownloadDelegate {
func urlSession(
_ session: URLSession,
downloadTask: URLSessionDownloadTask,
didFinishDownloadingTo location: URL) {
didFinishDownloadingTo location: URL)
{
temporaryURL = location
guard
@@ -372,7 +379,8 @@ class DownloadTaskDelegate: TaskDelegate, URLSessionDownloadDelegate {
downloadTask: URLSessionDownloadTask,
didWriteData bytesWritten: Int64,
totalBytesWritten: Int64,
totalBytesExpectedToWrite: Int64) {
totalBytesExpectedToWrite: Int64)
{
if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() }
if let downloadTaskDidWriteData = downloadTaskDidWriteData {
@@ -397,7 +405,8 @@ class DownloadTaskDelegate: TaskDelegate, URLSessionDownloadDelegate {
_ session: URLSession,
downloadTask: URLSessionDownloadTask,
didResumeAtOffset fileOffset: Int64,
expectedTotalBytes: Int64) {
expectedTotalBytes: Int64)
{
if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset {
downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes)
} else {
@@ -439,7 +448,8 @@ class UploadTaskDelegate: DataTaskDelegate {
task: URLSessionTask,
didSendBodyData bytesSent: Int64,
totalBytesSent: Int64,
totalBytesExpectedToSend: Int64) {
totalBytesExpectedToSend: Int64)
{
if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() }
if let taskDidSendBodyData = taskDidSendBodyData {

View File

@@ -1,7 +1,7 @@
//
// Timeline.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -64,7 +64,8 @@ public struct Timeline {
requestStartTime: CFAbsoluteTime = 0.0,
initialResponseTime: CFAbsoluteTime = 0.0,
requestCompletedTime: CFAbsoluteTime = 0.0,
serializationCompletedTime: CFAbsoluteTime = 0.0) {
serializationCompletedTime: CFAbsoluteTime = 0.0)
{
self.requestStartTime = requestStartTime
self.initialResponseTime = initialResponseTime
self.requestCompletedTime = requestCompletedTime

View File

@@ -1,7 +1,7 @@
//
// Validation.swift
//
// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -94,7 +94,8 @@ extension Request {
statusCode acceptableStatusCodes: S,
response: HTTPURLResponse)
-> ValidationResult
where S.Iterator.Element == Int {
where S.Iterator.Element == Int
{
if acceptableStatusCodes.contains(response.statusCode) {
return .success
} else {
@@ -110,7 +111,8 @@ extension Request {
response: HTTPURLResponse,
data: Data?)
-> ValidationResult
where S.Iterator.Element == String {
where S.Iterator.Element == String
{
guard let data = data, data.count > 0 else { return .success }
guard
@@ -217,7 +219,10 @@ extension DataRequest {
/// - returns: The request.
@discardableResult
public func validate() -> Self {
return validate(statusCode: self.acceptableStatusCodes).validate(contentType: self.acceptableContentTypes)
let contentTypes = { [unowned self] in
self.acceptableContentTypes
}
return validate(statusCode: acceptableStatusCodes).validate(contentType: contentTypes())
}
}
@@ -308,6 +313,9 @@ extension DownloadRequest {
/// - returns: The request.
@discardableResult
public func validate() -> Self {
return validate(statusCode: self.acceptableStatusCodes).validate(contentType: self.acceptableContentTypes)
let contentTypes = { [unowned self] in
self.acceptableContentTypes
}
return validate(statusCode: acceptableStatusCodes).validate(contentType: contentTypes())
}
}

View File

@@ -5,19 +5,19 @@
"osx": "10.11",
"tvos": "9.0"
},
"version": "0.0.1",
"version": "1.0",
"source": {
"git": "git@github.com:swagger-api/swagger-mustache.git",
"tag": "v1.0.0"
"git": "git@github.com:OpenAPITools/openapi-generator.git",
"tag": "v1.0"
},
"authors": "",
"license": "Proprietary",
"homepage": "https://github.com/swagger-api/swagger-codegen",
"homepage": "https://github.com/openapitools/openapi-generator",
"summary": "TestClient",
"source_files": "TestClient/Classes/**/*.swift",
"dependencies": {
"Alamofire": [
"~> 4.5.0"
"~> 4.9.0"
]
}
}

View File

@@ -1,20 +1,23 @@
PODS:
- Alamofire (4.5.1)
- TestClient (0.0.1):
- Alamofire (~> 4.5.0)
- Alamofire (4.9.0)
- TestClient (1.0):
- Alamofire (~> 4.9.0)
DEPENDENCIES:
- Alamofire (~> 4.5)
- TestClient (from `../`)
SPEC REPOS:
trunk:
- Alamofire
EXTERNAL SOURCES:
TestClient:
:path: ../
:path: "../"
SPEC CHECKSUMS:
Alamofire: 2d95912bf4c34f164fdfc335872e8c312acaea4a
TestClient: 410e69b600d7aa37590bc4077dc148d7f314ac84
Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321
TestClient: 4923530f672e09a8d020c93372c5ecc195a00ff2
PODFILE CHECKSUM: a4351ac5e001fd96f35ed7e647981803864100b5
PODFILE CHECKSUM: 837b06bfc9f93ccd7664fd918d113c8e3824bde3
COCOAPODS: 1.4.0.beta.2
COCOAPODS: 1.8.4

View File

@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.5.1</string>
<string>4.9.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>

View File

@@ -1,10 +1,10 @@
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Alamofire
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

View File

@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.0.1</string>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>

View File

@@ -3,7 +3,7 @@ This application makes use of the following third party libraries:
## Alamofire
Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -14,7 +14,7 @@
</dict>
<dict>
<key>FooterText</key>
<string>Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
<string>Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,15 +1,33 @@
#!/bin/sh
set -e
set -u
set -o pipefail
function on_error {
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
}
trap 'on_error $LINENO' ERR
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the script phase was successful).
exit 0
fi
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
# Used as a return value for each invocation of `strip_invalid_archs` function.
STRIP_BINARY_RETVAL=0
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
# Copies and strips a vendored framework
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
@@ -23,8 +41,8 @@ install_framework()
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
echo "Symlinked..."
source="$(readlink "${source}")"
fi
# Use filter instead of exclude so missing patterns don't throw errors.
@@ -34,8 +52,13 @@ install_framework()
local basename
basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
elif [ -L "${binary}" ]; then
echo "Destination binary is symlinked..."
dirname="$(dirname "${binary}")"
binary="${dirname}/$(readlink "${binary}")"
fi
# Strip invalid architectures so "fat" simulator / device frameworks work on device
@@ -49,7 +72,7 @@ install_framework()
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | 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)
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
@@ -58,30 +81,48 @@ install_framework()
fi
}
# Copies the dSYM of a vendored framework
# Copies and strips a vendored dSYM
install_dsym() {
local source="$1"
if [ -r "$source" ]; then
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}"
fi
# Copy the dSYM into a the targets temp dir.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
local basename
basename="$(basename -s .framework.dSYM "$source")"
binary="${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
local basename
basename="$(basename -s .framework.dSYM "$source")"
binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
strip_invalid_archs "$binary"
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then
strip_invalid_archs "$binary"
fi
if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
# Move the stripped file into its final destination.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
else
# The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
fi
fi
}
# Copies the bcsymbolmap files of a vendored framework
install_bcsymbolmap() {
local bcsymbolmap_path="$1"
local destination="${BUILT_PRODUCTS_DIR}"
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"
}
# Signs a framework with the provided identity
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
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identity
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
code_sign_cmd="$code_sign_cmd &"
@@ -94,19 +135,28 @@ code_sign_if_enabled() {
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
# Get architectures for current target binary
binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
# Intersect them with the architectures we are building for
intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
# If there are no archs supported by this binary then warn the user
if [[ -z "$intersected_archs" ]]; then
echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
STRIP_BINARY_RETVAL=0
return
fi
stripped=""
for arch in $archs; do
for arch in $binary_archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
lipo -remove "$arch" -output "$binary" "$binary"
stripped="$stripped $arch"
fi
done
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
STRIP_BINARY_RETVAL=1
}

View File

@@ -1,106 +0,0 @@
#!/bin/sh
set -e
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
3)
TARGET_DEVICE_ARGS="--target-device tv"
;;
4)
TARGET_DEVICE_ARGS="--target-device watch"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
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 ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_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 ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.framework)
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
*)
echo "$RESOURCE_PATH" || true
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
;;
esac
}
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_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).
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
while read line; do
if [[ $line != "${PODS_ROOT}*" ]]; then
XCASSET_FILES+=("$line")
fi
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 "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi

View File

@@ -1,11 +1,12 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/TestClient"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/TestClient/TestClient.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/TestClient/TestClient.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "TestClient"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

View File

@@ -1,11 +1,12 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/TestClient"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/TestClient/TestClient.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/TestClient/TestClient.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "TestClient"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

View File

@@ -0,0 +1,26 @@
<?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>${PRODUCT_BUNDLE_IDENTIFIER}</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>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@@ -1,114 +0,0 @@
#!/bin/sh
set -e
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
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
echo "Symlinked..."
source="$(readlink "${source}")"
fi
# Use filter instead of exclude so missing patterns don't throw errors.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
local basename
basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
fi
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
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
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
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
code_sign_if_enabled "${destination}/${lib}"
done
fi
}
# Copies the dSYM of a vendored framework
install_dsym() {
local source="$1"
if [ -r "$source" ]; then
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}"
fi
local basename
basename="$(basename -s .framework.dSYM "$source")"
binary="${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
strip_invalid_archs "$binary"
fi
}
# Signs a framework with the provided identity
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
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
code_sign_cmd="$code_sign_cmd &"
fi
echo "$code_sign_cmd"
eval "$code_sign_cmd"
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 ! [[ "${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 [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
wait
fi

View File

@@ -1,106 +0,0 @@
#!/bin/sh
set -e
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
3)
TARGET_DEVICE_ARGS="--target-device tv"
;;
4)
TARGET_DEVICE_ARGS="--target-device watch"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
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 ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_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 ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.framework)
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
*)
echo "$RESOURCE_PATH" || true
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
;;
esac
}
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_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).
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
while read line; do
if [[ $line != "${PODS_ROOT}*" ]]; then
XCASSET_FILES+=("$line")
fi
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 "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi

View File

@@ -1,8 +1,9 @@
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/TestClient"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/TestClient/TestClient.framework/Headers"
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/TestClient/TestClient.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "TestClient"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

View File

@@ -1,8 +1,9 @@
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/TestClient"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/TestClient/TestClient.framework/Headers"
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/TestClient/TestClient.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "TestClient"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

View File

@@ -0,0 +1,26 @@
<?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>${PRODUCT_BUNDLE_IDENTIFIER}</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>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@@ -1,11 +1,11 @@
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/TestClient
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

View File

@@ -7,8 +7,8 @@
objects = {
/* Begin PBXBuildFile section */
4A1BCE1AC3BD96766D32C207 /* Pods_TestClientAppTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AD75D9B83253D602C7B81A4 /* Pods_TestClientAppTests.framework */; };
6D635B67A7E1B44C644F3B41 /* Pods_TestClientApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C848517CE1BDF30D78E023D /* Pods_TestClientApp.framework */; };
38F9390AFCDA262FB068DF15 /* Pods_TestClientApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A23B54E8FB808BD3C9DD08C8 /* Pods_TestClientApp.framework */; };
C1ADDA787241158A360D054C /* Pods_TestClientAppTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7476A9BCC24D9147A35E4C81 /* Pods_TestClientAppTests.framework */; };
FDC99C781F1E832E000EB08F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDC99C771F1E832E000EB08F /* AppDelegate.swift */; };
FDC99C7A1F1E832E000EB08F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDC99C791F1E832E000EB08F /* ViewController.swift */; };
FDC99C7D1F1E832E000EB08F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FDC99C7B1F1E832E000EB08F /* Main.storyboard */; };
@@ -28,12 +28,12 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
07AEC709A0E6FE8B595AEF28 /* Pods-TestClientApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestClientApp.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestClientApp/Pods-TestClientApp.debug.xcconfig"; sourceTree = "<group>"; };
7E763E7CB9274D52F061112B /* Pods-TestClientAppTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestClientAppTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-TestClientAppTests/Pods-TestClientAppTests.release.xcconfig"; sourceTree = "<group>"; };
819CA295FA30D88F34CD9D86 /* Pods-TestClientApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestClientApp.release.xcconfig"; path = "Pods/Target Support Files/Pods-TestClientApp/Pods-TestClientApp.release.xcconfig"; sourceTree = "<group>"; };
8C848517CE1BDF30D78E023D /* Pods_TestClientApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestClientApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9AD75D9B83253D602C7B81A4 /* Pods_TestClientAppTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestClientAppTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F26735790A7AFC54CE3475ED /* Pods-TestClientAppTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestClientAppTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestClientAppTests/Pods-TestClientAppTests.debug.xcconfig"; sourceTree = "<group>"; };
3DE372F32029703A6CED4209 /* Pods-TestClientAppTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestClientAppTests.release.xcconfig"; path = "Target Support Files/Pods-TestClientAppTests/Pods-TestClientAppTests.release.xcconfig"; sourceTree = "<group>"; };
6DB31B4AAB586D1D0C5D8EA5 /* Pods-TestClientAppTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestClientAppTests.debug.xcconfig"; path = "Target Support Files/Pods-TestClientAppTests/Pods-TestClientAppTests.debug.xcconfig"; sourceTree = "<group>"; };
7476A9BCC24D9147A35E4C81 /* Pods_TestClientAppTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestClientAppTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A23B54E8FB808BD3C9DD08C8 /* Pods_TestClientApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestClientApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F7DC1AA685120D6BF86B80A5 /* Pods-TestClientApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestClientApp.debug.xcconfig"; path = "Target Support Files/Pods-TestClientApp/Pods-TestClientApp.debug.xcconfig"; sourceTree = "<group>"; };
FD4690FD2BC8291E69C8FD40 /* Pods-TestClientApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestClientApp.release.xcconfig"; path = "Target Support Files/Pods-TestClientApp/Pods-TestClientApp.release.xcconfig"; sourceTree = "<group>"; };
FDC99C741F1E832E000EB08F /* TestClientApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestClientApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
FDC99C771F1E832E000EB08F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
FDC99C791F1E832E000EB08F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
@@ -51,7 +51,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6D635B67A7E1B44C644F3B41 /* Pods_TestClientApp.framework in Frameworks */,
38F9390AFCDA262FB068DF15 /* Pods_TestClientApp.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -59,41 +59,42 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4A1BCE1AC3BD96766D32C207 /* Pods_TestClientAppTests.framework in Frameworks */,
C1ADDA787241158A360D054C /* Pods_TestClientAppTests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
0CA9EEA6BA1B6F76D0620F7F /* Pods */ = {
14E10881047978AE906EB19F /* Frameworks */ = {
isa = PBXGroup;
children = (
07AEC709A0E6FE8B595AEF28 /* Pods-TestClientApp.debug.xcconfig */,
819CA295FA30D88F34CD9D86 /* Pods-TestClientApp.release.xcconfig */,
F26735790A7AFC54CE3475ED /* Pods-TestClientAppTests.debug.xcconfig */,
7E763E7CB9274D52F061112B /* Pods-TestClientAppTests.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
59C4F171E0EB556B3FF32B4E /* Frameworks */ = {
isa = PBXGroup;
children = (
8C848517CE1BDF30D78E023D /* Pods_TestClientApp.framework */,
9AD75D9B83253D602C7B81A4 /* Pods_TestClientAppTests.framework */,
A23B54E8FB808BD3C9DD08C8 /* Pods_TestClientApp.framework */,
7476A9BCC24D9147A35E4C81 /* Pods_TestClientAppTests.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
CF51681F23C24C36AAED2CE8 /* Pods */ = {
isa = PBXGroup;
children = (
F7DC1AA685120D6BF86B80A5 /* Pods-TestClientApp.debug.xcconfig */,
FD4690FD2BC8291E69C8FD40 /* Pods-TestClientApp.release.xcconfig */,
6DB31B4AAB586D1D0C5D8EA5 /* Pods-TestClientAppTests.debug.xcconfig */,
3DE372F32029703A6CED4209 /* Pods-TestClientAppTests.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
FDC99C6B1F1E832D000EB08F = {
isa = PBXGroup;
children = (
FDC99C761F1E832E000EB08F /* TestClientApp */,
FDC99C8B1F1E832E000EB08F /* TestClientAppTests */,
FDC99C751F1E832E000EB08F /* Products */,
0CA9EEA6BA1B6F76D0620F7F /* Pods */,
59C4F171E0EB556B3FF32B4E /* Frameworks */,
CF51681F23C24C36AAED2CE8 /* Pods */,
14E10881047978AE906EB19F /* Frameworks */,
);
sourceTree = "<group>";
};
@@ -135,12 +136,11 @@
isa = PBXNativeTarget;
buildConfigurationList = FDC99C911F1E832E000EB08F /* Build configuration list for PBXNativeTarget "TestClientApp" */;
buildPhases = (
DCC608620FAB85F3B32E2DAC /* [CP] Check Pods Manifest.lock */,
49D4BFD3E4300757B94A1108 /* [CP] Check Pods Manifest.lock */,
FDC99C701F1E832D000EB08F /* Sources */,
FDC99C711F1E832D000EB08F /* Frameworks */,
FDC99C721F1E832D000EB08F /* Resources */,
D4F00C92C4912A890D17773C /* [CP] Embed Pods Frameworks */,
62BEBAA42E4C522B11A8A9DA /* [CP] Copy Pods Resources */,
963B093FCC81F62B36EB9CB5 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -155,12 +155,10 @@
isa = PBXNativeTarget;
buildConfigurationList = FDC99C941F1E832E000EB08F /* Build configuration list for PBXNativeTarget "TestClientAppTests" */;
buildPhases = (
03AFFA11C69DFEAD2F5EB773 /* [CP] Check Pods Manifest.lock */,
29B2A5322E23310EC5D6B2DD /* [CP] Check Pods Manifest.lock */,
FDC99C841F1E832E000EB08F /* Sources */,
FDC99C851F1E832E000EB08F /* Frameworks */,
FDC99C861F1E832E000EB08F /* Resources */,
760869883C00AF537CB6C498 /* [CP] Embed Pods Frameworks */,
7FCF8B6A49D1859C40EFFBA8 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -231,16 +229,20 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
03AFFA11C69DFEAD2F5EB773 /* [CP] Check Pods Manifest.lock */ = {
29B2A5322E23310EC5D6B2DD /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-TestClientAppTests-checkManifestLockResult.txt",
);
@@ -249,58 +251,35 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
62BEBAA42E4C522B11A8A9DA /* [CP] Copy Pods Resources */ = {
49D4BFD3E4300757B94A1108 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-TestClientApp-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-resources.sh\"\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
760869883C00AF537CB6C498 /* [CP] Embed Pods Frameworks */ = {
963B093FCC81F62B36EB9CB5 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TestClientAppTests/Pods-TestClientAppTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
7FCF8B6A49D1859C40EFFBA8 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TestClientAppTests/Pods-TestClientAppTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
D4F00C92C4912A890D17773C /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
"${BUILT_PRODUCTS_DIR}/TestClient/TestClient.framework",
);
@@ -311,25 +290,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
DCC608620FAB85F3B32E2DAC /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-TestClientApp-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@@ -491,7 +452,7 @@
};
FDC99C921F1E832E000EB08F /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 07AEC709A0E6FE8B595AEF28 /* Pods-TestClientApp.debug.xcconfig */;
baseConfigurationReference = F7DC1AA685120D6BF86B80A5 /* Pods-TestClientApp.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 82A2S5FGTA;
@@ -506,7 +467,7 @@
};
FDC99C931F1E832E000EB08F /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 819CA295FA30D88F34CD9D86 /* Pods-TestClientApp.release.xcconfig */;
baseConfigurationReference = FD4690FD2BC8291E69C8FD40 /* Pods-TestClientApp.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 82A2S5FGTA;
@@ -521,7 +482,7 @@
};
FDC99C951F1E832E000EB08F /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F26735790A7AFC54CE3475ED /* Pods-TestClientAppTests.debug.xcconfig */;
baseConfigurationReference = 6DB31B4AAB586D1D0C5D8EA5 /* Pods-TestClientAppTests.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
@@ -538,7 +499,7 @@
};
FDC99C961F1E832E000EB08F /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7E763E7CB9274D52F061112B /* Pods-TestClientAppTests.release.xcconfig */;
baseConfigurationReference = 3DE372F32029703A6CED4209 /* Pods-TestClientAppTests.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";

View File

@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@@ -1,3 +1,5 @@
#!/bin/sh
xcodebuild clean build build-for-testing -workspace "TestClientApp.xcworkspace" -scheme "TestClient" -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" | xcpretty && exit ${PIPESTATUS[0]}
pod install
xcodebuild clean build build-for-testing -workspace "TestClientApp.xcworkspace" -scheme "TestClientApp" -destination "platform=iOS Simulator,name=iPhone 11 Pro Max,OS=latest" && xcodebuild test-without-building -workspace "TestClientApp.xcworkspace" -scheme "TestClientAppTests" -destination "platform=iOS Simulator,name=iPhone 11 Pro Max,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}

View File

@@ -0,0 +1,43 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>Swift4PetstoreClientTests</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Swift4 Swagger Petstore Client</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>xcodebuild-test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>./run_spmbuild.sh</executable>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,3 @@
#!/bin/sh
swift build && exit ${PIPESTATUS[0]}

View File

@@ -0,0 +1,9 @@
#/bin/bash
set -e
# example project with unit tests
mvn -f default/TestClientApp/pom.xml integration-test
# spm build
mvn -f default/pom.xml integration-test