pod-builder 1.9.4 → 2.0.0.beta.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +9 -0
  3. data/README.md +50 -13
  4. data/exe/pod_builder +39 -28
  5. data/lib/pod_builder/analyze.rb +32 -7
  6. data/lib/pod_builder/analyzer.rb +16 -0
  7. data/lib/pod_builder/command/build.rb +44 -174
  8. data/lib/pod_builder/command/build_all.rb +2 -2
  9. data/lib/pod_builder/command/clean.rb +34 -55
  10. data/lib/pod_builder/command/clear_lldbinit.rb +7 -3
  11. data/lib/pod_builder/command/deintegrate.rb +29 -7
  12. data/lib/pod_builder/command/generate_lfs.rb +3 -3
  13. data/lib/pod_builder/command/generate_podspec.rb +3 -2
  14. data/lib/pod_builder/command/info.rb +1 -1
  15. data/lib/pod_builder/command/init.rb +37 -14
  16. data/lib/pod_builder/command/install_sources.rb +21 -14
  17. data/lib/pod_builder/command/none.rb +2 -2
  18. data/lib/pod_builder/command/restore_all.rb +4 -4
  19. data/lib/pod_builder/command/switch.rb +137 -95
  20. data/lib/pod_builder/command/sync_podfile.rb +5 -3
  21. data/lib/pod_builder/command/update.rb +5 -6
  22. data/lib/pod_builder/command/update_lldbinit.rb +11 -9
  23. data/lib/pod_builder/configuration.rb +88 -13
  24. data/lib/pod_builder/core.rb +95 -14
  25. data/lib/pod_builder/info.rb +32 -98
  26. data/lib/pod_builder/install.rb +255 -195
  27. data/lib/pod_builder/licenses.rb +4 -4
  28. data/lib/pod_builder/podfile.rb +300 -73
  29. data/lib/pod_builder/podfile/post_actions.rb +9 -15
  30. data/lib/pod_builder/podfile_cp.rb +93 -0
  31. data/lib/pod_builder/podfile_item.rb +181 -82
  32. data/lib/pod_builder/podspec.rb +144 -135
  33. data/lib/pod_builder/rome/post_install.rb +240 -0
  34. data/lib/pod_builder/rome/pre_install.rb +6 -0
  35. data/lib/pod_builder/templates/build_podfile.template +3 -3
  36. data/lib/pod_builder/version.rb +1 -1
  37. data/pod-builder.gemspec +5 -5
  38. metadata +23 -76
  39. data/Example/Frameworks/PodBuilder.json +0 -32
  40. data/Example/PodBuilderExample.xcodeproj/project.pbxproj +0 -416
  41. data/Example/PodBuilderExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  42. data/Example/PodBuilderExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  43. data/Example/PodBuilderExample.xcodeproj/project.xcworkspace/xcuserdata/tomas.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  44. data/Example/PodBuilderExample.xcodeproj/xcuserdata/tomas.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  45. data/Example/PodBuilderExample.xcworkspace/contents.xcworkspacedata +0 -10
  46. data/Example/PodBuilderExample/AppDelegate.swift +0 -47
  47. data/Example/PodBuilderExample/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -98
  48. data/Example/PodBuilderExample/Assets.xcassets/Contents.json +0 -6
  49. data/Example/PodBuilderExample/Base.lproj/LaunchScreen.storyboard +0 -25
  50. data/Example/PodBuilderExample/Base.lproj/Main.storyboard +0 -24
  51. data/Example/PodBuilderExample/Info.plist +0 -45
  52. data/Example/PodBuilderExample/ViewController.swift +0 -25
  53. data/Example/Podfile +0 -8
  54. data/Example/Podfile.lock +0 -16
  55. data/Example/Pods/Alamofire/LICENSE +0 -19
  56. data/Example/Pods/Alamofire/README.md +0 -242
  57. data/Example/Pods/Alamofire/Source/AFError.swift +0 -460
  58. data/Example/Pods/Alamofire/Source/Alamofire.swift +0 -465
  59. data/Example/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift +0 -37
  60. data/Example/Pods/Alamofire/Source/MultipartFormData.swift +0 -580
  61. data/Example/Pods/Alamofire/Source/NetworkReachabilityManager.swift +0 -233
  62. data/Example/Pods/Alamofire/Source/Notifications.swift +0 -55
  63. data/Example/Pods/Alamofire/Source/ParameterEncoding.swift +0 -483
  64. data/Example/Pods/Alamofire/Source/Request.swift +0 -654
  65. data/Example/Pods/Alamofire/Source/Response.swift +0 -567
  66. data/Example/Pods/Alamofire/Source/ResponseSerialization.swift +0 -715
  67. data/Example/Pods/Alamofire/Source/Result.swift +0 -300
  68. data/Example/Pods/Alamofire/Source/ServerTrustPolicy.swift +0 -307
  69. data/Example/Pods/Alamofire/Source/SessionDelegate.swift +0 -725
  70. data/Example/Pods/Alamofire/Source/SessionManager.swift +0 -896
  71. data/Example/Pods/Alamofire/Source/TaskDelegate.swift +0 -466
  72. data/Example/Pods/Alamofire/Source/Timeline.swift +0 -136
  73. data/Example/Pods/Alamofire/Source/Validation.swift +0 -315
  74. data/Example/Pods/Manifest.lock +0 -16
  75. data/Example/Pods/Pods.xcodeproj/project.pbxproj +0 -673
  76. data/Example/Pods/Pods.xcodeproj/xcuserdata/tomas.xcuserdatad/xcschemes/Alamofire.xcscheme +0 -60
  77. data/Example/Pods/Pods.xcodeproj/xcuserdata/tomas.xcuserdatad/xcschemes/Pods-PodBuilderExample.xcscheme +0 -60
  78. data/Example/Pods/Pods.xcodeproj/xcuserdata/tomas.xcuserdatad/xcschemes/xcschememanagement.plist +0 -21
  79. data/Example/Pods/Target Support Files/Alamofire/Alamofire-dummy.m +0 -5
  80. data/Example/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch +0 -12
  81. data/Example/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h +0 -16
  82. data/Example/Pods/Target Support Files/Alamofire/Alamofire.modulemap +0 -6
  83. data/Example/Pods/Target Support Files/Alamofire/Alamofire.xcconfig +0 -9
  84. data/Example/Pods/Target Support Files/Alamofire/Info.plist +0 -26
  85. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Info.plist +0 -26
  86. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-acknowledgements.markdown +0 -26
  87. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-acknowledgements.plist +0 -58
  88. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-dummy.m +0 -5
  89. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-frameworks.sh +0 -153
  90. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-resources.sh +0 -118
  91. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-umbrella.h +0 -16
  92. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample.debug.xcconfig +0 -11
  93. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample.modulemap +0 -6
  94. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample.release.xcconfig +0 -11
  95. data/lib/pod_builder/cocoapods/specification.rb +0 -27
