diff --git a/demo-xcframework/.bundle/config b/demo-xcframework/.bundle/config new file mode 100644 index 0000000..75a2fe5 --- /dev/null +++ b/demo-xcframework/.bundle/config @@ -0,0 +1,2 @@ +--- +BUNDLE_PATH: "./.bundler_cache" diff --git a/demo-xcframework/.gitignore b/demo-xcframework/.gitignore new file mode 100644 index 0000000..7873b65 --- /dev/null +++ b/demo-xcframework/.gitignore @@ -0,0 +1,50 @@ + +# Created by https://www.gitignore.io/api/xcode,cocoapods +# Edit at https://www.gitignore.io/?templates=xcode,cocoapods + +### CocoaPods ### +## CocoaPods GitIgnore Template + +# CocoaPods - Only use to conserve bandwidth / Save time on Pushing +# - Also handy if you have a large number of dependant pods +# - AS PER https://guides.cocoapods.org/using/using-cocoapods.html NEVER IGNORE THE LOCK FILE +Pods/ + +### Xcode ### +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 + +### Xcode Patch ### +*.xcodeproj/* +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcworkspace/contents.xcworkspacedata +/*.gcno +**/xcshareddata/WorkspaceSettings.xcsettings + +# End of https://www.gitignore.io/api/xcode,cocoapods + + +# the bundler local cache +.bundler_cache/ \ No newline at end of file diff --git a/demo-xcframework/Gemfile b/demo-xcframework/Gemfile new file mode 100644 index 0000000..3fc358f --- /dev/null +++ b/demo-xcframework/Gemfile @@ -0,0 +1,7 @@ + +# frozen_string_literal: true +source "https://rubygems.org" + +gem 'cocoapods', '1.10.0' +gem 'cocoapods-binary', :path => "../" +gem 'xcpretty' diff --git a/demo-xcframework/Gemfile.lock b/demo-xcframework/Gemfile.lock new file mode 100644 index 0000000..7c0bc1d --- /dev/null +++ b/demo-xcframework/Gemfile.lock @@ -0,0 +1,106 @@ +PATH + remote: .. + specs: + cocoapods-binary (0.4.4) + cocoapods (>= 1.5.0, < 2.0) + fourflusher (~> 2.0) + xcpretty (~> 0.3.0) + +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.3) + activesupport (5.2.4.4) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + atomos (0.1.3) + claide (1.0.3) + cocoapods (1.10.0) + addressable (~> 2.6) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.10.0) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 1.4.0, < 2.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.6.6) + nap (~> 1.0) + ruby-macho (~> 1.4) + xcodeproj (>= 1.19.0, < 2.0) + cocoapods-core (1.10.0) + activesupport (> 5.0, < 6) + addressable (~> 2.6) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + netrc (~> 0.11) + public_suffix + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.4) + cocoapods-downloader (1.4.0) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.0) + cocoapods-trunk (1.5.0) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.2.0) + colored2 (3.1.2) + concurrent-ruby (1.1.7) + escape (0.0.4) + ethon (0.12.0) + ffi (>= 1.3.0) + ffi (1.13.1) + fourflusher (2.3.1) + fuzzy_match (2.0.4) + gh_inspector (1.1.3) + httpclient (2.8.3) + i18n (1.8.5) + concurrent-ruby (~> 1.0) + json (2.3.1) + minitest (5.14.2) + molinillo (0.6.6) + nanaimo (0.3.0) + nap (1.1.0) + netrc (0.11.0) + public_suffix (4.0.6) + rouge (2.0.7) + ruby-macho (1.4.0) + thread_safe (0.3.6) + typhoeus (1.4.0) + ethon (>= 0.9.0) + tzinfo (1.2.8) + thread_safe (~> 0.1) + xcodeproj (1.19.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.3.0) + xcpretty (0.3.0) + rouge (~> 2.0.7) + +PLATFORMS + ruby + +DEPENDENCIES + cocoapods (= 1.10.0) + cocoapods-binary! + xcpretty + +BUNDLED WITH + 2.1.4 diff --git a/demo-xcframework/ModuleA/Info.plist b/demo-xcframework/ModuleA/Info.plist new file mode 100644 index 0000000..9bcb244 --- /dev/null +++ b/demo-xcframework/ModuleA/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + + diff --git a/demo-xcframework/ModuleA/ModuleA.h b/demo-xcframework/ModuleA/ModuleA.h new file mode 100644 index 0000000..9320d7d --- /dev/null +++ b/demo-xcframework/ModuleA/ModuleA.h @@ -0,0 +1,18 @@ +// +// ModuleA.h +// ModuleA +// +// Created by Muukii on 2021/04/23. +// + +#import + +//! Project version number for ModuleA. +FOUNDATION_EXPORT double ModuleAVersionNumber; + +//! Project version string for ModuleA. +FOUNDATION_EXPORT const unsigned char ModuleAVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/demo-xcframework/ModuleB/Info.plist b/demo-xcframework/ModuleB/Info.plist new file mode 100644 index 0000000..9bcb244 --- /dev/null +++ b/demo-xcframework/ModuleB/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + + diff --git a/demo-xcframework/ModuleB/ModuleB.h b/demo-xcframework/ModuleB/ModuleB.h new file mode 100644 index 0000000..47e2a4f --- /dev/null +++ b/demo-xcframework/ModuleB/ModuleB.h @@ -0,0 +1,18 @@ +// +// ModuleB.h +// ModuleB +// +// Created by Muukii on 2021/04/23. +// + +#import + +//! Project version number for ModuleB. +FOUNDATION_EXPORT double ModuleBVersionNumber; + +//! Project version string for ModuleB. +FOUNDATION_EXPORT const unsigned char ModuleBVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/demo-xcframework/Podfile b/demo-xcframework/Podfile new file mode 100644 index 0000000..35fddc7 --- /dev/null +++ b/demo-xcframework/Podfile @@ -0,0 +1,20 @@ +platform :ios, "12.0" +plugin "cocoapods-binary" + +use_frameworks! +enable_bitcode_for_prebuilt_frameworks! +use_xcframework! + +target "demo" do + pod "Alamofire", binary: true +end + +target "ModuleA" do + platform :ios, "12.0" + pod "Verge", binary: true +end + +target "ModuleB" do + platform :ios, "12.0" + pod "Reusable", binary: true +end diff --git a/demo-xcframework/Podfile.lock b/demo-xcframework/Podfile.lock new file mode 100644 index 0000000..8b2c691 --- /dev/null +++ b/demo-xcframework/Podfile.lock @@ -0,0 +1,16 @@ +PODS: + - Masonry (1.1.0) + +DEPENDENCIES: + - Masonry + +SPEC REPOS: + trunk: + - Masonry + +SPEC CHECKSUMS: + Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 + +PODFILE CHECKSUM: 35aa48f5e3b98796a58c6bec853dba2ef9d8dbc9 + +COCOAPODS: 1.10.0 diff --git a/demo-xcframework/demo.xcodeproj/project.pbxproj b/demo-xcframework/demo.xcodeproj/project.pbxproj new file mode 100644 index 0000000..0a30dbe --- /dev/null +++ b/demo-xcframework/demo.xcodeproj/project.pbxproj @@ -0,0 +1,730 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 51; + objects = { + +/* Begin PBXBuildFile section */ + 2E1AEA2ADE0B2C6D0E8CB73C /* BDWebImage_demo.m in Sources */ = {isa = PBXBuildFile; fileRef = 89A7B09D8E1B9A5928206B3D /* BDWebImage_demo.m */; }; + 4B374C762631D13500F20A58 /* ModuleA.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B374C742631D13500F20A58 /* ModuleA.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B374C792631D13500F20A58 /* ModuleA.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B374C722631D13500F20A58 /* ModuleA.framework */; }; + 4B374C7A2631D13500F20A58 /* ModuleA.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4B374C722631D13500F20A58 /* ModuleA.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 4B374C892631D13C00F20A58 /* ModuleB.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B374C872631D13C00F20A58 /* ModuleB.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B374C8C2631D13C00F20A58 /* ModuleB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B374C852631D13C00F20A58 /* ModuleB.framework */; }; + 4B374C8D2631D13C00F20A58 /* ModuleB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4B374C852631D13C00F20A58 /* ModuleB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 5D8F9A83A7C72EE0DD2E30B3 /* Pods_demo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D609230143B5D568D9C4A59C /* Pods_demo.framework */; }; + 8BC2E4C8225F2B8600EC0609 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BC2E4C7225F2B8600EC0609 /* AppDelegate.swift */; }; + 8BC2E4CA225F2B8600EC0609 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BC2E4C9225F2B8600EC0609 /* ViewController.swift */; }; + 8BC2E4D2225F2B8700EC0609 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8BC2E4D0225F2B8700EC0609 /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 4B374C772631D13500F20A58 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8BC2E4BC225F2B8600EC0609 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 4B374C712631D13500F20A58; + remoteInfo = ModuleA; + }; + 4B374C8A2631D13C00F20A58 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8BC2E4BC225F2B8600EC0609 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 4B374C842631D13C00F20A58; + remoteInfo = ModuleB; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 4B374C7B2631D13500F20A58 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 4B374C7A2631D13500F20A58 /* ModuleA.framework in Embed Frameworks */, + 4B374C8D2631D13C00F20A58 /* ModuleB.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 28E804D524A2FE8E262DC5C8 /* Pods-demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo.debug.xcconfig"; path = "Target Support Files/Pods-demo/Pods-demo.debug.xcconfig"; sourceTree = ""; }; + 4B374C722631D13500F20A58 /* ModuleA.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ModuleA.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 4B374C742631D13500F20A58 /* ModuleA.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ModuleA.h; sourceTree = ""; }; + 4B374C752631D13500F20A58 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 4B374C852631D13C00F20A58 /* ModuleB.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ModuleB.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 4B374C872631D13C00F20A58 /* ModuleB.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ModuleB.h; sourceTree = ""; }; + 4B374C882631D13C00F20A58 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 70BD4C68F86A3E0344BA64E0 /* Pods-demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo.release.xcconfig"; path = "Target Support Files/Pods-demo/Pods-demo.release.xcconfig"; sourceTree = ""; }; + 89A7B09D8E1B9A5928206B3D /* BDWebImage_demo.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = BDWebImage_demo.m; sourceTree = ""; }; + 8BC2E4C4225F2B8600EC0609 /* demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 8BC2E4C7225F2B8600EC0609 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 8BC2E4C9225F2B8600EC0609 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 8BC2E4D1225F2B8700EC0609 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 8BC2E4D3225F2B8700EC0609 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D609230143B5D568D9C4A59C /* Pods_demo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_demo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 4B374C6F2631D13500F20A58 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4B374C822631D13C00F20A58 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8BC2E4C1225F2B8600EC0609 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4B374C8C2631D13C00F20A58 /* ModuleB.framework in Frameworks */, + 4B374C792631D13500F20A58 /* ModuleA.framework in Frameworks */, + 5D8F9A83A7C72EE0DD2E30B3 /* Pods_demo.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 48064E0CABFB2B206E032E3B /* demos */ = { + isa = PBXGroup; + children = ( + 89A7B09D8E1B9A5928206B3D /* BDWebImage_demo.m */, + ); + name = demos; + path = ./demos; + sourceTree = ""; + }; + 4B374C732631D13500F20A58 /* ModuleA */ = { + isa = PBXGroup; + children = ( + 4B374C742631D13500F20A58 /* ModuleA.h */, + 4B374C752631D13500F20A58 /* Info.plist */, + ); + path = ModuleA; + sourceTree = ""; + }; + 4B374C862631D13C00F20A58 /* ModuleB */ = { + isa = PBXGroup; + children = ( + 4B374C872631D13C00F20A58 /* ModuleB.h */, + 4B374C882631D13C00F20A58 /* Info.plist */, + ); + path = ModuleB; + sourceTree = ""; + }; + 8BC2E4BB225F2B8600EC0609 = { + isa = PBXGroup; + children = ( + 8BC2E4C6225F2B8600EC0609 /* demo */, + 4B374C732631D13500F20A58 /* ModuleA */, + 4B374C862631D13C00F20A58 /* ModuleB */, + 8BC2E4C5225F2B8600EC0609 /* Products */, + D25B1A678978B02ABFF01D1C /* Pods */, + E70278DC0644AA423F156464 /* Frameworks */, + ); + sourceTree = ""; + }; + 8BC2E4C5225F2B8600EC0609 /* Products */ = { + isa = PBXGroup; + children = ( + 8BC2E4C4225F2B8600EC0609 /* demo.app */, + 4B374C722631D13500F20A58 /* ModuleA.framework */, + 4B374C852631D13C00F20A58 /* ModuleB.framework */, + ); + name = Products; + sourceTree = ""; + }; + 8BC2E4C6225F2B8600EC0609 /* demo */ = { + isa = PBXGroup; + children = ( + 8BC2E4C7225F2B8600EC0609 /* AppDelegate.swift */, + 8BC2E4C9225F2B8600EC0609 /* ViewController.swift */, + 8BC2E4D0225F2B8700EC0609 /* LaunchScreen.storyboard */, + 8BC2E4D3225F2B8700EC0609 /* Info.plist */, + 48064E0CABFB2B206E032E3B /* demos */, + ); + path = demo; + sourceTree = ""; + }; + D25B1A678978B02ABFF01D1C /* Pods */ = { + isa = PBXGroup; + children = ( + 28E804D524A2FE8E262DC5C8 /* Pods-demo.debug.xcconfig */, + 70BD4C68F86A3E0344BA64E0 /* Pods-demo.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + E70278DC0644AA423F156464 /* Frameworks */ = { + isa = PBXGroup; + children = ( + D609230143B5D568D9C4A59C /* Pods_demo.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 4B374C6D2631D13500F20A58 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 4B374C762631D13500F20A58 /* ModuleA.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4B374C802631D13C00F20A58 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 4B374C892631D13C00F20A58 /* ModuleB.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 4B374C712631D13500F20A58 /* ModuleA */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4B374C7E2631D13500F20A58 /* Build configuration list for PBXNativeTarget "ModuleA" */; + buildPhases = ( + 4B374C6D2631D13500F20A58 /* Headers */, + 4B374C6E2631D13500F20A58 /* Sources */, + 4B374C6F2631D13500F20A58 /* Frameworks */, + 4B374C702631D13500F20A58 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ModuleA; + productName = ModuleA; + productReference = 4B374C722631D13500F20A58 /* ModuleA.framework */; + productType = "com.apple.product-type.framework"; + }; + 4B374C842631D13C00F20A58 /* ModuleB */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4B374C8E2631D13C00F20A58 /* Build configuration list for PBXNativeTarget "ModuleB" */; + buildPhases = ( + 4B374C802631D13C00F20A58 /* Headers */, + 4B374C812631D13C00F20A58 /* Sources */, + 4B374C822631D13C00F20A58 /* Frameworks */, + 4B374C832631D13C00F20A58 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ModuleB; + productName = ModuleB; + productReference = 4B374C852631D13C00F20A58 /* ModuleB.framework */; + productType = "com.apple.product-type.framework"; + }; + 8BC2E4C3225F2B8600EC0609 /* demo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8BC2E4E1225F2B8800EC0609 /* Build configuration list for PBXNativeTarget "demo" */; + buildPhases = ( + 995211ADED1CF78B5D687D8E /* [CP] Check Pods Manifest.lock */, + 8BC2E4C0225F2B8600EC0609 /* Sources */, + 8BC2E4C1225F2B8600EC0609 /* Frameworks */, + 8BC2E4C2225F2B8600EC0609 /* Resources */, + 2D50A461DC632DB3E3986761 /* [CP] Embed Pods Frameworks */, + 4B374C7B2631D13500F20A58 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 4B374C782631D13500F20A58 /* PBXTargetDependency */, + 4B374C8B2631D13C00F20A58 /* PBXTargetDependency */, + ); + name = demo; + productName = demo; + productReference = 8BC2E4C4225F2B8600EC0609 /* demo.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8BC2E4BC225F2B8600EC0609 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1020; + LastUpgradeCheck = 1020; + TargetAttributes = { + 4B374C712631D13500F20A58 = { + CreatedOnToolsVersion = 12.4; + }; + 4B374C842631D13C00F20A58 = { + CreatedOnToolsVersion = 12.4; + }; + 8BC2E4C3225F2B8600EC0609 = { + CreatedOnToolsVersion = 10.2; + }; + }; + binary = binary; + }; + buildConfigurationList = 8BC2E4BF225F2B8600EC0609 /* Build configuration list for PBXProject "demo" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8BC2E4BB225F2B8600EC0609; + productRefGroup = 8BC2E4C5225F2B8600EC0609 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8BC2E4C3225F2B8600EC0609 /* demo */, + 4B374C712631D13500F20A58 /* ModuleA */, + 4B374C842631D13C00F20A58 /* ModuleB */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 4B374C702631D13500F20A58 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4B374C832631D13C00F20A58 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8BC2E4C2225F2B8600EC0609 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8BC2E4D2225F2B8700EC0609 /* LaunchScreen.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 2D50A461DC632DB3E3986761 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 995211ADED1CF78B5D687D8E /* [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-demo-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"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 4B374C6E2631D13500F20A58 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4B374C812631D13C00F20A58 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8BC2E4C0225F2B8600EC0609 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8BC2E4CA225F2B8600EC0609 /* ViewController.swift in Sources */, + 8BC2E4C8225F2B8600EC0609 /* AppDelegate.swift in Sources */, + 2E1AEA2ADE0B2C6D0E8CB73C /* BDWebImage_demo.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 4B374C782631D13500F20A58 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 4B374C712631D13500F20A58 /* ModuleA */; + targetProxy = 4B374C772631D13500F20A58 /* PBXContainerItemProxy */; + }; + 4B374C8B2631D13C00F20A58 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 4B374C842631D13C00F20A58 /* ModuleB */; + targetProxy = 4B374C8A2631D13C00F20A58 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8BC2E4D0225F2B8700EC0609 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8BC2E4D1225F2B8700EC0609 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 4B374C7C2631D13500F20A58 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = KU2QEJ9K3Z; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = ModuleA/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 14.4; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = app.muukii.ModuleA; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 4B374C7D2631D13500F20A58 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = KU2QEJ9K3Z; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = ModuleA/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 14.4; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = app.muukii.ModuleA; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 4B374C8F2631D13C00F20A58 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = KU2QEJ9K3Z; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = ModuleB/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 14.4; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = app.muukii.ModuleB; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 4B374C902631D13C00F20A58 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = KU2QEJ9K3Z; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = ModuleB/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 14.4; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = app.muukii.ModuleB; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 8BC2E4DF225F2B8800EC0609 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.2; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 8BC2E4E0225F2B8800EC0609 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8BC2E4E2225F2B8800EC0609 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 28E804D524A2FE8E262DC5C8 /* Pods-demo.debug.xcconfig */; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = KU2QEJ9K3Z; + INFOPLIST_FILE = demo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = me.leavez.demo; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 8BC2E4E3225F2B8800EC0609 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 70BD4C68F86A3E0344BA64E0 /* Pods-demo.release.xcconfig */; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KU2QEJ9K3Z; + INFOPLIST_FILE = demo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = me.leavez.demo; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 4B374C7E2631D13500F20A58 /* Build configuration list for PBXNativeTarget "ModuleA" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4B374C7C2631D13500F20A58 /* Debug */, + 4B374C7D2631D13500F20A58 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4B374C8E2631D13C00F20A58 /* Build configuration list for PBXNativeTarget "ModuleB" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4B374C8F2631D13C00F20A58 /* Debug */, + 4B374C902631D13C00F20A58 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8BC2E4BF225F2B8600EC0609 /* Build configuration list for PBXProject "demo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8BC2E4DF225F2B8800EC0609 /* Debug */, + 8BC2E4E0225F2B8800EC0609 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8BC2E4E1225F2B8800EC0609 /* Build configuration list for PBXNativeTarget "demo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8BC2E4E2225F2B8800EC0609 /* Debug */, + 8BC2E4E3225F2B8800EC0609 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8BC2E4BC225F2B8600EC0609 /* Project object */; +} diff --git a/demo-xcframework/demo.xcworkspace/contents.xcworkspacedata b/demo-xcframework/demo.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b72a852 --- /dev/null +++ b/demo-xcframework/demo.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/demo-xcframework/demo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/demo-xcframework/demo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/demo-xcframework/demo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/demo-xcframework/demo/AppDelegate.swift b/demo-xcframework/demo/AppDelegate.swift new file mode 100644 index 0000000..936d690 --- /dev/null +++ b/demo-xcframework/demo/AppDelegate.swift @@ -0,0 +1,53 @@ +// +// AppDelegate.swift +// demo +// +// Created by Leavez on 2019/04/16. +// Copyright © 2019 binary. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + + let viewController = ViewController(nibName: nil, bundle: nil) + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = viewController + self.window = window + window.makeKeyAndVisible() + + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/demo-xcframework/demo/Base.lproj/LaunchScreen.storyboard b/demo-xcframework/demo/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..bfa3612 --- /dev/null +++ b/demo-xcframework/demo/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo-xcframework/demo/Info.plist b/demo-xcframework/demo/Info.plist new file mode 100644 index 0000000..4222ac2 --- /dev/null +++ b/demo-xcframework/demo/Info.plist @@ -0,0 +1,43 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/demo-xcframework/demo/ViewController.swift b/demo-xcframework/demo/ViewController.swift new file mode 100644 index 0000000..0595a88 --- /dev/null +++ b/demo-xcframework/demo/ViewController.swift @@ -0,0 +1,21 @@ +// +// ViewController.swift +// demo +// +// Created by Leavez on 2019/04/16. +// Copyright © 2019 binary. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + view.backgroundColor = .white + } + + +} + diff --git a/demo-xcframework/demo/demos/BDWebImage_demo.m b/demo-xcframework/demo/demos/BDWebImage_demo.m new file mode 100644 index 0000000..9b3225e --- /dev/null +++ b/demo-xcframework/demo/demos/BDWebImage_demo.m @@ -0,0 +1,16 @@ + +// this is a demo for usage +#import +#import +void masonry_demo() { + + UIView *parent_view = [UIView new]; + UIView *view1 = [UIView new]; + [parent_view addSubview:view1]; + + [view1 mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(0); + }]; +} + + diff --git a/demo/Podfile b/demo/Podfile index e91f600..c868a2d 100644 --- a/demo/Podfile +++ b/demo/Podfile @@ -2,9 +2,9 @@ platform :ios, '9.0' plugin 'cocoapods-binary' use_frameworks! +enable_bitcode_for_prebuilt_frameworks! all_binary! - target 'demo' do pod 'Masonry' diff --git a/demo/Podfile.lock b/demo/Podfile.lock index f58bbb7..164186b 100644 --- a/demo/Podfile.lock +++ b/demo/Podfile.lock @@ -11,6 +11,6 @@ SPEC REPOS: SPEC CHECKSUMS: Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 -PODFILE CHECKSUM: 5daab9dbab4736d6a1b3df2ffa8d856285c16553 +PODFILE CHECKSUM: 925b998411b476f1e984ec4db3445caa0507500c COCOAPODS: 1.10.0 diff --git a/demo/demo.xcodeproj/project.pbxproj b/demo/demo.xcodeproj/project.pbxproj index 27d7f5d..fb16fa1 100644 --- a/demo/demo.xcodeproj/project.pbxproj +++ b/demo/demo.xcodeproj/project.pbxproj @@ -8,22 +8,22 @@ /* Begin PBXBuildFile section */ 2E1AEA2ADE0B2C6D0E8CB73C /* BDWebImage_demo.m in Sources */ = {isa = PBXBuildFile; fileRef = 89A7B09D8E1B9A5928206B3D /* BDWebImage_demo.m */; }; - 4E7F0A1DEF72401732631637 /* Pods_demo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 044EC92A39312500E33210F0 /* Pods_demo.framework */; }; 8BC2E4C8225F2B8600EC0609 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BC2E4C7225F2B8600EC0609 /* AppDelegate.swift */; }; 8BC2E4CA225F2B8600EC0609 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BC2E4C9225F2B8600EC0609 /* ViewController.swift */; }; 8BC2E4D2225F2B8700EC0609 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8BC2E4D0225F2B8700EC0609 /* LaunchScreen.storyboard */; }; + AE7D84C17AD02D79D882959E /* Pods_demo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C7F8C9B7EFD13C4074EC6983 /* Pods_demo.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 044EC92A39312500E33210F0 /* Pods_demo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_demo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 4CF2798C779A4B1DB1ED95EA /* Pods-demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo.release.xcconfig"; path = "Target Support Files/Pods-demo/Pods-demo.release.xcconfig"; sourceTree = ""; }; + 595C71FDA70B79D07DF11BFA /* Pods-demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo.release.xcconfig"; path = "Target Support Files/Pods-demo/Pods-demo.release.xcconfig"; sourceTree = ""; }; 89A7B09D8E1B9A5928206B3D /* BDWebImage_demo.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = BDWebImage_demo.m; sourceTree = ""; }; 8BC2E4C4225F2B8600EC0609 /* demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 8BC2E4C7225F2B8600EC0609 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 8BC2E4C9225F2B8600EC0609 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 8BC2E4D1225F2B8700EC0609 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 8BC2E4D3225F2B8700EC0609 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D04236F5B998AFD90E6F891E /* Pods-demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo.debug.xcconfig"; path = "Target Support Files/Pods-demo/Pods-demo.debug.xcconfig"; sourceTree = ""; }; + 985890B75E739D9D53D93CFD /* Pods-demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo.debug.xcconfig"; path = "Target Support Files/Pods-demo/Pods-demo.debug.xcconfig"; sourceTree = ""; }; + C7F8C9B7EFD13C4074EC6983 /* Pods_demo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_demo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -31,7 +31,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 4E7F0A1DEF72401732631637 /* Pods_demo.framework in Frameworks */, + AE7D84C17AD02D79D882959E /* Pods_demo.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -53,7 +53,7 @@ 8BC2E4C6225F2B8600EC0609 /* demo */, 8BC2E4C5225F2B8600EC0609 /* Products */, D25B1A678978B02ABFF01D1C /* Pods */, - F46AC028BDE2AFC77F39ED2B /* Frameworks */, + E556B515C78F87E3119DCD2D /* Frameworks */, ); sourceTree = ""; }; @@ -80,16 +80,16 @@ D25B1A678978B02ABFF01D1C /* Pods */ = { isa = PBXGroup; children = ( - D04236F5B998AFD90E6F891E /* Pods-demo.debug.xcconfig */, - 4CF2798C779A4B1DB1ED95EA /* Pods-demo.release.xcconfig */, + 985890B75E739D9D53D93CFD /* Pods-demo.debug.xcconfig */, + 595C71FDA70B79D07DF11BFA /* Pods-demo.release.xcconfig */, ); path = Pods; sourceTree = ""; }; - F46AC028BDE2AFC77F39ED2B /* Frameworks */ = { + E556B515C78F87E3119DCD2D /* Frameworks */ = { isa = PBXGroup; children = ( - 044EC92A39312500E33210F0 /* Pods_demo.framework */, + C7F8C9B7EFD13C4074EC6983 /* Pods_demo.framework */, ); name = Frameworks; sourceTree = ""; @@ -101,11 +101,11 @@ isa = PBXNativeTarget; buildConfigurationList = 8BC2E4E1225F2B8800EC0609 /* Build configuration list for PBXNativeTarget "demo" */; buildPhases = ( - 81ED7638A0CD08711B1D7EB7 /* [CP] Check Pods Manifest.lock */, + BE271F0362CA7D92AB456B61 /* [CP] Check Pods Manifest.lock */, 8BC2E4C0225F2B8600EC0609 /* Sources */, 8BC2E4C1225F2B8600EC0609 /* Frameworks */, 8BC2E4C2225F2B8600EC0609 /* Resources */, - 5801A456D772620A7851D8CB /* [CP] Embed Pods Frameworks */, + F4364BB65920BF4A63F2C700 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -161,43 +161,43 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 5801A456D772620A7851D8CB /* [CP] Embed Pods Frameworks */ = { + BE271F0362CA7D92AB456B61 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-demo-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks.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; }; - 81ED7638A0CD08711B1D7EB7 /* [CP] Check Pods Manifest.lock */ = { + F4364BB65920BF4A63F2C700 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-demo-checkManifestLockResult.txt", + "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); 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-demo/Pods-demo-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -345,7 +345,7 @@ }; 8BC2E4E2225F2B8800EC0609 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = D04236F5B998AFD90E6F891E /* Pods-demo.debug.xcconfig */; + baseConfigurationReference = 985890B75E739D9D53D93CFD /* Pods-demo.debug.xcconfig */; buildSettings = { CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = demo/Info.plist; @@ -362,7 +362,7 @@ }; 8BC2E4E3225F2B8800EC0609 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 4CF2798C779A4B1DB1ED95EA /* Pods-demo.release.xcconfig */; + baseConfigurationReference = 595C71FDA70B79D07DF11BFA /* Pods-demo.release.xcconfig */; buildSettings = { CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = demo/Info.plist; diff --git a/lib/cocoapods-binary/Integration.rb b/lib/cocoapods-binary/Integration.rb index 660b013..371f434 100644 --- a/lib/cocoapods-binary/Integration.rb +++ b/lib/cocoapods-binary/Integration.rb @@ -191,10 +191,15 @@ def empty_source_files(spec) # get_corresponding_targets targets = Pod.fast_get_targets_for_pod_name(spec.root.name, self.pod_targets, cache) targets.each do |target| - # the framework_file_path rule is decided when `install_for_prebuild`, - # as to compitable with older version and be less wordy. - framework_file_path = target.framework_name - framework_file_path = target.name + "/" + framework_file_path if targets.count > 1 + + if Pod::Podfile::DSL.use_xcframework + framework_file_path = "#{target.name}.xcframework" + else + # the framework_file_path rule is decided when `install_for_prebuild`, + # as to compitable with older version and be less wordy. + framework_file_path = target.framework_name + framework_file_path = target.name + "/" + framework_file_path if targets.count > 1 + end add_vendered_framework(spec, target.platform.name.to_s, framework_file_path) end # Clean the source files diff --git a/lib/cocoapods-binary/Main.rb b/lib/cocoapods-binary/Main.rb index 33e193d..64c4995 100644 --- a/lib/cocoapods-binary/Main.rb +++ b/lib/cocoapods-binary/Main.rb @@ -1,167 +1,170 @@ # encoding: UTF-8 -require_relative 'helper/podfile_options' -require_relative 'tool/tool' - -module Pod - class Podfile - module DSL - - # Enable prebuiding for all pods - # it has a lower priority to other binary settings - def all_binary! - DSL.prebuild_all = true - end - - # Fobidden dependency auto build to binary - def forbidden_dependency_binary! - DSL.forbidden_dependency_binary = true - end - - # Enable bitcode for prebuilt frameworks - def enable_bitcode_for_prebuilt_frameworks! - DSL.bitcode_enabled = true - end - - # Don't remove source code of prebuilt pods - # It may speed up the pod install if git didn't - # include the `Pods` folder - def keep_source_code_for_prebuilt_frameworks! - DSL.dont_remove_source_code = true - end - - # Add custom xcodebuild option to the prebuilding action - # - # You may use this for your special demands. For example: the default archs in dSYMs - # of prebuilt frameworks is 'arm64 armv7 x86_64', and no 'i386' for 32bit simulator. - # It may generate a warning when building for a 32bit simulator. You may add following - # to your podfile - # - # ` set_custom_xcodebuild_options_for_prebuilt_frameworks :simulator => "ARCHS=$(ARCHS_STANDARD)" ` - # - # Another example to disable the generating of dSYM file: - # - # ` set_custom_xcodebuild_options_for_prebuilt_frameworks "DEBUG_INFORMATION_FORMAT=dwarf"` - # - # - # @param [String or Hash] options - # - # If is a String, it will apply for device and simulator. Use it just like in the commandline. - # If is a Hash, it should be like this: { :device => "XXXXX", :simulator => "XXXXX" } - # - def set_custom_xcodebuild_options_for_prebuilt_frameworks(options) - if options.kind_of? Hash - DSL.custom_build_options = [ options[:device] ] unless options[:device].nil? - DSL.custom_build_options_simulator = [ options[:simulator] ] unless options[:simulator].nil? - elsif options.kind_of? String - DSL.custom_build_options = [options] - DSL.custom_build_options_simulator = [options] - else - raise "Wrong type." - end - end - - private - class_attr_accessor :forbidden_dependency_binary - forbidden_dependency_binary = false - - class_attr_accessor :prebuild_all - prebuild_all = false - - class_attr_accessor :bitcode_enabled - bitcode_enabled = false - - class_attr_accessor :dont_remove_source_code - dont_remove_source_code = false - - class_attr_accessor :custom_build_options - class_attr_accessor :custom_build_options_simulator - self.custom_build_options = [] - self.custom_build_options_simulator = [] +require_relative "helper/podfile_options" +require_relative "tool/tool" + +module Pod + class Podfile + module DSL + + # Enable prebuiding for all pods + # it has a lower priority to other binary settings + def all_binary! + DSL.prebuild_all = true + end + + def use_xcframework! + DSL.use_xcframework = true + end + + # Fobidden dependency auto build to binary + def forbidden_dependency_binary! + DSL.forbidden_dependency_binary = true + end + + # Enable bitcode for prebuilt frameworks + def enable_bitcode_for_prebuilt_frameworks! + DSL.bitcode_enabled = true + end + + # Don't remove source code of prebuilt pods + # It may speed up the pod install if git didn't + # include the `Pods` folder + def keep_source_code_for_prebuilt_frameworks! + DSL.dont_remove_source_code = true + end + + # Add custom xcodebuild option to the prebuilding action + # + # You may use this for your special demands. For example: the default archs in dSYMs + # of prebuilt frameworks is 'arm64 armv7 x86_64', and no 'i386' for 32bit simulator. + # It may generate a warning when building for a 32bit simulator. You may add following + # to your podfile + # + # ` set_custom_xcodebuild_options_for_prebuilt_frameworks :simulator => "ARCHS=$(ARCHS_STANDARD)" ` + # + # Another example to disable the generating of dSYM file: + # + # ` set_custom_xcodebuild_options_for_prebuilt_frameworks "DEBUG_INFORMATION_FORMAT=dwarf"` + # + # + # @param [String or Hash] options + # + # If is a String, it will apply for device and simulator. Use it just like in the commandline. + # If is a Hash, it should be like this: { :device => "XXXXX", :simulator => "XXXXX" } + # + def set_custom_xcodebuild_options_for_prebuilt_frameworks(options) + if options.kind_of? Hash + DSL.custom_build_options = [options[:device]] unless options[:device].nil? + DSL.custom_build_options_simulator = [options[:simulator]] unless options[:simulator].nil? + elsif options.kind_of? String + DSL.custom_build_options = [options] + DSL.custom_build_options_simulator = [options] + else + raise "Wrong type." end + end + + private + + class_attr_accessor :forbidden_dependency_binary + forbidden_dependency_binary = false + + class_attr_accessor :prebuild_all + prebuild_all = false + + class_attr_accessor :use_xcframework + use_xcframework = false + + class_attr_accessor :bitcode_enabled + bitcode_enabled = false + + class_attr_accessor :dont_remove_source_code + dont_remove_source_code = false + + class_attr_accessor :custom_build_options + class_attr_accessor :custom_build_options_simulator + self.custom_build_options = [] + self.custom_build_options_simulator = [] end + end end -Pod::HooksManager.register('cocoapods-binary', :pre_install) do |installer_context| +Pod::HooksManager.register("cocoapods-binary", :pre_install) do |installer_context| + require_relative "helper/feature_switches" + if Pod.is_prebuild_stage + next + end - require_relative 'helper/feature_switches' - if Pod.is_prebuild_stage - next - end - - # [Check Environment] - # check user_framework is on - podfile = installer_context.podfile - podfile.target_definition_list.each do |target_definition| - next if target_definition.prebuild_framework_pod_names.empty? - if not target_definition.uses_frameworks? - STDERR.puts "[!] Cocoapods-binary requires `use_frameworks!`".red - exit - end - end - - - # -- step 1: prebuild framework --- - # Execute a sperated pod install, to generate targets for building framework, - # then compile them to framework files. - require_relative 'helper/prebuild_sandbox' - require_relative 'Prebuild' - - Pod::UI.puts "🚀 Prebuild frameworks" - - # Fetch original installer (which is running this pre-install hook) options, - # then pass them to our installer to perform update if needed - # Looks like this is the most appropriate way to figure out that something should be updated - - update = nil - repo_update = nil - - include ObjectSpace - ObjectSpace.each_object(Pod::Installer) { |installer| - update = installer.update - repo_update = installer.repo_update - } - - # control features - Pod.is_prebuild_stage = true - Pod::Podfile::DSL.enable_prebuild_patch true # enable sikpping for prebuild targets - Pod::Installer.force_disable_integration true # don't integrate targets - Pod::Config.force_disable_write_lockfile true # disbale write lock file for perbuild podfile - Pod::Installer.disable_install_complete_message true # disable install complete message - - # make another custom sandbox - standard_sandbox = installer_context.sandbox - prebuild_sandbox = Pod::PrebuildSandbox.from_standard_sandbox(standard_sandbox) - - # get the podfile for prebuild - prebuild_podfile = Pod::Podfile.from_ruby(podfile.defined_in_file) - - # install - lockfile = installer_context.lockfile - binary_installer = Pod::Installer.new(prebuild_sandbox, prebuild_podfile, lockfile) - - if binary_installer.have_exact_prebuild_cache? && !update - binary_installer.install_when_cache_hit! - else - binary_installer.update = update - binary_installer.repo_update = repo_update - binary_installer.install! + # [Check Environment] + # check user_framework is on + podfile = installer_context.podfile + podfile.target_definition_list.each do |target_definition| + next if target_definition.prebuild_framework_pod_names.empty? + if not target_definition.uses_frameworks? + STDERR.puts "[!] Cocoapods-binary requires `use_frameworks!`".red + exit end - - - # reset the environment - Pod.is_prebuild_stage = false - Pod::Installer.force_disable_integration false - Pod::Podfile::DSL.enable_prebuild_patch false - Pod::Config.force_disable_write_lockfile false - Pod::Installer.disable_install_complete_message false - Pod::UserInterface.warnings = [] # clean the warning in the prebuild step, it's duplicated. - - - # -- step 2: pod install --- - # install - Pod::UI.puts "\n" - Pod::UI.puts "🤖 Pod Install" - require_relative 'Integration' - # go on the normal install step ... -end + end + + # -- step 1: prebuild framework --- + # Execute a sperated pod install, to generate targets for building framework, + # then compile them to framework files. + require_relative "helper/prebuild_sandbox" + require_relative "Prebuild" + + Pod::UI.puts "🚀 Prebuild frameworks" + + # Fetch original installer (which is running this pre-install hook) options, + # then pass them to our installer to perform update if needed + # Looks like this is the most appropriate way to figure out that something should be updated + + update = nil + repo_update = nil + + include ObjectSpace + ObjectSpace.each_object(Pod::Installer) { |installer| + update = installer.update + repo_update = installer.repo_update + } + # control features + Pod.is_prebuild_stage = true + Pod::Podfile::DSL.enable_prebuild_patch true # enable sikpping for prebuild targets + Pod::Installer.force_disable_integration true # don't integrate targets + Pod::Config.force_disable_write_lockfile true # disbale write lock file for perbuild podfile + Pod::Installer.disable_install_complete_message true # disable install complete message + + # make another custom sandbox + standard_sandbox = installer_context.sandbox + prebuild_sandbox = Pod::PrebuildSandbox.from_standard_sandbox(standard_sandbox) + + # get the podfile for prebuild + prebuild_podfile = Pod::Podfile.from_ruby(podfile.defined_in_file) + + # install + lockfile = installer_context.lockfile + binary_installer = Pod::Installer.new(prebuild_sandbox, prebuild_podfile, lockfile) + + if binary_installer.have_exact_prebuild_cache? && !update + binary_installer.install_when_cache_hit! + else + binary_installer.update = update + binary_installer.repo_update = repo_update + binary_installer.install! + end + + # reset the environment + Pod.is_prebuild_stage = false + Pod::Installer.force_disable_integration false + Pod::Podfile::DSL.enable_prebuild_patch false + Pod::Config.force_disable_write_lockfile false + Pod::Installer.disable_install_complete_message false + Pod::UserInterface.warnings = [] # clean the warning in the prebuild step, it's duplicated. + + # -- step 2: pod install --- + # install + Pod::UI.puts "\n" + Pod::UI.puts "🤖 Pod Install" + require_relative "Integration" + # go on the normal install step ... +end diff --git a/lib/cocoapods-binary/Prebuild.rb b/lib/cocoapods-binary/Prebuild.rb index 98e3449..0d629e8 100644 --- a/lib/cocoapods-binary/Prebuild.rb +++ b/lib/cocoapods-binary/Prebuild.rb @@ -71,6 +71,8 @@ def prebuild_frameworks! sandbox_path = sandbox.root existed_framework_folder = sandbox.generate_framework_path bitcode_enabled = Pod::Podfile::DSL.bitcode_enabled + use_xcframework = Pod::Podfile::DSL.use_xcframework + targets = [] if local_manifest != nil @@ -115,8 +117,7 @@ def prebuild_frameworks! end targets = targets.reject {|pod_target| sandbox.local?(pod_target.pod_name) } - - + # build! Pod::UI.puts "Prebuild frameworks (total #{targets.count})" Pod::Prebuild.remove_build_dir(sandbox_path) @@ -128,7 +129,26 @@ def prebuild_frameworks! output_path = sandbox.framework_folder_path_for_target_name(target.name) output_path.mkpath unless output_path.exist? - Pod::Prebuild.build(sandbox_path, target, output_path, bitcode_enabled, Podfile::DSL.custom_build_options, Podfile::DSL.custom_build_options_simulator) + + if use_xcframework + Pod::Prebuild.build_xcframework( + sandbox_path, + target, + output_path, + bitcode_enabled, + Podfile::DSL.custom_build_options, + Podfile::DSL.custom_build_options_simulator + ) + else + Pod::Prebuild.build( + sandbox_path, + target, + output_path, + bitcode_enabled, + Podfile::DSL.custom_build_options, + Podfile::DSL.custom_build_options_simulator + ) + end # save the resource paths for later installing if target.static_framework? and !target.resource_paths.empty? @@ -148,13 +168,13 @@ def prebuild_frameworks! raise "Wrong type: #{resources}" unless resources.kind_of? Array path_objects = resources.map do |path| - object = Prebuild::Passer::ResourcePath.new + object = Pod::Prebuild::Passer::ResourcePath.new object.real_file_path = framework_path + File.basename(path) object.target_file_path = path.gsub('${PODS_ROOT}', standard_sandbox_path.to_s) if path.start_with? '${PODS_ROOT}' object.target_file_path = path.gsub("${PODS_CONFIGURATION_BUILD_DIR}", standard_sandbox_path.to_s) if path.start_with? "${PODS_CONFIGURATION_BUILD_DIR}" object end - Prebuild::Passer.resources_to_copy_for_static_framework[target.name] = path_objects + Pod::Prebuild::Passer.resources_to_copy_for_static_framework[target.name] = path_objects end end diff --git a/lib/cocoapods-binary/helper/podfile_options.rb b/lib/cocoapods-binary/helper/podfile_options.rb index 8ed6823..b03f803 100644 --- a/lib/cocoapods-binary/helper/podfile_options.rb +++ b/lib/cocoapods-binary/helper/podfile_options.rb @@ -33,7 +33,7 @@ def set_prebuild_for_pod(pod_name, should_prebuild) @should_not_prebuild_framework_pod_names.push pod_name end end - + def prebuild_framework_pod_names names = @prebuild_framework_pod_names || [] if parent != nil and parent.kind_of? TargetDefinition @@ -41,6 +41,7 @@ def prebuild_framework_pod_names end names end + def should_not_prebuild_framework_pod_names names = @should_not_prebuild_framework_pod_names || [] if parent != nil and parent.kind_of? TargetDefinition diff --git a/lib/cocoapods-binary/rome/build_framework.rb b/lib/cocoapods-binary/rome/build_framework.rb index 44e217e..356352d 100644 --- a/lib/cocoapods-binary/rome/build_framework.rb +++ b/lib/cocoapods-binary/rome/build_framework.rb @@ -2,51 +2,178 @@ require 'xcpretty' CONFIGURATION = "Release" -PLATFORMS = { 'iphonesimulator' => 'iOS', - 'appletvsimulator' => 'tvOS', - 'watchsimulator' => 'watchOS' } +PLATFORMS = { + 'iphonesimulator' => 'iOS', + 'appletvsimulator' => 'tvOS', + 'watchsimulator' => 'watchOS' +} # Build specific target to framework file # @param [PodTarget] target # a specific pod target # -def build_for_iosish_platform(sandbox, - build_dir, - output_path, - target, - device, - simulator, - bitcode_enabled, - custom_build_options = [], # Array - custom_build_options_simulator = [] # Array - ) +def build_for_iosish_platform( + sandbox, + build_dir, + output_path, + target, + device, + simulator, + bitcode_enabled, + build_xcframework, + custom_build_options = [], # Array + custom_build_options_simulator = [] # Array +) deployment_target = target.platform.deployment_target.to_s - target_label = target.label # name with platform if it's used in multiple platforms - Pod::UI.puts "Prebuilding #{target_label}..." + + if build_xcframework + + Pod::UI.puts "Prebuilding #{target_label}... as XCFramework, bitcode: #{bitcode_enabled ? "YES" : "NO"}" + other_options = [] + # bitcode enabled + if bitcode_enabled + other_options += ['ENABLE_BITCODE=YES'] + other_options += ["BITCODE_GENERATION_MODE=bitcode"] + other_options += ["OTHER_CFLAGS=-fembed-bitcode"] + end - other_options = [] - # bitcode enabled - other_options += ['BITCODE_GENERATION_MODE=bitcode'] if bitcode_enabled - # make less arch to iphone simulator for faster build - custom_build_options_simulator += ['ARCHS=x86_64', 'ONLY_ACTIVE_ARCH=NO'] if simulator == 'iphonesimulator' - - is_succeed, _ = xcodebuild(sandbox, target_label, device, deployment_target, other_options + custom_build_options) - exit 1 unless is_succeed - is_succeed, _ = xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + custom_build_options_simulator) - exit 1 unless is_succeed - - # paths - target_name = target.name # equals target.label, like "AFNeworking-iOS" when AFNetworking is used in multiple platforms. - module_name = target.product_module_name - device_framework_path = "#{build_dir}/#{CONFIGURATION}-#{device}/#{target_name}/#{module_name}.framework" - simulator_framework_path = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{target_name}/#{module_name}.framework" - - device_binary = device_framework_path + "/#{module_name}" - simulator_binary = simulator_framework_path + "/#{module_name}" - return unless File.file?(device_binary) && File.file?(simulator_binary) + other_options += ['BUILD_LIBRARY_FOR_DISTRIBUTION=true'] + + other_options += ['SKIP_INSTALL=NO'] + + xcodebuild( + sandbox: sandbox, + scheme: target_label, + sdk: device, + deployment_target: deployment_target, + other_options: other_options + custom_build_options + ) + + xcodebuild( + sandbox: sandbox, + scheme: target_label, + sdk: simulator, + deployment_target: deployment_target, + other_options: other_options + custom_build_options_simulator + ) + + # paths + target_name = target.name # equals target.label, like "AFNeworking-iOS" when AFNetworking is used in multiple platforms. + module_name = target.product_module_name + + device_lib = "#{build_dir}/#{CONFIGURATION}-#{device}/#{target_name}/#{module_name}.framework" + simulator_lib = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{target_name}/#{module_name}.framework" + + create_xcframework([device_lib, simulator_lib], output_path, module_name) + # copy_dsym_files(sandbox_root.parent + 'dSYM', CONFIGURATION) + + dSYM_path = output_path + "#{module_name}.dSYMs" + + dSYM_path.mkpath unless dSYM_path.exist? + FileUtils.mv device_lib + ".dSYM", File.join(dSYM_path, "#{device}.dSYM") + FileUtils.mv simulator_lib + ".dSYM", File.join(dSYM_path, "#{simulator}.dSYM") + + else + + Pod::UI.puts "Prebuilding #{target_label}... as Universal Framework" + + # https://steipete.com/posts/couldnt-irgen-expression/ + other_options = [ + "SWIFT_SERIALIZE_DEBUGGING_OPTIONS=NO" + ] + + if bitcode_enabled + other_options += ["ENABLE_BITCODE=YES"] + other_options += ["BITCODE_GENERATION_MODE=bitcode"] + other_options += ["OTHER_CFLAGS=-fembed-bitcode"] + end + + xcodebuild( + sandbox: sandbox, + scheme: target_label, + sdk: device, + deployment_target: deployment_target, + other_options: other_options + custom_build_options + ) + + # make less arch to iphone simulator for faster build + other_options += ["ARCHS=x86_64", "ONLY_ACTIVE_ARCH=NO"] if simulator == "iphonesimulator" + + xcodebuild( + sandbox: sandbox, + scheme: target_label, + sdk: simulator, + deployment_target: deployment_target, + other_options: other_options + custom_build_options_simulator + ) + + # paths + target_name = target.name # equals target.label, like "AFNeworking-iOS" when AFNetworking is used in multiple platforms. + module_name = target.product_module_name + + device_lib = "#{build_dir}/#{CONFIGURATION}-#{device}/#{target_name}/#{module_name}.framework" + simulator_lib = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{target_name}/#{module_name}.framework" + + create_universal_framework( + device_lib, + simulator_lib, + build_dir, + target_name, + module_name, + output_path + ) + + end +end + +def build_for_macos_platform(sandbox, build_dir, target, flags, configuration, build_xcframework=false) + target_label = target.cocoapods_target_label + xcodebuild(sandbox, target_label, flags, configuration) + + spec_names = target.specs.map { |spec| [spec.root.name, spec.root.module_name] }.uniq + spec_names.each do |root_name, module_name| + if build_xcframework + framework = "#{build_dir}/#{configuration}/#{root_name}/#{module_name}.framework" + build_xcframework([framework], build_dir, module_name) + end + end +end + +def enable_debug_information(project_path, configuration) + project = Xcodeproj::Project.open(project_path) + project.targets.each do |target| + config = target.build_configurations.find { |config| config.name.eql? configuration } + config.build_settings["DEBUG_INFORMATION_FORMAT"] = "dwarf-with-dsym" + config.build_settings["ONLY_ACTIVE_ARCH"] = "NO" + end + project.save +end + +def create_xcframework(frameworks, destination, module_name) + args = %W(-create-xcframework -output #{destination}/#{module_name}.xcframework) + + frameworks.each do |framework| + args += %W(-framework #{framework}) + end + + Pod::Executable.execute_command 'xcodebuild', args, true +end + +def create_universal_framework(device_lib, simulator_lib, build_dir, target_name, module_name, output_path) + + device_binary = device_lib + "/#{module_name}" + simulator_binary = simulator_lib + "/#{module_name}" + + Pod::UI.puts "#{device_binary} #{simulator_binary}" + + unless File.file?(device_binary) && File.file?(simulator_binary) + Pod::UI.puts "Binary not found" + return + end + # the device_lib path is the final output file path # combine the binaries tmp_lipoed_binary_path = "#{build_dir}/#{target_name}" @@ -55,8 +182,8 @@ def build_for_iosish_platform(sandbox, FileUtils.mv tmp_lipoed_binary_path, device_binary, :force => true # collect the swiftmodule file for various archs. - device_swiftmodule_path = device_framework_path + "/Modules/#{module_name}.swiftmodule" - simulator_swiftmodule_path = simulator_framework_path + "/Modules/#{module_name}.swiftmodule" + device_swiftmodule_path = device_lib + "/Modules/#{module_name}.swiftmodule" + simulator_swiftmodule_path = simulator_lib + "/Modules/#{module_name}.swiftmodule" if File.exist?(device_swiftmodule_path) FileUtils.cp_r simulator_swiftmodule_path + "/.", device_swiftmodule_path end @@ -64,8 +191,8 @@ def build_for_iosish_platform(sandbox, # combine the generated swift headers # (In xcode 10.2, the generated swift headers vary for each archs) # https://github.com/leavez/cocoapods-binary/issues/58 - simulator_generated_swift_header_path = simulator_framework_path + "/Headers/#{module_name}-Swift.h" - device_generated_swift_header_path = device_framework_path + "/Headers/#{module_name}-Swift.h" + simulator_generated_swift_header_path = simulator_lib + "/Headers/#{module_name}-Swift.h" + device_generated_swift_header_path = device_lib + "/Headers/#{module_name}-Swift.h" if File.exist? simulator_generated_swift_header_path device_header = File.read(device_generated_swift_header_path) simulator_header = File.read(simulator_generated_swift_header_path) @@ -85,15 +212,15 @@ def build_for_iosish_platform(sandbox, end # handle the dSYM files - device_dsym = "#{device_framework_path}.dSYM" + device_dsym = "#{device_lib}.dSYM" if File.exist? device_dsym # lipo the simulator dsym - simulator_dsym = "#{simulator_framework_path}.dSYM" + simulator_dsym = "#{simulator_lib}.dSYM" if File.exist? simulator_dsym tmp_lipoed_binary_path = "#{output_path}/#{module_name}.draft" lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_dsym}/Contents/Resources/DWARF/#{module_name} #{simulator_dsym}/Contents/Resources/DWARF/#{module_name}` puts lipo_log unless File.exist?(tmp_lipoed_binary_path) - FileUtils.mv tmp_lipoed_binary_path, "#{device_framework_path}.dSYM/Contents/Resources/DWARF/#{module_name}", :force => true + FileUtils.mv tmp_lipoed_binary_path, "#{device_lib}.dSYM/Contents/Resources/DWARF/#{module_name}", :force => true end # move FileUtils.mv device_dsym, output_path, :force => true @@ -101,12 +228,19 @@ def build_for_iosish_platform(sandbox, # output output_path.mkpath unless output_path.exist? - FileUtils.mv device_framework_path, output_path, :force => true + FileUtils.mv device_lib, output_path, :force => true end -def xcodebuild(sandbox, target, sdk='macosx', deployment_target=nil, other_options=[]) - args = %W(-project #{sandbox.project_path.realdirpath} -scheme #{target} -configuration #{CONFIGURATION} -sdk #{sdk} ) +def xcodebuild( + sandbox:, + scheme:, + sdk:, + deployment_target:, + other_options: + ) + + args = %W(-project #{sandbox.project_path.realdirpath} -scheme #{scheme} -configuration #{CONFIGURATION} -sdk #{sdk} ) platform = PLATFORMS[sdk] args += Fourflusher::SimControl.new.destination(:oldest, platform, deployment_target) unless platform.nil? args += other_options @@ -131,12 +265,11 @@ def xcodebuild(sandbox, target, sdk='macosx', deployment_target=nil, other_optio end end [is_succeed, log] -end - +end module Pod - class Prebuild + class Prebuild # Build the frameworks with sandbox and targets # @@ -149,7 +282,7 @@ class Prebuild # [Pathname] output_path # output path for generated frameworks # - def self.build(sandbox_root_path, target, output_path, bitcode_enabled = false, custom_build_options=[], custom_build_options_simulator=[]) + def self.build(sandbox_root_path, target, output_path, bitcode_enabled, custom_build_options=[], custom_build_options_simulator=[]) return if target.nil? @@ -157,38 +290,107 @@ def self.build(sandbox_root_path, target, output_path, bitcode_enabled = false, sandbox = Pod::Sandbox.new(sandbox_root) build_dir = self.build_dir(sandbox_root) + enable_debug_information(sandbox.project_path, CONFIGURATION) + # -- build the framework case target.platform.name - when :ios then build_for_iosish_platform(sandbox, build_dir, output_path, target, 'iphoneos', 'iphonesimulator', bitcode_enabled, custom_build_options, custom_build_options_simulator) - when :osx then xcodebuild(sandbox, target.label, 'macosx', nil, custom_build_options) + when :ios then + build_for_iosish_platform( + sandbox, + build_dir, + output_path, + target, + 'iphoneos', + 'iphonesimulator', + bitcode_enabled, + false, + custom_build_options, + custom_build_options_simulator + ) + when :osx then + xcodebuild( + sandbox, + target.label, + 'macosx', + nil, + custom_build_options + ) # when :tvos then build_for_iosish_platform(sandbox, build_dir, target, 'appletvos', 'appletvsimulator') - when :watchos then build_for_iosish_platform(sandbox, build_dir, output_path, target, 'watchos', 'watchsimulator', true, custom_build_options, custom_build_options_simulator) + when :watchos then + build_for_iosish_platform( + sandbox, + build_dir, + output_path, + target, + 'watchos', + 'watchsimulator', + true, + false, + custom_build_options, + custom_build_options_simulator + ) else raise "Unsupported platform for '#{target.name}': '#{target.platform.name}'" end raise Pod::Informative, 'The build directory was not found in the expected location.' unless build_dir.directory? - # # --- copy the vendored libraries and framework - # frameworks = build_dir.children.select{ |path| File.extname(path) == ".framework" } - # Pod::UI.puts "Built #{frameworks.count} #{'frameworks'.pluralize(frameworks.count)}" + end + + def self.build_xcframework(sandbox_root_path, target, output_path, bitcode_enabled, custom_build_options=[], custom_build_options_simulator=[]) + + Pod::UI.puts "Build XCFramework" + + return if target.nil? - # pod_target = target - # consumer = pod_target.root_spec.consumer(pod_target.platform.name) - # file_accessor = Pod::Sandbox::FileAccessor.new(sandbox.pod_dir(pod_target.pod_name), consumer) - # frameworks += file_accessor.vendored_libraries - # frameworks += file_accessor.vendored_frameworks + sandbox_root = Pathname(sandbox_root_path) + sandbox = Pod::Sandbox.new(sandbox_root) + build_dir = self.build_dir(sandbox_root) - # frameworks.uniq! + # -- build the framework + case target.platform.name + when :ios then + build_for_iosish_platform( + sandbox, + build_dir, + output_path, + target, + 'iphoneos', + 'iphonesimulator', + bitcode_enabled, + true, + custom_build_options, + custom_build_options_simulator + ) + when :osx then + xcodebuild( + sandbox, + target.label, + 'macosx', + nil, + custom_build_options + ) + # when :tvos then build_for_iosish_platform(sandbox, build_dir, target, 'appletvos', 'appletvsimulator') + when :watchos then + build_for_iosish_platform( + sandbox, + build_dir, + output_path, + target, + 'watchos', + 'watchsimulator', + true, + true, + custom_build_options, + custom_build_options_simulator + ) + else raise "Unsupported platform for '#{target.name}': '#{target.platform.name}'" end - # frameworks.each do |framework| - # FileUtils.mkdir_p destination - # FileUtils.cp_r framework, destination, :remove_destination => true - # end - # build_dir.rmtree if build_dir.directory? + raise Pod::Informative, 'The build directory was not found in the expected location.' unless build_dir.directory? + end def self.remove_build_dir(sandbox_root) path = build_dir(sandbox_root) - # path.rmtree if path.exist? + path.rmtree if path.exist? end private