From e687a86e1730743e75be72db86487ae882128cf8 Mon Sep 17 00:00:00 2001 From: Gus Date: Mon, 21 Dec 2020 12:41:03 -0500 Subject: [PATCH] refactor: [ios framework] change dylib to framework --- example/ios/Podfile | 2 +- .../ios/TorExample.xcodeproj/project.pbxproj | 48 +++++++++--------- .../Headers/Libsifir_ios.h} | 0 .../Libsifir_ios} | Bin 9925688 -> 9925688 bytes .../Modules/module.modulemap | 5 ++ .../Resources/Info.plist | 22 ++++++++ ios/Tor-Bridging-Header.h | 1 + ios/Tor.xcodeproj/project.pbxproj | 2 + react-native-tor.podspec | 5 +- 9 files changed, 59 insertions(+), 26 deletions(-) rename ios/{sifir-tor.h => Libsifir_ios.framework/Headers/Libsifir_ios.h} (100%) rename ios/{library/universal/libsifir_ios.dylib => Libsifir_ios.framework/Libsifir_ios} (99%) create mode 100644 ios/Libsifir_ios.framework/Modules/module.modulemap create mode 100644 ios/Libsifir_ios.framework/Resources/Info.plist diff --git a/example/ios/Podfile b/example/ios/Podfile index 41adb90..4be5337 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,4 +1,4 @@ -platform :ios, '11.0' +platform :ios, '11.1' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' def add_flipper_pods! diff --git a/example/ios/TorExample.xcodeproj/project.pbxproj b/example/ios/TorExample.xcodeproj/project.pbxproj index d55741d..e52c950 100644 --- a/example/ios/TorExample.xcodeproj/project.pbxproj +++ b/example/ios/TorExample.xcodeproj/project.pbxproj @@ -30,6 +30,7 @@ 31C15CFB9EF7CBD68C660F2A /* libPods-TorExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-TorExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 4D7192F03A36A017E887435B /* Pods-TorExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TorExample.release.xcconfig"; path = "Target Support Files/Pods-TorExample/Pods-TorExample.release.xcconfig"; sourceTree = ""; }; 85A481D925692C9D00942D45 /* TorExample.profdata */ = {isa = PBXFileReference; lastKnownFileType = file; path = TorExample.profdata; sourceTree = ""; }; + 85C8E5052590FB1800701A4C /* libsifir_ios.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libsifir_ios.framework; path = ../../ios/library/universal/libsifir_ios.framework; sourceTree = ""; }; 871719007ECC5EAD276C345C /* Pods-TorExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TorExample.debug.xcconfig"; path = "Target Support Files/Pods-TorExample/Pods-TorExample.debug.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ @@ -72,6 +73,7 @@ 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { isa = PBXGroup; children = ( + 85C8E5052590FB1800701A4C /* libsifir_ios.framework */, ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 31C15CFB9EF7CBD68C660F2A /* libPods-TorExample.a */, ); @@ -132,7 +134,7 @@ 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - 897C7EC8BEB56E007D60842C /* [CP] Embed Pods Frameworks */, + F7B61BE004B04AA11CD603C2 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -204,24 +206,6 @@ shellPath = /bin/sh; shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n"; }; - 897C7EC8BEB56E007D60842C /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-TorExample/Pods-TorExample-frameworks.sh", - "${PODS_ROOT}/../../../ios/library/universal/libsifir_ios.dylib", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libsifir_ios.dylib", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TorExample/Pods-TorExample-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; CCCC07BCAFDEF1FCADC0D0C9 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -244,6 +228,24 @@ 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; }; + F7B61BE004B04AA11CD603C2 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-TorExample/Pods-TorExample-frameworks.sh", + "${PODS_ROOT}/../../../ios/Libsifir_ios.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Libsifir_ios.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TorExample/Pods-TorExample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; FD10A7F022414F080027D42C /* Start Packager */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -304,7 +306,7 @@ ENABLE_BITCODE = NO; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = TorExample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.1; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_CFLAGS = ( "$(inherited)", @@ -336,7 +338,7 @@ ENABLE_BITCODE = NO; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = TorExample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.1; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_CFLAGS = ( "$(inherited)", @@ -401,7 +403,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.1; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -447,7 +449,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; diff --git a/ios/sifir-tor.h b/ios/Libsifir_ios.framework/Headers/Libsifir_ios.h similarity index 100% rename from ios/sifir-tor.h rename to ios/Libsifir_ios.framework/Headers/Libsifir_ios.h diff --git a/ios/library/universal/libsifir_ios.dylib b/ios/Libsifir_ios.framework/Libsifir_ios similarity index 99% rename from ios/library/universal/libsifir_ios.dylib rename to ios/Libsifir_ios.framework/Libsifir_ios index 7b39583a2646606160fc7fb383689c8fb4cd09f9..0b5e52b9db70d5b7b588401d6ff8df9c19364166 100755 GIT binary patch delta 657 zcma*jSyPPx0LJlCI?5g@NtP(t%brMYk);#<_T4#!^xDcf$G(dvOGTEtbgo^QX{ayY z+6QRNxa=di^o&p7nfc9g{~sOyl{0Ez3xe!Fxx+=lV6?J25{VSsm!H4mzJCjnU9IVk zs+O=V6}E@Tc-Wa59&7qhG7#i-XA(V`M3!aS1k16gO|)Fgvq?7Drr1=QX47qk<=ae~ zWwWio3a!ZISh3Bu5}RkGHs2Q5LR(~Iw%C?fxmDOwtF&dd+*a61TV<BjTtyCXR~};-okwPKz_*tT-p)A|YBun>a5nh>N0K zToN536qm&naaCLs*F~r35;sIrq(oZW6t~1}aYx)0_r!hiKs*$W#AES9JQdGGw|FjI l2#Fr?QoItc#T(Hp`b58YE8d9#@m_ooAH^pz_?@Ae^1qlp2jTz# delta 667 zcmb8rS5lJ!0L1Z+62;yCBZ?KoO6*2Ki3JN$`P;h*h{&fXn8bnw3%c05@Mw2Aq%*) zY}g)VQejuNwynoA2!=)*e^>P7)BX8$ffZVj6t+Lg&#@1S`#cZ9ew+*(@ zHrZy|Vp}b4+ibhlS-tJBoz`Fp+hx0LkL|Ta+h_ajfE^spr<-!$3!*>El7s(!^zdjT zS=}U(;*dBjj)-P~I4X{bjcp)VE j#Y^!@ycTc7Tk%f37azn&@kx9ZU&L4OO$_{EFkUqdJq8E` diff --git a/ios/Libsifir_ios.framework/Modules/module.modulemap b/ios/Libsifir_ios.framework/Modules/module.modulemap new file mode 100644 index 0000000..e3d0858 --- /dev/null +++ b/ios/Libsifir_ios.framework/Modules/module.modulemap @@ -0,0 +1,5 @@ +framework module "Libsifir_ios" { + header "Libsifir_ios.h" + export * +} + diff --git a/ios/Libsifir_ios.framework/Resources/Info.plist b/ios/Libsifir_ios.framework/Resources/Info.plist new file mode 100644 index 0000000..b701b6e --- /dev/null +++ b/ios/Libsifir_ios.framework/Resources/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + Libsifir_ios + CFBundleIdentifier + sifirapps.sdk.tor + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Libsifir_Tor + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + 0.1.1 + + diff --git a/ios/Tor-Bridging-Header.h b/ios/Tor-Bridging-Header.h index 84660e3..924e603 100644 --- a/ios/Tor-Bridging-Header.h +++ b/ios/Tor-Bridging-Header.h @@ -1 +1,2 @@ #import "React/RCTBridgeModule.h" +#import "Libsifir_ios/Libsifir_ios.h" diff --git a/ios/Tor.xcodeproj/project.pbxproj b/ios/Tor.xcodeproj/project.pbxproj index efec07a..373b85b 100644 --- a/ios/Tor.xcodeproj/project.pbxproj +++ b/ios/Tor.xcodeproj/project.pbxproj @@ -235,6 +235,7 @@ "$(SRCROOT)/../../../React/**", "$(SRCROOT)/../../react-native/React/**", ); + IPHONEOS_DEPLOYMENT_TARGET = 11.1; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", @@ -259,6 +260,7 @@ "$(SRCROOT)/../../../React/**", "$(SRCROOT)/../../react-native/React/**", ); + IPHONEOS_DEPLOYMENT_TARGET = 11.1; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", diff --git a/react-native-tor.podspec b/react-native-tor.podspec index b2fa5a4..0fb667c 100644 --- a/react-native-tor.podspec +++ b/react-native-tor.podspec @@ -14,7 +14,8 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/Sifir-io/react-native-tor.git", :tag => "#{s.version}" } s.swift_version = '5.0' - s.source_files = "ios/**/*.{h,m,mm,swift}" - s.ios.vendored_libraries= ["ios/library/universal/libsifir_ios.dylib"] + s.source_files = "ios/*.{h,m,mm,swift}" +# s.source_files = "ios/**/*.{swift}" + s.ios.vendored_frameworks= "ios/Libsifir_ios.framework" s.dependency "React" end