@@ -1,60 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Scheme
3
- LastUpgradeVersion = "0930"
4
- version = "1.3">
5
- <BuildAction
6
- parallelizeBuildables = "YES"
7
- buildImplicitDependencies = "YES">
8
- <BuildActionEntries>
9
- <BuildActionEntry
10
- buildForAnalyzing = "YES"
11
- buildForTesting = "YES"
12
- buildForRunning = "YES"
13
- buildForProfiling = "YES"
14
- buildForArchiving = "YES">
15
- <BuildableReference
16
- BuildableIdentifier = "primary"
17
- BlueprintIdentifier = "E76458C58C9140B6A16D60547E68E80C"
18
- BlueprintName = "Alamofire"
19
- ReferencedContainer = "container:Pods.xcodeproj"
20
- BuildableName = "Alamofire.framework">
21
- </BuildableReference>
22
- </BuildActionEntry>
23
- </BuildActionEntries>
24
- </BuildAction>
25
- <TestAction
26
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
27
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
28
- shouldUseLaunchSchemeArgsEnv = "YES"
29
- buildConfiguration = "Debug">
30
- <AdditionalOptions>
31
- </AdditionalOptions>
32
- </TestAction>
33
- <LaunchAction
34
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
35
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
36
- launchStyle = "0"
37
- useCustomWorkingDirectory = "NO"
38
- ignoresPersistentStateOnLaunch = "NO"
39
- debugDocumentVersioning = "YES"
40
- debugServiceExtension = "internal"
41
- buildConfiguration = "Debug"
42
- allowLocationSimulation = "YES">
43
- <AdditionalOptions>
44
- </AdditionalOptions>
45
- </LaunchAction>
46
- <ProfileAction
47
- savedToolIdentifier = ""
48
- useCustomWorkingDirectory = "NO"
49
- debugDocumentVersioning = "YES"
50
- buildConfiguration = "Release"
51
- shouldUseLaunchSchemeArgsEnv = "YES">
52
- </ProfileAction>
53
- <AnalyzeAction
54
- buildConfiguration = "Debug">
55
- </AnalyzeAction>
56
- <ArchiveAction
57
- buildConfiguration = "Release"
58
- revealArchiveInOrganizer = "YES">
59
- </ArchiveAction>
60
- </Scheme>
@@ -1,60 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Scheme
3
- LastUpgradeVersion = "0930"
4
- version = "1.3">
5
- <BuildAction
6
- parallelizeBuildables = "YES"
7
- buildImplicitDependencies = "YES">
8
- <BuildActionEntries>
9
- <BuildActionEntry
10
- buildForAnalyzing = "YES"
11
- buildForTesting = "YES"
12
- buildForRunning = "YES"
13
- buildForProfiling = "YES"
14
- buildForArchiving = "YES">
15
- <BuildableReference
16
- BuildableIdentifier = "primary"
17
- BlueprintIdentifier = "CC218A2E6B4301C73CD659FB87AFF330"
18
- BlueprintName = "Pods-PodBuilderExample"
19
- ReferencedContainer = "container:Pods.xcodeproj"
20
- BuildableName = "Pods-PodBuilderExample.framework">
21
- </BuildableReference>
22
- </BuildActionEntry>
23
- </BuildActionEntries>
24
- </BuildAction>
25
- <TestAction
26
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
27
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
28
- shouldUseLaunchSchemeArgsEnv = "YES"
29
- buildConfiguration = "Debug">
30
- <AdditionalOptions>
31
- </AdditionalOptions>
32
- </TestAction>
33
- <LaunchAction
34
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
35
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
36
- launchStyle = "0"
37
- useCustomWorkingDirectory = "NO"
38
- ignoresPersistentStateOnLaunch = "NO"
39
- debugDocumentVersioning = "YES"
40
- debugServiceExtension = "internal"
41
- buildConfiguration = "Debug"
42
- allowLocationSimulation = "YES">
43
- <AdditionalOptions>
44
- </AdditionalOptions>
45
- </LaunchAction>
46
- <ProfileAction
47
- savedToolIdentifier = ""
48
- useCustomWorkingDirectory = "NO"
49
- debugDocumentVersioning = "YES"
50
- buildConfiguration = "Release"
51
- shouldUseLaunchSchemeArgsEnv = "YES">
52
- </ProfileAction>
53
- <AnalyzeAction
54
- buildConfiguration = "Debug">
55
- </AnalyzeAction>
56
- <ArchiveAction
57
- buildConfiguration = "Release"
58
- revealArchiveInOrganizer = "YES">
59
- </ArchiveAction>
60
- </Scheme>
@@ -1,21 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>SchemeUserState</key>
6
- <dict>
7
- <key>Alamofire.xcscheme</key>
8
- <dict>
9
- <key>isShown</key>
10
- <false/>
11
- </dict>
12
- <key>Pods-PodBuilderExample.xcscheme</key>
13
- <dict>
14
- <key>isShown</key>
15
- <false/>
16
- </dict>
17
- </dict>
18
- <key>SuppressBuildableAutocreation</key>
19
- <dict/>
20
- </dict>
21
- </plist>
@@ -1,5 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- @interface PodsDummy_Alamofire : NSObject
3
- @end
4
- @implementation PodsDummy_Alamofire
5
- @end
@@ -1,12 +0,0 @@
1
- #ifdef __OBJC__
2
- #import <UIKit/UIKit.h>
3
- #else
4
- #ifndef FOUNDATION_EXPORT
5
- #if defined(__cplusplus)
6
- #define FOUNDATION_EXPORT extern "C"
7
- #else
8
- #define FOUNDATION_EXPORT extern
9
- #endif
10
- #endif
11
- #endif
12
-
@@ -1,16 +0,0 @@
1
- #ifdef __OBJC__
2
- #import <UIKit/UIKit.h>
3
- #else
4
- #ifndef FOUNDATION_EXPORT
5
- #if defined(__cplusplus)
6
- #define FOUNDATION_EXPORT extern "C"
7
- #else
8
- #define FOUNDATION_EXPORT extern
9
- #endif
10
- #endif
11
- #endif
12
-
13
-
14
- FOUNDATION_EXPORT double AlamofireVersionNumber;
15
- FOUNDATION_EXPORT const unsigned char AlamofireVersionString[];
16
-
@@ -1,6 +0,0 @@
1
- framework module Alamofire {
2
- umbrella header "Alamofire-umbrella.h"
3
-
4
- export *
5
- module * { export * }
6
- }
@@ -1,9 +0,0 @@
1
- CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Alamofire
2
- GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3
- OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
4
- PODS_BUILD_DIR = ${BUILD_DIR}
5
- PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6
- PODS_ROOT = ${SRCROOT}
7
- PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire
8
- PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9
- SKIP_INSTALL = YES
@@ -1,26 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>CFBundleDevelopmentRegion</key>
6
- <string>en</string>
7
- <key>CFBundleExecutable</key>
8
- <string>${EXECUTABLE_NAME}</string>
9
- <key>CFBundleIdentifier</key>
10
- <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
11
- <key>CFBundleInfoDictionaryVersion</key>
12
- <string>6.0</string>
13
- <key>CFBundleName</key>
14
- <string>${PRODUCT_NAME}</string>
15
- <key>CFBundlePackageType</key>
16
- <string>FMWK</string>
17
- <key>CFBundleShortVersionString</key>
18
- <string>4.7.3</string>
19
- <key>CFBundleSignature</key>
20
- <string>????</string>
21
- <key>CFBundleVersion</key>
22
- <string>${CURRENT_PROJECT_VERSION}</string>
23
- <key>NSPrincipalClass</key>
24
- <string></string>
25
- </dict>
26
- </plist>
@@ -1,26 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>CFBundleDevelopmentRegion</key>
6
- <string>en</string>
7
- <key>CFBundleExecutable</key>
8
- <string>${EXECUTABLE_NAME}</string>
9
- <key>CFBundleIdentifier</key>
10
- <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
11
- <key>CFBundleInfoDictionaryVersion</key>
12
- <string>6.0</string>
13
- <key>CFBundleName</key>
14
- <string>${PRODUCT_NAME}</string>
15
- <key>CFBundlePackageType</key>
16
- <string>FMWK</string>
17
- <key>CFBundleShortVersionString</key>
18
- <string>1.0.0</string>
19
- <key>CFBundleSignature</key>
20
- <string>????</string>
21
- <key>CFBundleVersion</key>
22
- <string>${CURRENT_PROJECT_VERSION}</string>
23
- <key>NSPrincipalClass</key>
24
- <string></string>
25
- </dict>
26
- </plist>
@@ -1,26 +0,0 @@
1
- # Acknowledgements
2
- This application makes use of the following third party libraries:
3
-
4
- ## Alamofire
5
-
6
- Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/)
7
-
8
- Permission is hereby granted, free of charge, to any person obtaining a copy
9
- of this software and associated documentation files (the "Software"), to deal
10
- in the Software without restriction, including without limitation the rights
11
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- copies of the Software, and to permit persons to whom the Software is
13
- furnished to do so, subject to the following conditions:
14
-
15
- The above copyright notice and this permission notice shall be included in
16
- all copies or substantial portions of the Software.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- THE SOFTWARE.
25
-
26
- Generated by CocoaPods - https://cocoapods.org
@@ -1,58 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>PreferenceSpecifiers</key>
6
- <array>
7
- <dict>
8
- <key>FooterText</key>
9
- <string>This application makes use of the following third party libraries:</string>
10
- <key>Title</key>
11
- <string>Acknowledgements</string>
12
- <key>Type</key>
13
- <string>PSGroupSpecifier</string>
14
- </dict>
15
- <dict>
16
- <key>FooterText</key>
17
- <string>Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/)
18
-
19
- Permission is hereby granted, free of charge, to any person obtaining a copy
20
- of this software and associated documentation files (the "Software"), to deal
21
- in the Software without restriction, including without limitation the rights
22
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23
- copies of the Software, and to permit persons to whom the Software is
24
- furnished to do so, subject to the following conditions:
25
-
26
- The above copyright notice and this permission notice shall be included in
27
- all copies or substantial portions of the Software.
28
-
29
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35
- THE SOFTWARE.
36
- </string>
37
- <key>License</key>
38
- <string>MIT</string>
39
- <key>Title</key>
40
- <string>Alamofire</string>
41
- <key>Type</key>
42
- <string>PSGroupSpecifier</string>
43
- </dict>
44
- <dict>
45
- <key>FooterText</key>
46
- <string>Generated by CocoaPods - https://cocoapods.org</string>
47
- <key>Title</key>
48
- <string></string>
49
- <key>Type</key>
50
- <string>PSGroupSpecifier</string>
51
- </dict>
52
- </array>
53
- <key>StringsTable</key>
54
- <string>Acknowledgements</string>
55
- <key>Title</key>
56
- <string>Acknowledgements</string>
57
- </dict>
58
- </plist>
@@ -1,5 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- @interface PodsDummy_Pods_PodBuilderExample : NSObject
3
- @end
4
- @implementation PodsDummy_Pods_PodBuilderExample
5
- @end
@@ -1,153 +0,0 @@
1
- #!/bin/sh
2
- set -e
3
- set -u
4
- set -o pipefail
5
-
6
- if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
7
- # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
8
- # frameworks to, so exit 0 (signalling the script phase was successful).
9
- exit 0
10
- fi
11
-
12
- echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
13
- mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
14
-
15
- COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
16
- SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
17
-
18
- # Used as a return value for each invocation of `strip_invalid_archs` function.
19
- STRIP_BINARY_RETVAL=0
20
-
21
- # This protects against multiple targets copying the same framework dependency at the same time. The solution
22
- # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
23
- RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
24
-
25
- # Copies and strips a vendored framework
26
- install_framework()
27
- {
28
- if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
29
- local source="${BUILT_PRODUCTS_DIR}/$1"
30
- elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
31
- local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
32
- elif [ -r "$1" ]; then
33
- local source="$1"
34
- fi
35
-
36
- local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
37
-
38
- if [ -L "${source}" ]; then
39
- echo "Symlinked..."
40
- source="$(readlink "${source}")"
41
- fi
42
-
43
- # Use filter instead of exclude so missing patterns don't throw errors.
44
- echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
45
- rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
46
-
47
- local basename
48
- basename="$(basename -s .framework "$1")"
49
- binary="${destination}/${basename}.framework/${basename}"
50
- if ! [ -r "$binary" ]; then
51
- binary="${destination}/${basename}"
52
- fi
53
-
54
- # Strip invalid architectures so "fat" simulator / device frameworks work on device
55
- if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
56
- strip_invalid_archs "$binary"
57
- fi
58
-
59
- # Resign the code if required by the build settings to avoid unstable apps
60
- code_sign_if_enabled "${destination}/$(basename "$1")"
61
-
62
- # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
63
- if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
64
- local swift_runtime_libs
65
- swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
66
- for lib in $swift_runtime_libs; do
67
- echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
68
- rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
69
- code_sign_if_enabled "${destination}/${lib}"
70
- done
71
- fi
72
- }
73
-
74
- # Copies and strips a vendored dSYM
75
- install_dsym() {
76
- local source="$1"
77
- if [ -r "$source" ]; then
78
- # Copy the dSYM into a the targets temp dir.
79
- 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}\""
80
- 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}"
81
-
82
- local basename
83
- basename="$(basename -s .framework.dSYM "$source")"
84
- binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
85
-
86
- # Strip invalid architectures so "fat" simulator / device frameworks work on device
87
- if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
88
- strip_invalid_archs "$binary"
89
- fi
90
-
91
- if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
92
- # Move the stripped file into its final destination.
93
- 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}\""
94
- 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}"
95
- else
96
- # 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.
97
- touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
98
- fi
99
- fi
100
- }
101
-
102
- # Signs a framework with the provided identity
103
- code_sign_if_enabled() {
104
- if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
105
- # Use the current code_sign_identitiy
106
- echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
107
- local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
108
-
109
- if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
110
- code_sign_cmd="$code_sign_cmd &"
111
- fi
112
- echo "$code_sign_cmd"
113
- eval "$code_sign_cmd"
114
- fi
115
- }
116
-
117
- # Strip invalid architectures
118
- strip_invalid_archs() {
119
- binary="$1"
120
- # Get architectures for current target binary
121
- binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
122
- # Intersect them with the architectures we are building for
123
- intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
124
- # If there are no archs supported by this binary then warn the user
125
- if [[ -z "$intersected_archs" ]]; then
126
- echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
127
- STRIP_BINARY_RETVAL=0
128
- return
129
- fi
130
- stripped=""
131
- for arch in $binary_archs; do
132
- if ! [[ "${ARCHS}" == *"$arch"* ]]; then
133
- # Strip non-valid architectures in-place
134
- lipo -remove "$arch" -output "$binary" "$binary" || exit 1
135
- stripped="$stripped $arch"
136
- fi
137
- done
138
- if [[ "$stripped" ]]; then
139
- echo "Stripped $binary of architectures:$stripped"
140
- fi
141
- STRIP_BINARY_RETVAL=1
142
- }
143
-
144
-
145
- if [[ "$CONFIGURATION" == "Debug" ]]; then
146
- install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework"
147
- fi
148
- if [[ "$CONFIGURATION" == "Release" ]]; then
149
- install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework"
150
- fi
151
- if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
152
- wait
153
- fi